1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,489690,e=>{e.v({cardBody:"EmbeddedOnDemandCard-module__46mHqq__cardBody",cardBodyImage:"EmbeddedOnDemandCard-module__46mHqq__cardBodyImage",cardBodyTitle:"EmbeddedOnDemandCard-module__46mHqq__cardBodyTitle",cardBodyWithoutPlayButton:"EmbeddedOnDemandCard-module__46mHqq__cardBodyWithoutPlayButton",classification:"EmbeddedOnDemandCard-module__46mHqq__classification",container:"EmbeddedOnDemandCard-module__46mHqq__container",countdownStatus:"EmbeddedOnDemandCard-module__46mHqq__countdownStatus",dateStatus:"EmbeddedOnDemandCard-module__46mHqq__dateStatus",imageWrapper:"EmbeddedOnDemandCard-module__46mHqq__imageWrapper","label-seriesTitle":"EmbeddedOnDemandCard-module__46mHqq__label-seriesTitle",link:"EmbeddedOnDemandCard-module__46mHqq__link",liveLayout:"EmbeddedOnDemandCard-module__46mHqq__liveLayout",liveStatus:"EmbeddedOnDemandCard-module__46mHqq__liveStatus",metaRow:"EmbeddedOnDemandCard-module__46mHqq__metaRow",playIcon:"EmbeddedOnDemandCard-module__46mHqq__playIcon",pulse:"EmbeddedOnDemandCard-module__46mHqq__pulse",shelfLabel:"EmbeddedOnDemandCard-module__46mHqq__shelfLabel",statusDot:"EmbeddedOnDemandCard-module__46mHqq__statusDot",statusRow:"EmbeddedOnDemandCard-module__46mHqq__statusRow",textContent:"EmbeddedOnDemandCard-module__46mHqq__textContent",topRow:"EmbeddedOnDemandCard-module__46mHqq__topRow"})},995781,e=>{e.v({logo:"OnDemandLogo-module__qjKGOq__logo",picture:"OnDemandLogo-module__qjKGOq__picture"})},442416,e=>{e.v({container:"InvalidOnDemandCard-module__Fjl5La__container",link:"InvalidOnDemandCard-module__Fjl5La__link",linkText:"InvalidOnDemandCard-module__Fjl5La__linkText",logo:"InvalidOnDemandCard-module__Fjl5La__logo"})},194569,e=>{"use strict";e.s(["default",()=>P],194569);var t=e.i(857727),i=e.i(271645),r=e.i(207670),s=e.i(481026),n=e.i(826547),a=e.i(86132);e.i(752623);var o=e.i(120764),l=e.i(250194),d=e.i(234960),u=e.i(489690),h=e.i(236692),c=e.i(717720),p=e.i(995781);let m={src:e.i(280730).default,width:116,height:23,blurWidth:0,blurHeight:0},f={src:e.i(379229).default,width:48,height:24,blurWidth:0,blurHeight:0};function g(e){let{className:i}=e;return(0,t.jsxs)("picture",{className:(0,r.default)(p.default.picture,i),children:[(0,t.jsx)("source",{media:`(min-width: ${h.BREAKPOINT_SM}px)`,srcSet:(0,c.default)(m)}),(0,t.jsx)("source",{media:"(min-width: 0px)",srcSet:(0,c.default)(f)}),(0,t.jsx)("img",{alt:"",className:p.default.logo})]})}var y=e.i(708370),_=e.i(21019),v=e.i(442416);function b(e){let{message:i="This content is currently unavailable.",clickEventData:r}=e,{domain:s}=(0,_.useConfigContext)(),o=`https://${s}/ondemand`;return(0,t.jsx)(n.default,{theme:"od",children:(0,t.jsx)("aside",{className:v.default.container,"data-mui-isolated":!0,"data-testid":"od-embed-invalid",children:(0,t.jsxs)(a.default,{href:o,className:v.default.link,clickEventData:{...r,elementText:i,clickURL:o},children:[(0,t.jsx)(g,{className:v.default.logo}),(0,t.jsxs)("p",{className:"subtitle1",children:[i,(0,t.jsx)("br",{}),"For more content, Stream Now on"," ",(0,t.jsx)("u",{className:v.default.linkText,children:"SBS On Demand"}),"."]})]})})})}var T=e.i(365222);
1function A(e){let{contentTitle:h,contentUrl:c="https://www.sbs.com.au/ondemand",imageUrl:p,labels:m=[],classificationId:f,variant:_,onDemandType:v,clickEventData:A,statusText:S,startEpochMs:E,seriesTitle:C,endEpochMs:w}=e,k=(0,i.useId)(),x=(0,i.useId)(),I=(0,i.useId)(),{clientMeta:D,clientStatusText:P,clientVariant:L,isExpired:R}=(0,y.default)({statusText:S,variant:_,endEpochMs:w,startEpochMs:E}),M=m.length>0||!!f,O="status"===D.type?!!P:M,{cardTitle:N,showPlayButton:j=!0}=(0,i.useMemo)(()=>({cardTitle:d.ON_DEMAND_CARD_VARIANT_CONFIG[L].cardTitle,showPlayButton:d.ON_DEMAND_CARD_VARIANT_CONFIG[L].showPlayButton}),[L]);if("post-live"===L)return(0,t.jsx)(b,{message:"This live stream has ended.",clickEventData:A});if(R)return(0,t.jsx)(b,{clickEventData:A});let U=function(e){let{meta:t,labels:i,onDemandType:r,classificationId:s,clientStatusText:n,seriesTitle:a}=e,o=e=>i.find(t=>t.type===e)?.value,l=function(e){let{labelOdType:t,onDemandType:i}=e,r=(t??"").trim().toLowerCase();if(r)return r;let s=(i??"").trim().toLowerCase();return s?s.split("-").pop()??s:""}({labelOdType:o("odType"),onDemandType:r}),d=o("genre"),u=o("duration"),h=o("caption"),c=[];if("episode"===l&&a?c.push(`Episode of ${a}.`):l&&c.push(`${(0,T.default)(l)}.`),"status"===t.type)switch(t.mode){case"live":c.push("Live now.");break;case"countdown":n&&c.push(`${n}.`);break;case"date":n&&c.push(`Starts ${n}.`)}else d&&c.push(`${function(e){let t=e.trim();return t?t[0].toUpperCase()+t.slice(1):t}(d)}.`),u&&c.push(`${function(e){let t=e.trim(),i=(e,t)=>`${e} ${t}${1===e?"":"s"}`;return t.replace(/\b(\d+)\s*([hms])\b/gi,(e,t,r)=>{let s=Number(t),n=r.toLowerCase();return"h"===n?i(s,"hour"):"m"===n?i(s,"minute"):i(s,"second")})}(u)}.`),h&&c.push(h),s&&c.push(`Rated ${s}.`);return c.join(" ")}({meta:D,labels:m,onDemandType:v,classificationId:f,clientStatusText:P,seriesTitle:C});return(0,t.jsx)(n.default,{theme:"od",children:(0,t.jsx)("aside",{className:u.default.container,"data-mui-isolated":!0,style:{...p?{"--bg-image":`url("${p}")`}:{}},"data-testid":"od-embed",children:(0,t.jsxs)(a.default,{href:c,className:u.default.link,clickEventData:{elementType:"OnDemandEmbed",elementText:h,clickURL:c,sectionName:N,...A},"aria-labelledby":k,"aria-describedby":`${I} ${x}`,children:[(0,t.jsx)("span",{id:I,className:"srOnly",children:U}),(0,t.jsxs)("div",{className:u.default.topRow,children:[(0,t.jsx)(s.default,{children:(0,t.jsx)("h2",{className:u.default.shelfLabel,id:x,children:N})}),(0,t.jsx)(g,{})]}),(0,t.jsxs)("div",{className:(0,r.default)(u.default.cardBody,!j&&u.default.cardBodyWithoutPlayButton),children:[(0,t.jsx)("div",{className:u.default.imageWrapper,children:(0,t.jsx)(o.default,{src:p,alt:"",width:195,height:109,className:u.default.cardBodyImage})}),j&&(0,t.jsx)("div",{className:u.default.playIcon,"aria-hidden":"true",children:(0,t.jsx)(l.PlayIcon,{weight:"fill"})}),(0,t.jsxs)("div",{className:(0,r.default)(u.default.textContent,{[u.default.liveLayout]:"default"!==L&&"default-upcoming"!==L}),children:[(0,t.jsx)("h3",{className:u.default.cardBodyTitle,id:k,children:h}),O&&(0,t.jsx)("div",{className:u.default.metaRow,children:function(e){let{meta:i,labels:s,classificationId:n,clientStatusText:a,startEpochMs:o}=e;if("labels"===i.type)return(0,t.jsxs)(t.Fragment,{children:[s.map((e,i)=>{let r=u.default[`label-${e.type}`];return(0,t.jsxs)("span",{className:r,children:[e.value,i<s.length-1&&(0,t.jsx)("span",{"aria-hidden":"true",children:" â¢Â "})]},`${e.type}-${e.value}-${i}`)}),n&&(0,t.jsx)("span",{className:u.default.classification,children:n})]});let l=(0,r.default)(u.default.statusRow,{[u.default.liveStatus]:"live"===i.mode,[u.default.countdownStatus]:"countdown"===i.mode,[u.default.dateStatus]:"date"===i.mode});if("live"===i.mode)return(0,t.jsxs)("span",{className:l,children:[(0,t.jsx)("span",{className:u.default.statusDot,"aria-hidden":"true"}),a]});let d="number"==typeof o&&Number.isFinite(o)?new Date(o).toISOString():void 0,h="countdown"===i.mode;return(0,t.jsxs)("time",{className:l,dateTime:d,children:[h&&(0,t.jsx)("span",{className:u.default.statusDot,"aria-hidden":"true"}),a]})}({meta:D,labels:m,classificationId:f,clientStatusText:P,startEpochMs:E})})]})]})]})})})}var S=e.i(212313);let E={EPISODE:"episode",SERIES:"series",PROGRAM:"program",MOVIE:"movie"},C=e=>(e??"").replaceAll("_"," "),w=e=>e.filter(e=>void 0!==e.value&&""!==e.value),k={[E.EPISODE]:e=>w([{value:E.EPISODE,type:"odType"},{value:e.seriesTitle,type:"seriesTitle"},{value:C(e.genres?.[0]),type:"genre"},{value:(0,S.secondsToTime)(e.durationSeconds),type:"duration"}]),[E.SERIES]:e=>w([{value:E.SERIES,type:"odType"},{value:C(e.genres?.[0]),type:"genre"},{value:e?.displayLanguage,type:"language"}]),[E.PROGRAM]:e=>w([{value:E.PROGRAM,type:"odType"},{value:C(e.genres?.[0]),type:"genre"},{value:e.releaseYear?.toString(),type:"releaseYear"}]),[E.MOVIE]:e=>w([{value:C(e.genres?.[0]),type:"genre"},{value:C(e.genres?.[1]),type:"genre"},{value:e.releaseYear?.toString(),type:"releaseYear"}])},x=e=>e.filter(e=>null!=e.value&&""!==e.value);var I=e.i(359677),D=e.i(538114);let P=e=>{let{clickEventData:i,embed:{value:r}={}}=e;if(!r)return null;let{onDemandType:s,contentUrl:n,title:a,imageUrl:o,classificationId:l,availability:u,isLiveStream:h=!1,seriesTitle:c}=r?.onDemandContent??{};if(!n||!a?.[0]||!o)return(0,t.jsx)(b,{clickEventData:i});let p=u?.start?.unixEpochMilli,m=u?.end?.unixEpochMilli,f="string"==typeof p?Number(p):p,g="string"==typeof m?Number(m):m,y=(0,D.default)({isLiveStream:h,startTimeUnixMs:f,endTimeUnixMs:g}),_=(0,I.default)({meta:d.ON_DEMAND_CARD_VARIANT_CONFIG[y].meta,startEpochMs:f});return(0,t.jsx)(A,{contentTitle:a[0].value,labels:(e=>{let{onDemandContent:t,caption:i}=e;if(i?.text)return x([{type:"caption",value:i.text}
1]);let r=(t.onDemandType??"").split("-").pop();return x(k[r]?.(t)??[])})(r)??[],imageUrl:o,contentUrl:n,classificationId:((e,t)=>{if(e!==E.MOVIE&&"NC"!==t)return t})(s,l),variant:y,startEpochMs:f,endEpochMs:g,statusText:_,onDemandType:s,seriesTitle:c,clickEventData:{elementType:"OnDemandEmbed",...i}})}},357178,e=>{e.v({trackingPixel:"ConversationTrackingPixel-module__xANZFq__trackingPixel"})},936390,e=>{e.v({container:"FlourishWidget-module__Yj0B2q__container",skeleton:"FlourishWidget-module__Yj0B2q__skeleton"})},409219,e=>{e.v({container:"SponsorBlock-module__b7dVCa__container",item:"SponsorBlock-module__b7dVCa__item"})},788334,e=>{e.v({error:"HighlightedError-module__PGJvhW__error"})},503760,e=>{"use strict";e.s(["default",()=>y],503760);var t=e.i(857727);e.i(140408);var i=e.i(528579),i=i,r=e.i(738286),s=e.i(357178),n=e.i(271645),a=e.i(207670),o=e.i(618566),l=e.i(244456),d=e.i(936390),u=e.i(657688),h=e.i(86132),c=e.i(409219),p=e.i(788334);function m(e){let{err:i,input:r}=e,s=(e=>{let t=e.match(/((?!position|column)(?!\s).)(\d+)/g);return t?e.match(/column/g)?(t[0]-1).toString():t[0]:null})(i);if(!s)return r;let n=Number(s),a=r.charAt(n);if(!a)return r;let o=r.substring(0,n),l=r.substring(n+a.length);return(0,t.jsxs)(t.Fragment,{children:[o,(0,t.jsx)("strong",{className:p.default.error,children:a}),l]})}let f={SponsorBlock:function(e){let{sponsors:i=[]}=e;return 0===i.length?null:(0,t.jsx)("div",{className:c.default.container,children:i.map(e=>{let{name:i,url:r,img:s}=e;return(0,t.jsx)(h.default,{className:c.default.item,title:i,href:r,target:"_blank",rel:"noopener noreferrer",passHref:!0,children:(0,t.jsx)(u.default,{alt:i,src:s,fill:!0,sizes:"33.33vw, (min-width: 768px) 25vw, (min-width: 1200px) 16.66vw"})},r)})})},FlourishWidget:function(e){let{story:i}=e,[r,s]=(0,n.useState)(!1),u=(0,n.useRef)(null),{scriptLoaded:h}=((e,t)=>{let i=(0,o.usePathname)(),[r,s]=(0,n.useState)(!1),[a,l]=(0,n.use
1State)(!1);return(0,n.useEffect)(()=>{let i=()=>{let i=document.querySelectorAll(`script[src="${e}"]`);i.length>0&&(i.forEach(e=>{document.body.removeChild(e)}),t&&t.forEach(e=>{window[e]&&delete window[e]}))};return i(),(()=>{if(r)return;let t=document.createElement("script");t.src=e,t.async=!0,t.setAttribute("data-testid","useDynamicScript-script"),document.body.appendChild(t),t.onload=()=>{s(!0)},t.onerror=()=>l(!0)})(),()=>{i()}},[e,i,r,t]),{scriptLoaded:r,error:a}})("https://public.flourish.studio/resources/embed.js",["FlourishLoaded"]);(0,n.useEffect)(()=>{let e,t=()=>{s(!0)};return h&&u?.current?.children&&(e=u.current.querySelector("iframe")||null)&&e.addEventListener("load",t),()=>{e&&e.removeEventListener("load",t)}},[h]);let c=h&&r;return(0,t.jsx)("div",{className:(0,a.default)("flourish-embed",d.default.container),"data-src":`story/${i}`,"data-testid":"flourish-widget-container",ref:u,children:!c&&(0,t.jsx)(l.default,{variant:"rectangular",testId:"flourish-widget-skeleton",className:d.default.skeleton})})},ConversationTrackingPixel:function(e){let{conversationArticleId:i}=e;if((0,r.default)(i))return null;let n=`https://counter.theconversation.com/content/${i}/count.gif?distributor=republish-lightbox-advanced`;return(0,t.jsx)("img",{className:s.default.trackingPixel,src:n,alt:"",width:1,height:1,loading:"eager"})}},g=Object.keys(f);function y(e){let r,{componentId:s,componentConfig:n}=e;if(!g.includes(s))return(0,t.jsxs)(i.default,{"data-testid":"invalid-component-id",severity:"warning",title:"Custom Component",children:[(0,t.jsxs)("p",{children:['The "Component ID" (',s,") is not in the AllowedComponentIds array, try one of:"," "]}),(0,t.jsx)("ul",{children:g.map(e=>(0,t.jsx)("li",{children:e},e))})]});try{r=n&&JSON.parse(n)}catch(e){return(0,t.jsxs)(i.default,{"data-testid":"invalid-component-config",severity:"warning",title:"Custom Component",children:[(0,t.jsx)("p",{children:'The format of the supplied "Component Config" is incorrect, please make sure you are supplying a valid JSON string.'}),(0,t.jsx)("p",{children:(0,t.jsx)("code",{children:e.toString()})}),(0,t.jsx)("p",{children:(0,t.jsx)("code",{children:(0,t.jsx)(m,{err:e.toString(),input:n})})})]})}let a=f[s];return(0,t.jsx)(a,{...r})}},635804,e=>{"use strict";e.s(["useSize",()=>r]);var t=e.i(271645),i=e.i(934620);function r(e){let[r,s]=t.useState(void 0);return(0,i.useLayoutEffect)(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let i,r;if(!Array.isArray(t)||!t.length)return;let n=t[0];if("borderBoxSize"in n){let e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,r=t.blockSize}else i=e.offsetWidth,r=e.offsetHeight;s({width:i,height:r})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}s(void 0)},[e]),r}},540666,842727,e=>{"use strict";e.s(["Content",()=>tZ,"Item",()=>tJ,"Portal",()=>tQ,"Root",()=>tY,"Trigger",()=>tK],540666);var t=e.i(271645),i=e.i(981140),r=e.i(820783),s=e.i(30030),n=e.i(369340),a=e.i(248425),o=e.i(75830),l=e.i(586318),d=e.i(726330),u=0;function h(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var c=e.i(30207),p=e.i(843476),m="focusScope.autoFocusOnMount",f="focusScope.autoFocusOnUnmount",g={bubbles:!1,cancelable:!0},y=t.forwardRef((e,i)=>{let{loop:s=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...d}=e,[u,h]=t.useState(null),y=(0,c.useCallbackRef)(o),A=(0,c.useCallbackRef)(l),S=t.useRef(null),E=(0,r.useComposedRefs)(i,e=>h(e)),C=t.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;t.useEffect(()=>{if(n){let e=function(e){if(C.paused||!u)return;let t=e.target;u.contains(t)?S.current=t:b(S.current,{select:!0})},t=function(e){if(C.paused||!u)return;let t=e.relatedTarget;null!==t&&(u.contains(t)||b(S.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let i=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&b(u)});return u&&i.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),i.disconnect()}}},[n,u,C.paused]),t.useEffect(()=>{if(u){T.add(C);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(m,g);u.addEventListener(m,y),u.dispatchEvent(t),t.defaultPrevented||(function(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=document.activeElement;for(let r of e)if(b(r,{select:t}),document.activeElement!==i)return}(_(u).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&b(u))}return()=>{u.removeEventListener(m,y),setTimeout(()=>{let t=new CustomEvent(f,g);u.addEventListener(f,A),u.dispatchEvent(t),t.defaultPrevented||b(e??document.body,{select:!0}),u.removeEventListener(f,A),T.remove(C)},0)}}},[u,y,A,C]);let w=t.useCallback(e=>{if(!s&&!n||C.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,n]=function(e){let t=_(e);return[v(t,e),v(t.reverse(),e)]}(t);r&&n?e.shiftKey||i!==n?e.shiftKey&&i===r&&(e.preventDefault(),s&&b(n,{select:!0})):(e.preventDefault(),s&&b(r,{select:!0})):i===t&&e.preventDefault()}},[s,n,C.paused]);return(0,p.jsx)(a.Primitive.div,{tabIndex:-1,...d,ref:E,onKeyDown:w})});function _(e){let t=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)t.push(i.currentNode);return t}function v(e,t){for(let i of e)if(!function(e,t){let{upTo:i}=t;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===i||e!==i);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(i,{upTo:t}))return i}function b(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&e.focus){var i;let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&(i=e)instanceof HTMLInputElement&&"select"in i&&t&&e.select()}}y.displayName="FocusScope";var T=function(){let e=[];return{add(t){let i=e[0];t!==i&&i?.pause(),(e=A(e,t)).unshift(t)},remove(t){e=A(e,t),e[0]?.resume()}}}();function A(e,t){let i=[...e],r=i.indexOf(t);return -1!==r&&i.splice(r,1),i}var S=e.i(610772),E=e.i(258950),C=e.i(27788),w=t.forwardRef((e,t)=>
1{let{children:i,width:r=10,height:s=5,...n}=e;return(0,p.jsx)(a.Primitive.svg,{...n,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?i:(0,p.jsx)("polygon",{points:"0,0 30,0 15,10"})})});w.displayName="Arrow";var k=e.i(934620),x=e.i(635804),I="Popper",[D,P]=(0,s.createContextScope)(I),[L,R]=D(I),M=e=>{let{__scopePopper:i,children:r}=e,[s,n]=t.useState(null);return(0,p.jsx)(L,{scope:i,anchor:s,onAnchorChange:n,children:r})};M.displayName=I;var O="PopperAnchor",N=t.forwardRef((e,i)=>{let{__scopePopper:s,virtualRef:n,...o}=e,l=R(O,s),d=t.useRef(null),u=(0,r.useComposedRefs)(i,d),h=t.useRef(null);return t.useEffect(()=>{let e=h.current;h.current=n?.current||d.current,e!==h.current&&l.onAnchorChange(h.current)}),n?null:(0,p.jsx)(a.Primitive.div,{...o,ref:u})});N.displayName=O;var j="PopperContent",[U,B]=D(j),F=t.forwardRef((e,i)=>{let{__scopePopper:s,side:n="bottom",sideOffset:o=0,align:l="center",alignOffset:d=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:m=[],collisionPadding:f=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:_="optimized",onPlaced:v,...b}=e,T=R(j,s),[A,S]=t.useState(null),w=(0,r.useComposedRefs)(i,e=>S(e)),[I,D]=t.useState(null),P=(0,x.useSize)(I),L=P?.width??0,M=P?.height??0,O="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},N=Array.isArray(m)?m:[m],B=N.length>0,F={padding:O,boundary:N.filter(H),altBoundary:B},{refs:q,floatingStyles:V,placement:$,isPositioned:G,middlewareData:X}=(0,E.useFloating)({strategy:"fixed",placement:n+("center"!==l?"-"+l:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return(0,C.autoUpdate)(...t,{animationFrame:"always"===_})},elements:{reference:T.anchor},middleware:[(0,E.offset)({mainAxis:o+M,alignmentAxis:d}),h&&(0,E.shift)({mainAxis:!0,crossAxis:!1,limiter:"partial"===g?(0,E.limitShift)():void 0,...F}),h&&(0,E.flip)({...F}),(0,E.size)({...F,apply:e=>{let{elements:t,rects:i,availableWidth:r,availableHeight:s}=e,{width:n,height:a}=i.reference,o=t.floating.style;o.setProperty("--radix-popper-available-width",`${r}px`),o.setProperty("--radix-popper-available-height",`${s}px`),o.setProperty("--radix-popper-anchor-width",`${n}px`),o.setProperty("--radix-popper-anchor-height",`${a}px`)}}),I&&(0,E.arrow)({element:I,padding:u}),z({arrowWidth:L,arrowHeight:M}),y&&(0,E.hide)({strategy:"referenceHidden",...F})]}),[Y,K]=W($),Q=(0,c.useCallbackRef)(v);(0,k.useLayoutEffect)(()=>{G&&Q?.()},[G,Q]);let Z=X.arrow?.x,J=X.arrow?.y,ee=X.arrow?.centerOffset!==0,[et,ei]=t.useState();return(0,k.useLayoutEffect)(()=>{A&&ei(window.getComputedStyle(A).zIndex)},[A]),(0,p.jsx)("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:G?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:et,"--radix-popper-transform-origin":[X.transformOrigin?.x,X.transformOrigin?.y].join(" "),...X.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,p.jsx)(U,{scope:s,placedSide:Y,onArrowChange:D,arrowX:Z,arrowY:J,shouldHideArrow:ee,children:(0,p.jsx)(a.Primitive.div,{"data-side":Y,"data-align":K,...b,ref:w,style:{...b.style,animation:G?void 0:"none"}})})})});F.displayName=j;var q="PopperArrow",V={top:"bottom",right:"left",bottom:"top",left:"right"},$=t.forwardRef(function(e,t){let{__scopePopper:i,...r}=e,s=B(q,i),n=V[s.placedSide];return(0,p.jsx)("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[n]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:(0,p.jsx)(w,{...r,ref:t,style:{...r.style,display:"block"}})})});function H(e){return null!==e}$.displayName=q;var z=e=>({name:"transformOrigin",options:e,fn(t){let{placement:i,rects:r,middlewareData:s}=t,n=s.arrow?.centerOffset!==0,a=n?0:e.arrowWidth,o=n?0:e.arrowHeight,[l,d]=W(i),u={start:"0%",center:"50%",end:"100%"}[d],h=(s.arrow?.x??0)+a/2,c=(s.arrow?.y??0)+o/2,p="",m="";return"bottom"===l?(p=n?u:`${h}px`,m=`${-o}px`):"top"===l?(p=n?u:`${h}px`,m=`${r.floating.height+o}px`):"right"===l?(p=`${-o}px`,m=n?u:`${c}px`):"left"===l&&(p=`${r.floating.width+o}px`,m=n?u:`${c}px`),{data:{x:p,y:m}}}});function W(e){let[t,i="center"]=e.split("-");return[t,i]}var G=e.i(174080),X=t.forwardRef((e,i)=>{let{container:r,...s}=e,[n,o]=t.useState(!1);(0,k.useLayoutEffect)(()=>o(!0),[]);let l=r||n&&globalThis?.document?.body;return l?G.default.createPortal((0,p.jsx)(a.Primitive.div,{...s,ref:i}),l):null});X.displayName="Portal";var Y=e.i(296626);e.s(["Item",()=>ep,"Root",()=>ec,"createRovingFocusGroupScope",()=>er],842727);var K="rovingFocusGroup.onEntryFocus",Q={bubbles:!1,cancelable:!0},Z="RovingFocusGroup",[J,ee,et]=(0,o.createCollection)(Z),[ei,er]=(0,s.createContextScope)(Z,[et]),[es,en]=ei(Z),ea=t.forwardRef((e,t)=>
1(0,p.jsx)(J.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(J.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(eo,{...e,ref:t})})}));ea.displayName=Z;var eo=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:o,orientation:d,loop:u=!1,dir:h,currentTabStopId:m,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:g,onEntryFocus:y,preventScrollOnEntryFocus:_=!1,...v}=e,b=t.useRef(null),T=(0,r.useComposedRefs)(s,b),A=(0,l.useDirection)(h),[S,E]=(0,n.useControllableState)({prop:m,defaultProp:f??null,onChange:g,caller:Z}),[C,w]=t.useState(!1),k=(0,c.useCallbackRef)(y),x=ee(o),I=t.useRef(!1),[D,P]=t.useState(0);return t.useEffect(()=>{let e=b.current;if(e)return e.addEventListener(K,k),()=>e.removeEventListener(K,k)},[k]),(0,p.jsx)(es,{scope:o,orientation:d,dir:A,loop:u,currentTabStopId:S,onItemFocus:t.useCallback(e=>E(e),[E]),onItemShiftTab:t.useCallback(()=>w(!0),[]),onFocusableItemAdd:t.useCallback(()=>P(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>P(e=>e-1),[]),children:(0,p.jsx)(a.Primitive.div,{tabIndex:C||0===D?-1:0,"data-orientation":d,...v,ref:T,style:{outline:"none",...e.style},onMouseDown:(0,i.composeEventHandlers)(e.onMouseDown,()=>{I.current=!0}),onFocus:(0,i.composeEventHandlers)(e.onFocus,e=>{let t=!I.current;if(e.target===e.currentTarget&&t&&!C){let t=new CustomEvent(K,Q);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);eh([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),_)}}I.current=!1}),onBlur:(0,i.composeEventHandlers)(e.onBlur,()=>w(!1))})})}),el="RovingFocusGroupItem",ed=t.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:s,focusable:n=!0,active:o=!1,tabStopId:l,children:d,...u}=e,h=(0,S.useId)(),c=l||h,m=en(el,s),f=m.currentTabStopId===c,g=ee(s),{onFocusableItemAdd:y,onFocusableItemRemove:_,currentTabStopId:v}=m;return t.useEffect(()=>{if(n)return y(),()=>_()},[n,y,_]),(0,p.jsx)(J.ItemSlot,{scope:s,id:c,focusable:n,active:o,children:(0,p.jsx)(a.Primitive.span,{tabIndex:f?0:-1,"data-orientation":m.orientation,...u,ref:r,onMouseDown:(0,i.composeEventHandlers)(e.onMouseDown,e=>{n?m.onItemFocus(c):e.preventDefault()}),onFocus:(0,i.composeEventHandlers)(e.onFocus,()=>m.onItemFocus(c)),onKeyDown:(0,i.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void m.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,i){var r;let s=(r=e.key,"rtl"!==i?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(s))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(s)))return eu[s]}(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)i.reverse();else if("prev"===t||"next"===t){"prev"===t&&i.reverse();let r=i.indexOf(e.currentTarget);i=m.loop?function(e,t){return e.map((i,r)=>e[(t+r)%e.length])}(i,r+1):i.slice(r+1)}setTimeout(()=>eh(i))}}),children:"function"==typeof d?d({isCurrentTabStop:f,hasTabStop:null!=v}):d})})});ed.displayName=el;var eu={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eh(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=document.activeElement;for(let r of e)if(r===i||(r.focus({preventScroll:t}),document.activeElement!==i))return}var ec=ea,ep=ed,em=e.i(991918),ef=e.i(186312),eg=function(){return(eg=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)};Object.create;Object.create,"function"==typeof SuppressedError&&SuppressedError;var ey=e.i(559700),e_=e.i(232286),ev=(0,e.i(386252).createSidecarMedium)(),eb=function(){},eT=t.forwardRef(function(e,i){var r=t.useRef(null),s=t.useState({onScrollCapture:eb,onWheelCapture:eb,onTouchMoveCapture:eb}),n=s[0],a=s[1],o=e.forwardProps,l=e.children,d=e.className,u=e.removeScrollBar,h=e.enabled,c=e.shards,p=e.sideCar,m=e.noRelative,f=e.noIsolation,g=e.inert,y=e.allowPinchZoom,_=e.as,v=e.gapMode,b=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)0>t.indexOf(r[s])&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(i[r[s]]=e[r[s]]);return i}(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=(0,e_.useMergeRefs)([r,i]),A=eg(eg({},b),n);return t.createElement(t.Fragment,null,h&&t.createElement(p,{sideCar:ev,removeScrollBar:u,shards:c,noRelative:m,n
1oIsolation:f,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:r,gapMode:v}),o?t.cloneElement(t.Children.only(l),eg(eg({},A),{ref:T})):t.createElement(void 0===_?"div":_,eg({},A,{className:d,ref:T}),l))});eT.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},eT.classNames={fullWidth:ey.fullWidthClassName,zeroRight:ey.zeroRightClassName};var eA=e.i(241352);e.i(897712);var eS=e.i(507507);e.i(974687);var eE=e.i(915070),eC=!1;if("undefined"!=typeof window)try{var ew=Object.defineProperty({},"passive",{get:function(){return eC=!0,!0}});window.addEventListener("test",ew,ew),window.removeEventListener("test",ew,ew)}catch(e){eC=!1}var ek=!!eC&&{passive:!1},ex=function(e,t){if(!(e instanceof Element))return!1;var i=window.getComputedStyle(e);return"hidden"!==i[t]&&(i.overflowY!==i.overflowX||"TEXTAREA"===e.tagName||"visible"!==i[t])},eI=function(e,t){var i=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),eD(e,r)){var s=eP(e,r);if(s[1]>s[2])return!0}r=r.parentNode}while(r&&r!==i.body)return!1},eD=function(e,t){return"v"===e?ex(t,"overflowY"):ex(t,"overflowX")},eP=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},eL=function(e,t,i,r,s){var n,a=(n=window.getComputedStyle(t).direction,"h"===e&&"rtl"===n?-1:1),o=a*r,l=i.target,d=t.contains(l),u=!1,h=o>0,c=0,p=0;do{if(!l)break;var m=eP(e,l),f=m[0],g=m[1]-m[2]-a*f;(f||g)&&eD(e,l)&&(c+=g,p+=f);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!d&&l!==document.body||d&&(t.contains(l)||t===l))return h&&(s&&1>Math.abs(c)||!s&&o>c)?u=!0:!h&&(s&&1>Math.abs(p)||!s&&-o>p)&&(u=!0),u},eR=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eM=function(e){return[e.deltaX,e.deltaY]},eO=function(e){return e&&"current"in e?e.current:e},eN=0,ej=[];let eU=(0,eA.exportSidecar)(ev,function(e){var i=t.useRef([]),r=t.useRef([0,0]),s=t.useRef(),n=t.useState(eN++)[0],a=t.useState(eE.styleSingleton)[0],o=t.useRef(e);t.useEffect(function(){o.current=e},[e]),t.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(n));var t=(function(e,t,i){if(i||2==arguments.length)for(var r,s=0,n=t.length;s<n;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(eO),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(n))})}}},[e.inert,e.lockRef.current,e.shards]);var l=t.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var i,n=eR(e),a=r.current,l="deltaX"in e?e.deltaX:a[0]-n[0],d="deltaY"in e?e.deltaY:a[1]-n[1],u=e.target,h=Math.abs(l)>Math.abs(d)?"h":"v";if("touches"in e&&"h"===h&&"range"===u.type)return!1;var c=eI(h,u);if(!c)return!0;if(c?i=h:(i="v"===h?"h":"v",c=eI(h,u)),!c)return!1;if(!s.current&&"changedTouches"in e&&(l||d)&&(s.current=i),!i)return!0;var p=s.current||i;return eL(p,t,e,"h"===p?l:d,!0)},[]),d=t.useCallback(function(e){if(ej.length&&ej[ej.length-1]===a){var t="deltaY"in e?eM(e):eR(e),r=i.current.filter(function(i){var r;return i.name===e.type&&(i.target===e.target||e.target===i.shadowParent)&&(r=i.delta,r[0]===t[0]&&r[1]===t[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}
1if(!r){var s=(o.current.shards||[]).map(eO).filter(Boolean).filter(function(t){return t.contains(e.target)});(s.length>0?l(e,s[0]):!o.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),u=t.useCallback(function(e,t,r,s){var n={name:e,delta:t,target:r,should:s,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};i.current.push(n),setTimeout(function(){i.current=i.current.filter(function(e){return e!==n})},1)},[]),h=t.useCallback(function(e){r.current=eR(e),s.current=void 0},[]),c=t.useCallback(function(t){u(t.type,eM(t),t.target,l(t,e.lockRef.current))},[]),p=t.useCallback(function(t){u(t.type,eR(t),t.target,l(t,e.lockRef.current))},[]);t.useEffect(function(){return ej.push(a),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:p}),document.addEventListener("wheel",d,ek),document.addEventListener("touchmove",d,ek),document.addEventListener("touchstart",h,ek),function(){ej=ej.filter(function(e){return e!==a}),document.removeEventListener("wheel",d,ek),document.removeEventListener("touchmove",d,ek),document.removeEventListener("touchstart",h,ek)}},[]);var m=e.removeScrollBar,f=e.inert;return t.createElement(t.Fragment,null,f?t.createElement(a,{styles:"\n .block-interactivity-".concat(n," {pointer-events: none;}\n .allow-interactivity-").concat(n," {pointer-events: all;}\n")}):null,m?t.createElement(eS.RemoveScrollBar,{noRelative:e.noRelative,gapMode:e.gapMode}):null)});var eB=t.forwardRef(function(e,i){return t.createElement(eT,eg({},e,{ref:i,sideCar:eU}))});eB.classNames=eT.classNames;var eF=["Enter"," "],eq=["ArrowUp","PageDown","End"],eV=["ArrowDown","PageUp","Home",...eq],e$={ltr:[...eF,"ArrowRight"],rtl:[...eF,"ArrowLeft"]},eH={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ez="Menu",[eW,eG,eX]=(0,o.createCollection)(ez),[eY,eK]=(0,s.createContextScope)(ez,[eX,P,er]),eQ=P(),eZ=er(),[eJ,e0]=eY(ez),[e1,e2]=eY(ez),e4=e=>{let{__scopeMenu:i,open:r=!1,children:s,dir:n,onOpenChange:a,modal:o=!0}=e,d=eQ(i),[u,h]=t.useState(null),m=t.useRef(!1),f=(0,c.useCallbackRef)(a),g=(0,l.useDirection)(n);return t.useEffect(()=>{let e=()=>{m.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>m.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,p.jsx)(M,{...d,children:(0,p.jsx)(eJ,{scope:i,open:r,onOpenChange:f,content:u,onContentChange:h,children:(0,p.jsx)(e1,{scope:i,onClose:t.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:m,dir:g,modal:o,children:s})})})};e4.displayName=ez;var e5=t.forwardRef((e,t)=>{let{__scopeMenu:i,...r}=e,s=eQ(i);return(0,p.jsx)(N,{...s,...r,ref:t})});e5.displayName="MenuAnchor";var e8="MenuPortal",[e3,e6]=eY(e8,{forceMount:void 0}),e7=e=>{let{__scopeMenu:t,forceMount:i,children:r,container:s}=e,n=e0(e8,t);return(0,p.jsx)(e3,{scope:t,forceMount:i,children:(0,p.jsx)(Y.Presence,{present:i||n.open,children:(0,p.jsx)(X,{asChild:!0,container:s,children:r})})})};e7.displayName=e8;var e9="MenuContent",[te,tt]=eY(e9),ti=t.forwardRef((e,t)=>{let i=e6(e9,e.__scopeMenu),{forceMount:r=i.forceMount,...s}=e,n=e0(e9,e.__scopeMenu),a=e2(e9,e.__scopeMenu);return(0,p.jsx)(eW.Provider,{scope:e.__scopeMenu,children:(0,p.jsx)(Y.Presence,{present:r||n.open,children:(0,p.jsx)(eW.Slot,{scope:e.__scopeMenu,children:a.modal?(0,p.jsx)(tr,{...s,ref:t}):(0,p.jsx)(ts,{...s,ref:t})})})})}),tr=t.forwardRef((e,s)=>{let n=e0(e9,e.__scopeMenu),a=t.useRef(null),o=(0,r.useComposedRefs)(s,a);return t.useEffect(()=>{let e=a.current;if(e)return(0,ef.hideOthers)(e)},[]),(0,p.jsx)(ta,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:(0,i.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ts=t.forwardRef((e,t)=>{let i=e0(e9,e.__scopeMenu);return(0,p.jsx)(ta,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})}),tn=(0,em.createSlot)("MenuContent.ScrollLock"),ta=t.forwardRef((e,s)=>{let{__scopeMenu:n,loop:a=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:m,onEntryFocus:f,onEscapeKeyDown:g,onPointerDownOutside:_,onFocusOutside:v,onInteractOutside:b,onDismiss:T,disableOutsideScroll:A,...S}=e,E=e0(e9,n),C=e2(e9,n),w=eQ(n),k=eZ(n),x=eG(n),[I,D]=t.useState(null),P=t.useRef(null),L=(0,r.useComposedRefs)(s,P,E.onContentChange),R=t.useRef(0),M=t.useRef(""),O=t.useRef(0),N=t.useRef(null),j=t.useRef("right"),U=t.useRef(0),B=A?eB:t.Fragment;t.useEffect(()=>()=>window.clearTimeout(R.current),[]),t.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??h()),document.body.insertAdjacentElement("beforeend",e[1]??h()),u++,()=>{1===u&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
1=>e.remove()),u--}},[]);let q=t.useCallback(e=>j.current===N.current?.side&&function(e,t){return!!t&&function(e,t){let{x:i,y:r}=e,s=!1;for(let e=0,n=t.length-1;e<t.length;n=e++){let a=t[e],o=t[n],l=a.x,d=a.y,u=o.x,h=o.y;d>r!=h>r&&i<(u-l)*(r-d)/(h-d)+l&&(s=!s)}return s}({x:e.clientX,y:e.clientY},t)}(e,N.current?.area),[]);return(0,p.jsx)(te,{scope:n,searchRef:M,onItemEnter:t.useCallback(e=>{q(e)&&e.preventDefault()},[q]),onItemLeave:t.useCallback(e=>{q(e)||(P.current?.focus(),D(null))},[q]),onTriggerLeave:t.useCallback(e=>{q(e)&&e.preventDefault()},[q]),pointerGraceTimerRef:O,onPointerGraceIntentChange:t.useCallback(e=>{N.current=e},[]),children:(0,p.jsx)(B,{...A?{as:tn,allowPinchZoom:!0}:void 0,children:(0,p.jsx)(y,{asChild:!0,trapped:o,onMountAutoFocus:(0,i.composeEventHandlers)(l,e=>{e.preventDefault(),P.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:(0,p.jsx)(d.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:g,onPointerDownOutside:_,onFocusOutside:v,onInteractOutside:b,onDismiss:T,children:(0,p.jsx)(ec,{asChild:!0,...k,dir:C.dir,orientation:"vertical",loop:a,currentTabStopId:I,onCurrentTabStopIdChange:D,onEntryFocus:(0,i.composeEventHandlers)(f,e=>{C.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,p.jsx)(F,{role:"menu","aria-orientation":"vertical","data-state":tL(E.open),"data-radix-menu-content":"",dir:C.dir,...w,...S,ref:L,style:{outline:"none",...S.style},onKeyDown:(0,i.composeEventHandlers)(S.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,i=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!i&&r&&(e=>{let t=M.current+e,i=x().filter(e=>!e.disabled),r=document.activeElement,s=i.find(e=>e.ref.current===r)?.textValue,n=function(e,t,i){var r;let s=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,n=i?e.indexOf(i):-1,a=(r=Math.max(n,0),e.map((t,i)=>e[(r+i)%e.length]));1===s.length&&(a=a.filter(e=>e!==i));let o=a.find(e=>e.toLowerCase().startsWith(s.toLowerCase()));return o!==i?o:void 0}(i.map(e=>e.textValue),t,s),a=i.find(e=>e.textValue===n)?.ref.current;!function e(t){M.current=t,window.clearTimeout(R.current),""!==t&&(R.current=window.setTimeout(()=>e(""),1e3))}(t),a&&setTimeout(()=>a.focus())})(e.key));let s=P.current;if(e.target!==s||!eV.includes(e.key))return;e.preventDefault();let n=x().filter(e=>!e.disabled).map(e=>e.ref.current);eq.includes(e.key)&&n.reverse(),function(e){let t=document.activeElement;for(let i of e)if(i===t||(i.focus(),document.activeElement!==t))return}(n)}),onBlur:(0,i.composeEventHandlers)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(R.current),M.current="")}),onPointerMove:(0,i.composeEventHandlers)(e.onPointerMove,tO(e=>{let t=e.target,i=U.current!==e.clientX;e.currentTarget.contains(t)&&i&&(j.current=e.clientX>U.current?"right":"left",U.current=e.clientX)}))})})})})})})});ti.displayName=e9;var to=t.forwardRef((e,t)=>{let{__scopeMenu:i,...r}=e;return(0,p.jsx)(a.Primitive.div,{role:"group",...r,ref:t})});to.displayName="MenuGroup";var tl=t.forwardRef((e,t)=>{let{__scopeMenu:i,...r}=e;return(0,p.jsx)(a.Primitive.div,{...r,ref:t})});tl.displayName="MenuLabel";var td="MenuItem",tu="menu.itemSelect",th=t.forwardRef((e,s)=>{let{disabled:n=!1,onSelect:o,...l}=e,d=t.useRef(null),u=e2(td,e.__scopeMenu),h=tt(td,e.__scopeMenu),c=(0,r.useComposedRefs)(s,d),m=t.useRef(!1);return(0,p.jsx)(tc,{...l,ref:c,disabled:n,onClick:(0,i.composeEventHandlers)(e.onClick,()=>{let e=d.current;if(!n&&e){let t=new CustomEvent(tu,{bubbles:!0,cancelable:!0});e.addEventListener(tu,e=>o?.(e),{once:!0}),(0,a.dispatchDiscreteCustomEvent)(e,t),t.defaultPrevented?m.current=!1:u.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),m.current=!0},onPointerUp:(0,i.composeEventHandlers)(e.onPointerUp,e=>{m.current||e.currentTarget?.click()}),onKeyDown:(0,i.composeEventHandlers)(e.onKeyDown,e=>{let t=""!==h.searchRef.current;n||t&&" "===e.key||eF.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});th.displayName=td;var tc=t.forwardRef((e,s)=>{let{__scopeMenu:n,disabled:o=!1,textValue:l,...d}=e,u=tt(td,n),h=eZ(n),c=t.useRef(null),m=(0,r.useComposedRefs)(s,c),[f,g]=t.useState(!1),[y,_]=t.useState("");return t.useEffect(()=>
1{let e=c.current;e&&_((e.textContent??"").trim())},[d.children]),(0,p.jsx)(eW.ItemSlot,{scope:n,disabled:o,textValue:l??y,children:(0,p.jsx)(ep,{asChild:!0,...h,focusable:!o,children:(0,p.jsx)(a.Primitive.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...d,ref:m,onPointerMove:(0,i.composeEventHandlers)(e.onPointerMove,tO(e=>{o?u.onItemLeave(e):(u.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,i.composeEventHandlers)(e.onPointerLeave,tO(e=>u.onItemLeave(e))),onFocus:(0,i.composeEventHandlers)(e.onFocus,()=>g(!0)),onBlur:(0,i.composeEventHandlers)(e.onBlur,()=>g(!1))})})})}),tp=t.forwardRef((e,t)=>{let{checked:r=!1,onCheckedChange:s,...n}=e;return(0,p.jsx)(tT,{scope:e.__scopeMenu,checked:r,children:(0,p.jsx)(th,{role:"menuitemcheckbox","aria-checked":tR(r)?"mixed":r,...n,ref:t,"data-state":tM(r),onSelect:(0,i.composeEventHandlers)(n.onSelect,()=>s?.(!!tR(r)||!r),{checkForDefaultPrevented:!1})})})});tp.displayName="MenuCheckboxItem";var tm="MenuRadioGroup",[tf,tg]=eY(tm,{value:void 0,onValueChange:()=>{}}),ty=t.forwardRef((e,t)=>{let{value:i,onValueChange:r,...s}=e,n=(0,c.useCallbackRef)(r);return(0,p.jsx)(tf,{scope:e.__scopeMenu,value:i,onValueChange:n,children:(0,p.jsx)(to,{...s,ref:t})})});ty.displayName=tm;var t_="MenuRadioItem",tv=t.forwardRef((e,t)=>{let{value:r,...s}=e,n=tg(t_,e.__scopeMenu),a=r===n.value;return(0,p.jsx)(tT,{scope:e.__scopeMenu,checked:a,children:(0,p.jsx)(th,{role:"menuitemradio","aria-checked":a,...s,ref:t,"data-state":tM(a),onSelect:(0,i.composeEventHandlers)(s.onSelect,()=>n.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});tv.displayName=t_;var tb="MenuItemIndicator",[tT,tA]=eY(tb,{checked:!1}),tS=t.forwardRef((e,t)=>{let{__scopeMenu:i,forceMount:r,...s}=e,n=tA(tb,i);return(0,p.jsx)(Y.Presence,{present:r||tR(n.checked)||!0===n.checked,children:(0,p.jsx)(a.Primitive.span,{...s,ref:t,"data-state":tM(n.checked)})})});tS.displayName=tb;var tE=t.forwardRef((e,t)=>{let{__scopeMenu:i,...r}=e;return(0,p.jsx)(a.Primitive.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});tE.displayName="MenuSeparator";var tC=t.forwardRef((e,t)=>{let{__scopeMenu:i,...r}=e,s=eQ(i);return(0,p.jsx)($,{...s,...r,ref:t})});tC.displayName="MenuArrow";var[tw,tk]=eY("MenuSub"),tx="MenuSubTrigger",tI=t.forwardRef((e,s)=>{let n=e0(tx,e.__scopeMenu),a=e2(tx,e.__scopeMenu),o=tk(tx,e.__scopeMenu),l=tt(tx,e.__scopeMenu),d=t.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:h}=l,c={__scopeMenu:e.__scopeMenu},m=t.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return t.useEffect(()=>m,[m]),t.useEffect(()=>{let e=u.current;return()=>{window.clearTimeout(e),h(null)}},[u,h]),(0,p.jsx)(e5,{asChild:!0,...c,children:(0,p.jsx)(tc,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":tL(n.open),...e,ref:(0,r.composeRefs)(s,o.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:(0,i.composeEventHandlers)(e.onPointerMove,tO(t=>{l.onItemEnter(t),!t.defaultPrevented&&(e.disabled||n.open||d.current||(l.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100)))})),onPointerLeave:(0,i.composeEventHandlers)(e.onPointerLeave,tO(e=>{m();let t=n.content?.getBoundingClientRect();if(t){let i=n.content?.dataset.side,r="right"===i,s=t[r?"left":"right"],a=t[r?"right":"left"];l.onPointerGraceIntentChange({area:[{x:e.clientX+(r?-5:5),y:e.clientY},{x:s,y:t.top},{x:a,y:t.top},{x:a,y:t.bottom},{x:s,y:t.bottom}],side:i}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(e),e.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:(0,i.composeEventHandlers)(e.onKeyDown,t=>{let i=""!==l.searchRef.current;e.disabled||i&&" "===t.key||e$[a.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});tI.displayName=tx;var tD="MenuSubContent",tP=t.forwardRef((e,s)=>{let n=e6(e9,e.__scopeMenu),{forceMount:a=n.forceMount,...o}=e,l=e0(e9,e.__scopeMenu),d=e2(e9,e.__scopeMenu),u=tk(tD,e.__scopeMenu),h=t.useRef(null),c=(0,r.useComposedRefs)(s,h);return(0,p.jsx)(eW.Provider,{scope:e.__scopeMenu,children:(0,p.jsx)(Y.Presence,{present:a||l.open,children:(0,p.jsx)(eW.Slot,{scope:e.__scopeMenu,children:(0,p.jsx)(ta,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:c,align:"start",side:"rtl"===d.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{d.isUsingKeyboardRef.current&&h.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,i.composeEventHandlers)(e.onFocusOutside,e=>{e.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:(0,i.composeEventHandlers)(e.onEscapeKeyDown,e=>{d.onClose(),e.preventDefault()}),onKeyDown:(0,i.composeEventHandlers)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),i=eH[d.dir].includes(e.ke
1y);t&&i&&(l.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})});function tL(e){return e?"open":"closed"}function tR(e){return"indeterminate"===e}function tM(e){return tR(e)?"indeterminate":e?"checked":"unchecked"}function tO(e){return t=>"mouse"===t.pointerType?e(t):void 0}tP.displayName=tD;var tN="DropdownMenu",[tj,tU]=(0,s.createContextScope)(tN,[eK]),tB=eK(),[tF,tq]=tj(tN),tV=e=>{let{__scopeDropdownMenu:i,children:r,dir:s,open:a,defaultOpen:o,onOpenChange:l,modal:d=!0}=e,u=tB(i),h=t.useRef(null),[c,m]=(0,n.useControllableState)({prop:a,defaultProp:o??!1,onChange:l,caller:tN});return(0,p.jsx)(tF,{scope:i,triggerId:(0,S.useId)(),triggerRef:h,contentId:(0,S.useId)(),open:c,onOpenChange:m,onOpenToggle:t.useCallback(()=>m(e=>!e),[m]),modal:d,children:(0,p.jsx)(e4,{...u,open:c,onOpenChange:m,dir:s,modal:d,children:r})})};tV.displayName=tN;var t$="DropdownMenuTrigger",tH=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:s,disabled:n=!1,...o}=e,l=tq(t$,s),d=tB(s);return(0,p.jsx)(e5,{asChild:!0,...d,children:(0,p.jsx)(a.Primitive.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...o,ref:(0,r.composeRefs)(t,l.triggerRef),onPointerDown:(0,i.composeEventHandlers)(e.onPointerDown,e=>{!n&&0===e.button&&!1===e.ctrlKey&&(l.onOpenToggle(),l.open||e.preventDefault())}),onKeyDown:(0,i.composeEventHandlers)(e.onKeyDown,e=>{!n&&(["Enter"," "].includes(e.key)&&l.onOpenToggle(),"ArrowDown"===e.key&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});tH.displayName=t$;var tz=e=>{let{__scopeDropdownMenu:t,...i}=e,r=tB(t);return(0,p.jsx)(e7,{...r,...i})};tz.displayName="DropdownMenuPortal";var tW="DropdownMenuContent",tG=t.forwardRef((e,r)=>{let{__scopeDropdownMenu:s,...n}=e,a=tq(tW,s),o=tB(s),l=t.useRef(!1);return(0,p.jsx)(ti,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...n,ref:r,onCloseAutoFocus:(0,i.composeEventHandlers)(e.onCloseAutoFocus,e=>{l.current||a.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:(0,i.composeEventHandlers)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,i=0===t.button&&!0===t.ctrlKey,r=2===t.button||i;(!a.modal||r)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tG.displayName=tW,t.forwardRef((e,t)=>{let{__scopeDropdownMenu:i,...r}=e,s=tB(i);return(0,p.jsx)(to,{...s,...r,ref:t})}).displayName="DropdownMenuGroup",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:i,...r}=e,s=tB(i);return(0,p.jsx)(tl,{...s,...r,ref:t})}).displayName="DropdownMenuLabel";var tX=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:i,...r}=e,s=tB(i);return(0,p.jsx)(th,{...s,...r,ref:t})});tX.displayName="DropdownMenuItem",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:i,...r}=e,s=tB(i);return(0,p.jsx)(tp,{...s,...r,ref:t})}).displayName="DropdownMenuCheckboxItem",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:i,...r}=e,s=tB(i);return(0,p.jsx)(ty,{...s,...r,ref:t})}).displayName="DropdownMenuRadioGroup",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:i,...r}=e,s=tB(i);return(0,p.jsx)(tv,{...s,...r,ref:t})}).displayName="DropdownMenuRadioItem",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:i,...r}=e,s=tB(i);return(0,p.jsx)(tS,{...s,...r,ref:t})}).displayName="DropdownMenuItemIndicator",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:i,...r}=e,s=tB(i);return(0,p.jsx)(tE,{...s,...r,ref:t})}).displayName="DropdownMenuSeparator",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:i,...r}=e,s=tB(i);return(0,p.jsx)(tC,{...s,...r,ref:t})}).displayName="DropdownMenuArrow",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:i,...r}=e,s=tB(i);return(0,p.jsx)(tI,{...s,...r,ref:t})}).displayName="DropdownMenuSubTrigger",t.forwardRef((e,t)=>
1{let{__scopeDropdownMenu:i,...r}=e,s=tB(i);return(0,p.jsx)(tP,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent";var tY=tV,tK=tH,tQ=tz,tZ=tG,tJ=tX},359644,e=>{e.v({container:"EmbedContainer-module__-GtaLq__container",placeholder:"EmbedContainer-module__-GtaLq__placeholder",pulse:"EmbedContainer-module__-GtaLq__pulse"})},177636,e=>{e.v({belongsTo:"AudioEmbed-module__ZEoajq__belongsTo",bottom:"AudioEmbed-module__ZEoajq__bottom",bottomAudioOnly:"AudioEmbed-module__ZEoajq__bottomAudioOnly",bottomPodcast:"AudioEmbed-module__ZEoajq__bottomPodcast",container:"AudioEmbed-module__ZEoajq__container "+e.i(359644).container,description:"AudioEmbed-module__ZEoajq__description",dropdownContent:"AudioEmbed-module__ZEoajq__dropdownContent",image:"AudioEmbed-module__ZEoajq__image",label:"AudioEmbed-module__ZEoajq__label",metaItem:"AudioEmbed-module__ZEoajq__metaItem",middle:"AudioEmbed-module__ZEoajq__middle",moreButton:"AudioEmbed-module__ZEoajq__moreButton",optionLink:"AudioEmbed-module__ZEoajq__optionLink",playAndMore:"AudioEmbed-module__ZEoajq__playAndMore",playButton:"AudioEmbed-module__ZEoajq__playButton",title:"AudioEmbed-module__ZEoajq__title"})},585401,e=>{"use strict";e.s(["default",()=>S],585401);var t=e.i(857727),i=e.i(271645),r=e.i(657688),s=e.i(207670),n=e.i(67405),a=e.i(301404),o=e.i(324876),l=e.i(212313),d=e.i(392695),u=e.i(250194),h=e.i(45607),c=e.i(540666),p=e.i(612579),m=e.i(245685),f=e.i(236692),g=e.i(789544),y=e.i(397584),_=e.i(86132),v=e.i(177636);function b(e){return"Download"===e.name?"_blank":e.target||"_self"}function T(e){let{item:i,clickEventData:r,className:n,...a}=e,o=(0,p.default)(i.icon),l=i.contentSize?` (${i.contentSize})`:"";return(0,t.jsxs)(_.default,{href:i.url,target:b(i),"data-testid":i.id,className:(0,s.default)(v.default.optionLink,n),clickEventData:{...r,elementText:i.name,clickURL:i.url},...a,children:[(0,t.jsxs)("span",{children:[i.name,"Download"===i.name&&l]}),(0,t.jsx)(o,{fill:"currentColor"})]})}function A(e){let{options:r,clickEventData:s}=e,n=(0,m.default)(`(max-width: ${f.BREAKPOINT_SM}px)`),[a,o]=(0,i.useState)(!1);return n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:v.default.moreButton,"aria-label":"More options","data-testid":"moreVerticalButton",onClick:()=>o(!0),children:(0,t.jsx)(u.DotsThreeVerticalIcon,{weight:"bold"})}),(0,t.jsx)(g.default,{open:a,setOpen:o,isMobileScreenWidth:n,"aria-label":"More options",children:(0,t.jsxs)(y.default,{children:[(0,t.jsx)(y.MobileDrawerCloseButton,{"aria-label":"Close more options",onClick:()=>o(!1)}),(0,t.jsx)("p",{children:"More options"}),(0,t.jsx)(y.MobileDrawerListContainer,{children:r.map(e=>{let i=(0,p.default)(e.icon),r=e.contentSize?` (${e.contentSize})`:"";return(0,t.jsx)("li",{children:(0,t.jsxs)(y.MobileDrawerLink,{href:e.url,target:b(e),"data-testid":e.id,clickEventData:{...s,elementText:e.name,clickURL:e.url},children:[(0,t.jsxs)("span",{children:[e.name,"Download"===e.name&&r]}),(0,t.jsx)(i,{fill:"currentColor"})]})},e.id)})})]})})]}):(0,t.jsxs)(c.Root,{modal:!1,children:[(0,t.jsx)(c.Trigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:v.default.moreButton,"aria-label":"More options","data-testid":"moreVertical",children:(0,t.jsx)(u.DotsThreeVerticalIcon,{weight:"bold"})})}),(0,t.jsx)(c.Portal,{children:(0,t.jsx)(c.Content,{className:v.default.dropdownContent,side:"bottom",align:"end",sideOffset:4,children:r.map(e=>(0,t.jsx)(c.Item,{asChild:!0,children:(0,t.jsx)(T,{item:e,clickEventData:s})},e.id))})})]})}function S(e){let{id:c,src:p,name:m,caption:f,imageUrl:g="",duration:y=0,label:_="LISTEN TO",language:b="",belongsTo:T="",publishedDate:S,moreOptionsList:E,seriesId:C,page:w,clickEventData:k}=e,[x,I]=(0,n.useMediaContextV2)(),D=(0,n.useTogglePlay)(p),P=(0,d.mediaIsPlaying)(x.status,p,x.activeMediaUrl),L=(0,l.default)(y),R=!!b?.length,M=!!T?.length,O=!!E?.length,N=[R,M,O,!!S?.length].every(e=>!1===e),[j,U]=(0,i.useState)(!1);return(0,a.usePodcastRecommendations)({pathOrId:C??"",site:(0,o.default)(w)},{enabled:j&&!!C,staleTime:1/0,onSuccess:e=>{I({type:"APPEND_PLAYLIST",payload:{beforeAppend:"clear",playlist:(0,a.getFormattedPodcastEpisodesFromRecommendations)(e)}})}}),(0,t.jsx)(h.default,{children:(0,t.jsxs)("aside",{id:m,itemScope:!0,itemType:"https://schema.org/AudioObject",className:v.default.container,"data-testid":"embed-audio",children:[(0,t.jsx)("div",{className:v.default.label,"data-testid":"audio-listenTo",children:_}),(0,t.jsxs)("div",{className:v.default.middle,children:[g&&(0,t.jsx)(r.default,{src:g,width:160,height:90,alt:m,sizes:"160px",loading:"lazy",className:v.default.image,"data-testid":"audio-image"}),(0,t.jsx)("h3",{className:v.default.title,"data-testid":"audio-title",children:f})]}),(0,t.jsxs)("div",{className:(0,s.default)(v.default.bottom,N?v.default.bottomAudioOnly:v.default.bottomPodcast),children:[M&&(0,t.jsx)("p",{className:v.default.belongsTo,"data-testid":"audio-belongsTo",children:T}),(0,t.jsxs)("div",{className:v.default.description,children:[(0,t.jsxs)("span",{className:v.default.metaItem,"data-testid":"audio-duration",children:[(0,t.jsx)(u.WaveformIcon,{}),L||"00:00"]}),R&&(0,t.jsxs)("span",{className:v.default.metaItem,children:[(0,t.jsx)(u.LanguageIcon,{}),b]})]}),(0,t.jsxs)("div",{className:v.default.playAndMore,children:[O&&(0,t.jsx)(A,{options:E,clickEventData:k}),(0,t.jsx)("button",{type:"button",onClick:()=>{U(!0),D()},className:v.default.playButton,"data-testid":"audio-playButton","aria-label":P?`Pause audio ${f}`:`Play audio ${f}`,children:P?(0,t.jsx)(u.PauseIcon,{weight:"fill","data-testid":"audio-playButton__icon-pause"}):(0,t.jsx)(u.PlayIcon,{weight:"fill","data-testid":"audio-playButton__icon-play"})})]})]}),(0,t.jsx)("meta",{itemProp:"identifier",content:c})]})})}},46737,e=>{e.v({container:"IFrameEmbed-module__XpGlNW__container",fluid:"IFrameEmbed-module__XpGlNW__fluid",iframe:"IFrameEmbed-module__XpGlNW__iframe"})},514892,e=>{"use strict";e.s(["default",()=>o]);var t=e.i(857727),i=e.i(770703),r=e.i(207670),s=e.i(46737);let n=(0,i.default)(()=>e.A(891822),{loadableGenerated:{modules:[551378]}}),a=(0,i.default)(()=>e.A(730460),{loadableGenerated:{modules:[959166]}});function o(e){let{src:i,title:o,height:l,width:d,iframeJsLibrary:u}=e,h=o||i,c=!!(d||l)&&"DefaultResizer"!==u&&"Pym.js"!==u,p=c?{maxWidth:d?`${d}px`:void 0,"--aspect-ratio":d&&l?`${d} / ${l}`:void 0,height:!d&&l?`${l}px`:void 0}:void 0;return(0,t.jsxs)("div",{className:(0,r.default)(s.default.container,c&&s.default.fluid),style:p,itemScope:!0,itemType:"https://schema.org/MediaObject","data-testid":"iframe-embed",children:["DefaultResizer"===u?(0,t.jsx)(a,{src:i,title:h,width:"100%",height:"100%",frameBorder:"0",sizeHeight:!0,inPageLinks:!0,style:{width:"100%",...d?{maxWidth:`${d}px`}:{},...l?{minHeight:`${l}px`}:{}}}):"Pym.js"===u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"data-pym-src":i}
1),(0,t.jsx)(n,{strategy:"afterInteractive",id:"pymjs",src:"https://pym.nprapps.org/pym.v1.min.js"})]}):(0,t.jsx)("iframe",{className:s.default.iframe,src:i,title:h}),(0,t.jsx)("meta",{itemProp:"identifier",content:i}),(0,t.jsx)("meta",{itemProp:"url",content:i}),(0,t.jsx)("meta",{itemProp:"headline",content:h}),d&&(0,t.jsx)("meta",{itemProp:"width",content:String(d)}),l&&(0,t.jsx)("meta",{itemProp:"height",content:String(l)})]})}},325273,(e,t,i)=>{var r;t.exports=r="undefined"!=typeof window?window:e.g},729265,(e,t,i)=>{var r,s=e.g;"undefined"!=typeof document?r=document:(r=s["__GLOBAL_DOCUMENT_CACHE@4"])||(r=s["__GLOBAL_DOCUMENT_CACHE@4"]={}),t.exports=r},575959,(e,t,i)=>{t.exports=function(e){if(!e)return!1;var t=r.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var r=Object.prototype.toString},475071,(e,t,i)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}t.exports=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},t.addInterceptor=function(e,t){this.typeToInterceptorsMap_.has(e)||this.typeToInterceptorsMap_.set(e,new Set);var i=this.typeToInterceptorsMap_.get(e);return!i.has(t)&&(i.add(t),!0)},t.removeInterceptor=function(e,t){var i=this.typeToInterceptorsMap_.get(e);return!!(i&&i.has(t))&&(i.delete(t),!0)},t.clearInterceptorsByType=function(e){return!!this.typeToInterceptorsMap_.get(e)&&(this.typeToInterceptorsMap_.delete(e),this.typeToInterceptorsMap_.set(e,new Set),!0)},t.clear=function(){return!!this.typeToInterceptorsMap_.size&&(this.typeToInterceptorsMap_=new Map,!0)},t.getForType=function(e){return this.typeToInterceptorsMap_.get(e)||new Set},t.execute=function(e,t){for(var i,s=this.getForType(e),n=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return r(e,void 0);var i=Object.prototype.toString.call(e).slice(8,-1);if("Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return r(e,t)}}(e))){i&&(e=i);var s=0;return function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(s);!(i=n()).done;){var a=i.value;try{t=a(t)}catch(e){}}return t},e}()},177346,(e,t,i)=>{"use strict";var r=function(){function e(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},t.getMaxAttempts=function(){return this.maxAttempts_},t.setMaxAttempts=function(e){this.maxAttempts_=e},t.getDelayFactor=function(){return this.delayFactor_},t.setDelayFactor=function(e){this.delayFactor_=e},t.getFuzzFactor=function(){return this.fuzzFactor_},t.setFuzzFactor=function(e){this.fuzzFactor_=e},t.getInitialDelay=function(){return this.initialDelay_},t.setInitialDelay=function(e){this.initialDelay_=e},t.createRetry=function(e){var t=void 0===e?{}:e,i=t.maxAttempts,r=t.delayFactor,n=t.fuzzFactor,a=t.initialDelay;return new s({maxAttempts:i||this.maxAttempts_,delayFactor:r||this.delayFactor_,fuzzFactor:n||this.fuzzFactor_,initialDelay:a||this.initialDelay_})},e}(),s=function(){function e(e){this.maxAttempts_=e.maxAttempts,this.delayFactor_=e.delayFactor,this.fuzzFactor_=e.fuzzFactor,this.currentDelay_=e.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+e},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var e=this.getCurrentMinPossibleDelay();return e+Math.random()*(this.getCurrentMaxPossibleDelay()-e)},e}();t.exports=r},937496,(e,t,i)=>{"use strict";var r=e.r(325273);t.exports=function(e,t){return void 0===t&&(t=!1),function(i,s,n){if(i)return void e(i);if(s.statusCode>=400&&s.statusCode<=599){var a=n;if(t)if(r.TextDecoder){var o,l=(void 0===(o=s.headers&&s.headers["content-type"])&&(o=""),o.toLowerCase().split(";").reduce(function(e,t){var i=t.split("="),r=i[0],s=i[1];return"charset"===r.trim()?s.trim():e},"utf-8"));try{a=new TextDecoder(l).decode(n)}catch(e){}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}}},53618,(e,t,i)=>{"use strict";var r=e.r(325273),s=e.r(343676),n=e.r(575959),a=e.r(475071),o=e.r(177346);u.httpHandler=e.r(937496),u.requestInterceptorsStorage=new a,u.responseInterceptorsStorage=new a,u.retryM
1anager=new o;var l=function(e){var t={};return e&&e.trim().split("\n").forEach(function(e){var i=e.indexOf(":"),r=e.slice(0,i).trim().toLowerCase(),s=e.slice(i+1).trim();void 0===t[r]?t[r]=s:Array.isArray(t[r])?t[r].push(s):t[r]=[t[r],s]}),t};function d(e,t,i){var r=e;return n(t)?(i=t,"string"==typeof e&&(r={uri:e})):r=s({},t,{uri:e}),r.callback=i,r}function u(e,t,i){return h(t=d(e,t,i))}function h(e){if(void 0===e.callback)throw Error("callback argument missing");if(e.requestType&&u.requestInterceptorsStorage.getIsEnabled()){var t,i,r,s={uri:e.uri||e.url,headers:e.headers||{},body:e.body,metadata:e.metadata||{},retry:e.retry,timeout:e.timeout},n=u.requestInterceptorsStorage.execute(e.requestType,s);e.uri=n.uri,e.headers=n.headers,e.body=n.body,e.metadata=n.metadata,e.retry=n.retry,e.timeout=n.timeout}var a=!1,o=function(t,i,r){a||(a=!0,e.callback(t,i,r))};function d(t){if(clearTimeout(r),clearTimeout(e.retryTimeout),t instanceof Error||(t=Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,!i&&u.retryManager.getIsEnabled()&&e.retry&&e.retry.shouldRetry()){e.retryTimeout=setTimeout(function(){e.retry.moveToNextAttempt(),e.xhr=p,h(e)},e.retry.getCurrentFuzzedDelay());return}if(e.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var s={headers:b.headers||{},body:b.body,responseUrl:p.responseURL,responseType:p.responseType},n=u.responseInterceptorsStorage.execute(e.requestType,s);b.body=n.body,b.headers=n.headers}return o(t,b)}function c(){if(!i){clearTimeout(r),clearTimeout(e.retryTimeout);var t=e.useXDR&&void 0===p.status?200:1223===p.status?204:p.status,s=b,n=null;if(0!==t?(s={body:function(){var e=void 0;if(e=p.response?p.response:p.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(p),v)try{e=JSON.parse(e)}catch(e){}return e}(),statusCode:t,method:f,headers:{},url:m,rawRequest:p},p.getAllResponseHeaders&&(s.headers=l(p.getAllResponseHeaders()))):n=Error("Internal XMLHttpRequest Error"),e.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var a={headers:s.headers||{},body:s.body,responseUrl:p.responseURL,responseType:p.responseType},d=u.responseInterceptorsStorage.execute(e.requestType,a);s.body=d.body,s.headers=d.headers}return o(n,s,s.body)}}var p=e.xhr||null;p||(p=e.cors||e.useXDR?new u.XDomainRequest:new u.XMLHttpRequest);var m=p.url=e.uri||e.url,f=p.method=e.method||"GET",g=e.body||e.data,y=p.headers=e.headers||{},_=!!e.sync,v=!1,b={body:void 0,headers:{},statusCode:0,method:f,url:m,rawRequest:p};if("json"in e&&!1!==e.json&&(v=!0,y.accept||y.Accept||(y.Accept="application/json"),"GET"!==f&&"HEAD"!==f&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),g=JSON.stringify(!0===e.json?g:e.json))),p.onreadystatechange=function(){4!==p.readyState||u.responseInterceptorsStorage.getIsEnabled()||setTimeout(c,0)},p.onload=c,p.onerror=d,p.onprogress=function(){},p.onabort=function(){i=!0,clearTimeout(e.retryTimeout)},p.ontimeout=d,p.open(f,m,!_,e.username,e.password),_||(p.withCredentials=!!e.withCredentials),!_&&e.timeout>0&&(r=setTimeout(function(){if(!i){i=!0,p.abort("timeout");var e=Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",d(e)}},e.timeout)),p.setRequestHeader)for(t in y)y.hasOwnProperty(t)&&p.setRequestHeader(t,y[t]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(p.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(p),p.send(g||null),p}t.exports=u,t.exports.default=u,u.XMLHttpRequest=r.XMLHttpRequest||function(){},u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:r.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],function(e){u["delete"===e?"del":e]=function(t,i,r){return(i=d(t,i,r)).method=e.toUpperCase(),h(i)}})},35525,(e,t,i)=>{var r=e.r(729265),s=Object.create||function(){function e(){}return function(t){if(1!=arguments.length)throw Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();
1function n(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function a(e){function t(e,t,i,r){return(0|e)*3600+(0|t)*60+(0|i)+(0|r)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=s(null)}function l(e,t,i,r){var s=r?e.split(r):[e];for(var n in s)if("string"==typeof s[n]){var a=s[n].split(i);2===a.length&&t(a[0].trim(),a[1].trim())}}n.prototype=s(Error.prototype),n.prototype.constructor=n,n.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var r=0;r<i.length;++r)if(t===i[r]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0)&&!!(t<=100)&&(this.set(e,t),!0)}};var d=r.createElement&&r.createElement("textarea"),u={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},h={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},c={v:"title",lang:"lang"},p={rt:"ruby"};function m(e,t){for(var i,r=e.document.createElement("div"),s=r,n=[];null!==(i=function(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}());){if("<"===i[0]){if("/"===i[1]){n.length&&n[n.length-1]===i.substr(2).replace(">","")&&(n.pop(),s=s.parentNode);continue}var o,l,m,f,g=a(i.substr(1,i.length-2));if(g){f=e.document.createProcessingInstruction("timestamp",g),s.appendChild(f);continue}var y=i.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y||!(f=function(t,i){var r=u[t];if(!r)return null;var s=e.document.createElement(r),n=c[t];return n&&i&&(s[n]=i.trim()),s}(y[1],y[3]))||(l=s,p[(m=f).localName]&&p[m.localName]!==l.localName))continue;if(y[2]){var _=y[2].split(".");_.forEach(function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(h.hasOwnProperty(i)){var r=t?"background-color":"color",s=h[i];f.style[r]=s}}),f.className=_.join(" ")}n.push(y[1]),s.appendChild(f),s=f;continue}s.appendChild(e.document.createTextNode((d.innerHTML=o=i,o=d.textContent,d.textContent="",o)))}return r}var f=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function g(){}function y(e,t,i){g.call(this),this.cue=t,this.cueDiv=m(e,t.text);var r={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"
vendor: 10,606 bytes, line 1
1===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv),this.div=e.document.createElement("div"),r={direction:function(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}for(r(t,e);i=function e(t){if(!t||!t.length)return null;var i=t.pop(),s=i.textContent||i.innerText;if(s){var n=s.match(/^.*(\n|\r)/);return n?(t.length=0,n[0]):s}return"ruby"===i.tagName?e(t):i.childNodes?(r(t,i),e(t)):void 0}(t);)for(var s=0;s<i.length;s++)if(function(e){for(var t=0;t<f.length;t++){var i=f[t];if(e>=i[0]&&e<=i[1])return!0}return!1}(i.charCodeAt(s)))return"rtl";return"ltr"}(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(r),this.div.appendChild(this.cueDiv);var s=0;switch(t.positionAlign){case"start":case"line-left":s=t.position;break;case"center":s=t.position-t.size/2;break;case"end":case"line-right":s=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(s,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(s,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function _(e){var t,i,r,s;if(e.div){i=e.div.offsetHeight,r=e.div.offsetWidth,s=e.div.offsetTop;var n=(n=e.div.childNodes)&&(n=n[0])&&n.getClientRects&&n.getClientRects();e=e.div.getBoundingClientRect(),t=n?Math.max(n[0]&&n[0].height||0,e.height/n.length):0}this.left=e.left,this.right=e.right,this.top=e.top||s,this.height=e.height||i,this.bottom=e.bottom||s+(e.height||i),this.width=e.width||r,this.lineHeight=void 0!==t?t:e.lineHeight}function v(){}g.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},g.prototype.formatStyle=function(e,t){return 0===e?0:e+t},y.prototype=s(g.prototype),y.prototype.constructor=y,_.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},_.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},_.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},_.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},_.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},_.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},_.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},_.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||i}},v.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},v.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null},v.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var r,s,n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),!function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){for(var a=0;a<t.length;a++)n.appendChild(t[a].displayState);return}for(var o=[],l=_.getSimpleBoxPosition(n),d={font:Math.round(.05*l.height*100)/100+"px sans-serif"},u=0;u<t.length;u++)r=new y(e,s=t[u],d),n.appendChild(r.div),function(e,t,i,r){var s=new _(t),n=t.cue,a=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return -1;for(var t=e.track,i=t.textTrackList,r=0,s=0;s<i.length&&i[s]!==t;s++)"showing"===i[s].mode&&r++;return -1*++r}(n),o=[];if(n.snapToLines){switch(n.vertical){case"":o=["+y","-y"],l="height";break;case"rl":o=["+x","-x"],l="width";break;case"lr":o=["-x","+x"],l="width"}var l,d=s.lineHeight,u=d*Math.round(a),h=i[l]+d,c=o[0];Math.abs(u)>h&&(u=Math.ceil(h/d)*d*(u<0?-1:1)),a<0&&(u+=""===n.vertical?i.height:i.width,o=o.reverse()),s.move(c,u)}else{var p=s.lineHeight/i.height*100;switch(n.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(n.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],s=new _(t)}var m=function(e,t){for(var s,n=new _(e),a=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(r);)e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);a>l&&(s=new _(e),a=l),e=new _(n)}return s||n}(s,o);t.move(m.toCSSCompatValues(i))}(0,r,l,o),s.displayState=r.div,o.push(_.getSimpleBoxPosition(r))},v.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},v.Parser.prototype={reportOrThrowError:function(e){if(e instanceof n)this.onparsingerror&&this.onparsingerror(e);else throw e},parse:function(e){var t=this;function i(){for(var e=t.buffer,i=0;i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var r=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),r}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var r,s=i(),d=s.match(/^WEBVTT([ \t].*)?$/);if(!d||!d[0])throw new n(n.Errors.BadSignature);t.state="HEADER"}for(var u=!1;t.buffer&&/\r\n|\n/.test(t.buffer);)switch(u?u=!1:s=i(),t.state){case"HEADER":/:/.test(s)?(r=s).match(/X-TIMESTAMP-MAP/)?l(r,function(e,i){if("X-TIMESTAMP-MAP"===e){var r;r=new o,l(i,function(e,t){switch(e){case"MPEGT":r.integer(e+"S",t);break;case"LOCA":r.set(e+"L",a(t))}},/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:r.get("MPEGTS"),LOCAL:r.get("LOCAL")})}},/=/):l(r,function(e,i){if("Region"===e){var r=new o;if(l(i,function(e,t){switch(e){case"id":r.set(e,t);break;case"width":r.percent(e,t);break;case"lines":r.integer(e,t);break;case"regionanchor":case"viewportanchor":var i=t.split(",");if(2!==i.length)break;var s=new o;if(s.percent("x",i[0]),s.percent("y",i[1]),!s.has("x")||!s.has("y"))break;r.set(e+"X",s.get("x")),r.set(e+"Y",s.get("y"));break;case"scroll":r.alt(e,t,["up"])}},/=/,/\s/),r.has("id")){var s=new(t.vttjs.VTTRegion||t.window.VTTRegion);s.width=r.get("width",100),s.lines=r.get("lines",3),s.regionAnchorX=r.get("regionanchorX",0),s.regionAnchorY=r.get("regionanchorY",100),s.viewportAnchorX=r.get("viewportanchorX",0),s.viewportAnchorY=r.get("viewportanchorY",100),s.scroll=r.get("scroll",""),t.onregion&&t.onregion(s),t.regionList.push({id:r.get("id"),region:s})}}},/:/):s||(t.state="ID");continue;case"NOTE":s||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(s)){t.state="NOTE";break}if(!s)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center"}catch(e){t.cue.align="middle"}if(t.state="CUE",-1===s.indexOf("-->")){t.cue.id=s;continue}case"CUE":try{!function(e,t,i){var r=e;function s(){var t=a(e);if(null===t)throw new n(n.Errors.BadTimeStamp,"Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function d(){e=e.replace(/^\s+/,"")}if(d(),t.startTime=s(),d(),"-->"!==e.substr(0,3))throw new n(n.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+r);e=e.substr(3),d(),t.endTime=s(),d();var u=e,h=new o;l(u,function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){h.set(e,i[r].region);break}break;case"vertical":h.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),n=s[0];h.integer(e,n),h.percent(e,n)&&h.set("snapToLines",!1),h.alt(e,n,["auto"]),2===s.length&&h.alt("lineAlign",s[1],["start","center","end"]);break;case"position":s=t.split(","),h.percent(e,s[0]),2===s.length&&h.alt("positionAlign",s[1],["start","center","end"]);break;case"size":h.percent(e,t);break;case"align":h.alt(e,t,["start","center","end","left","right"])}},/:/,/\s/),t.region=h.get("region",null),t.vertical=h.get("vertical","");try{t.line=h.get("line","auto")}catch(e){}t.lineAlign=h.get("lineAlign","start"),t.snapToLines=h.get("snapToLines",!0),t.size=h.get("size",100);try{t.align=h.get("align","center")}catch(e){t.align=h.get("align","middle")}try{t.position=h.get("position","auto")}catch(e){t.position=h.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=h.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(s,t.cue,t.regionList)}catch(e){t.reportOrThrowError(e),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var h=-1!==s.indexOf("-->");if(!s||h&&(u=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=s.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":s||(t.state="ID");continue}}catch(e){t.reportOrThrowError(e),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){try{if(this.buffer+=this.decoder.decode(),(this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state)throw new n(n.Errors.BadSignature)}catch(e){this.reportOrThrowError(e)}return this.onflush&&this.onflush(),this}},t.exports=v},635129,(e,t,i)=>
1{var r={"":1,lr:1,rl:1},s={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function n(e){return"string"==typeof e&&!!s[e.toLowerCase()]&&e.toLowerCase()}function a(e,t,i){this.hasBeenReset=!1;var s="",a=!1,o=e,l=t,d=i,u=null,h="",c=!0,p="auto",m="start",f="auto",g="auto",y=100,_="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(e){s=""+e}},pauseOnExit:{enumerable:!0,get:function(){return a},set:function(e){a=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e)throw TypeError("End time must be set to a number.");l=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return d},set:function(e){d=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(e){u=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return h},set:function(e){var t="string"==typeof e&&!!r[e.toLowerCase()]&&e.toLowerCase();if(!1===t)throw SyntaxError("Vertical: an invalid or illegal direction string was specified.");h=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(e){c=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(e){if("number"!=typeof e&&"auto"!==e)throw SyntaxError("Line: an invalid number or illegal string was specified.");p=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return m},set:function(e){var t=n(e);t?(m=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return f},set:function(e){if(e<0||e>100)throw Error("Position must be between 0 and 100.");f=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=n(e);t?(g=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw Error("Size must be between 0 and 100.");y=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return _},set:function(e){var t=n(e);if(!t)throw SyntaxError("align: an invalid or illegal alignment string was specified.");_=t,this.hasBeenReset=!0}}}),this.displayState=void 0}a.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},t.exports=a},242454,(e,t,i)=>{var r={"":!0,up:!0};function s(e){return"number"==typeof e&&e>=0&&e<=100}t.exports=function(){var e=100,t=3,i=0,n=100,a=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!s(t))throw Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!s(e))throw Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!s(e))throw Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!s(e))throw Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return a}
1,set:function(e){if(!s(e))throw Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var t="string"==typeof e&&!!r[e.toLowerCase()]&&e.toLowerCase();!1===t?console.warn("Scroll: an invalid or illegal string was specified."):l=t}}})}},810755,(e,t,i)=>{var r=e.r(325273),s=t.exports={WebVTT:e.r(35525),VTTCue:e.r(635129),VTTRegion:e.r(242454)};r.vttjs=s,r.WebVTT=s.WebVTT;var n=s.VTTCue,a=s.VTTRegion,o=r.VTTCue,l=r.VTTRegion;s.shim=function(){r.VTTCue=n,r.VTTRegion=a},s.restore=function(){r.VTTCue=o,r.VTTRegion=l},r.VTTCue||s.shim()},607598,(e,t,i)=>{"use strict";function r(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var s=r({HTML:"text/html",isHTML:function(e){return e===s.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),n=r({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===n.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});i.assign=function(e,t){if(null===e||"object"!=typeof e)throw TypeError("target is not an object");for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.find=function(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"==typeof i.find)return i.find.call(e,t);for(var r=0;r<e.length;r++)if(Object.prototype.hasOwnProperty.call(e,r)){var s=e[r];if(t.call(void 0,s,r,e))return s}},i.freeze=r,i.MIME_TYPE=s,i.NAMESPACE=n},949684,(e,t,i)=>{var r=e.r(607598),s=r.find,n=r.NAMESPACE;function a(e){return""!==e}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function l(e){return e?Object.keys((e?e.split(/[\t\n\f\r ]+/).filter(a):[]).reduce(o,{})):[]}function d(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function u(e,t){var i=e.prototype;if(!(i instanceof t)){function r(){}r.prototype=t.prototype,d(i,r=new r),e.prototype=i=r}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var h={},c=h.ELEMENT_NODE=1,p=h.ATTRIBUTE_NODE=2,m=h.TEXT_NODE=3,f=h.CDATA_SECTION_NODE=4,g=h.ENTITY_REFERENCE_NODE=5,y=h.ENTITY_NODE=6,_=h.PROCESSING_INSTRUCTION_NODE=7,v=h.COMMENT_NODE=8,b=h.DOCUMENT_NODE=9,T=h.DOCUMENT_TYPE_NODE=10,A=h.DOCUMENT_FRAGMENT_NODE=11,S=h.NOTATION_NODE=12,E={},C={};C[1]="Index size error",E.INDEX_SIZE_ERR=1,C[2]="DOMString size error",E.DOMSTRING_SIZE_ERR=2;var w=(C[3]="Hierarchy request error",E.HIERARCHY_REQUEST_ERR=3);C[4]="Wrong document",E.WRONG_DOCUMENT_ERR=4,C[5]="Invalid character",E.INVALID_CHARACTER_ERR=5,
1C[6]="No data allowed",E.NO_DATA_ALLOWED_ERR=6,C[7]="No modification allowed",E.NO_MODIFICATION_ALLOWED_ERR=7;var k=(C[8]="Not found",E.NOT_FOUND_ERR=8);C[9]="Not supported",E.NOT_SUPPORTED_ERR=9;var x=(C[10]="Attribute in use",E.INUSE_ATTRIBUTE_ERR=10);function I(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,C[e]),this.message=C[e],Error.captureStackTrace&&Error.captureStackTrace(this,I);return i.code=e,t&&(this.message=this.message+": "+t),i}function D(){}function P(e,t){this._node=e,this._refresh=t,L(this)}function L(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);if(eg(e,"length",i.length),!e.$$length||i.length<e.$$length)for(var r=i.length;r in e;r++)Object.prototype.hasOwnProperty.call(e,r)&&delete e[r];d(i,e),e._inc=t}}function R(){}function M(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function O(e,t,i,r){if(r?t[M(t,r)]=i:t[t.length++]=i,e){i.ownerElement=e;var s,a,o,l=e.ownerDocument;l&&(r&&V(l,e,r),s=l,a=e,o=i,s&&s._inc++,o.namespaceURI===n.XMLNS&&(a._nsMap[o.prefix?o.localName:""]=o.value))}}function N(e,t,i){var r=M(t,i);if(r>=0){for(var s=t.length-1;r<s;)t[r]=t[++r];if(t.length=s,e){var n=e.ownerDocument;n&&(V(n,e,i),i.ownerElement=null)}}else throw new I(k,Error(e.tagName+"@"+i))}function j(){}function U(){}function B(e){return"<"==e&&"<"||">"==e&&">"||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function F(e,t){if(t(e))return!0;if(e=e.firstChild)do if(F(e,t))return!0;while(e=e.nextSibling)}function q(){this.ownerDocument=this}function V(e,t,i,r){e&&e._inc++,i.namespaceURI===n.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function $(e,t,i){if(e&&e._inc){e._inc++;var r=t.childNodes;if(i)r[r.length++]=i;else{for(var s=t.firstChild,n=0;s;)r[n++]=s,s=s.nextSibling;r.length=n,delete r[r.length]}}}function H(e,t){var i=t.previousSibling,r=t.nextSibling;return i?i.nextSibling=r:e.firstChild=r,r?r.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,$(e.ownerDocument,e),t}function z(e){return e&&e.nodeType===U.DOCUMENT_TYPE_NODE}function W(e){return e&&e.nodeType===U.ELEMENT_NODE}function G(e){return e&&e.nodeType===U.TEXT_NODE}function X(e,t){var i=e.childNodes||[];if(s(i,W)||z(t))return!1;var r=s(i,z);return!(t&&r&&i.indexOf(r)>i.indexOf(t))}function Y(e,t){var i=e.childNodes||[];if(s(i,function(e){return W(e)&&e!==t}))return!1;var r=s(i,z);return!(t&&r&&i.indexOf(r)>i.indexOf(t))}function K(e,t,i){var r=e.childNodes||[],n=t.childNodes||[];
1if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var a=n.filter(W);if(a.length>1||s(n,G))throw new I(w,"More than one element or text in fragment");if(1===a.length&&!Y(e,i))throw new I(w,"Element in fragment can not be inserted before doctype")}if(W(t)&&!Y(e,i))throw new I(w,"Only one element can be added and only after doctype");if(z(t)){if(s(r,function(e){return z(e)&&e!==i}))throw new I(w,"Only one doctype is allowed");var o=s(r,W);if(i&&r.indexOf(o)<r.indexOf(i))throw new I(w,"Doctype can only be inserted before an element")}}function Q(e,t,i,r){if(!(e&&(e.nodeType===U.DOCUMENT_NODE||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.ELEMENT_NODE)))throw new I(w,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new I(k,"child not in parent");if(!(t&&(W(t)||G(t)||z(t)||t.nodeType===U.DOCUMENT_FRAGMENT_NODE||t.nodeType===U.COMMENT_NODE||t.nodeType===U.PROCESSING_INSTRUCTION_NODE))||z(t)&&e.nodeType!==U.DOCUMENT_NODE)throw new I(w,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType);e.nodeType===U.DOCUMENT_NODE&&(r||function(e,t,i){var r=e.childNodes||[],n=t.childNodes||[];
vendor: 6,749 bytes, line 1
1if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var a=n.filter(W);if(a.length>1||s(n,G))throw new I(w,"More than one element or text in fragment");if(1===a.length&&!X(e,i))throw new I(w,"Element in fragment can not be inserted before doctype")}if(W(t)&&!X(e,i))throw new I(w,"Only one element can be added and only after doctype");if(z(t)){if(s(r,z))throw new I(w,"Only one doctype is allowed");var o=s(r,W);if(i&&r.indexOf(o)<r.indexOf(i))throw new I(w,"Doctype can only be inserted before an element");if(!i&&o)throw new I(w,"Doctype can not be appended since element is present")}})(e,t,i);var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===A){var a=t.firstChild;if(null==a)return t;var o=t.lastChild}else a=o=t;var l=i?i.previousSibling:e.lastChild;a.previousSibling=l,o.nextSibling=i,l?l.nextSibling=a:e.firstChild=a,null==i?e.lastChild=o:i.previousSibling=o;do a.parentNode=e,Z(a,e.ownerDocument||e);while(a!==o&&(a=a.nextSibling))return $(e.ownerDocument||e,e),t.nodeType==A&&(t.firstChild=t.lastChild=null),t}function Z(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===c&&e.attributes)for(var i=0;i<e.attributes.length;i++){var r=e.attributes.item(i);r&&(r.ownerDocument=t)}for(var s=e.firstChild;s;)Z(s,t),s=s.nextSibling}}function J(){this._nsMap={}}function ee(){}function et(){}function ei(){}function er(){}function es(){}function en(){}function ea(){}function eo(){}function el(){}function ed(){}function eu(){}function eh(){}function ec(e,t){var i=[],r=9==this.nodeType&&this.documentElement||this,s=r.prefix,n=r.namespaceURI;if(n&&null==s){var s=r.lookupPrefix(n);if(null==s)var a=[{namespace:n,prefix:null}]}return ef(this,i,e,t,a),i.join("")}function ep(e,t,i){var r=e.prefix||"",s=e.namespaceURI;if(!s||"xml"===r&&s===n.XML||s===n.XMLNS)return!1;for(var a=i.length;a--;){var o=i[a];if(o.prefix===r)return o.namespace!==s}return!0}function em(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,B),'"')}function ef(e,t,i,r,s){if(s||(s=[]),r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case c:var a,o=e.attributes,l=o.length,d=e.firstChild,u=e.tagName;i=n.isHTML(e.namespaceURI)||i;var h=u;if(!i&&!e.prefix&&e.namespaceURI){for(var y=0;y<o.length;y++)if("xmlns"===o.item(y).name){a=o.item(y).value;break}if(!a)for(var S=s.length-1;S>=0;S--){var E=s[S];if(""===E.prefix&&E.namespace===e.namespaceURI){a=E.namespace;break}}if(a!==e.namespaceURI)for(var S=s.length-1;S>=0;S--){var E=s[S];if(E.namespace===e.namespaceURI){E.prefix&&(h=E.prefix+":"+u);break}}}t.push("<",h);for(var C=0;C<l;C++){var w=o.item(C);"xmlns"==w.prefix?s.push({prefix:w.localName,namespace:w.value}):"xmlns"==w.nodeName&&s.push({prefix:"",namespace:w.value})}for(var C=0;C<l;C++){var w=o.item(C);if(ep(w,i,s)){var k=w.prefix||"",x=w.namespaceURI;em(t,k?"xmlns:"+k:"xmlns",x),s.push({prefix:k,namespace:x})}ef(w,t,i,r,s)}if(u===h&&ep(e,i,s)){var k=e.prefix||"",x=e.namespaceURI;em(t,k?"xmlns:"+k:"xmlns",x),s.push({prefix:k,namespace:x})}if(d||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),i&&/^script$/i.test(u))for(;d;)d.data?t.push(d.data):ef(d,t,i,r,s.slice()),d=d.nextSibling;else for(;d;)ef(d,t,i,r,s.slice()),d=d.nextSibling;t.push("</",h,">")}else t.push("/>");return;case b:case A:for(var d=e.firstChild;d;)ef(d,t,i,r,s.slice()),d=d.nextSibling;return;case p:return em(t,e.name,e.value);case m:return t.push(e.data.replace(/[<&>]/g,B));case f:return t.push("<![CDATA[",e.data,"]]>");case v:return t.push("<!--",e.data,"-->");case T:var I=e.publicId,D=e.systemId;if(t.push("<!DOCTYPE ",e.name),I)t.push(" PUBLIC ",I),D&&"."!=D&&t.push(" ",D),t.push(">");else if(D&&"."!=D)t.push(" SYSTEM ",D,">");else{var P=e.internalSubset;P&&t.push(" [",P,"]"),t.push(">")}return;case _:return t.push("<?",e.target," ",e.data,"?>");case g:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function eg(e,t,i){e[t]=i}C[11]="Invalid state",E.INVALID_STATE_ERR=11,C[12]="Syntax error",E.SYNTAX_ERR=12,C[13]="Invalid modification",E.INVALID_MODIFICATION_ERR=13,C[14]="Invalid namespace",E.NAMESPACE_ERR=14,C[15]="Invalid access",E.INVALID_ACCESS_ERR=15,I.prototype=Error.prototype,d(E,I),D.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var i=[],r=0;r<this.length;r++)ef(this[r],i,e,t);return i.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},P.prototype.item=function(e){return L(this),this[e]||null},u(P,D),R.prototype={length:0,item:D.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new I(x);var i=this.getNamedItem(e.nodeName);return O(this._ownerElement,this,e,i),i},setNamedItemNS:function(e){var t,i=e.ownerElement;if(i&&i!=this._ownerElement)throw new I(x);return t=this.getNamedItemNS(e.namespaceURI,e.localName),O(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return N(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);return N(this._ownerElement,this,i),i},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var r=this[i];if(r.localName==t&&r.namespaceURI==e)return r}return null}},j.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var r=new q;if(r.implementation=this,r.childNodes=new D,r.doctype=i||null,i&&r.appendChild(i),t){var s=r.createElementNS(e,t);r.appendChild(s)}return r},createDocumentType:function(e,t,i){var r=new en;return r.name=e,r.nodeName=e,r.publicId=t||"",r.systemId=i||"",r}},U.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return Q(this,e,t)},replaceChild:function(e,t){Q(this,e,t,K),t&&this.removeChild(t)},removeChild:function(e){return H(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return function e(t,i,r){var s=new i.constructor;for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var a=i[n];"object"!=typeof a&&a!=s[n]&&(s[n]=a)}switch(i.childNodes&&(s.childNodes=new D),s.ownerDocument=t,s.nodeType){case c:var o=i.attributes,l=s.attributes=new R,d=o.length;l._ownerElement=s;for(var u=0;u<d;u++)s.setAttributeNode(e(t,o.item(u),!0));break;case p:r=!0}if(r)for(var h=i.firstChild;h;)s.appendChild(e(t,h,r)),h=h.nextSibling;return s}(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;
1t&&t.nodeType==m&&e.nodeType==m?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i){for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)&&i[r]===e)return r}t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},d(h,U),d(h,U.prototype),q.prototype={nodeName:"#document",nodeType:b,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==A){for(var i=e.firstChild;i;){var r=i.nextSibling;this.insertBefore(i,t),i=r}return e}return Q(this,e,t),Z(e,this),null===this.documentElement&&e.nodeType===c&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),H(this,e)},replaceChild:function(e,t){Q(this,e,t,K),Z(e,this),t&&this.removeChild(t),W(e)&&(this.documentElement=e)},importNode:function(e,t){return function e(t,i,r){var s;switch(i.nodeType){case c:(s=i.cloneNode(!1)).ownerDocument=t;case A:break;case p:r=!0}if(s||(s=i.cloneNode(!1)),s.ownerDocument=t,s.parentNode=null,r)for(var n=i.firstChild;n;)s.appendChild(e(t,n,r)),n=n.nextSibling;return s}(this,e,t)},getElementById:function(e){var t=null;return F(this.documentElement,function(i){if(i.nodeType==c&&i.getAttribute("id")==e)return t=i,!0}),t},getElementsByClassName:function(e){var t=l(e);return new P(this,function(i){var r=[];return t.length>0&&F(i.documentElement,function(s){if(s!==i&&s.nodeType===c){var n=s.getAttribute("class");if(n){var a=e===n;if(!a){var o=l(n);a=t.every(function(e){return o&&-1!==o.indexOf(e)})}a&&r.push(s)}}}),r})},createElement:function(e){var t=new J;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new D,(t.attributes=new R)._ownerElement=t,t},createDocumentFragment:function(){var e=new ed;return e.ownerDocument=this,e.childNodes=new D,e},createTextNode:function(e){var t=new ei;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new er;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new es;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new eu;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new ee;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new el;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new J,r=t.split(":"),s=i.attributes=new R;return i.childNodes=new D,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==r.length?(i.prefix=r[0],i.localName=r[1]):i.localName=t,s._ownerElement=i,i},createAttributeNS:function(e,t){var i=new ee,r=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==r.length?(i.prefix=r[0],i.localName=r[1]):i.localName=t,i}},u(q,U),J.prototype={nodeType:c,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===A?this.insertBefore(e,null):(e.parentNode&&e.parentNode.removeChild(e),e.parentNode=this,e.previousSibling=this.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:this.firstChild=e,this.lastChild=e,$(this.ownerDocument,this,e),Z(e,this.ownerDocument||this),e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+i,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new P(this,function(t){var i=[];return F(t,function(r){r!==t&&r.nodeType==c&&("*"===e||r.tagName==e)&&i.push(r)}),i})},getElementsByTagNameNS:function(e,t){return new P(this,function(i){var r=[];return F(i,function(s){s!==i&&s.nodeType===c&&("*"===e||s.namespaceURI===e)&&("*"===t||s.localName==t)&&r.push(s)}),r})}},q.prototype.getElementsByTagName=J.prototype.getElementsByTagName,q.prototype.getElementsByTagNameNS=J.prototype.getElementsByTagNameNS,u(J,U),ee.prototype.nodeType=p,u(ee,U),et.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw Error(C[w])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},u(et,U),ei.prototype={nodeName:"#text",nodeType:m,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},u(ei,et),er.prototype={nodeName:"#comment",nodeType:v},u(er,et),es.prototype={nodeName:"#cdata-section",nodeType:f},u(es,et),en.prototype.nodeType=T,u(en,U),ea.prototype.nodeType=S,u(ea,U),eo.prototype.nodeType=y,u(eo,U),el.prototype.nodeType=g,u(el,U),ed.prototype.nodeName="#document-fragment",ed.prototype.nodeType=A,u(ed,U),eu.prototype.nodeType=_,u(eu,U),eh.prototype.serializeToString=function(e,t,i){return ec.call(e,t,i)},U.prototype.toString=ec;try{Object.defineProperty&&(Object.defineProperty(P.prototype,"length",{get:function(){return L(this),this.$$length}}),Object.defineProperty(U.prototype,"textContent",{get:function(){return function e(t){switch(t.nodeType){case c:case A:var i=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&i.push(e(t)),t=t.nextSibling;return i.join("");default:return t.nodeValue}}(this)},set:function(e){switch(this.nodeType){case c:case A:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),eg=function(e,t,i){e["$$"+t]=i})}catch(e){}i.DocumentType=en,i.DOMException=I,i.DOMImplementation=j,i.Element=J,i.Node=U,i.NodeList=D,i.XMLSerializer
1=eh},353393,(e,t,i)=>{"use strict";var r=e.r(607598).freeze;i.XML_ENTITIES=r({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),i.HTML_ENTITIES=r({Aacute:"Ã",aacute:"á",Abreve:"Ä",abreve:"Ä",ac:"â¾",acd:"â¿",acE:"â¾Ì³",Acirc:"Ã",acirc:"â",acute:"´",Acy:"Ð",acy:"а",AElig:"Ã",aelig:"æ",af:"â¡",Afr:"\uD835\uDD04",afr:"\uD835\uDD1E",Agrave:"Ã",agrave:"à ",alefsym:"âµ",aleph:"âµ",Alpha:"Î",alpha:"α",Amacr:"Ä",amacr:"Ä",amalg:"⨿",AMP:"&",amp:"&",And:"â©",and:"â§",andand:"â©",andd:"â©",andslope:"â©",andv:"â©",ang:"â ",ange:"⦤",angle:"â ",angmsd:"â¡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"â¦",angmsdag:"⦮",angmsdah:"⦯",angrt:"â",angrtvb:"â¾",angrtvbd:"â¦",angsph:"â¢",angst:"Ã
",angzarr:"â¼",Aogon:"Ä",aogon:"Ä
",Aopf:"\uD835\uDD38",aopf:"\uD835\uDD52",ap:"â",apacir:"⩯",apE:"â©°",ape:"â",apid:"â",apos:"'",ApplyFunction:"â¡",approx:"â",approxeq:"â",Aring:"Ã
",aring:"Ã¥",Ascr:"\uD835\uDC9C",ascr:"\uD835\uDCB6",Assign:"â",ast:"*",asymp:"â",asympeq:"â",Atilde:"Ã",atilde:"ã",Auml:"Ã",auml:"ä",awconint:"â³",awint:"â¨",backcong:"â",backepsilon:"϶",backprime:"âµ",backsim:"â½",backsimeq:"â",Backslash:"â",Barv:"â«§",barvee:"â½",Barwed:"â",barwed:"â
",barwedge:"â
",bbrk:"âµ",bbrktbrk:"â¶",bcong:"â",Bcy:"Ð",bcy:"б",bdquo:"â",becaus:"âµ",Because:"âµ",because:"âµ",bemptyv:"⦰",bepsi:"϶",bernou:"â¬",Bernoullis:"â¬",Beta:"Î",beta:"β",beth:"â¶",between:"â¬",Bfr:"\uD835\uDD05",bfr:"\uD835\uDD1F",bigcap:"â",bigcirc:"â¯",bigcup:"â",bigodot:"â¨",bigoplus:"â¨",bigotimes:"â¨",bigsqcup:"â¨",bigstar:"â
",bigtriangledown:"â½",bigtriangleup:"â³",biguplus:"â¨",bigvee:"â",bigwedge:"â",bkarow:"â¤",blacklozenge:"â§«",blacksquare:"âª",blacktriangle:"â´",blacktriangledown:"â¾",blacktriangleleft:"â",blacktriangleright:"â¸",blank:"â£",blk12:"â",blk14:"â",blk34:"â",block:"â",bne:"=â¥",bnequiv:"â¡â¥",bNot:"â«",bnot:"â",Bopf:"\uD835\uDD39",bopf:"\uD835\uDD53",bot:"â¥",bottom:"â¥",bowtie:"â",boxbox:"â§",boxDL:"â",boxDl:"â",boxdL:"â",boxdl:"â",boxDR:"â",boxDr:"â",boxdR:"â",boxdr:"â",boxH:"â",boxh:"â",boxHD:"â¦",boxHd:"â¤",boxhD:"â¥",boxhd:"â¬",boxHU:"â©",boxHu:"â§",boxhU:"â¨",boxhu:"â´",boxminus:"â",boxplus:"â",boxtimes:"â ",boxUL:"â",boxUl:"â",boxuL:"â",boxul:"â",boxUR:"â",boxUr:"â",boxuR:"â",boxur:"â",boxV:"â",boxv:"â",boxVH:"â¬",boxVh:"â«",boxvH:"âª",boxvh:"â¼",boxVL:"â£",boxVl:"â¢",boxvL:"â¡",boxvl:"â¤",boxVR:"â ",boxVr:"â",boxvR:"â",boxvr:"â",bprime:"âµ",Breve:"Ë",breve:"Ë",brvbar:"¦",Bscr:"â¬",bscr:"\uD835\uDCB7",bsemi:"â",bsim:"â½",b
1sime:"â",bsol:"\\",bsolb:"â§
",bsolhsub:"â",bull:"â¢",bullet:"â¢",bump:"â",bumpE:"⪮",bumpe:"â",Bumpeq:"â",bumpeq:"â",Cacute:"Ä",cacute:"Ä",Cap:"â",cap:"â©",capand:"â©",capbrcup:"â©",capcap:"â©",capcup:"â©",capdot:"â©",CapitalDifferentialD:"â
",caps:"â©ï¸",caret:"â",caron:"Ë",Cayleys:"â",ccaps:"â©",Ccaron:"Ä",ccaron:"Ä",Ccedil:"Ã",ccedil:"ç",Ccirc:"Ä",ccirc:"Ä",Cconint:"â°",ccups:"â©",ccupssm:"â©",Cdot:"Ä",cdot:"Ä",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"â",cfr:"\uD835\uDD20",CHcy:"Ч",chcy:"Ñ",check:"â",checkmark:"â",Chi:"Χ",chi:"Ï",cir:"â",circ:"Ë",circeq:"â",circlearrowleft:"âº",circlearrowright:"â»",circledast:"â",circledcirc:"â",circleddash:"â",CircleDot:"â",circledR:"®",circledS:"â",CircleMinus:"â",CirclePlus:"â",CircleTimes:"â",cirE:"â§",cire:"â",cirfnint:"â¨",cirmid:"⫯",cirscir:"â§",ClockwiseContourIntegral:"â²",CloseCurlyDoubleQuote:"â",CloseCurlyQuote:"â",clubs:"â£",clubsuit:"â£",Colon:"â·",colon:":",Colone:"â©´",colone:"â",coloneq:"â",comma:",",commat:"@",comp:"â",compfn:"â",complement:"â",complexes:"â",cong:"â
",congdot:"â©",Congruent:"â¡",Conint:"â¯",conint:"â®",ContourIntegral:"â®",Copf:"â",copf:"\uD835\uDD54",coprod:"â",Coproduct:"â",COPY:"©",copy:"©",copysr:"â",CounterClockwiseContourIntegral:"â³",crarr:"âµ",Cross:"⨯",cross:"â",Cscr:"\uD835\uDC9E",cscr:"\uD835\uDCB8",csub:"â«",csube:"â«",csup:"â«",csupe:"â«",ctdot:"â¯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"â",cuesc:"â",cularr:"â¶",cularrp:"⤽",Cup:"â",cup:"âª",cupbrcap:"â©",CupCap:"â",cupcap:"â©",cupcup:"â©",cupdot:"â",cupor:"â©
",cups:"âªï¸",curarr:"â·",curarrm:"⤼",curlyeqprec:"â",curlyeqsucc:"â",curlyvee:"â",curlywedge:"â",curren:"¤",curvearrowleft:"â¶",curvearrowright:"â·",cuvee:"â",cuwed:"â",cwconint:"â²",cwint:"â±",cylcty:"â",Dagger:"â¡",dagger:"â ",daleth:"â¸",Darr:"â¡",dArr:"â",darr:"â",dash:"â",Dashv:"⫤",dashv:"â£",dbkarow:"â¤",dblac:"Ë",Dcaron:"Ä",dcaron:"Ä",Dcy:"Ð",dcy:"д",DD:"â
",dd:"â
",ddagger:"â¡",ddarr:"â",DDotrahd:"â¤",ddotseq:"â©·",deg:"°",Del:"â",Delta:"Î",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"\uD835\uDD07",dfr:"\uD835\uDD21",dHar:"⥥",dharl:"â",dharr:"â",DiacriticalAcute:"´",DiacriticalDot:"Ë",DiacriticalDoubleAcute:"Ë",DiacriticalGrave:"`",DiacriticalTilde:"Ë",diam:"â",Diamond:"â",diamond:"â",diamondsuit:"â¦",diams:"â¦",die:"¨",DifferentialD:"â
",digamma:"Ï",disin:"â²",div:"÷",divide:"÷",divideontimes:"â",divonx:"â",DJcy:"Ð",djcy:"Ñ",dlcorn:"â",dlcrop:"â",dollar:"$",Dopf:"\uD835\uDD3B",dopf:"\uD835\uDD55",Dot:"¨",dot:"Ë",DotDot:"â",doteq:"â",doteqdot:"â",DotEqual:"â",dotminus:"â¸",dotplus:"â",dotsquare:"â¡",doublebarwedge:"â",DoubleContourIntegral:"â¯",DoubleDot:"¨",DoubleDownArrow:"â",DoubleLeftArrow:"â",DoubleLeftRightArrow:"â",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"â¸",DoubleLongLeftRightArrow:"âº",DoubleLongRightArrow:"â¹",DoubleRightArrow:"â",DoubleRightTee:"â¨",DoubleUpArrow:"â",DoubleUpDownArrow:"â",DoubleVerticalBar:"â¥",DownArrow:"â",Downarrow:"â",downarrow:"â",DownArrowBar:"â¤",DownArrowUpArrow:"âµ",DownBreve:"Ì",downdownarrows:"â",downharpoonleft:"â",downharpoonright:"â",DownLeftRightVector:"â¥",DownLeftTeeVector:"â¥",DownLeftVector:"â½",DownLeftVectorBar:"â¥",DownRightTeeVector:"â¥",DownRightVector:"â",DownRightVectorBar:"â¥",DownTee:"â¤",DownTeeArrow:"â§",drbkarow:"â¤",drcorn:"â",drcrop:"â",Dscr:"\uD835\uDC9F",dscr:"\uD835\uDCB9",DScy:"Ð
",dscy:"Ñ",dsol:"â§¶",Dstrok:"Ä",dstrok:"Ä",dtdot:"â±",dtri:"â¿",dtrif:"â¾",duarr:"âµ",duhar:"⥯",dwangle:"⦦",DZcy:"Ð",dzcy:"Ñ",dzigrarr:"â¿",Eacute:"Ã",eacute:"é",easter:"â©®",Ecaron:"Ä",ecaron:"Ä",ecir:"â",Ecirc:"Ã",ecirc:"ê",ecolon:"â",Ecy:"Ð",ecy:"Ñ",eDDot:"â©·",Edot:"Ä",eDot:"â",edot:"Ä",ee:"â
",efDot:"â",Efr:"\uD835\uDD08",efr:"\uD835\uDD22",eg:"âª",Egrave:"Ã",egrave:"è",egs:"âª",egsdot:"âª",el:"âª",Element:"â",elinters:"â§",ell:"â",els:"âª",elsdot:"âª",Emacr:"Ä",emacr:"Ä",empty:"â
",emptyset:"â
",EmptySmallSquare:"â»",emptyv:"â
",EmptyVerySmallSquare:"â«",emsp:"â",emsp13:"â",emsp14:"â
",ENG:"Å",eng:"Å",ensp:"â",Eogon:"Ä",eogon:"Ä",Eopf:"\uD835\uDD3C",eopf:"\uD835\uDD56",epar:"â",eparsl:"â§£",eplus:"⩱",epsi:"ε",Epsilon:"Î",epsilon:"ε",epsiv:"ϵ",eqcirc:"â",eqcolon:"â",eqsim:"â",eqslantgtr:"âª",eqslantless:"âª",Equal:"⩵",equals:"=",EqualTilde:"â",equest:"â",Equilibrium:"â",equiv:"â¡",equivDD:"⩸",eqvparsl:"â§¥",erarr:"⥱",erDot:"â",Escr:"â°",escr:"â¯",esdot:"â",Esim:"⩳",esim:"â",Eta:"Î",eta:"η",ETH:"Ã",eth:"ð",Euml:"Ã",euml:"ë",euro:"â¬",excl:"!",exist:"â",Exists:"â",expectation:"â°",ExponentialE:"â
",exponentiale:"â
",fallingdotseq:"â",Fcy:"Ф",fcy:"Ñ",female:"â",ffilig:"ï¬",fflig:"ï¬",ffllig:"ï¬",Ffr:"\uD835\uDD09",ffr:"\uD835\uDD23",filig:"ï¬",FilledSmallSquare:"â¼",FilledVerySmallSquare:"âª",fjlig:"fj",flat:"â",fllig:"ï¬",fltns:"â±",fnof:"Æ",Fopf:"\uD835\uDD3D",fopf:"\uD835\uDD57",ForAll:"â",forall:"â",fork:"â",forkv:"â«",Fouriertrf:"â±",fpartint:"â¨",frac12:"½",frac13:"â
",frac14:"¼",frac15:"â
",frac16:"â
",frac18
1:"â
",frac23:"â
",frac25:"â
",frac34:"¾",frac35:"â
",frac38:"â
",frac45:"â
",frac56:"â
",frac58:"â
",frac78:"â
",frasl:"â",frown:"â¢",Fscr:"â±",fscr:"\uD835\uDCBB",gacute:"ǵ",Gamma:"Î",gamma:"γ",Gammad:"Ï",gammad:"Ï",gap:"âª",Gbreve:"Ä",gbreve:"Ä",Gcedil:"Ä¢",Gcirc:"Ä",gcirc:"Ä",Gcy:"Ð",gcy:"г",Gdot:"Ä ",gdot:"Ä¡",gE:"â§",ge:"â¥",gEl:"âª",gel:"â",geq:"â¥",geqq:"â§",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"âª",gesdoto:"âª",gesdotol:"âª",gesl:"âï¸",gesles:"âª",Gfr:"\uD835\uDD0A",gfr:"\uD835\uDD24",Gg:"â",gg:"â«",ggg:"â",gimel:"â·",GJcy:"Ð",gjcy:"Ñ",gl:"â·",gla:"⪥",glE:"âª",glj:"⪤",gnap:"âª",gnapprox:"âª",gnE:"â©",gne:"âª",gneq:"âª",gneqq:"â©",gnsim:"â§",Gopf:"\uD835\uDD3E",gopf:"\uD835\uDD58",grave:"`",GreaterEqual:"â¥",GreaterEqualLess:"â",GreaterFullEqual:"â§",GreaterGreater:"⪢",GreaterLess:"â·",GreaterSlantEqual:"⩾",GreaterTilde:"â³",Gscr:"\uD835\uDCA2",gscr:"â",gsim:"â³",gsime:"âª",gsiml:"âª",Gt:"â«",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"â",gtlPar:"â¦",gtquest:"⩼",gtrapprox:"âª",gtrarr:"⥸",gtrdot:"â",gtreqless:"â",gtreqqless:"âª",gtrless:"â·",gtrsim:"â³",gvertneqq:"â©ï¸",gvnE:"â©ï¸",Hacek:"Ë",hairsp:"â",half:"½",hamilt:"â",HARDcy:"Ъ",hardcy:"Ñ",hArr:"â",harr:"â",harrcir:"â¥",harrw:"â",Hat:"^",hbar:"â",Hcirc:"Ĥ",hcirc:"Ä¥",hearts:"â¥",heartsuit:"â¥",hellip:"â¦",hercon:"â¹",Hfr:"â",hfr:"\uD835\uDD25",HilbertSpace:"â",hksearow:"⤥",hkswarow:"⤦",hoarr:"â¿",homtht:"â»",hookleftarrow:"â©",hookrightarrow:"âª",Hopf:"â",hopf:"\uD835\uDD59",horbar:"â",HorizontalLine:"â",Hscr:"â",hscr:"\uD835\uDCBD",hslash:"â",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"â",HumpEqual:"â",hybull:"â",hyphen:"â",Iacute:"Ã",iacute:"Ã",ic:"â£",Icirc:"Ã",icirc:"î",Icy:"Ð",icy:"и",Idot:"İ",IEcy:"Ð",iecy:"е",iexcl:"¡",iff:"â",Ifr:"â",ifr:"\uD835\uDD26",Igrave:"Ã",igrave:"ì",ii:"â
",iiiint:"â¨",iiint:"â",iinfin:"â§",iiota:"â©",IJlig:"IJ",ijlig:"ij",Im:"â",Imacr:"Ī",imacr:"Ä«",image:"â",ImaginaryI:"â
",imagline:"â",imagpart:"â",imath:"ı",imof:"â·",imped:"Ƶ",Implies:"â",in:"â",incare:"â
",infin:"â",infintie:"â§",inodot:"ı",Int:"â¬",int:"â«",intcal:"âº",integers:"â¤",Integral:"â«",intercal:"âº",Intersection:"â",intlarhk:"â¨",intprod:"⨼",InvisibleComma:"â£",InvisibleTimes:"â¢",IOcy:"Ð",iocy:"Ñ",Iogon:"Ä®",iogon:"į",Iopf:"\uD835\uDD40",iopf:"\uD835\uDD5A",Iota:"Î",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"â",iscr:"\uD835\uDCBE",isin:"â",isindot:"âµ",isinE:"â¹",isins:"â´",isinsv:"â³",isinv:"â",it:"â¢",Itilde:"Ĩ",itilde:"Ä©",Iukcy:"Ð",iukcy:"Ñ",Iuml:"Ã",iuml:"ï",Jcirc:"Ä´",jcirc:"ĵ",Jcy:"Ð",jcy:"й",Jfr:"\uD835\uDD0D",jfr:"\uD835\uDD27",jmath:"È·",Jopf:"\uD835\uDD41",jopf:"\uD835\uDD5B",Jscr:"\uD835\uDCA5",jscr:"\uD835\uDCBF",Jsercy:"Ð",jsercy:"Ñ",Jukcy:"Ð",jukcy:"Ñ",Kappa:"Î",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"Ä·",Kcy:"Ð",kcy:"к",Kfr:"\uD835\uDD0E",kfr:"\uD835\uDD28",kgreen:"ĸ",KHcy:"Ð¥",khcy:"Ñ
",KJcy:"Ð",kjcy:"Ñ",Kopf:"\uD835\uDD42",kopf:"\uD835\uDD5C",Kscr:"\uD835\uDCA6",kscr:"\uD835\uDCC0",lAarr:"â",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"â",Lambda:"Î",lambda:"λ",Lang:"âª",lang:"â¨",langd:"â¦",langle:"â¨",lap:"âª
",Laplacetrf:"â",laquo:"«",Larr:"â",lArr:"â",larr:"â",larrb:"â¤",larrbfs:"â¤",larrfs:"â¤",larrhk:"â©",larrlp:"â«",larrpl:"⤹",larrsim:"⥳",larrtl:"â¢",lat:"⪫",lAtail:"â¤",latail:"â¤",late:"âª",lates:"âªï¸",lBarr:"â¤",lbarr:"â¤",lbbrk:"â²",lbrace:"{",lbrack:"[",lbrke:"â¦",lbrksld:"â¦",lbrkslu:"â¦",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ä»",lcedil:"ļ",lceil:"â",lcub:"{",Lcy:"Ð",lcy:"л",ldca:"⤶",ldquo:"â",ldquor:"â",ldrdhar:"⥧",ldrushar:"â¥",ldsh:"â²",lE:"â¦",le:"â¤",LeftAngleBracket:"â¨",LeftArrow:"â",Leftarrow:"â",leftarrow:"â",LeftArrowBar:"â¤",LeftArrowRightArrow:"â",leftarrowtail:"â¢",LeftCeiling:"â",LeftDoubleBracket:"â¦",LeftDownTeeVector:"⥡",LeftDownVector:"â",LeftDownVectorBar:"â¥",LeftFloor:"â",leftharpoondown:"â½",leftharpoonup:"â¼",leftleftarrows:"â",LeftRightArrow:"â",Leftrightarrow:"â",leftrightarrow:"â",leftrightarrows:"â",leftrightharpoons:"â",leftrightsquigarrow:"â",LeftRightVector:"â¥",LeftTee:"â£",LeftTeeArrow:"â¤",LeftTeeVector:"â¥",leftthreetimes:"â",LeftTriangle:"â²",LeftTriangleBar:"â§",LeftTriangleEqual:"â´",LeftUpDownVector:"â¥",LeftUpTeeVector:"⥠",LeftUpVector:"â¿",LeftUpVectorBar:"â¥",LeftVector:"â¼",LeftVectorBar:"â¥",lEg:"âª",leg:"â",leq:"â¤",leqq:"â¦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"â©¿",lesdoto:"âª",lesdotor:"âª",lesg:"âï¸",lesges:"âª",lessapprox:"âª
",lessdot:"â
1",lesseqgtr:"â",lesseqqgtr:"âª",LessEqualGreater:"â",LessFullEqual:"â¦",LessGreater:"â¶",lessgtr:"â¶",LessLess:"⪡",lesssim:"â²",LessSlantEqual:"⩽",LessTilde:"â²",lfisht:"⥼",lfloor:"â",Lfr:"\uD835\uDD0F",lfr:"\uD835\uDD29",lg:"â¶",lgE:"âª",lHar:"⥢",lhard:"â½",lharu:"â¼",lharul:"⥪",lhblk:"â",LJcy:"Ð",ljcy:"Ñ",Ll:"â",ll:"âª",llarr:"â",llcorner:"â",Lleftarrow:"â",llhard:"⥫",lltri:"âº",Lmidot:"Ä¿",lmidot:"Å",lmoust:"â°",lmoustache:"â°",lnap:"âª",lnapprox:"âª",lnE:"â¨",lne:"âª",lneq:"âª",lneqq:"â¨",lnsim:"â¦",loang:"â¬",loarr:"â½",lobrk:"â¦",LongLeftArrow:"âµ",Longleftarrow:"â¸",longleftarrow:"âµ",LongLeftRightArrow:"â·",Longleftrightarrow:"âº",longleftrightarrow:"â·",longmapsto:"â¼",LongRightArrow:"â¶",Longrightarrow:"â¹",longrightarrow:"â¶",looparrowleft:"â«",looparrowright:"â¬",lopar:"â¦
",Lopf:"\uD835\uDD43",lopf:"\uD835\uDD5D",loplus:"â¨",lotimes:"⨴",lowast:"â",lowbar:"_",LowerLeftArrow:"â",LowerRightArrow:"â",loz:"â",lozenge:"â",lozf:"â§«",lpar:"(",lparlt:"â¦",lrarr:"â",lrcorner:"â",lrhar:"â",lrhard:"â¥",lrm:"â",lrtri:"â¿",lsaquo:"â¹",Lscr:"â",lscr:"\uD835\uDCC1",Lsh:"â°",lsh:"â°",lsim:"â²",lsime:"âª",lsimg:"âª",lsqb:"[",lsquo:"â",lsquor:"â",Lstrok:"Å",lstrok:"Å",Lt:"âª",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"â",lthree:"â",ltimes:"â",ltlarr:"⥶",ltquest:"â©»",ltri:"â",ltrie:"â´",ltrif:"â",ltrPar:"â¦",lurdshar:"â¥",luruhar:"⥦",lvertneqq:"â¨ï¸",lvnE:"â¨ï¸",macr:"¯",male:"â",malt:"â ",maltese:"â ",Map:"â¤
",map:"â¦",mapsto:"â¦",mapstodown:"â§",mapstoleft:"â¤",mapstoup:"â¥",marker:"â®",mcomma:"⨩",Mcy:"Ð",mcy:"м",mdash:"â",mDDot:"âº",measuredangle:"â¡",MediumSpace:"â",Mellintrf:"â³",Mfr:"\uD835\uDD10",mfr:"\uD835\uDD2A",mho:"â§",micro:"µ",mid:"â£",midast:"*",midcir:"â«°",middot:"·",minus:"â",minusb:"â",minusd:"â¸",minusdu:"⨪",MinusPlus:"â",mlcp:"â«",mldr:"â¦",mnplus:"â",models:"â§",Mopf:"\uD835\uDD44",mopf:"\uD835\uDD5E",mp:"â",Mscr:"â³",mscr:"\uD835\uDCC2",mstpos:"â¾",Mu:"Î",mu:"μ",multimap:"â¸",mumap:"â¸",nabla:"â",Nacute:"Å",nacute:"Å",nang:"â â",nap:"â",napE:"⩰̸",napid:"â̸",napos:"Å",napprox:"â",natur:"â®",natural:"â®",naturals:"â",nbsp:" ",nbump:"â̸",nbumpe:"â̸",ncap:"â©",Ncaron:"Å",ncaron:"Å",Ncedil:"Å
",ncedil:"Å",ncong:"â",ncongdot:"â©Ì¸",ncup:"â©",Ncy:"Ð",ncy:"н",ndash:"â",ne:"â ",nearhk:"⤤",neArr:"â",nearr:"â",nearrow:"â",nedot:"â̸",NegativeMediumSpace:"â",NegativeThickSpace:"â",NegativeThinSpace:"â",NegativeVeryThinSpace:"â",nequiv:"â¢",nesear:"⤨",nesim:"â̸",NestedGreaterGreater:"â«",NestedLessLess:"âª",NewLine:"\n",nexist:"â",nexists:"â",Nfr:"\uD835\uDD11",nfr:"\uD835\uDD2B",ngE:"â§Ì¸",nge:"â±",ngeq:"â±",ngeqq:"â§Ì¸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"â̸",ngsim:"âµ",nGt:"â«â",ngt:"â¯",ngtr:"â¯",nGtv:"â«Ì¸",nhArr:"â",nharr:"â®",nhpar:"⫲",ni:"â",nis:"â¼",nisd:"âº",niv:"â",NJcy:"Ð",njcy:"Ñ",nlArr:"â",nlarr:"â",nldr:"â¥",nlE:"â¦Ì¸",nle:"â°",nLeftarrow:"â",nleftarrow:"â",nLeftrightarrow:"â",nleftrightarrow:"â®",nleq:"â°",nleqq:"â¦Ì¸",nleqslant:"⩽̸",nles:"⩽̸",nless:"â®",nLl:"â̸",nlsim:"â´",nLt:"âªâ",nlt:"â®",nltri:"âª",nltrie:"â¬",nLtv:"âªÌ¸",nmid:"â¤",NoBreak:"â ",NonBreakingSpace:" ",Nopf:"â",nopf:"\uD835\uDD5F",Not:"⫬",not:"¬",NotCongruent:"â¢",NotCupCap:"â",NotDoubleVerticalBar:"â¦",NotElement:"â",NotEqual:"â ",NotEqualTilde:"â̸",NotExists:"â",NotGreater:"â¯",NotGreaterEqual:"â±",NotGreaterFullEqual:"â§Ì¸",NotGreaterGreater:"â«Ì¸",NotGreaterLess:"â¹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"âµ",NotHumpDownHump:"â̸",NotHumpEqual:"â̸",notin:"â",notindot:"âµÌ¸",notinE:"â¹Ì¸",notinva:"â",notinvb:"â·",notinvc:"â¶",NotLeftTriangle:"âª",NotLeftTriangleBar:"â§Ì¸",NotLeftTriangleEqual:"â¬",NotLess:"â®",NotLessEqual:"â°",NotLessGreater:"â¸",NotLessLess:"âªÌ¸",NotLessSlantEqual:"⩽̸",NotLessTilde:"â´",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"â",notniva:"â",notnivb:"â¾",notnivc:"â½",NotPrecedes:"â",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"â ",NotReverseElement:"â",NotRightTriangle:"â«",NotRightTriangleBar:"â§Ì¸",NotRightTriangleEqual:"â",NotSquareSubset:"â̸",NotSquareSubsetEqual:"â¢",NotSquareSuperset:"â̸",NotSquareSupersetEqual:"â£",NotSubset:"ââ",NotSubsetEqual:"â",NotSucceeds:"â",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"â¡",NotSucceedsTilde:"â¿Ì¸",NotSuperset:"ââ",NotSupersetEqual:"â",NotTilde:"â",NotTildeEqual:"â",NotTildeFullEqual:"â",NotTildeTilde:"â",NotVerticalBar:"â¤",npar:"â¦",nparallel:"â¦",nparsl:"⫽â¥",npart:"â̸",npolint:"â¨",npr:"â",nprcue:"â
1 ",npre:"⪯̸",nprec:"â",npreceq:"⪯̸",nrArr:"â",nrarr:"â",nrarrc:"⤳̸",nrarrw:"â̸",nRightarrow:"â",nrightarrow:"â",nrtri:"â«",nrtrie:"â",nsc:"â",nsccue:"â¡",nsce:"⪰̸",Nscr:"\uD835\uDCA9",nscr:"\uD835\uDCC3",nshortmid:"â¤",nshortparallel:"â¦",nsim:"â",nsime:"â",nsimeq:"â",nsmid:"â¤",nspar:"â¦",nsqsube:"â¢",nsqsupe:"â£",nsub:"â",nsubE:"â«
̸",nsube:"â",nsubset:"ââ",nsubseteq:"â",nsubseteqq:"â«
̸",nsucc:"â",nsucceq:"⪰̸",nsup:"â
",nsupE:"â«Ì¸",nsupe:"â",nsupset:"ââ",nsupseteq:"â",nsupseteqq:"â«Ì¸",ntgl:"â¹",Ntilde:"Ã",ntilde:"ñ",ntlg:"â¸",ntriangleleft:"âª",ntrianglelefteq:"â¬",ntriangleright:"â«",ntrianglerighteq:"â",Nu:"Î",nu:"ν",num:"#",numero:"â",numsp:"â",nvap:"ââ",nVDash:"â¯",nVdash:"â®",nvDash:"â",nvdash:"â¬",nvge:"â¥â",nvgt:">â",nvHarr:"â¤",nvinfin:"â§",nvlArr:"â¤",nvle:"â¤â",nvlt:"<â",nvltrie:"â´â",nvrArr:"â¤",nvrtrie:"âµâ",nvsim:"â¼â",nwarhk:"⤣",nwArr:"â",nwarr:"â",nwarrow:"â",nwnear:"⤧",Oacute:"Ã",oacute:"ó",oast:"â",ocir:"â",Ocirc:"Ã",ocirc:"ô",Ocy:"Ð",ocy:"о",odash:"â",Odblac:"Å",odblac:"Å",odiv:"⨸",odot:"â",odsold:"⦼",OElig:"Å",oelig:"Å",ofcir:"⦿",Ofr:"\uD835\uDD12",ofr:"\uD835\uDD2C",ogon:"Ë",Ograve:"Ã",ograve:"ò",ogt:"â§",ohbar:"⦵",ohm:"Ω",oint:"â®",olarr:"âº",olcir:"⦾",olcross:"⦻",oline:"â¾",olt:"â§",Omacr:"Å",omacr:"Å",Omega:"Ω",omega:"Ï",Omicron:"Î",omicron:"ο",omid:"⦶",ominus:"â",Oopf:"\uD835\uDD46",oopf:"\uD835\uDD60",opar:"⦷",OpenCurlyDoubleQuote:"â",OpenCurlyQuote:"â",operp:"⦹",oplus:"â",Or:"â©",or:"â¨",orarr:"â»",ord:"â©",order:"â´",orderof:"â´",ordf:"ª",ordm:"º",origof:"â¶",oror:"â©",orslope:"â©",orv:"â©",oS:"â",Oscr:"\uD835\uDCAA",oscr:"â´",Oslash:"Ã",oslash:"ø",osol:"â",Otilde:"Ã",otilde:"õ",Otimes:"⨷",otimes:"â",otimesas:"⨶",Ouml:"Ã",ouml:"ö",ovbar:"â½",OverBar:"â¾",OverBrace:"â",OverBracket:"â´",OverParenthesis:"â",par:"â¥",para:"¶",parallel:"â¥",parsim:"⫳",parsl:"⫽",part:"â",PartialD:"â",Pcy:"Ð",pcy:"п",percnt:"%",period:".",permil:"â°",perp:"â¥",pertenk:"â±",Pfr:"\uD835\uDD13",pfr:"\uD835\uDD2D",Phi:"Φ",phi:"Ï",phiv:"Ï",phmmat:"â³",phone:"â",Pi:"Î ",pi:"Ï",pitchfork:"â",piv:"Ï",planck:"â",planckh:"â",plankv:"â",plus:"+",plusacir:"⨣",plusb:"â",pluscir:"⨢",plusdo:"â",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"â",pointint:"â¨",Popf:"â",popf:"\uD835\uDD61",pound:"£",Pr:"⪻",pr:"âº",prap:"⪷",prcue:"â¼",prE:"⪳",pre:"⪯",prec:"âº",precapprox:"⪷",preccurlyeq:"â¼",Precedes:"âº",PrecedesEqual:"⪯",PrecedesSlantEqual:"â¼",PrecedesTilde:"â¾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"â¨",precsim:"â¾",Prime:"â³",prime:"â²",primes:"â",prnap:"⪹",prnE:"⪵",prnsim:"â¨",prod:"â",Product:"â",profalar:"â®",profline:"â",profsurf:"â",prop:"â",Proportion:"â·",Proportional:"â",propto:"â",prsim:"â¾",prurel:"â°",Pscr:"\uD835\uDCAB",pscr:"\uD835\uDCC5",Psi:"Ψ",psi:"Ï",puncsp:"â",Qfr:"\uD835\uDD14",qfr:"\uD835\uDD2E",qint:"â¨",Qopf:"â",qopf:"\uD835\uDD62",qprime:"â",Qscr:"\uD835\uDCAC",qscr:"\uD835\uDCC6",quaternions:"â",quatint:"â¨",quest:"?",questeq:"â",QUOT:'"',quot:'"',rAarr:"â",race:"â½Ì±",Racute:"Å",racute:"Å",radic:"â",raemptyv:"⦳",Rang:"â«",rang:"â©",rangd:"â¦",range:"⦥",rangle:"â©",raquo:"»",Rarr:"â ",rArr:"â",rarr:"â",rarrap:"⥵",rarrb:"â¥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"â¤",rarrhk:"âª",rarrlp:"â¬",rarrpl:"â¥
",rarrsim:"⥴",Rarrtl:"â¤",rarrtl:"â£",rarrw:"â",rAtail:"â¤",ratail:"â¤",ratio:"â¶",rationals:"â",RBarr:"â¤",rBarr:"â¤",rbarr:"â¤",rbbrk:"â³",rbrace:"}",rbrack:"]",rbrke:"â¦",rbrksld:"â¦",rbrkslu:"â¦",Rcaron:"Å",rcaron:"Å",Rcedil:"Å",rcedil:"Å",rceil:"â",rcub:"}",Rcy:"Ð ",rcy:"Ñ",rdca:"⤷",rdldhar:"⥩",rdquo:"â",rdquor:"â",rdsh:"â³",Re:"â",real:"â",realine:"â",realpart:"â",reals:"â",rect:"â",REG:"®",reg:"®",ReverseElement:"â",ReverseEquilibrium:"â",ReverseUpEquilibrium:"⥯",rf
1isht:"⥽",rfloor:"â",Rfr:"â",rfr:"\uD835\uDD2F",rHar:"⥤",rhard:"â",rharu:"â",rharul:"⥬",Rho:"Ρ",rho:"Ï",rhov:"ϱ",RightAngleBracket:"â©",RightArrow:"â",Rightarrow:"â",rightarrow:"â",RightArrowBar:"â¥",RightArrowLeftArrow:"â",rightarrowtail:"â£",RightCeiling:"â",RightDoubleBracket:"â§",RightDownTeeVector:"â¥",RightDownVector:"â",RightDownVectorBar:"â¥",RightFloor:"â",rightharpoondown:"â",rightharpoonup:"â",rightleftarrows:"â",rightleftharpoons:"â",rightrightarrows:"â",rightsquigarrow:"â",RightTee:"â¢",RightTeeArrow:"â¦",RightTeeVector:"â¥",rightthreetimes:"â",RightTriangle:"â³",RightTriangleBar:"â§",RightTriangleEqual:"âµ",RightUpDownVector:"â¥",RightUpTeeVector:"â¥",RightUpVector:"â¾",RightUpVectorBar:"â¥",RightVector:"â",RightVectorBar:"â¥",ring:"Ë",risingdotseq:"â",rlarr:"â",rlhar:"â",rlm:"â",rmoust:"â±",rmoustache:"â±",rnmid:"â«®",roang:"â",roarr:"â¾",robrk:"â§",ropar:"â¦",Ropf:"â",ropf:"\uD835\uDD63",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"â¦",rppolint:"â¨",rrarr:"â",Rrightarrow:"â",rsaquo:"âº",Rscr:"â",rscr:"\uD835\uDCC7",Rsh:"â±",rsh:"â±",rsqb:"]",rsquo:"â",rsquor:"â",rthree:"â",rtimes:"â",rtri:"â¹",rtrie:"âµ",rtrif:"â¸",rtriltri:"â§",RuleDelayed:"â§´",ruluhar:"⥨",rx:"â",Sacute:"Å",sacute:"Å",sbquo:"â",Sc:"⪼",sc:"â»",scap:"⪸",Scaron:"Å ",scaron:"Å¡",sccue:"â½",scE:"⪴",sce:"⪰",Scedil:"Å",scedil:"Å",Scirc:"Å",scirc:"Å",scnap:"⪺",scnE:"⪶",scnsim:"â©",scpolint:"â¨",scsim:"â¿",Scy:"С",scy:"Ñ",sdot:"â
",sdotb:"â¡",sdote:"⩦",searhk:"⤥",seArr:"â",searr:"â",searrow:"â",sect:"§",semi:";",seswar:"⤩",setminus:"â",setmn:"â",sext:"â¶",Sfr:"\uD835\uDD16",sfr:"\uD835\uDD30",sfrown:"â¢",sharp:"â¯",SHCHcy:"Щ",shchcy:"Ñ",SHcy:"Ш",shcy:"Ñ",ShortDownArrow:"â",ShortLeftArrow:"â",shortmid:"â£",shortparallel:"â¥",ShortRightArrow:"â",ShortUpArrow:"â",shy:"Â",Sigma:"Σ",sigma:"Ï",sigmaf:"Ï",sigmav:"Ï",sim:"â¼",simdot:"⩪",sime:"â",simeq:"â",simg:"âª",simgE:"⪠",siml:"âª",simlE:"âª",simne:"â",simplus:"⨤",simrarr:"⥲",slarr:"â",SmallCircle:"â",smallsetminus:"â",smashp:"⨳",smeparsl:"⧤",smid:"â£",smile:"â£",smt:"⪪",smte:"⪬",smtes:"⪬ï¸",SOFTcy:"Ь",softcy:"Ñ",sol:"/",solb:"â§",solbar:"â¿",Sopf:"\uD835\uDD4A",sopf:"\uD835\uDD64",spades:"â ",spadesuit:"â ",spar:"â¥",sqcap:"â",sqcaps:"âï¸",sqcup:"â",sqcups:"âï¸",Sqrt:"â",sqsub:"â",sqsube:"â",sqsubset:"â",sqsubseteq:"â",sqsup:"â",sqsupe:"â",sqsupset:"â",sqsupseteq:"â",squ:"â¡",Square:"â¡",square:"â¡",SquareIntersection:"â",SquareSubset:"â",SquareSubsetEqual:"â",SquareSuperset:"â",SquareSupersetEqual:"â",SquareUnion:"â",squarf:"âª",squf:"âª",srarr:"â",Sscr:"\uD835\uDCAE",sscr:"\uD835\uDCC8",ssetmn:"â",ssmile:"â£",sstarf:"â",Star:"â",star:"â",starf:"â
",straightepsilon:"ϵ",straightphi:"Ï",strns:"¯",Sub:"â",sub:"â",subdot:"⪽",subE:"â«
",sube:"â",subedot:"â«",submult:"â«",subnE:"â«",subne:"â",subplus:"⪿",subrarr:"⥹",Subset:"â",subset:"â",subseteq:"â",subseteqq:"â«
",SubsetEqual:"â",subsetneq:"â",subsetneqq:"â«",subsim:"â«",subsub:"â«",subsup:"â«",succ:"â»",succapprox:"⪸",succcurlyeq:"â½",Succeeds:"â»",SucceedsEqual:"⪰",SucceedsSlantEqual:"â½",SucceedsTilde:"â¿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"â©",succsim:"â¿",SuchThat:"â",Sum:"â",sum:"â",sung:"âª",Sup:"â",sup:"â",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"â«",supE:"â«",supe:"â",supedot:"â«",Superset:"â",SupersetEqual:"â",suphsol:"â",suphsub:"â«",suplarr:"⥻",supmult:"â«",supnE:"â«",supne:"â",supplus:"â«",Supset:"â",supset:"â",supseteq:"â",supseteqq:"â«",supsetneq:"â",supsetneqq:"â«",supsim:"â«",supsub:"â«",supsup:"â«",swarhk:"⤦",swArr:"â",swarr:"â",swarrow:"â",swnwar:"⤪",szlig:"Ã",Tab:" ",target:"â",Tau:"Τ",tau:"Ï",tbrk:"â´",Tcaron:"Ť",tcaron:"Å¥",Tcedil:"Å¢",tcedil:"Å£",Tcy:"Т",tcy:"Ñ",tdot:"â",telrec:"â",Tfr:"\uD835\uDD17",tfr:"\uD835\uDD31",there4:"â´",Therefore:"â´",therefore:"â´",Theta:"Î",theta:"θ",thetasym:"Ï",thetav:"Ï",thickapprox:"â",thicksim:"â¼",ThickS
1pace:"ââ",thinsp:"â",ThinSpace:"â",thkap:"â",thksim:"â¼",THORN:"Ã",thorn:"þ",Tilde:"â¼",tilde:"Ë",TildeEqual:"â",TildeFullEqual:"â
",TildeTilde:"â",times:"Ã",timesb:"â ",timesbar:"⨱",timesd:"⨰",tint:"â",toea:"⤨",top:"â¤",topbot:"â¶",topcir:"⫱",Topf:"\uD835\uDD4B",topf:"\uD835\uDD65",topfork:"â«",tosa:"⤩",tprime:"â´",TRADE:"â¢",trade:"â¢",triangle:"âµ",triangledown:"â¿",triangleleft:"â",trianglelefteq:"â´",triangleq:"â",triangleright:"â¹",trianglerighteq:"âµ",tridot:"â¬",trie:"â",triminus:"⨺",TripleDot:"â",triplus:"⨹",trisb:"â§",tritime:"⨻",trpezium:"â¢",Tscr:"\uD835\uDCAF",tscr:"\uD835\uDCC9",TScy:"Ц",tscy:"Ñ",TSHcy:"Ð",tshcy:"Ñ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"â¬",twoheadleftarrow:"â",twoheadrightarrow:"â ",Uacute:"Ã",uacute:"ú",Uarr:"â",uArr:"â",uarr:"â",Uarrocir:"â¥",Ubrcy:"Ð",ubrcy:"Ñ",Ubreve:"Ŭ",ubreve:"Å",Ucirc:"Ã",ucirc:"û",Ucy:"У",ucy:"Ñ",udarr:"â
",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"\uD835\uDD18",ufr:"\uD835\uDD32",Ugrave:"Ã",ugrave:"ù",uHar:"⥣",uharl:"â¿",uharr:"â¾",uhblk:"â",ulcorn:"â",ulcorner:"â",ulcrop:"â",ultri:"â¸",Umacr:"Ū",umacr:"Å«",uml:"¨",UnderBar:"_",UnderBrace:"â",UnderBracket:"âµ",UnderParenthesis:"â",Union:"â",UnionPlus:"â",Uogon:"Ų",uogon:"ų",Uopf:"\uD835\uDD4C",uopf:"\uD835\uDD66",UpArrow:"â",Uparrow:"â",uparrow:"â",UpArrowBar:"â¤",UpArrowDownArrow:"â
",UpDownArrow:"â",Updownarrow:"â",updownarrow:"â",UpEquilibrium:"⥮",upharpoonleft:"â¿",upharpoonright:"â¾",uplus:"â",UpperLeftArrow:"â",UpperRightArrow:"â",Upsi:"Ï",upsi:"Ï
",upsih:"Ï",Upsilon:"Î¥",upsilon:"Ï
",UpTee:"â¥",UpTeeArrow:"â¥",upuparrows:"â",urcorn:"â",urcorner:"â",urcrop:"â",Uring:"Å®",uring:"ů",urtri:"â¹",Uscr:"\uD835\uDCB0",uscr:"\uD835\uDCCA",utdot:"â°",Utilde:"Ũ",utilde:"Å©",utri:"âµ",utrif:"â´",uuarr:"â",Uuml:"Ã",uuml:"ü",uwangle:"⦧",vangrt:"â¦",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"â
",varphi:"Ï",varpi:"Ï",varpropto:"â",vArr:"â",varr:"â",varrho:"ϱ",varsigma:"Ï",varsubsetneq:"âï¸",varsubsetneqq:"â«ï¸",varsupsetneq:"âï¸",varsupsetneqq:"â«ï¸",vartheta:"Ï",vartriangleleft:"â²",vartriangleright:"â³",Vbar:"â««",vBar:"⫨",vBarv:"â«©",Vcy:"Ð",vcy:"в",VDash:"â«",Vdash:"â©",vDash:"â¨",vdash:"â¢",Vdashl:"⫦",Vee:"â",vee:"â¨",veebar:"â»",veeeq:"â",vellip:"â®",Verbar:"â",verbar:"|",Vert:"â",vert:"|",VerticalBar:"â£",VerticalLine:"|",VerticalSeparator:"â",VerticalTilde:"â",VeryThinSpace:"â",Vfr:"\uD835\uDD19",vfr:"\uD835\uDD33",vltri:"â²",vnsub:"ââ",vnsup:"ââ",Vopf:"\uD835\uDD4D",vopf:"\uD835\uDD67",vprop:"â",vrtri:"â³",Vscr:"\uD835\uDCB1",vscr:"\uD835\uDCCB",vsubnE:"â«ï¸",vsubne:"âï¸",vsupnE:"â«ï¸",vsupne:"âï¸",Vvdash:"âª",vzigzag:"â¦",Wcirc:"Å´",wcirc:"ŵ",wedbar:"â©",Wedge:"â",wedge:"â§",wedgeq:"â",weierp:"â",Wfr:"\uD835\uDD1A",wfr:"\uD835\uDD34",Wopf:"\uD835\uDD4E",wopf:"\uD835\uDD68",wp:"â",wr:"â",wreath:"â",Wscr:"\uD835\uDCB2",wscr:"\uD835\uDCCC",xcap:"â",xcirc:"â¯",xcup:"â",xdtri:"â½",Xfr:"\uD835\uDD1B",xfr:"\uD835\uDD35",xhArr:"âº",xharr:"â·",Xi:"Î",xi:"ξ",xlArr:"â¸",xlarr:"âµ",xmap:"â¼",xnis:"â»",xodot:"â¨",Xopf:"\uD835\uDD4F",xopf:"\uD835\uDD69",xoplus:"â¨",xotime:"â¨",xrArr:"â¹",xrarr:"â¶",Xscr:"\uD835\uDCB3",xscr:"\uD835\uDCCD",xsqcup:"â¨",xuplus:"â¨",xutri:"â³",xvee:"â",xwedge:"â",Yacute:"Ã",yacute:"ý",YAcy:"Я",yacy:"Ñ",Ycirc:"Ŷ",ycirc:"Å·",Ycy:"Ы",ycy:"Ñ",yen:"Â¥",Yfr:"\uD835\uDD1C",yfr:"\uD835\uDD36",YIcy:"Ð",yicy:"Ñ",Yopf:"\uD835\uDD50",yopf:"\uD835\uDD6A",Yscr:"\uD835\uDCB4",yscr:"\uD835\uDCCE",YUcy:"Ю",yucy:"Ñ",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"Ð",zcy:"з",Zdot:"Å»",zdot:"ż",zeetrf:"â¨",ZeroWidthSpace:"â",Zeta:"Î",zeta:"ζ",Zfr:"â¨",zfr:"\uD835\uDD37",ZHcy:"Ð",zhcy:"ж",zigrarr:"â",Zopf:"â¤",zopf:"\uD835\uDD6B",Zscr:"\uD835\uDCB5",zscr:"\uD835\uDCCF",zwj:"â",zwnj:"â"}),i.entityMap=i.HTML_ENTITIES},994100,(e,t,i)=>{var r=e.r(607598).NAMESPACE,s=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,n=RegExp("[\\-\\.0-9"+s.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),a=RegExp("^"+s.source+n.source+"*(?::"+s.source+n.source+"*)?$");function o(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,o)}function l(){}function d(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function u(e,t,i){for(var s=e.tagName,n=null,a=e.length;a--;){var o=e[a],l=o.qName,d=o.value,u=l.indexOf(":");if(u>0)var c=o.prefix=l.slice(0,u),p=l.slice(u+1),m="xmlns"===c&&p;else p=l,c=null,m="xmlns"===l&&"";o.localName=p,!1!==m&&(null==n&&(n={},h(i,i={})),i[m]=n[m]=d,o.uri=r.XMLNS,t.startPrefixMapping(m,d))}for(var a=e.length;a--;){var c=(o=e[a]).prefix;c&&("xml"===c&&(o.uri=r.XML),"xmlns"!==c&&(o.uri=i[c||""]))}var u=s.indexOf(":");u>0?(c=e.prefix=s.slice(0,u),p=e.localName=s.slice(u+1)):(c=null,p=e.localName=s);var f=e.uri=i[c||""];if(t.startElement(f,p,s,e),!e.closed)return e.currentNSMap=i,e.localNSMap=n,!0;if(t.endElement(f,p,s),n)for(c in n)Object.prototype.hasOwnProperty.call(n,c)&&t.endPrefixMapping(c)}function h(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function c(){this.attributeNames={}}o.prototype=Error(),o.prototype.name=o.name,l.prototype={parse:function(e,t,i){var s=this.domBuilder;s.startDocument(),h(t,t={}),function(e,t,i,s,n){function a(e){var t,r=e.slice(1,-1);return Object.hasOwnProperty.call(i,r)?i[r]:"#"===r.charAt(0)?(t=parseInt(r.substr(1).replace("x","0x")))>65535?String.fromCharCode(55296+((t-=65536)>>
110),56320+(1023&t)):String.fromCharCode(t):(n.error("entity not found:"+e),e)}function l(t){if(t>v){var i=e.substring(v,t).replace(/&#?\w+;/g,a);g&&h(v),s.characters(i,0,t-v),v=t}}function h(t,i){for(;t>=m&&(i=f.exec(e));)m=(p=i.index)+i[0].length,g.lineNumber++;g.columnNumber=t-p+1}for(var p=0,m=0,f=/.*(?:\r\n?|\n)|.*$/g,g=s.locator,y=[{currentNSMap:t}],_={},v=0;;){try{var b=e.indexOf("<",v);if(b<0){if(!e.substr(v).match(/^\s*$/)){var T=s.doc,A=T.createTextNode(e.substr(v));T.appendChild(A),s.currentElement=A}return}switch(b>v&&l(b),e.charAt(b+1)){case"/":var S=e.indexOf(">",b+3),E=e.substring(b+2,S).replace(/[ \t\n\r]+$/g,""),C=y.pop();S<0?(E=e.substring(b+2).replace(/[\s<].*/,""),n.error("end tag name: "+E+" is not complete:"+C.tagName),S=b+1+E.length):E.match(/\s</)&&(E=E.replace(/[\s<].*/,""),n.error("end tag name: "+E+" maybe not complete"),S=b+1+E.length);var w=C.localNSMap,k=C.tagName==E;if(k||C.tagName&&C.tagName.toLowerCase()==E.toLowerCase()){if(s.endElement(C.uri,C.localName,E),w)for(var x in w)Object.prototype.hasOwnProperty.call(w,x)&&s.endPrefixMapping(x);k||n.fatalError("end tag name: "+E+" is not match the current start tagName:"+C.tagName)}else y.push(C);S++;break;case"?":g&&h(b),S=function(e,t,i){var r=e.indexOf("?>",t);if(r){var s=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(s)return s[0].length,i.processingInstruction(s[1],s[2]),r+2}return -1}(e,b,s);break;case"!":g&&h(b),S=function(e,t,i,r){if("-"===e.charAt(t+2)){if("-"===e.charAt(t+3)){var s=e.indexOf("-->",t+4);if(s>t)return i.comment(e,t+4,s-t-4),s+3;r.error("Unclosed comment")}}else{if("CDATA["==e.substr(t+3,6)){var s=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,s-t-9),i.endCDATA(),s+3}var n=function(e,t){var i,r=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=t,s.exec(e);i=s.exec(e);)if(r.push(i),i[1])return r}(e,t),a=n.length;if(a>1&&/!doctype/i.test(n[0][0])){var o=n[1][0],l=!1,d=!1;a>3&&(/^public$/i.test(n[2][0])?(l=n[3][0],d=a>4&&n[4][0]):/^system$/i.test(n[2][0])&&(d=n[3][0]));var u=n[a-1];return i.startDTD(o,l,d),i.endDTD(),u.index+u[0].length}}return -1}(e,b,s,n);break;default:g&&h(b);var I=new c,D=y[y.length-1].currentNSMap,S=function(e,t,i,s,n,a){function o(e,t,r){i.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),i.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,n),r)}for(var l,d,u=++t,h=0;;){var c=e.charAt(u);switch(c){case"=":if(1===h)l=e.slice(t,u),h=3;else if(2===h)h=3;else throw Error("attribute equal must after attrName");break;case"'":case'"':if(3===h||1===h)if(1===h&&(a.warning('attribute value must after "="'),l=e.slice(t,u)),t=u+1,(u=e.indexOf(c,t))>0)o(l,d=e.slice(t,u),t-1),h=5;else throw Error("attribute value no end '"+c+"' match");else if(4==h)o(l,d=e.slice(t,u),t),a.warning('attribute "'+l+'" missed start quot('+c+")!!"),t=u+1,h=5;else throw Error('attribute value must after "="');break;case"/":switch(h){case 0:i.setTagName(e.slice(t,u));case 5:case 6:case 7:h=7,i.closed=!0;case 4:case 1:break;case 2:i.closed=!0;break;default:throw Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==h&&i.setTagName(e.slice(t,u)),u;case">":switch(h){case 0:i.setTagName(e.slice(t,u));case 5:case 6:case 7:break;case 4:case 1:"/"===(d=e.slice(t,u)).slice(-1)&&(i.closed=!0,d=d.slice(0,-1));case 2:2===h&&(d=l),4==h?(a.warning('attribute "'+d+'" missed quot(")!'),o(l,d,t)):(r.isHTML(s[""])&&d.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),o(d,d,t));break;case 3:throw Error("attribute value missed!!")}return u;case"Â":c=" ";default:if(c<=" ")switch(h){case 0:i.setTagName(e.slice(t,u)),h=6;break;case 1:l=e.slice(t,u),h=2;break;case 4:var d=e.slice(t,u);a.warning('attribute "'+d+'" missed quot(")!!'),o(l,d,t);case 5:h=6}else switch(h){case 2:i.tagName,r.isHTML(s[""])&&l.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,t),t=u,h=1;break;case 5:a.warning('attribute space is required"'+l+'"!!');case 6:h=1,t=u;break;case 3:h=4,t=u;break;case 7:throw Error("elements closed character '/' and '>' must be connected to")}}u++}}(e,b,I,D,a,n),P=I.length;if(!I.closed&&function(e,t,i,r){var s=r[i];return null==s&&((s=e.lastIndexOf("</"+i+">
vendor: 4,700 bytes, line 1
1"))<t&&(s=e.lastIndexOf("</"+i)),r[i]=s),s<t}(e,S,I.tagName,_)&&(I.closed=!0,i.nbsp||n.warning("unclosed xml attribute")),g&&P){for(var L=d(g,{}),R=0;R<P;R++){var M=I[R];h(M.offset),M.locator=d(g,{})}s.locator=L,u(I,s,D)&&y.push(I),s.locator=g}else u(I,s,D)&&y.push(I);r.isHTML(I.uri)&&!I.closed?S=function(e,t,i,r,s){if(/^(?:script|textarea)$/i.test(i)){var n=e.indexOf("</"+i+">",t),a=e.substring(t+1,n);if(/[&<]/.test(a))return/^script$/i.test(i)||(a=a.replace(/&#?\w+;/g,r)),s.characters(a,0,a.length),n}return t+1}(e,S,I.tagName,a,s):S++}}catch(e){if(e instanceof o)throw e;n.error("element parse error: "+e),S=-1}S>v?v=S:l(Math.max(b,v)+1)}}(e,t,i,s,this.errorHandler),s.endDocument()}},c.prototype={setTagName:function(e){if(!a.test(e))throw Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!a.test(e))throw Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},i.XMLReader=l,i.ParseError=o},197856,(e,t,i)=>{var r=e.r(607598),s=e.r(949684),n=e.r(353393),a=e.r(994100),o=s.DOMImplementation,l=r.NAMESPACE,d=a.ParseError,u=a.XMLReader;function h(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function c(e){this.options=e||{locator:{}}}function p(){this.cdata=!1}function m(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function f(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function g(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function y(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}c.prototype.parseFromString=function(e,t){var i=this.options,r=new u,s=i.domBuilder||new p,a=i.errorHandler,o=i.locator,d=i.xmlns||{},c=/\/x?html?$/.test(t),m=c?n.HTML_ENTITIES:n.XML_ENTITIES;o&&s.setDocumentLocator(o),r.errorHandler=function(e,t,i){if(!e){if(t instanceof p)return t;e=t}var r={},s=e instanceof Function;function n(t){var n=e[t];!n&&s&&(n=2==e.length?function(i){e(t,i)}:e),r[t]=n&&function(e){n("[xmldom "+t+"] "+e+f(i))}||function(){}}return i=i||{},n("warning"),n("error"),n("fatalError"),r}(a,s,o),r.domBuilder=i.domBuilder||s,c&&(d[""]=l.HTML),d.xml=d.xml||l.XML;var g=i.normalizeLineEndings||h;return e&&"string"==typeof e?r.parse(g(e),d,m):r.errorHandler.error("invalid doc source"),s.doc},p.prototype={startDocument:function(){this.doc=new o().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,r){var s=this.doc,n=s.createElementNS(e,i||t),a=r.length;y(this,n),this.currentElement=n,this.locator&&m(this.locator,n);for(var o=0;o<a;o++){var e=r.getURI(o),l=r.getValue(o),i=r.getQName(o),d=s.createAttributeNS(e,i);this.locator&&m(r.getLocator(o),d),d.value=d.nodeValue=l,n.setAttributeNode(d)}},endElement:function(e,t,i){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var i=this.doc.createProcessingInstruction(e,t);this.locator&&m(this.locator,i),y(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){if(e=g.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&m(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=g.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&m(this.locator,r),y(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var r=this.doc.implementation;if(r&&r.createDocumentType){var s=r.createDocumentType(e,t,i);this.locator&&m(this.locator,s),y(this,s),this.doc.doctype=s}},warning:function(e){console.warn("[xmldom warning] "+e,f(this.locator))},error:function(e){console.error("[xmldom error] "+e,f(this.locator))},fatalError:function(e){throw new d(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){p.prototype[e]=function(){return null}}),i.__DOMHandler=p,i.normalizeLineEndings=h,i.DOMParser=c},519204,(e,t,i)=>{var r=e.r(949684);
1i.DOMImplementation=r.DOMImplementation,i.XMLSerializer=r.XMLSerializer,i.DOMParser=e.r(197856).DOMParser},903342,(e,t,i)=>{t.exports={getUint64:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:0x100000000*i.getUint32(0)+i.getUint32(4)},MAX_UINT32:0x100000000}},722277,(e,t,i)=>{var r=e.r(903342).getUint64;t.exports=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},s=12;0===i.version?(i.earliestPresentationTime=t.getUint32(s),i.firstOffset=t.getUint32(s+4),s+=8):(i.earliestPresentationTime=r(e.subarray(s)),i.firstOffset=r(e.subarray(s+8)),s+=16),s+=2;var n=t.getUint16(s);for(s+=2;n>0;s+=12,n--)i.references.push({referenceType:(128&e[s])>>>7,referencedSize:0x7fffffff&t.getUint32(s),subsegmentDuration:t.getUint32(s+4),startsWithSap:!!(128&e[s+8]),sapType:(112&e[s+8])>>>4,sapDeltaTime:0xfffffff&t.getUint32(s+8)});return i}},98124,(e,t,i)=>{var r,s,n,a;r=function(e){return 9e4*e},s=function(e,t){return e*t},n=function(e){return e/9e4},t.exports={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:r,secondsToAudioTs:s,videoTsToSeconds:n,audioTsToSeconds:a=function(e,t){return e/t},audioTsToVideoTs:function(e,t){return r(a(e,t))},videoTsToAudioTs:function(e,t){return s(n(e),t)},metadataTsToSeconds:function(e,t,i){return n(i?e:e-t)}}},861288,e=>{"use strict";let t,i,r,s,n,a;e.s(["default",()=>nP],861288);var o,l=e.i(325273),d=e.i(729265),u=e.i(53618),h=e.i(810755),c=e.i(931067),p="https://example.com";let m=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=l.default.location&&l.default.location.href||"");var i=/^\/\//.test(e),r=!l.default.location&&!/\/\//i.test(e),s=new URL(t,e=new l.default.URL(e,l.default.location||p));return r?s.href.slice(p.length):i?s.href.slice(s.protocol.length):s.href};var f=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2==arguments.length)for(var i=t.length,r=0;r<i;++r)t[r].call(this,arguments[1]);else for(var s=Array.prototype.slice.call(arguments,1),n=t.length,a=0;a<n;++a)t[a].apply(this,s)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}(),g=e.i(467034);function y(e){for(var t=l.default.atob?l.default.atob(e):g.Buffer.from(e,"base64").toString("binary"),i=new Uint8Array(t.length),r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return i}class _ extends f{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}let v=function(e){let t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},b=function(e){let t,i={};if(!e)return i;let r=e.split(RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),s=r.length;for(;s--;)""!==r[s]&&((t=/([^=]*)=(.*)/.exec(r[s]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),i[t[0]]=t[1]);return i},T=e=>{let t=e.split("x"),i={};return t[0]&&(i.width=parseInt(t[0],10)),t[1]&&(i.height=parseInt(t[1],10)),i};class A extends f{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if(0!==(e=e.trim()).length){if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce((t,i)=>{let r=i(e);return r===e?t:t.concat([r])},[e]).forEach(e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(0!==e.indexOf("#EXT"))return void this.trigger("data",{type:"comment",text:e.slice(1)});if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))return void this.trigger("data",{type:"tag",tagType:"m3u"});if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e)){i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),this.trigger("data",i);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e)){i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e)){i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e)){i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e)){i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e)){i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e)){i=(0,c.default)(v(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",i);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e)){i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(e)){if(i={type:"tag",tagType:"map"},t[1]){let e=b(t[1]);e.URI&&(i.uri=e.URI),e.BYTERANGE&&(i.byterange=v(e.BYTERANGE))}this.trigger("data",i);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e)){i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=b(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=T(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e)){i={type:"tag",tagType:"media"},t[1]&&(i.attributes=b(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-ENDLIST/.exec(e))return void this.trigger("data",{type:"tag",tagType:"endlist"});if(t=/^#EXT-X-DISCONTINUITY/.exec(e))return void this.trigger("data",{type:"tag",tagType:"discontinuity"});if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e)){i={type:"tag",tagType:"program-date-time"}
1,t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(e)){i={type:"tag",tagType:"key"},t[1]&&(i.attributes=b(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),this.trigger("data",i);return}if(t=/^#EXT-X-START:(.*)$/.exec(e)){i={type:"tag",tagType:"start"},t[1]&&(i.attributes=b(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e)){i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e)){i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e)){i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if((t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"skip"}).attributes=b(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(" ")),this.trigger("data",i);return}if((t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"part"}).attributes=b(t[1]),["DURATION"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["INDEPENDENT","GAP"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=v(i.attributes.BYTERANGE)),this.trigger("data",i);return}if((t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"server-control"}).attributes=b(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),this.trigger("data",i);return}if((t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"part-inf"}).attributes=b(t[1]),["PART-TARGET"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),this.trigger("data",i);return}if((t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"preload-hint"}).attributes=b(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);let t="BYTERANGE-LENGTH"===e?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e]}}),this.trigger("data",i);return}if((t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"rendition-report"}).attributes=b(t[1]),["LAST-MSN","LAST-PART"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))}),this.trigger("data",i);return}if((t=/^#EXT-X-DATERANGE:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"daterange"}).attributes=b(t[1]),["ID","CLASS"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=String(i.attributes[e]))}),["START-DATE","END-DATE"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=new Date(i.attributes[e]))}),["DURATION","PLANNED-DURATION"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["END-ON-NEXT"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/i.test(i.attributes[e]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=i.attributes[e].toString(16))});let e=/^X-([A-Z]+-)+[A-Z]+$/;
1for(let t in i.attributes){if(!e.test(t))continue;let r=/[0-9A-Fa-f]{6}/g.test(i.attributes[t]),s=/^\d+(\.\d+)?$/.test(i.attributes[t]);i.attributes[t]=r?i.attributes[t].toString(16):s?parseFloat(i.attributes[t]):String(i.attributes[t])}this.trigger("data",i);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e))return void this.trigger("data",{type:"tag",tagType:"independent-segments"});if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(e))return void this.trigger("data",{type:"tag",tagType:"i-frames-only"});if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e)){(i={type:"tag",tagType:"content-steering"}).attributes=b(t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(e)){(i={type:"tag",tagType:"i-frame-playlist"}).attributes=b(t[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=T(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),this.trigger("data",i);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(e)){(i={type:"tag",tagType:"define"}).attributes=b(t[1]),this.trigger("data",i);return}this.trigger("data",{type:"tag",data:e.slice(4)})})}}addParser(e){let{expression:t,customType:i,dataParser:r,segment:s}=e;"function"!=typeof r&&(r=e=>e),this.customParsers.push(e=>{if(t.exec(e))return this.trigger("data",{type:"custom",data:r(e),customType:i,segment:s}),!0})}addTagMapper(e){let{expression:t,map:i}=e;this.tagMappers.push(e=>t.test(e)?i(e):e)}}let S=function(e){let t={};return Object.keys(e).forEach(function(i){t[i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase())]=e[i]}),t},E=function(e){let{serverControl:t,targetDuration:i,partTargetDuration:r}=e;if(!t)return;let s="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=i&&3*i,l=r&&2*r;i&&!t.hasOwnProperty(n)&&(t[n]=o,this.trigger("info",{message:`${s} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&t[n]<o&&(this.trigger("warn",{message:`${s} clamping HOLD-BACK (${t[n]}) to targetDuration * 3 (${o})`}),t[n]=o),r&&!t.hasOwnProperty(a)&&(t[a]=3*r,this.trigger("info",{message:`${s} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})),r&&t[a]<l&&(this.trigger("warn",{message:`${s} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`}),t[a]=l)};class C extends f{constructor(e={}){let t,i;super(),this.lineStream=new _,this.parseStream=new A,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;let r=this,s=[],n={},a=!1,o=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},d=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let u=0,h=0,p={};this.on("end",()=>{!n.uri&&(n.parts||n.preloadHints)&&(!n.map&&t&&(n.map=t),!n.key&&i&&(n.key=i),n.timeline||"number"!=typeof d||(n.timeline=d),this.manifest.preloadSegment=n)}),this.parseStream.on("data",function(e){let m,f;if(r.manifest.definitions){for(let t in r.manifest.definitions)if(e.uri&&(e.uri=e.uri.replace(`{$${t}}`,r.manifest.definitions[t])),e.attributes)for(let i in e.attributes)"string"==typeof e.attributes[i]&&(e.attributes[i]=e.attributes[i].replace(`{$${t}}`,r.manifest.definitions[t]))}({tag(){(({version(){e.version&&(this.manifest.version=e.version)},"allow-cache"(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){let t={};"length"in e&&(n.byterange=t,t.length=e.length,"offset"in e||(e.offset=u)),"offset"in e&&(n.byterange=t,t.offset=e.offset),u=t.offset+t.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),e.title&&(n.title=e.title),e.duration>0&&(n.duration=e.duration),0===e.duration&&(n.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key(){if(!e.attributes)return void this.trigger("warn",{message:"ignoring key declaration without attribute list"});if("NONE"===e.attributes.METHOD){i=null;return}if(!e.attributes.URI)return void this.trigger("warn",{message:"ignoring key declaration without URI"});if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes};return}if("com.microsoft.playready"===e.attributes.KEYFORMAT){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI};return}if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT)return -1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23))?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:y(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"});e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),i={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(i.iv=e.attributes.IV)},"media-sequence"(){if(!isFinite(e.number))return void this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number});this.manifest.mediaSequence=e.number},"discontinuity-sequence"(){if(!isFinite(e.number))return void this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number});this.manifest.discontinuitySequence=e.number,d=e.number},"playlist-type"(){if(!/VOD|EVENT/.test(e.playlistType))return void this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist});this.manifest.playlistType=e.playlistType},map(){t={}
1,e.uri&&(t.uri=e.uri),e.byterange&&(t.byterange=e.byterange),i&&(t.key=i)},"stream-inf"(){if(this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||l,!e.attributes)return void this.trigger("warn",{message:"ignoring empty stream-inf attributes"});n.attributes||(n.attributes={}),(0,c.default)(n.attributes,e.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});let t=this.manifest.mediaGroups[e.attributes.TYPE];t[e.attributes["GROUP-ID"]]=t[e.attributes["GROUP-ID"]]||{},m=t[e.attributes["GROUP-ID"]],(f={default:/yes/i.test(e.attributes.DEFAULT)}).default?f.autoselect=!0:f.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(f.language=e.attributes.LANGUAGE),e.attributes.URI&&(f.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(f.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(f.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(f.forced=/yes/i.test(e.attributes.FORCED)),m[e.attributes.NAME]=f},discontinuity(){d+=1,n.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),n.dateTimeString=e.dateTimeString,n.dateTimeObject=e.dateTimeObject;let{lastProgramDateTime:t}=this;this.lastProgramDateTime=new Date(e.dateTimeString).getTime(),null===t&&this.manifest.segments.reduceRight((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(e.duration)||e.duration<0)return void this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration});this.manifest.targetDuration=e.duration,E.call(this,this.manifest)},start(){if(!e.attributes||isNaN(e.attributes["TIME-OFFSET"]))return void this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}},"cue-out"(){n.cueOut=e.data},"cue-out-cont"(){n.cueOutCont=e.data},"cue-in"(){n.cueIn=e.data},skip(){this.manifest.skip=S(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;let t=this.manifest.segments.length,i=S(e.attributes);n.parts=n.parts||[],n.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=h),h=i.byterange.offset+i.byterange.length);let r=n.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${r} for segment #${t}`,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})})},"server-control"(){let t=this.manifest.serverControl=S(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),E.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){let t=this.manifest.segments.length,i=S(e.attributes),r=i.type&&"PART"===i.type;n.preloadHints=n.preloadHints||[],n.preloadHints.push(i),i.byterange&&!i.byterange.hasOwnProperty("offset")&&(i.byterange.offset=r?h:0,r&&(h=i.byterange.offset+i.byterange.length));let s=n.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${s} for segment #${t}`,e.attributes,["TYPE","URI"]),i.type)for(let e=0;e<n.preloadHints.length-1;e++){let r=n.preloadHints[e];r.type&&r.type===i.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${s} for segment #${t} has the same TYPE ${i.type} as preload hint #${e}`})}},"rendition-report"(){let t=S(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);let i=this.manifest.renditionReports.length-1,r=["LAST-MSN","URI"];a&&r.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${i}`,e.attributes,r)},"part-inf"(){this.manifest.partInf=S(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),E.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(S(e.attributes));let t=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${t}`,e.attributes,["ID","START-DATE"]);let i=this.manifest.dateRanges[t];i.endDate&&i.startDate&&new Date(i.endDate)<new Date(i.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),i.duration&&i.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),i.plannedDuration&&i.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});let r=!!i.endOnNext;if(r&&!i.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT
1=YES attribute must have a CLASS attribute"}),r&&(i.duration||i.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),i.duration&&i.endDate){let e=i.startDate.getTime()+1e3*i.duration;this.manifest.dateRanges[t].endDate=new Date(e)}if(p[i.id]){for(let e in p[i.id])if(i[e]&&JSON.stringify(p[i.id][e])!==JSON.stringify(i[e])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}let e=this.manifest.dateRanges.findIndex(e=>e.id===i.id);this.manifest.dateRanges[e]=(0,c.default)(this.manifest.dateRanges[e],i),p[i.id]=(0,c.default)(p[i.id],i),this.manifest.dateRanges.pop()}else p[i.id]=i},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=S(e.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",e.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};let t=(e,t)=>{if(e in this.manifest.definitions)return void this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${e}`});this.manifest.definitions[e]=t};if("QUERYPARAM"in e.attributes){if("NAME"in e.attributes||"IMPORT"in e.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});let i=this.params.get(e.attributes.QUERYPARAM);return i?void t(e.attributes.QUERYPARAM,decodeURIComponent(i)):void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${e.attributes.QUERYPARAM}`})}return"NAME"in e.attributes?"IMPORT"in e.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in e.attributes&&"string"==typeof e.attributes.VALUE?void t(e.attributes.NAME,e.attributes.VALUE):void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${e.attributes.NAME}`}):"IMPORT"in e.attributes?this.mainDefinitions[e.attributes.IMPORT]?void t(e.attributes.IMPORT,this.mainDefinitions[e.attributes.IMPORT]):void this.trigger("error",{message:`EXT-X-DEFINE: No value ${e.attributes.IMPORT} to import, or IMPORT used on main playlist`}):void this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:e.attributes,uri:e.uri,timeline:d}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",e.attributes,["BANDWIDTH","URI"])}})[e.tagType]||o).call(r)},uri(){n.uri=e.uri,s.push(n),!this.manifest.targetDuration||"duration"in n||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),n.duration=this.manifest.targetDuration),i&&(n.key=i),n.timeline=d,t&&(n.map=t),h=0,null!==this.lastProgramDateTime&&(n.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*n.duration),n={}},comment(){},custom(){e.segment?(n.custom=n.custom||{},n.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(r)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,i){let r=[];i.forEach(function(e){t.hasOwnProperty(e)||r.push(e)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var w={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},k=["video","audio","text"],x=["Video","Audio","Text"],I=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)}):e},D=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach(function(e){var t;
1e=e.trim(),k.forEach(function(r){var s=w[r].exec(e.toLowerCase());if(s&&!(s.length<=1)){t=r;var n=e.substring(0,s[1].length),a=e.replace(n,"");i.push({type:n,details:a,mediaType:r})}}),t||i.push({type:e,details:"",mediaType:"unknown"})}),i},P=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var r in i){var s=i[r];if(s.default&&s.playlists)return D(s.playlists[0].attributes.CODECS)}return null},L=function(e){return void 0===e&&(e=""),w.audio.test(e.trim().toLowerCase())},R=function(e){if(e&&"string"==typeof e){var t,i=e.toLowerCase().split(",").map(function(e){return I(e.trim())}),r="video";1===i.length&&L(i[0])?r="audio":1===i.length&&(void 0===(t=i[0])&&(t=""),w.text.test(t.trim().toLowerCase()))&&(r="application");var s="mp4";return i.every(function(e){return w.mp4.test(e)})?s="mp4":i.every(function(e){return w.webm.test(e)})?s="webm":i.every(function(e){return w.ogg.test(e)})&&(s="ogg"),r+"/"+s+';codecs="'+e+'"'}},M=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=!1),l.default.MediaSource&&l.default.MediaSource.isTypeSupported&&l.default.MediaSource.isTypeSupported(R(e))||t&&l.default.ManagedMediaSource&&l.default.ManagedMediaSource.isTypeSupported&&l.default.ManagedMediaSource.isTypeSupported(R(e))||!1},O=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<x.length;t++)if(w["muxer"+x[t]].test(e))return!0;return!1})},N="mp4a.40.2",j=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,U=/^application\/dash\+xml/i,B=function(e){return j.test(e)?"hls":U.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},F=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},q=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||F(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},V=l.default.BigInt||Number,$=[V("0x1"),V("0x100"),V("0x10000"),V("0x1000000"),V("0x100000000"),V("0x10000000000"),V("0x1000000000000"),V("0x100000000000000"),V("0x10000000000000000")];!function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();var H=function(e,t){var i=void 0===t?{}:t,r=i.signed,s=i.le,n=void 0!==s&&s;e=q(e);var a=n?"reduce":"reduceRight",o=(e[a]?e[a]:Array.prototype[a]).call(e,function(t,i,r){var s=n?r:Math.abs(r+1-e.length);return t+V(i)*$[s]},V(0));if(void 0!==r&&r){var l=$[e.length]/V(2)-V(1);(o=V(o))>l&&(o-=l,o-=l,o-=V(2))}return Number(o)},z=function(e,t){var i=(void 0===t?{}:t).le,r=void 0!==i&&i;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var s=Math.ceil((e=V(e)).toString(2).length/8),n=new Uint8Array(new ArrayBuffer(s)),a=0;a<s;a++){var o=r?a:Math.abs(a+1-n.length);n[o]=Number(e/$[a]&V(255)),e<0&&(n[o]=Math.abs(~n[o]),n[o]-=0===a?1:2)}return n},W=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,q(e));try{return decodeURIComponent(escape(t))}catch(e){}return t},G=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return i},X=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];if((t=t.filter(function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e})).length<=1)return q(t[0]);var r=new Uint8Array(t.reduce(function(e,t,i){return e+(t.byteLength||t.length)},0)),s=0;return t.forEach(function(e){e=q(e),r.set(e,s),s+=e.byteLength}),r},Y=function(e,t,i){var r=void 0===i?{}:i,s=r.offset,n=void 0===s?0:s,a=r.mask,o=void 0===a?[]:a;e=q(e);var l=(t=q(t)).every?t.every:Array.prototype.every;return t.length&&e.length-n>=t.length&&l.call(t,function(t,i){return t===(o[i]?o[i]&e[n+i]:e[n+i])})},K=function(e,t,i){t.forEach(function(t){for(var r in e.mediaGroups[t])for(var s in e.mediaGroups[t][r])i(e.mediaGroups[t][r][s],t,r,s)})},Q=e.i(519204);let Z=e=>!!e&&"object"==typeof e,J=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.reduce((e,t)=>
1("object"!=typeof t||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):Z(e[i])&&Z(t[i])?e[i]=J(e[i],t[i]):e[i]=t[i]}),e),{})},ee=e=>Object.keys(e).map(t=>e[t]),et=e=>e.reduce((e,t)=>e.concat(t),[]),ei=e=>{if(!e.length)return[];let t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t};var er={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};let es=e=>{let{baseUrl:t="",source:i="",range:r="",indexRange:s=""}=e,n={uri:i,resolvedUri:m(t||"",i)};if(r||s){let e,t=(r||s).split("-"),i=l.default.BigInt?l.default.BigInt(t[0]):parseInt(t[0],10),a=l.default.BigInt?l.default.BigInt(t[1]):parseInt(t[1],10);i<Number.MAX_SAFE_INTEGER&&"bigint"==typeof i&&(i=Number(i)),a<Number.MAX_SAFE_INTEGER&&"bigint"==typeof a&&(a=Number(a)),"bigint"==typeof(e="bigint"==typeof a||"bigint"==typeof i?l.default.BigInt(a)-l.default.BigInt(i)+l.default.BigInt(1):a-i+1)&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),n.byterange={length:e,offset:i}}return n},en=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e))?null:e,ea={static(e){let{duration:t,timescale:i=1,sourceDuration:r,periodDuration:s}=e,n=en(e.endNumber),a=t/i;return"number"==typeof n?{start:0,end:n}:"number"==typeof s?{start:0,end:s/a}:{start:0,end:r/a}},dynamic(e){let{NOW:t,clientOffset:i,availabilityStartTime:r,timescale:s=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,d=en(e.endNumber),u=(t+i)/1e3,h=r+a,c=Math.ceil((u+o-h)*s/n),p=Math.floor((u-h-l)*s/n),m=Math.floor((u-h)*s/n);return{start:Math.max(0,p),end:"number"==typeof d?d:Math.min(c,m)}}},eo=e=>{let{type:t,duration:i,timescale:r=1,periodDuration:s,sourceDuration:n}=e,{start:a,end:o}=ea[t](e),l=((e,t)=>{let i=[];for(let r=e;r<t;r++)i.push(r);return i})(a,o).map(t=>{let{duration:i,timescale:r=1,periodStart:s,startNumber:n=1}=e;return{number:n+t,duration:i/r,timeline:s,time:t*i}});if("static"===t){let e=l.length-1;l[e].duration=("number"==typeof s?s:n)-i/r*e}return l},el=e=>{let{baseUrl:t,initialization:i={},sourceDuration:r,indexRange:s="",periodStart:n,presentationTime:a,number:o=0,duration:l}=e;if(!t)throw Error(er.NO_BASE_URL);let d=es({baseUrl:t,source:i.sourceURL,range:i.range}),u=es({baseUrl:t,source:t,indexRange:s});if(u.map=d,l){let t=eo(e);t.length&&(u.duration=t[0].duration,u.timeline=t[0].timeline)}else r&&(u.duration=r,u.timeline=n);return u.presentationTime=a||n,u.number=o,[u]},ed=(e,t,i)=>{let r,s=e.sidx.map?e.sidx.map:null,n=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,d=o.offset+o.length,u=t.timescale,h=t.references.filter(e=>1!==e.referenceType),c=[],p=e.endList?"static":"dynamic",m=e.sidx.timeline,f=m,g=e.mediaSequence||0;r="bigint"==typeof t.firstOffset?l.default.BigInt(d)+t.firstOffset:d+t.firstOffset;for(let e=0;e<h.length;e++){let o,d=t.references[e],h=d.referencedSize,y=d.subsegmentDuration;o="bigint"==typeof r?r+l.default.BigInt(h)-l.default.BigInt(1):r+h-1;let _={baseUrl:i,timescale:u,timeline:a,periodStart:m,presentationTime:f,number:g,duration:y,sourceDuration:n,indexRange:`${r}-${o}`,type:p},v=el(_)[0];s&&(v.map=s),c.push(v),"bigint"==typeof r?r+=l.default.BigInt(h):r+=h,f+=y/u,g++}return e.segments=c,e},eu=["AUDIO","SUBTITLES"],eh=1/60,ec=e=>{let t;return(t=e=>{let{timeline:t}=e;return t},ee(e.reduce((e,i)=>(i.forEach(i=>{e[t(i)]=i}),e),{}))).sort((e,t)=>e.timeline>t.timeline?1:-1)},ep=e=>{let t=[];return K(e,eu,(e,i,r,s)=>{t=t.concat(e.playlists||[])}),t},em=e=>{let{playlist:t,mediaSequence:i}=e;t.mediaSequence=i,t.segments.forEach((e,i)=>{e.number=t.mediaSequence+i})},ef=e=>e&&e.uri+"-"+(e=>{let t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?l.default.BigInt(e.offset)+l.default.BigInt(e.length)-l.default.BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`})(e.byterange),eg=e=>{let t=e.reduce(function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e},{}),i=[];
1return Object.values(t).forEach(e=>{let t=ee(e.reduce((e,t)=>{let i=t.attributes.id+(t.attributes.lang||"");return e[i]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[i].segments.push(...t.segments)),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):(e[i]=t,e[i].attributes.timelineStarts=[]),e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{}));i=i.concat(t)}),i.map(e=>(e.discontinuityStarts=(e.segments||[]).reduce((e,t,i)=>(t.discontinuity&&e.push(i),e),[]),e))},ey=(e,t)=>{let i=ef(e.sidx),r=i&&t[i]&&t[i].sidx;return r&&ed(e,r,e.sidx.resolvedUri),e},e_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object.keys(t).length)return e;for(let i in e)e[i]=ey(e[i],t);return e},ev=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=e.reduce((e,s)=>{let n=s.attributes.role&&s.attributes.role.value||"",a=s.attributes.lang||"",o=s.attributes.label||"main";if(a&&!s.attributes.label){let e=n?` (${n})`:"";o=`${s.attributes.lang}${e}`}e[o]||(e[o]={language:a,autoselect:!0,default:"main"===n,playlists:[],uri:""});let l=ey(((e,t)=>{let{attributes:i,segments:r,sidx:s,mediaSequence:n,discontinuitySequence:a,discontinuityStarts:o}=e,l={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:a,discontinuityStarts:o,timelineStarts:i.timelineStarts,mediaSequence:n,segments:r};return i.contentProtection&&(l.contentProtection=i.contentProtection),i.serviceLocation&&(l.attributes.serviceLocation=i.serviceLocation),s&&(l.sidx=s),t&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l})(s,r),i);return e[o].playlists.push(l),void 0===t&&"main"===n&&((t=s).default=!0),e},{});if(!t){let e=Object.keys(s)[0];s[e].default=!0}return s},eb=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.reduce((e,i)=>{let r=i.attributes.label||i.attributes.lang||"text",s=i.attributes.lang||"und";return e[r]||(e[r]={language:s,default:!1,autoselect:!1,playlists:[],uri:""}),e[r].playlists.push(ey((e=>{let{attributes:t,segments:i,mediaSequence:r,discontinuityStarts:s,discontinuitySequence:n}=e;void 0===i&&(i=[{uri:t.baseUrl,timeline:t.periodStart,resolvedUri:t.baseUrl||"",duration:t.sourceDuration,number:0}],t.duration=t.sourceDuration);let a={NAME:t.id,BANDWIDTH:t.bandwidth,"PROGRAM-ID":1};t.codecs&&(a.CODECS=t.codecs);let o={attributes:a,uri:"",endList:"static"===t.type,timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,timelineStarts:t.timelineStarts,discontinuityStarts:s,discontinuitySequence:n,mediaSequence:r,segments:i};return t.serviceLocation&&(o.attributes.serviceLocation=t.serviceLocation),o})(i),t)),e},{})},eT=e=>{let{attributes:t,segments:i,sidx:r,discontinuityStarts:s}=e,n={attributes:{NAME:t.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:t.width,height:t.height},CODECS:t.codecs,BANDWIDTH:t.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===t.type,timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuityStarts:s,timelineStarts:t.timelineStarts,segments:i};return t.frameRate&&(n.attributes["FRAME-RATE"]=t.frameRate),t.contentProtection&&(n.contentProtection=t.contentProtection),t.serviceLocation&&(n.attributes.serviceLocation=t.serviceLocation),r&&(n.sidx=r),n},eA=e=>{let{attributes:t}=e;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},eS=e=>{let{attributes:t}=e;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},eE=e=>{let{attributes:t}=e;return"text/vtt"===t.mimeType||"text"===t.contentType},eC=e=>e?Object.keys(e).reduce((t,i)=>{let r=e[i];return t.concat(r.playlists)},[]):[],ew=(e,t,i)=>{let{NOW:r,clientOffset:s,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e;return Math.ceil((((r+s)/1e3+l-(n+o))*a-t)/i)},ek=(e,t)=>{let{type:i,minimumUpdatePeriod:r=0,media:s="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=e,d=[],u=-1;for(let h=0;h<t.length;h++){let c,p=t[h],m=p.d,f=p.r||0,g=p.t||0;if(u<0&&(u=g),g&&g>u&&(u=g),f<0){let o=h+1;c=o===t.length?"dynamic"===i&&r>0&&s.indexOf("$Number$")>0?ew(e,u,m):(n*a-u)/m:(t[o].t-u)/m}else c=f+1;let y=o+d.length+c,_=o+d.length;for(;_<y;)d.push({number:_,duration:m/a,time:u,timeline:l}),u+=m,_++}return d},ex=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,eI=(e,t)=>e.replace(ex,(e=>(t,i,r,s)=>{if("$$"===t)return"$";if(void 0===e[i])return t;let n=""+e[i];return"RepresentationID"===i||(s=r?parseInt(s,10):1,n.length>=s)?n:`${Array(s-n.length+1).join("0")}${n}`})(t)),eD=(e,t)=>{let i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:r={sourceURL:"",range:""}}
1=e,s=es({baseUrl:e.baseUrl,source:eI(r.sourceURL,i),range:r.range});return((e,t)=>e.duration||t?e.duration?eo(e):ek(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}])(e,t).map(t=>{i.Number=t.number,i.Time=t.time;let r=eI(e.media||"",i),n=e.timescale||1,a=e.presentationTimeOffset||0,o=e.periodStart+(t.time-a)/n;return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:m(e.baseUrl||"",r),map:s,number:t.number,presentationTime:o}})},eP=(e,t)=>{let i,{duration:r,segmentUrls:s=[],periodStart:n}=e;if(!r&&!t||r&&t)throw Error(er.SEGMENT_TIME_UNSPECIFIED);let a=s.map(t=>((e,t)=>{let{baseUrl:i,initialization:r={}}=e,s=es({baseUrl:i,source:r.sourceURL,range:r.range}),n=es({baseUrl:i,source:t.media,range:t.mediaRange});return n.map=s,n})(e,t));return r&&(i=eo(e)),t&&(i=ek(e,t)),i.map((t,i)=>{if(a[i]){let r=a[i],s=e.timescale||1,o=e.presentationTimeOffset||0;return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r.presentationTime=n+(t.time-o)/s,r}}).filter(e=>e)},eL=e=>{let t,i,{attributes:r,segmentInfo:s}=e;s.template?(i=eD,t=J(r,s.template)):s.base?(i=el,t=J(r,s.base)):s.list&&(i=eP,t=J(r,s.list));let n={attributes:r};if(!i)return n;let a=i(t,s.segmentTimeline);if(t.duration){let{duration:e,timescale:i=1}=t;t.duration=e/i}else a.length?t.duration=a.reduce((e,t)=>Math.max(e,Math.ceil(t.duration)),0):t.duration=0;return n.attributes=t,n.segments=a,s.base&&t.indexRange&&(n.sidx=a[0],n.segments=[]),n},eR=(e,t)=>ei(e.childNodes).filter(e=>{let{tagName:i}=e;return i===t}),eM=e=>e.textContent.trim(),eO=e=>{let t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;let[i,r,s,n,a,o]=t.slice(1);return 31536e3*parseFloat(i||0)+2592e3*parseFloat(r||0)+86400*parseFloat(s||0)+3600*parseFloat(n||0)+60*parseFloat(a||0)+parseFloat(o||0)},eN={mediaPresentationDuration:e=>eO(e),availabilityStartTime:e=>(e=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),Date.parse(e)))(e)/1e3,minimumUpdatePeriod:e=>eO(e),suggestedPresentationDelay:e=>eO(e),type:e=>e,timeShiftBufferDepth:e=>eO(e),start:e=>eO(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>parseFloat(e.split("/").reduce((e,t)=>e/t)),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){let t=parseInt(e,10);return isNaN(t)?eO(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),presentationTime:e=>parseInt(e,10),DEFAULT:e=>e},ej=e=>e&&e.attributes?ei(e.attributes).reduce((e,t)=>{let i=eN[t.name]||eN.DEFAULT;return e[t.name]=i(t.value),e},{}):{},eU={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},eB=(e,t)=>t.length?et(e.map(function(e){return t.map(function(t){let i=eM(t),r=m(e.baseUrl,i),s=J(ej(t),{baseUrl:r});return r!==i&&!s.serviceLocation&&e.serviceLocation&&(s.serviceLocation=e.serviceLocation),s})})):e,eF=e=>{let t=eR(e,"SegmentTemplate")[0],i=eR(e,"SegmentList")[0],r=i&&eR(i,"SegmentURL").map(e=>J({tag:"SegmentURL"},ej(e))),s=eR(e,"SegmentBase")[0],n=i||t,a=n&&eR(n,"SegmentTimeline")[0],o=i||s||t,l=o&&eR(o,"Initialization")[0],d=t&&ej(t);d&&l?d.initialization=l&&ej(l):d&&d.initialization&&(d.initialization={sourceURL:d.initialization});let u={template:d,segmentTimeline:a&&eR(a,"S").map(e=>ej(e)),list:i&&J(ej(i),{segmentUrls:r,initialization:ej(l)}),base:s&&J(ej(s),{initialization:ej(l)})};return Object.keys(u).forEach(e=>{u[e]||delete u[e]}),u},eq=e=>et(eR(e.node,"EventStream").map(t=>{let i=ej(t),r=i.schemeIdUri;return eR(t,"Event").map(t=>{let s=ej(t),n=s.presentationTime||0,a=i.timescale||1,o=s.duration||0,l=n/a+e.attributes.start;return{schemeIdUri:r,value:i.value,id:s.id,start:l,end:l+o/a,messageData:eM(t)||s.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}})})),eV=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{manifestUri:i="",NOW:r=Date.now(),clientOffset:s=0,eventHandler:n=function(){}}=t,a=eR(e,"Period");
1if(!a.length)throw Error(er.INVALID_NUMBER_OF_PERIOD);let o=eR(e,"Location"),l=ej(e),d=eB([{baseUrl:i}],eR(e,"BaseURL")),u=eR(e,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=r,l.clientOffset=s,o.length&&(l.locations=o.map(eM));let h=[];return a.forEach((e,t)=>{let i=ej(e),r=h[t-1];i.start=(e=>{let{attributes:t,priorPeriodAttributes:i,mpdType:r}=e;return"number"==typeof t.start?t.start:i&&"number"==typeof i.start&&"number"==typeof i.duration?i.start+i.duration:i||"static"!==r?null:0})({attributes:i,priorPeriodAttributes:r?r.attributes:null,mpdType:l.type}),h.push({node:e,attributes:i})}),{locations:l.locations,contentSteeringInfo:((e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;let i=J({serverURL:eM(e[0])},ej(e[0]));return i.queryBeforeStart="true"===i.queryBeforeStart,i})(u,n),representationInfo:et(h.map((e,t)=>{let i=eB(d,eR(e.node,"BaseURL")),r=J(l,{periodStart:e.attributes.start});"number"==typeof e.attributes.duration&&(r.periodDuration=e.attributes.duration);let s=eR(e.node,"AdaptationSet"),n=eF(e.node);return et(s.map(e=>{var t;let s,a=ej(e),o=eB(i,eR(e,"BaseURL")),l=J(r,a,{role:ej(eR(e,"Role")[0])}),d="urn:scte:dash:cc:cea-608:2015"===(t=ej(eR(e,"Accessibility")[0])).schemeIdUri?("string"!=typeof t.value?[]:t.value.split(";")).map(e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}}):"urn:scte:dash:cc:cea-708:2015"===t.schemeIdUri?("string"!=typeof t.value?[]:t.value.split(";")).map(e=>{let t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){let[i,r=""]=e.split("=");t.channel=i,t.language=e,r.split(",").forEach(e=>{let[i,r]=e.split(":");"lang"===i?t.language=r:"er"===i?t.easyReader=Number(r):"war"===i?t.aspectRatio=Number(r):"3D"===i&&(t["3D"]=Number(r))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t}):void 0;d&&(l=J(l,{captionServices:d}));let u=eR(e,"Label")[0];u&&u.childNodes.length&&(l=J(l,{label:u.childNodes[0].nodeValue.trim()}));let h=eR(e,"ContentProtection").reduce((e,t)=>{let i=ej(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());let r=eU[i.schemeIdUri];if(r){e[r]={attributes:i};let s=eR(t,"cenc:pssh")[0];if(s){let t=eM(s);e[r].pssh=t&&y(t)}}return e},{});Object.keys(h).length&&(l=J(l,{contentProtection:h}));let c=eF(e),p=eR(e,"Representation"),m=J(n,c);return et(p.map((s=l,e=>{let t=eB(o,eR(e,"BaseURL")),i=J(s,ej(e)),r=eF(e);return t.map(e=>({segmentInfo:J(m,r),attributes:J(i,e)}))})))}))})),eventStream:et(h.map(eq))}},e$=e=>{let t,i;if(""===e)throw Error(er.DASH_EMPTY_MANIFEST);let r=new Q.DOMParser;try{i=(t=r.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw Error(er.DASH_INVALID_XML);return i},eH=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=eV(e$(e),t);return(e=>{var t;let{dashPlaylists:i,locations:r,contentSteering:s,sidxMapping:n={},previousManifest:a,eventStream:o}=e;if(!i.length)return{};let{sourceDuration:l,type:d,suggestedPresentationDelay:u,minimumUpdatePeriod:h}=i[0].attributes,c=eg(i.filter(eA)).map(eT),p=eg(i.filter(eS)),m=eg(i.filter(eE)),f=i.map(e=>e.attributes.captionServices).filter(Boolean),g={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:l,playlists:e_(c,n)};h>=0&&(g.minimumUpdatePeriod=1e3*h),r&&(g.locations=r),s&&(g.contentSteering=s),"dynamic"===d&&(g.suggestedPresentationDelay=u),o&&o.length>0&&(g.eventStream=o);let y=0===g.playlists.length,_=p.length?ev(p,n,y):null,v=m.length?eb(m,n):null,b=c.concat(eC(_),eC(v));return g.timelineStarts=ec(b.map(e=>{let{timelineStarts:t}=e;return t})),t=g.timelineStarts,b.forEach(e=>{e.mediaSequence=0,e.discontinuitySequence=t.findIndex(function(t){let{timeline:i}=t;return i===e.timeline}),e.segments&&e.segments.forEach((e,t)=>{e.number=t})}),_&&(g.mediaGroups.AUDIO.audio=_),v&&(g.mediaGroups.SUBTITLES.subs=v),(f.length&&(g.mediaGroups["CLOSED-CAPTIONS"].cc=f.reduce((e,t)=>
1(t&&t.forEach(t=>{let{channel:i,language:r}=t;e[r]={autoselect:!1,default:!1,instreamId:i,language:r},t.hasOwnProperty("aspectRatio")&&(e[r].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[r].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[r]["3D"]=t["3D"])}),e),{})),a)?(e=>{let{oldManifest:t,newManifest:i}=e,r=t.playlists.concat(ep(t)),s=i.playlists.concat(ep(i));return i.timelineStarts=ec([t.timelineStarts,i.timelineStarts]),(e=>{let{oldPlaylists:t,newPlaylists:i,timelineStarts:r}=e;i.forEach(e=>{e.discontinuitySequence=r.findIndex(function(t){let{timeline:i}=t;return i===e.timeline});let i=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null})(t,e.attributes.NAME);if(!i||e.sidx)return;let s=e.segments[0],n=i.segments.findIndex(function(e){return Math.abs(e.presentationTime-s.presentationTime)<eh});if(-1===n){em({playlist:e,mediaSequence:i.mediaSequence+i.segments.length}),e.segments[0].discontinuity=!0,e.discontinuityStarts.unshift(0),(!i.segments.length&&e.timeline>i.timeline||i.segments.length&&e.timeline>i.segments[i.segments.length-1].timeline)&&e.discontinuitySequence--;return}i.segments[n].discontinuity&&!s.discontinuity&&(s.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),em({playlist:e,mediaSequence:i.segments[n].number})})})({oldPlaylists:r,newPlaylists:s,timelineStarts:i.timelineStarts}),i})({oldManifest:a,newManifest:g}):g})({dashPlaylists:i.representationInfo.map(eL),locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})};var ez=e.i(722277),eW=q([73,68,51]),eG=function(e,t){void 0===t&&(t=0);var i=(e=q(e))[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&i)>>4?r+20:r+10},eX=function e(t,i){return(void 0===i&&(i=0),(t=q(t)).length-i<10||!Y(t,eW,{offset:i}))?i:(i+=eG(t,i),e(t,i))};new Uint8Array([79,112,117,115,72,101,97,100]);var eY=function(e){return"string"==typeof e?G(e):e},eK=function(e){e=q(e);for(var t=[],i=0;e.length>i;){var r=e[i],s=0,n=0,a=e[++n];for(n++;128&a;)s=(127&a)<<7,a=e[n],n++;s+=127&a;for(var l=0;l<o.length;l++){var d=o[l],u=d.id,h=d.parser;if(r===u){t.push(h(e.subarray(n,n+s)));break}}i+=s+n}return t};o=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var i=e[t.size];t.url=W(e.subarray(t.size+1,t.size+1+i)),t.size+=i}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=eK(e.subarray(t.size))||[],t}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:eK(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var eQ=function e(t,i,r){void 0===r&&(r=!1),i=Array.isArray(s=i)?s.map(function(e){return eY(e)}):[eY(s)],t=q(t);var s,n=[];if(!i.length)return n;for(var a=0;a<t.length;){var o=(t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3])>>>0,l=t.subarray(a+4,a+8);if(0===o)break;var d=a+o;if(d>t.length){if(r)break;d=t.length}var u=t.subarray(a+8,d);Y(l,i[0])&&(1===i.length?n.push(u):n.push.apply(n,e(u,i.slice(1),r))),a=d}return n},eZ={EBML:q([26,69,223,163]),DocType:q([66,130]),Segment:q([24,83,128,103]),SegmentInfo:q([21,73,169,102]),Tracks:q([22,84,174,107]),Track:q([174]),TrackNumber:q([215]),DefaultDuration:q([35,227,131]),TrackEntry:q([174]),TrackType:q([131]),FlagDefault:q([136]),CodecID:q([134]),CodecPrivate:q([99,162]),VideoTrack:q([224]),AudioTrack:q([225]),Cluster:q([31,67,182,117]),Timestamp:q([231]),TimestampScale:q([42,215,177]),BlockGroup:q([160]),BlockDuration:q([155]),Block:q([161]),SimpleBlock:q([163])},eJ=[128,64,32,16,8,4,2,1],e0=function(e){for(var t=1,i=0;i<eJ.length&&!(e&eJ[i]);i++)t++;return t},e1=function(e,t,i,r){void 0===i&&(i=!0),void 0===r&&(r=!1);var s=e0(e[t]),n=e.subarray(t,t+s);return i&&(n=Array.prototype.slice.call(e,t,t+s),n[0]^=eJ[s-1]),{length:s,value:H(n,{signed:r}),bytes:n}},e2=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map(function(t){return e(t)}):"number"==typeof t?z(t):t},e4=function e(t,i,r){if(r>=i.length)return i.length;var s=e1(i,r,!1);if(Y(t.bytes,s.bytes))return r;var n=e1(i,r+s.length);return e(t,i,r+n.length+n.value+s.length)},e5=function e(t,i){i=Array.isArray(r=i)?r.map(function(e){return e2(e)}):[e2(r)],t=q(t);var r,s=[];if(!i.length)return s;for(var n=0;n<t.length;){var a=e1(t,n,!1),o=e1(t,n+a.length),l=n+a.length+o.length;127===o.value&&(o.value=e4(a,t,l),o.value!==t.length&&(o.value-=l));var d=l+o.value>
1t.length?t.length:l+o.value,u=t.subarray(l,d);Y(i[0],a.bytes)&&(1===i.length?s.push(u):s=s.concat(e(u,i.slice(1)))),n+=a.length+o.length+u.length}return s},e8=q([0,0,0,1]),e3=q([0,0,1]),e6=q([0,0,3]),e7=function(e){for(var t=[],i=1;i<e.length-2;)Y(e.subarray(i,i+3),e6)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var r=e.length-t.length,s=new Uint8Array(r),n=0;for(i=0;i<r;n++,i++)n===t[0]&&(n++,t.shift()),s[i]=e[n];return s},e9=function(e,t,i,r){void 0===r&&(r=1/0),e=q(e),i=[].concat(i);for(var s,n=0,a=0;n<e.length&&(a<r||s);){var o=void 0;if(Y(e.subarray(n),e8)?o=4:Y(e.subarray(n),e3)&&(o=3),!o){n++;continue}if(a++,s)return e7(e.subarray(s,n));var l=void 0;"h264"===t?l=31&e[n+o]:"h265"===t&&(l=e[n+o]>>1&63),-1!==i.indexOf(l)&&(s=n+o),n+=o+("h264"===t?1:2)}return e.subarray(0,0)},te={webm:q([119,101,98,109]),matroska:q([109,97,116,114,111,115,107,97]),flac:q([102,76,97,67]),ogg:q([79,103,103,83]),ac3:q([11,119]),riff:q([82,73,70,70]),avi:q([65,86,73]),wav:q([87,65,86,69]),"3gp":q([102,116,121,112,51,103]),mp4:q([102,116,121,112]),fmp4:q([115,116,121,112]),mov:q([102,116,121,112,113,116]),moov:q([109,111,111,118]),moof:q([109,111,111,102])},tt={aac:function(e){var t=eX(e);return Y(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=eX(e);return Y(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){return Y(e5(e,[eZ.EBML,eZ.DocType])[0],te.webm)},mkv:function(e){return Y(e5(e,[eZ.EBML,eZ.DocType])[0],te.matroska)},mp4:function(e){return!(tt["3gp"](e)||tt.mov(e))&&(!!(Y(e,te.mp4,{offset:4})||Y(e,te.fmp4,{offset:4})||Y(e,te.moof,{offset:4})||Y(e,te.moov,{offset:4}))||void 0)},mov:function(e){return Y(e,te.mov,{offset:4})},"3gp":function(e){return Y(e,te["3gp"],{offset:4})},ac3:function(e){var t=eX(e);return Y(e,te.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=eX(e);return Y(e,te.flac,{offset:t})},ogg:function(e){return Y(e,te.ogg)},avi:function(e){return Y(e,te.riff)&&Y(e,te.avi,{offset:8})},wav:function(e){return Y(e,te.riff)&&Y(e,te.wav,{offset:8})},h264:function(e){return e9(e,"h264",7,3).length},h265:function(e){return e9(e,"h265",[32,33],3).length}},ti=Object.keys(tt).filter(function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e}).concat(["ts","h264","h265"]);ti.forEach(function(e){var t=tt[e];tt[e]=function(e){return t(q(e))}});var tr=function(e){e=q(e);for(var t=0;t<ti.length;t++){var i=ti[t];if(tt[i](e))return i}return""},ts=e.i(98124),tn="8.23.6";let ta={},to=function(e,t){return ta[e]=ta[e]||[],t&&(ta[e]=ta[e].concat(t)),ta[e]},tl=function(e,t){let i=to(e).indexOf(t);return!(i<=-1)&&(ta[e]=ta[e].slice(),ta[e].splice(i,1),!0)},td={prefixed:!0},tu=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],th=tu[0];for(let e=0;e<tu.length;e++)if(tu[e][1]in d.default){t=tu[e];break}if(t){for(let e=0;e<t.length;e++)td[th[e]]=t[e];td.prefixed=t[0]!==th[0]}let tc=[],tp=function e(t){let i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n="info";function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];i("log",n,t)}return i=(e,i,r)=>{let n=a.levels[i],o=RegExp(`^(${n})$`),d=t;if("log"!==e&&r.unshift(e.toUpperCase()+":"),s&&(d=`%c${t}`,r.unshift(s)),r.unshift(d+":"),tc){tc.push([].concat(r));let e=tc.length-1e3;tc.splice(0,e>0?e:0)}if(!l.default.console)return;let u=l.default.console[e];u||"debug"!==e||(u=l.default.console.info||l.default.console.log),u&&n&&o.test(e)&&u[Array.isArray(r)?"apply":"call"](l.default.console,r)},a.createLogger=(i,n,a)=>{let o=void 0!==n?n:r;return e(`${t} ${o} ${i}`,o,void 0!==a?a:s)},a.createNewLogger=(t,i,r)=>e(t,i,r),a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},a.level=e=>{if("string"==typeof e){if(!a.levels.hasOwnProperty(e))throw Error(`"${e}" in not a valid log level`);n=e}return n},a.history=()=>tc?[].concat(tc):[],a.history.filter=e=>(tc||[]).filter(t=>RegExp(`.*${e}.*`).test(t[0])),a.history.clear=()=>{tc&&(tc.length=0)},a.history.disable=()=>{null!==tc&&(tc.length=0,tc=null)},a.history.enable=()=>{null===tc&&(tc=[])},a.error=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("error",n,t)},a.warn=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("warn",n,t)},a.debug=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("debug",n,t)},a}("VIDEOJS"),tm=tp.createLogger,tf=Object.prototype.toString,tg=function(e){return tv(e)?Object.keys(e):[]};function ty(e,t){tg(e).forEach(i=>
1t(e[i],i))}function t_(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return tg(e).reduce((i,r)=>t(i,e[r],r),i)}function tv(e){return!!e&&"object"==typeof e}function tb(e){return tv(e)&&"[object Object]"===tf.call(e)&&e.constructor===Object}function tT(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];let r={};return t.forEach(e=>{e&&ty(e,(e,t)=>{if(!tb(e)){r[t]=e;return}tb(r[t])||(r[t]={}),r[t]=tT(r[t],e)})}),r}function tA(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[];for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t.push(r)}return t}function tS(e,t,i){let r=!(arguments.length>3)||void 0===arguments[3]||arguments[3],s=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){let e=i();return s(e),e}};return r&&(n.set=s),Object.defineProperty(e,t,n)}var tE=Object.freeze({__proto__:null,each:ty,reduce:t_,isObject:tv,isPlain:tb,merge:tT,values:tA,defineLazyProperty:tS});let tC=!1,tw=null,tk=!1,tx=!1,tI=!1,tD=!1,tP=!1,tL=null,tR=null,tM=!!(l.default.cast&&l.default.cast.framework&&l.default.cast.framework.CastReceiverContext),tO=null,tN=!1,tj=!1,tU=!1,tB=!1,tF=!1,tq=!1,tV=!1,t$=!!(tY()&&("ontouchstart"in l.default||l.default.navigator.maxTouchPoints||l.default.DocumentTouch&&l.default.document instanceof l.default.DocumentTouch)),tH=l.default.navigator&&l.default.navigator.userAgentData;if(tH&&tH.platform&&tH.brands&&(tk="Android"===tH.platform,tI=!!tH.brands.find(e=>"Microsoft Edge"===e.brand),tD=!!tH.brands.find(e=>"Chromium"===e.brand),tP=!tI&&tD,tL=tR=(tH.brands.find(e=>"Chromium"===e.brand)||{}).version||null,tj="Windows"===tH.platform),!tD){let e=l.default.navigator&&l.default.navigator.userAgent||"";tC=/iPod/i.test(e),tw=function(){let t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),tk=/Android/i.test(e),i=function(){let t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;let i=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);return i&&r?parseFloat(t[1]+"."+t[2]):i||null}(),tx=/Firefox/i.test(e),tI=/Edg/i.test(e),tD=/Chrome/i.test(e)||/CriOS/i.test(e),tP=!tI&&tD,tL=tR=function(){let t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),tO=function(){let t=/MSIE\s(\d+)\.\d/.exec(e),i=t&&parseFloat(t[1]);return!i&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(i=11),i}(),tF=/Tizen/i.test(e),tq=/Web0S/i.test(e),tV=tF||tq,tN=/Safari/i.test(e)&&!tP&&!tk&&!tI&&!tV,tj=/Windows/i.test(e),tU=/iPad/i.test(e)||tN&&t$&&!/iPhone/i.test(e),tB=/iPhone/i.test(e)&&!tU}let tz=tB||tU||tC,tW=(tN||tz)&&!tP;var tG=Object.freeze({__proto__:null,get IS_IPOD(){return tC},get IOS_VERSION(){return tw},get IS_ANDROID(){return tk},get ANDROID_VERSION(){return i},get IS_FIREFOX(){return tx},get IS_EDGE(){return tI},get IS_CHROMIUM(){return tD},get IS_CHROME(){return tP},get CHROMIUM_VERSION(){return tL},get CHROME_VERSION(){return tR},IS_CHROMECAST_RECEIVER:tM,get IE_VERSION(){return tO},get IS_SAFARI(){return tN},get IS_WINDOWS(){return tj},get IS_IPAD(){return tU},get IS_IPHONE(){return tB},get IS_TIZEN(){return tF},get IS_WEBOS(){return tq},get IS_SMART_TV(){return tV},TOUCH_ENABLED:t$,IS_IOS:tz,IS_ANY_SAFARI:tW});function tX(e){return"string"==typeof e&&!!e.trim()}function tY(){return d.default===l.default.document}function tK(e){return tv(e)&&1===e.nodeType}function tQ(){try{return l.default.parent!==l.default.self}catch(e){return!0}}function tZ(e){return function(t,i){if(!tX(t))return d.default[e](null);tX(i)&&(i=d.default.querySelector(i));let r=tK(i)?i:d.default;return r[e]&&r[e](t)}}function tJ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0,s=d.default.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){let i=t[e];"textContent"===e?t0(s,i):(s[e]!==i||"tabIndex"===e)&&(s[e]=i)}),Object.getOwnPropertyNames(i).forEach(function(e){s.setAttribute(e,i[e])}),r&&iu(s,r),s}
1function t0(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function t1(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function t2(e,t){if(t.indexOf(" ")>=0)throw Error("class has illegal whitespace characters");return e.classList.contains(t)}function t4(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return e.classList.add(...i.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function t5(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return e?(e.classList.remove(...i.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(tp.warn("removeClass was called with an element that doesn't exist"),null)}function t8(e,t,i){return"function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=void 0),t.split(/\s+/).forEach(t=>e.classList.toggle(t,i)),e}function t3(e,t){Object.getOwnPropertyNames(t).forEach(function(i){let r=t[i];null==r||!1===r?e.removeAttribute(i):e.setAttribute(i,!0===r?"":r)})}function t6(e){let t={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){let r=e.attributes;for(let e=r.length-1;e>=0;e--){let s=r[e].name,n=r[e].value;i.includes(s)&&(n=null!==n),t[s]=n}}return t}function t7(e,t){return e.getAttribute(t)}function t9(e,t,i){e.setAttribute(t,i)}function ie(e,t){e.removeAttribute(t)}function it(){d.default.body.focus(),d.default.onselectstart=function(){return!1}}function ii(){d.default.onselectstart=function(){return!0}}function ir(e){if(e&&e.getBoundingClientRect&&e.parentNode){let t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(e=>{void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(ig(e,"height"))),i.width||(i.width=parseFloat(ig(e,"width"))),i}}function is(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};let t=e.offsetWidth,i=e.offsetHeight,r=0,s=0;for(;e.offsetParent&&e!==d.default[td.fullscreenElement];)r+=e.offsetLeft,s+=e.offsetTop,e=e.offsetParent;return{left:r,top:s,width:t,height:i}}function ia(e,t){let i={x:0,y:0};if(tz){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){let e=ig(t,"transform");
1if(/^matrix/.test(e)){let t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5]}else if(/^matrix3d/.test(e)){let t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13]}if(t.assignedSlot&&t.assignedSlot.parentElement&&l.default.WebKitCSSMatrix){let e=l.default.getComputedStyle(t.assignedSlot.parentElement).transform,r=new l.default.WebKitCSSMatrix(e);i.x+=r.m41,i.y+=r.m42}t=t.parentNode||t.host}}let r={},s=is(t.target),n=is(e),a=n.width,o=n.height,d=t.offsetY-(n.top-s.top),u=t.offsetX-(n.left-s.left);return t.changedTouches&&(u=t.changedTouches[0].pageX-n.left,d=t.changedTouches[0].pageY+n.top,tz&&(u-=i.x,d-=i.y)),r.y=1-Math.max(0,Math.min(1,d/o)),r.x=Math.max(0,Math.min(1,u/a)),r}function io(e){return tv(e)&&3===e.nodeType}function il(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function id(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>("function"==typeof e&&(e=e()),tK(e)||io(e))?e:"string"==typeof e&&/\S/.test(e)?d.default.createTextNode(e):void 0).filter(e=>e)}function iu(e,t){return id(t).forEach(t=>e.appendChild(t)),e}function ih(e,t){return iu(il(e),t)}function ic(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||"mousedown"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}let ip=tZ("querySelector"),im=tZ("querySelectorAll");function ig(e,t){if(!e||!t)return"";if("function"==typeof l.default.getComputedStyle){let i;try{i=l.default.getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}return""}function iy(e){[...d.default.styleSheets].forEach(t=>{try{let i=[...t.cssRules].map(e=>e.cssText).join(""),r=d.default.createElement("style");r.textContent=i,e.document.head.appendChild(r)}catch(r){let i=d.default.createElement("link");i.rel="stylesheet",i.type=t.type,i.media=t.media.mediaText,i.href=t.href,e.document.head.appendChild(i)}})}var i_=Object.freeze({__proto__:null,isReal:tY,isEl:tK,isInFrame:tQ,createEl:tJ,textContent:t0,prependTo:t1,hasClass:t2,addClass:t4,removeClass:t5,toggleClass:t8,setAttributes:t3,getAttributes:t6,getAttribute:t7,setAttribute:t9,removeAttribute:ie,blockTextSelection:it,unblockTextSelection:ii,getBoundingClientRect:ir,findPosition:is,getPointerPosition:ia,isTextNode:io,emptyEl:il,normalizeContent:id,appendContent:iu,insertContent:ih,isSingleLeftClick:ic,$:ip,$$:im,computedStyle:ig,copyStyleSheetsToWindow:iy});let iv=!1,ib=function(){if(!1===r.options.autoSetup)return;let e=Array.prototype.slice.call(d.default.getElementsByTagName("video")),t=Array.prototype.slice.call(d.default.getElementsByTagName("audio")),i=Array.prototype.slice.call(d.default.getElementsByTagName("video-js")),s=e.concat(t,i);if(s&&s.length>0)for(let e=0,t=s.length;e<t;e++){let t=s[e];if(t&&t.getAttribute)void 0===t.player&&null!==t.getAttribute("data-setup")&&r(t);else{iT(1);break}}else iv||iT(1)};function iT(e,t){tY()&&(t&&(r=t),l.default.setTimeout(ib,e))}function iA(){iv=!0,l.default.removeEventListener("load",iA)}tY()&&("complete"===d.default.readyState?iA():l.default.addEventListener("load",iA));let iS=function(e){let t=d.default.createElement("style");return t.className=e,t},iE=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var iC=new WeakMap;let iw=3;function ik(e,t){if(!iC.has(e))return;let i=iC.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&iC.delete(e)}function ix(e,t,i,r){i.forEach(function(i){e(t,i,r)})}function iI(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){let r=e||l.default.event;e={};let s=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(let t in r)s.includes(t)||"returnValue"===t&&r.preventDefault||(e[t]=r[t]);if(e.target||(e.target=e.srcElement||d.default),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){let t=d.default.documentElement,i=d.default.body;e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}let iD=function(){if("boolean"!=typeof s){s=!1;try{let e=Object.defineProperty({},"passive",{get(){s=!0}});l.default.addEventListener("test",null,e),l.default.removeEventListener("test",null,e)}catch(e){}}return s},iP=["touchstart","touchmove"];function iL(e,t,i){if(Array.isArray(t))return ix(iL,e,t,i);iC.has(e)||iC.set(e,{});let r=iC.get(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),i.guid||(i.guid=iw++),r.handlers[t].push(i),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,i){if(r.disabled)return;t=iI(t);let s=r.handlers[t.type];if(s){let r=s.slice(0);for(let s=0,n=r.length;s<n;s++)if(t.isImmediatePropagationStopped())break;else try{r[s].call(e,t,i)}catch(e){tp.error(e)}}}),1===r.handlers[t].length)if(e.addEventListener){let i=!1;iD()&&iP.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,r.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function iR(e,t,i){if(!iC.has(e))return;let r=iC.get(e);if(!r.handlers)return;if(Array.isArray(t))return ix(iR,e,t,i);let s=function(e,t){r.handlers[t]=[],ik(e,t)};if(void 0===t){for(let t in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},t)&&s(e,t);return}let n=r.handlers[t];if(n){if(!i)return void s(e,t);if(i.guid)for(let e=0;e<n.length;e++)n[e].guid===i.guid&&n.splice(e--,1);ik(e,t)}}function iM(e,t,i){let r=iC.has(e)?iC.get(e):{},s=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=iI(t),r.dispatcher&&r.dispatcher.call(e,t,i),s&&!t.isPropagationStopped()&&!0===t.bubbles)iM.call(null,s,t,i);else if(!s&&!t.defaultPrevented&&t.target&&t.target[t.type]){iC.has(t.target)||iC.set(t.target,{});let e=iC.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function iO(e,t,i){if(Array.isArray(t))return ix(iO,e,t,i);let r=function(){iR(e,t,r),i.apply(this,arguments)};r.guid=i.guid=i.guid||iw++,iL(e,t,r)}function iN(e,t,i){let r=function(){iR(e,t,r),i.apply(this,arguments)};r.guid=i.guid=i.guid||iw++,iL(e,t,r)}var ij=Object.freeze({__proto__:null,fixEvent:iI,on:iL,off:iR,trigger:iM,one:iO,any:iN});let iU=function(e,t,i){t.guid||(t.guid=iw++);let r=t.bind(e);return r.guid=i?i+"_"+t.guid:t.guid,r},iB=function(e,t){let i=l.default.performance.now();return function(){for(var r=arguments.length,s=Array(r),n=0;n<r;n++)s[n]=arguments[n];let a=l.default.performance.now();a-i>=t&&(e(...s),i=a)}},iF=function(e,t,i){let r,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.default,n=function(){let n=this,a=arguments,o=function(){r=null,o=null,i||e.apply(n,a)};!r&&i&&e.apply(n,a),s.clearTimeout(r),r=s.setTimeout(o,t)};return n.cancel=()=>{s.clearTimeout(r),r=null},n};var iq=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:iU,throttle:iB,debounce:iF});class iV{on(e,t){let i=this.addEventListener;this.addEventListener=()=>{},iL(this,e,t),this.addEventListener=i}off(e,t){iR(this,e,t)}
1one(e,t){let i=this.addEventListener;this.addEventListener=()=>{},iO(this,e,t),this.addEventListener=i}any(e,t){let i=this.addEventListener;this.addEventListener=()=>{},iN(this,e,t),this.addEventListener=i}trigger(e){let t=e.type||e;"string"==typeof e&&(e={type:t}),e=iI(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),iM(this,e)}queueTrigger(e){n||(n=new Map);let t=e.type||e,i=n.get(this);i||(i=new Map,n.set(this,i));let r=i.get(t);i.delete(t),l.default.clearTimeout(r);let s=l.default.setTimeout(()=>{i.delete(t),0===i.size&&(i=null,n.delete(this)),this.trigger(e)},0);i.set(t,s)}}iV.prototype.allowedEvents_={},iV.prototype.addEventListener=iV.prototype.on,iV.prototype.removeEventListener=iV.prototype.off,iV.prototype.dispatchEvent=iV.prototype.trigger;let i$=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,iH=e=>e instanceof iV||!!e.eventBusEl_&&["on","one","off","trigger"].every(t=>"function"==typeof e[t]),iz=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,iW=(e,t,i)=>{if(!e||!e.nodeName&&!iH(e))throw Error(`Invalid target for ${i$(t)}#${i}; must be a DOM node or evented object.`)},iG=(e,t,i)=>{if(!iz(e))throw Error(`Invalid event type for ${i$(t)}#${i}; must be a non-empty string or array.`)},iX=(e,t,i)=>{if("function"!=typeof e)throw Error(`Invalid listener for ${i$(t)}#${i}; must be a function.`)},iY=(e,t,i)=>{let r,s,n,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(r=e.eventBusEl_,t.length>=3&&t.shift(),[s,n]=t):(r=t[0],s=t[1],n=t[2]),iW(r,e,i),iG(s,e,i),iX(n,e,i),{isTargetingSelf:a,target:r,type:s,listener:n=iU(e,n)}},iK=(e,t,i,r)=>{iW(e,e,t),e.nodeName?ij[t](e,i,r):e[t](i,r)},iQ={on(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];let{isTargetingSelf:r,target:s,type:n,listener:a}=iY(this,t,"on");if(iK(s,"on",n,a),!r){let e=()=>this.off(s,n,a);e.guid=a.guid;let t=()=>this.off("dispose",e);t.guid=a.guid,iK(this,"on","dispose",e),iK(s,"on","dispose",t)}},one(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];let{isTargetingSelf:r,target:s,type:n,listener:a}=iY(this,t,"one");if(r)iK(s,"one",n,a);else{var o=this;let e=function(){for(var t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];o.off(s,n,e),a.apply(null,i)};e.guid=a.guid,iK(s,"one",n,e)}},any(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];let{isTargetingSelf:r,target:s,type:n,listener:a}=iY(this,t,"any");if(r)iK(s,"any",n,a);else{var o=this;let e=function(){for(var t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];o.off(s,n,e),a.apply(null,i)};e.guid=a.guid,iK(s,"any",n,e)}},off(e,t,i){!e||iz(e)?iR(this.eventBusEl_,e,t):(iW(e,this,"off"),iG(t,this,"off"),iX(i,this,"off"),i=iU(this,i),this.off("dispose",i),e.nodeName?(iR(e,t,i),iR(e,"dispose",i)):iH(e)&&(e.off(t,i),e.off("dispose",i)))},trigger(e,t){if(iW(this.eventBusEl_,this,"trigger"),!iz(e&&"string"!=typeof e?e.type:e))throw Error(`Invalid event type for ${i$(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return iM(this.eventBusEl_,e,t)}};function iZ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i]}else e.eventBusEl_=tJ("span",{className:"vjs-event-bus"});return Object.assign(e,iQ),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on("dispose",()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&iC.has(e)&&iC.delete(e)}),l.default.setTimeout(()=>{e.eventBusEl_=null},0)}),e}let iJ={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),ty(e,(e,i)=>{this.state[i]!==e&&((t=t||{})[i]={from:this.state[i],to:e}),this.state[i]=e}),t&&iH(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function i0(e,t){return Object.assign(e,iJ),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&iH(e)&&e.on("statechanged",e.handleStateChanged),e}let i1=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toLowerCase())},i2=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())},i4=function(e,t){return i2(e)===i2(t)};
1var i5=Object.freeze({__proto__:null,toLowerCase:i1,toTitleCase:i2,titleCaseEquals:i4});class i8{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=tT({},this.options_),t=this.options_=tT(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){let t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${iw++}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(e=>this.addClass(e)),["on","off","one","any","trigger"].forEach(e=>{this[e]=void 0}),!1!==t.evented&&(iZ(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),i0(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}dispose(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e&&(this.options_=tT(this.options_,e)),this.options_}el(){return this.el_}createEl(e,t,i){return tJ(e,t,i)}localize(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),n=s&&s[r],a=r&&r.split("-")[0],o=s&&s[a],l=i;return n&&n[e]?l=n[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,function(e,i){let r=t[i-1],s=r;return void 0===r&&(s=e),s})),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];t=t.reduce((e,t)=>e.concat(t),[]);let r=this;for(let e=0;e<t.length;e++)if(!(r=r.getChild(t[e]))||!r.getChild)return;return r}setIcon(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(!this.player_.options_.experimentalSvgIcons)return;let i="http://www.w3.org/2000/svg",r=tJ("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),s=d.default.createElementNS(i,"svg");s.setAttributeNS(null,"viewBox","0 0 512 512");let n=d.default.createElementNS(i,"use");return s.appendChild(n),n.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(s),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e){let t,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length;if("string"==typeof e){i=i2(e);let s=r.componentClass||i;r.name=i;let n=i8.getComponent(s);if(!n)throw Error(`Component ${s} does not exist`);if("function"!=typeof n)return null;t=new n(this.player_||this,r)}else t=e;if(t.parentComponent_&&t.parentComponent_.removeChild(t),this.children_.splice(s,0,t),t.parentComponent_=this,"function"==typeof t.id&&(this.childIndex_[t.id()]=t),(i=i||t.name&&i2(t.name()))&&(this.childNameIndex_[i]=t,this.childNameIndex_[i1(i)]=t),"function"==typeof t.el&&t.el()){let e=null;this.children_[s+1]&&(this.children_[s+1].el_?e=this.children_[s+1].el_:tK(this.children_[s+1])&&(e=this.children_[s+1])),this.contentEl().insertBefore(t.el(),e)}return t}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[i2(e.name())]=null,this.childNameIndex_[i1(e.name())]=null;let i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){let e=this.options_.children;if(e){let t,i=this.options_,r=e=>{let t=e.name,r=e.opts;if(void 0!==i[t]&&(r=i[t]),!1===r)return;!0===r&&(r={}),r.playerOptions=this.options_.playerOptions;let s=this.addChild(t,r);s&&(this[t]=s)},s=i8.getComponent("Tech");(t=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(e){return!t.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(t=>{let i,r;return"string"==typeof t?r=e[i=t]||this.options_[i]||{}:(i=t.name,r=t),{name:i,opts:r}}).filter(e=>
1{let t=i8.getComponent(e.opts.componentClass||i2(e.name));return t&&!s.isTech(t)}).forEach(r)}}buildCSSClass(){return""}ready(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){let e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)}$(e,t){return ip(e,t||this.contentEl())}$$(e,t){return im(e,t||this.contentEl())}hasClass(e){return t2(this.el_,e)}addClass(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];t4(this.el_,...t)}removeClass(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];t5(this.el_,...t)}toggleClass(e,t){t8(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return t7(this.el_,e)}setAttribute(e,t){t9(this.el_,e,t)}removeAttribute(e){ie(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(void 0!==t){(null===t||t!=t)&&(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:"auto"===t?this.el_.style[e]="":this.el_.style[e]=t+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;let r=this.el_.style[e],s=r.indexOf("px");return -1!==s?parseInt(r.slice(0,s),10):parseInt(this.el_["offset"+i2(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw Error("currentDimension only accepts width or height value");if(0===(t=parseFloat(t=ig(this.el_,e)))||isNaN(t)){let i=`offset${i2(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){let e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&("Tab"===e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e,t=0,i=null;this.on("touchstart",function(r){1===r.touches.length&&(i={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},t=l.default.performance.now(),e=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(i){let r=t.touches[0].pageX-i.pageX,s=t.touches[0].pageY-i.pageY;Math.sqrt(r*r+s*s)>10&&(e=!1)}});let r=function(){e=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",function(r){i=null,!0===e&&l.default.performance.now()-t<200&&(r.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){let e;if(!this.player()||!this.player().reportUserActivity)return;let t=iU(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});let i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=iU(this,e),this.clearTimersOnDispose_(),i=l.default.setTimeout(()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),l.default.clearTimeout(e)),e}setInterval(e,t){e=iU(this,e),this.clearTimersOnDispose_();let i=l.default.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),l.default.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=iU(this,e),t=l.default.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=iU(this,t);let i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),l.default.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEac
1h(e=>{let[t,i]=e;this[t].forEach((e,t)=>this[i](t))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){var t;function i(e){let t=l.default.getComputedStyle(e,null),i=t.getPropertyValue("visibility");return"none"!==t.getPropertyValue("display")&&!["hidden","collapse"].includes(i)}return e||(e=this.el()),!!(function(e){if(e.offsetWidth+e.offsetHeight+e.getBoundingClientRect().height+e.getBoundingClientRect().width===0)return!1;let t={x:e.getBoundingClientRect().left+e.offsetWidth/2,y:e.getBoundingClientRect().top+e.offsetHeight/2};if(t.x<0||t.x>(d.default.documentElement.clientWidth||l.default.innerWidth)||t.y<0||t.y>(d.default.documentElement.clientHeight||l.default.innerHeight))return!1;let i=d.default.elementFromPoint(t.x,t.y);for(;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}}(e)&&i((t=e).parentElement)&&i(t)&&"0"!==t.style.opacity&&"0px"!==l.default.getComputedStyle(t).height&&"0px"!==l.default.getComputedStyle(t).width&&1)&&(!e.parentElement||!!(e.tabIndex>=0))}static registerComponent(e,t){if("string"!=typeof e||!e)throw Error(`Illegal component name, "${e}"; must be a non-empty string.`);let i=i8.getComponent("Tech"),r=i&&i.isTech(t),s=i8===t||i8.prototype.isPrototypeOf(t.prototype);if(r||!s){let t;throw t=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",Error(`Illegal component, "${e}"; ${t}.`)}e=i2(e),i8.components_||(i8.components_={});let n=i8.getComponent("Player");if("Player"===e&&n&&n.players){let e=n.players,t=Object.keys(e);if(e&&t.length>0){for(let i=0;i<t.length;i++)if(null!==e[t[i]])throw Error("Can not register Player component after player has been created.")}}return i8.components_[e]=t,i8.components_[i1(e)]=t,t}static getComponent(e){if(e&&i8.components_)return i8.components_[e]}}function i3(e,t,i,r){var s=i.length-1;if("number"!=typeof r||r<0||r>s)throw Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${r}) is non-numeric or out of bounds (0-${s}).`);return i[r][t]}function i6(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw Error("This TimeRanges object is empty")},end(){throw Error("This TimeRanges object is empty")}}:{length:e.length,start:i3.bind(null,"start",0,e),end:i3.bind(null,"end",1,e)},l.default.Symbol&&l.default.Symbol.iterator&&(t[l.default.Symbol.iterator]=()=>(e||[]).values()),t}function i7(e,t){return Array.isArray(e)?i6(e):void 0===e||void 0===t?i6():i6([[e,t]])}i8.registerComponent("Component",i8);let i9=function(e,t){let i=Math.floor((e=e<0?0:e)%60),r=Math.floor(e/60%60),s=Math.floor(e/3600),n=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(s=r=i="-"),r=(((s=s>0||a>0?s+":":"")||n>=10)&&r<10?"0"+r:r)+":",s+r+(i=i<10?"0"+i:i)},re=i9;function rt(e){re=e}function ri(){re=i9}function rr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return re(e,t)}var rs=Object.freeze({__proto__:null,createTimeRanges:i7,createTimeRange:i7,setFormatTime:rt,resetFormatTime:ri,formatTime:rr});function rn(e,t){let i,r,s=0;if(!t)return 0;e&&e.length||(e=i7(0,0));for(let n=0;n<e.length;n++)i=e.start(n),(r=e.end(n))>t&&(r=t),s+=r-i;return s/t}function ra(e){if(e instanceof ra)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:tv(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=ra.defaultMessages[this.code]||"")}function ro(e){return null!=e&&"function"==typeof e.then}function rl(e){ro(e)&&e.then(null,e=>{})}ra.prototype.code=0,ra.prototype.message="",ra.prototype.status=null,ra.prototype.metadata=null,ra.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],ra.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},ra.MEDIA_ERR_CUSTOM=0,ra.prototype.MEDIA_ERR_CUSTOM=0,ra.MEDIA_ERR_ABORTED=1,ra.prototype.MEDIA_ERR_ABORTED=1,ra.MEDIA_ERR_NETWORK=2,ra.prototype.MEDIA_ERR_NETWORK=2,ra.MEDIA_ERR_DECODE=3,ra.prototype.MEDIA_ERR_DECODE=3,ra.MEDIA_ERR_SRC_NOT_SUPPORTED=4,ra.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,ra.MEDIA_ERR_ENCRYPTED=5,ra.prototype.MEDIA_ERR_ENCRYPTED=5;let rd=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,r)=>
1(e[i]&&(t[i]=e[i]),t),{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var ru={textTracksToJson:function(e){let t=e.$$("track"),i=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){let t=rd(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return -1===i.indexOf(e)}).map(rd))},jsonToTextTracks:function(e,t){return e.forEach(function(e){let i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>i.addCue(e))}),t.textTracks()},trackToJson:rd};let rh="vjs-modal-dialog";class rc extends i8{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=tJ("div",{className:`${rh}-content`},{role:"document"}),this.descEl_=tJ("p",{className:`${rh}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),t0(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${rh} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}let e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,!this.options_.fillAlways&&(this.hasBeenOpened_||this.hasBeenFilled_)||this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;let e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){let t=this.closeable_=!!e,i=this.getChild("closeButton");if(t&&!i){let e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){let t=this.contentEl(),i=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),ih(t,e),this.trigger("modalfill"),r?i.insertBefore(t,r):i.appendChild(t);let s=this.getChild("closeButton");s&&i.appendChild(s.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),il(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){let e=d.default.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){let t;if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),"Escape"===e.key&&this.closeable()){e.preventDefault(),this.close();return}if("Tab"!==e.key)return;let i=this.focusableEls_(),r=this.el_.querySelector(":focus");for(let e=0;e<i.length;e++)if(r===i[e]){t=e;break}d.default.activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(i[i.length-1].focus(),e.preventDefault()):e.shiftKey||t!==i.length-1||(i[0].focus(),e.preventDefault())}focusableEls_(){let e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,e=>(e instanceof l.default.HTMLAnchorElement||e instanceof l.default.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof l.default.HTMLInputElement||e instanceof l.default.HTMLSelectElement||e instanceof l.default.HTMLTextAreaElement||e instanceof l.default.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof l.default.HTMLIFrameElement||e instanceof l.default.HTMLObjectElement||e instanceof l.default.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable"))}}
1rc.prototype.options_={pauseOnOpen:!0,temporary:!0},i8.registerComponent("ModalDialog",rc);class rp extends iV{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){let t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},iH(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){(t=this[i]).off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,r=this.length;i<r;i++){let r=this[i];if(r.id===e){t=r;break}}return t}}for(let e in rp.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},rp.prototype.allowedEvents_)rp.prototype["on"+e]=null;let rm=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)};class rf extends rp{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){rm(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&rm(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,rm(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}let rg=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)};class ry extends rp{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){rg(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return -1},set(){}})}addTrack(e){e.selected&&rg(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,rg(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class r_ extends rp{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class rv{constructor(e){rv.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){let t=this.length||0,i=0,r=e.length;this.cues_=e,this.length_=e.length;let s=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<r)for(i=t;i<r;i++)s.call(this,i)}getCueById(e){let t=null;for(let i=0,r=this.length;i<r;i++){let r=this[i];if(r.id===e){t=r;break}}return t}}let rb={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},rT={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},rA={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},rS={disabled:"disabled",hidden:"hidden",showing:"showing"};class rE extends iV{constructor(e={}){super();let t={id:e.id||"vjs_track_"+iw++,kind:e.kind||"",language:e.language||""},i=e.label||"";for(let e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}let rC=function(e){return new URL(e,d.default.baseURI)},rw=function(e){return new URL(e,d.default.baseURI).href},rk=function(e){if("string"==typeof e){let t=e.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},rx=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.location;return rC(e).origin!==t.origin};var rI=Object.freeze({__proto__:null,parseUrl:rC,getAbsoluteURL:rw,getFileExtension:rk,isCrossOrigin:rx});let rD=function(e,t){let i=new l.default.WebVTT.Parser(l.default,l.default.vttjs,l.default.WebVTT.StringDecoder()),r=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){r.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),r.length>0&&(l.default.console&&l.default.console.groupCollapsed&&l.default.console.groupCollapsed(`Text Track parsing errors for ${t.src}
1`),r.forEach(e=>tp.error(e)),l.default.console&&l.default.console.groupEnd&&l.default.console.groupEnd()),i.flush()},rP=function(e,t){let i={uri:e},r=rx(e);r&&(i.cors=r);let s="use-credentials"===t.tech_.crossOrigin();s&&(i.withCredentials=s),(0,u.default)(i,iU(this,function(e,i,r){if(e)return tp.error(e,i);t.loaded_=!0,"function"!=typeof l.default.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],e=>"vttjserror"===e.type?void tp.error(`vttjs failed to load, stopping trying to process ${t.src}`):rD(r,t)):rD(r,t)}))};class rL extends rE{constructor(e={}){if(!e.tech)throw Error("A tech was not provided.");let t=tT(e,{kind:rA[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=rS[t.mode]||"disabled",r=t.default;("metadata"===t.kind||"chapters"===t.kind)&&(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;let s=new rv(this.cues_),n=new rv(this.activeCues_),a=!1;this.timeupdateHandler=iU(this,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});let o=()=>{this.stopTracking()};this.tech_.one("dispose",o),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>r,set(){}},mode:{get:()=>i,set(e){rS[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||rP(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?s:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return n;let e=this.tech_.currentTime(),t=[];for(let i=0,r=this.cues.length;i<r;i++){let r=this.cues[i];r.startTime<=e&&r.endTime>=e&&t.push(r)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(a=!0);return this.activeCues_=t,n.setCues_(this.activeCues_),n},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&rP(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){for(let i in t=new l.default.vttjs.VTTCue(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}let i=this.tech_.textTracks();for(let e=0;e<i.length;e++)i[e]!==this&&i[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return ru.trackToJson(this)}removeCue(e){let t=this.cues_.length;for(;t--;){let i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}rL.prototype.allowedEvents_={cuechange:"cuechange"};class rR extends rE{constructor(e={}){let t=tT(e,{kind:rT[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class rM extends rE{constructor(e={}){let t=tT(e,{kind:rb[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class rO extends iV{constructor(e={}){let t;super();let i=new rL(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=rO.NONE,i.addEventListener("loadeddata",()=>{t=rO.LOADED,this.trigger({type:"load",target:this})})}}rO.prototype.allowedEvents_={load:"load"},rO.NONE=0,rO.LOADING=1,rO.LOADED=2,rO.ERROR=3;
vendor: 4,478 bytes, line 1
1let rN={audio:{ListClass:rf,TrackClass:rR,capitalName:"Audio"},video:{ListClass:ry,TrackClass:rM,capitalName:"Video"},text:{ListClass:r_,TrackClass:rL,capitalName:"Text"}};Object.keys(rN).forEach(function(e){rN[e].getterName=`${e}Tracks`,rN[e].privateName=`${e}Tracks_`});let rj={remoteText:{ListClass:r_,TrackClass:rL,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){let t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,r=this.trackElements_.length;i<r;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},TrackClass:rO,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},rU=Object.assign({},rN,rj);rj.names=Object.keys(rj),rN.names=Object.keys(rN),rU.names=[].concat(rj.names).concat(rN.names);class rB extends i8{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),rU.names.forEach(t=>{let i=rU[t];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)}),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:(!0===e.nativeCaptions||!0===e.nativeTextTracks)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new rU.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(iU(this,function(){let e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return i7(0,0)}bufferedPercent(){return rn(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(rN.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}
1clearTracks(e){(e=[].concat(e)).forEach(e=>{let t=this[`${e}Tracks`]()||[],i=t.length;for(;i--;){let r=t[i];"text"===e&&this.removeRemoteTextTrack(r),t.removeTrack(r)}})}cleanupAutoTextTracks(){let e=this.autoRemoteTextTracks_||[],t=e.length;for(;t--;){let i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new ra(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?i7(0,0):i7()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){rN.names.forEach(e=>{let t=rN[e],i=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),this.on("dispose",()=>{r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!l.default.WebVTT)if(d.default.body.contains(this.el())){if(!this.options_["vtt.js"]&&tb(h.default)&&Object.keys(h.default).length>0)return void this.trigger("vttjsloaded");let e=d.default.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),l.default.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){let e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),r=t=>e.removeTrack(t.track);t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();let s=()=>this.trigger("texttrackchange"),n=()=>{s();for(let t=0;t<e.length;t++){let i=e[t];i.removeEventListener("cuechange",s),"showing"===i.mode&&i.addEventListener("cuechange",s)}};n(),e.addEventListener("change",n),e.addEventListener("addtrack",n),e.addEventListener("removetrack",n),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",r),e.removeEventListener("change",n),e.removeEventListener("addtrack",n),e.removeEventListener("removetrack",n);for(let t=0;t<e.length;t++)e[t].removeEventListener("cuechange",s)})}addTextTrack(e,t,i){if(!e)throw Error("TextTrack kind is required but was not provided");return function(e,t,i,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},n=e.textTracks();s.kind=t,i&&(s.label=i),r&&(s.language=r),s.tech=e;let a=new rU.text.TrackClass(s);return n.addTrack(a),a}(this,e,t,i)}createRemoteTextTrack(e){let t=tT(e,{tech:this});return new rj.remoteTextEl.TrackClass(t)}addRemoteTextTrack(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,i=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===t&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){let t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){let t=iw++;return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return rB.canPlayType(e.type)}static isTech(e){return e.prototype instanceof rB||e instanceof rB||e===rB}static registerTech(e,t){if(rB.techs_||(rB.techs_={}),!rB.isTech(t))throw Error(`Tech ${e} must be a Tech`);if(!rB.canPlayType)throw Error("Techs must have a static canPlayType method on them");if(!rB.canPlaySource)throw Error("Techs must have a static canPlaySource method on them");return e=i2(e),rB.techs_[e]=t,rB.techs_[i1(e)]=t,"Tech"!==e&&rB.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(rB.techs_&&rB.techs_[e])return rB.techs_[e];
1if(e=i2(e),l.default&&l.default.videojs&&l.default.videojs[e])return tp.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),l.default.videojs[e]}}}rU.names.forEach(function(e){let t=rU[e];rB.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),rB.prototype.featuresVolumeControl=!0,rB.prototype.featuresMuteControl=!0,rB.prototype.featuresFullscreenResize=!1,rB.prototype.featuresPlaybackRate=!1,rB.prototype.featuresProgressEvents=!1,rB.prototype.featuresSourceset=!1,rB.prototype.featuresTimeupdateEvents=!1,rB.prototype.featuresNativeTextTracks=!1,rB.prototype.featuresVideoFrameCallback=!1,rB.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let r=e.sourceHandlers;r||(r=e.sourceHandlers=[]),void 0===i&&(i=r.length),r.splice(i,0,t)},e.canPlayType=function(t){let i,r=e.sourceHandlers||[];for(let e=0;e<r.length;e++)if(i=r[e].canPlayType(t))return i;return""},e.selectSourceHandler=function(t,i){let r=e.sourceHandlers||[];for(let e=0;e<r.length;e++)if(r[e].canHandleSource(t,i))return r[e];return null},e.canPlaySource=function(t,i){let r=e.selectSourceHandler(t,i);return r?r.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach(function(e){let t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},e.prototype),e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:tp.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},i8.registerComponent("Tech",rB),rB.registerTech("Tech",rB),rB.defaultTechOrder_=[];let rF={},rq={},rV={};function r$(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s="call"+i2(i),n=e.reduce(rG(s),r),a=n===rV,o=a?null:t[i](n);return function(e,t,i,r){for(let s=e.length-1;s>=0;s--){let n=e[s];n[t]&&n[t](r,i)}}(e,i,o,a),o}let rH={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},rz={setCurrentTime:1,setMuted:1,setVolume:1},rW={play:1,pause:1};function rG(e){return(t,i)=>t===rV?rV:i[e]?i[e](t):t}let rX={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},rY=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return rX[rk(e).toLowerCase()]||""},rK=function(e){if(Array.isArray(e)){let t=[];e.forEach(function(e){Array.isArray(e=rK(e))?t=t.concat(e):tv(e)&&t.push(e)}),e=t}else e="string"==typeof e&&e.trim()?[rQ({src:e})]:tv(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[rQ(e)]:[];return e};function rQ(e){if(!e.type){let t=rY(e.src);t&&(e.type=t)}return e}let rZ=tF?10009:tq?461:8,rJ={codes:{play:415,pause:19,ff:417,rw:412,back:rZ},names:{415:"play",19:"pause",417:"ff",412:"rw",[rZ]:"back"},isEventKey(e,t){return t=t.toLowerCase(),!!this.names[e.keyCode]&&this.names[e.keyCode]===t},getEventName(e){if(this.names[e.keyCode])return this.names[e.keyCode];if(this.codes[e.code]){let t=this.codes[e.code];return this.names[t]}return null}};class r0 extends iV{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}
1start(){!this.isListening_&&(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){let t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();let e=t.key.substring(5).toLowerCase();this.move(e)}else if(rJ.isEventKey(t,"play")||rJ.isEventKey(t,"pause")||rJ.isEventKey(t,"ff")||rJ.isEventKey(t,"rw")){t.preventDefault();let e=rJ.getEventName(t);this.performMediaAction_(e)}else rJ.isEventKey(t,"Back")&&e.target&&"function"==typeof e.target.closeable&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+5);break;case"rw":this.userSeek_(this.player_.currentTime()-5)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){let t=e.relatedTarget,i=null,r=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!i||!t)&&(r&&"CloseButton"===r.name()?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){let e=this.player_,t=[];function i(e){for(let r of e)r.hasOwnProperty("el_")&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())&&t.push(r),r.hasOwnProperty("children_")&&r.children_.length>0&&i(r.children_)}return e.children_.forEach(e=>{if(e.hasOwnProperty("el_"))if(e.getIsFocusable&&e.getIsAvailableToBeFocused&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el()))return void t.push(e);else e.hasOwnProperty("children_")&&e.children_.length>0?i(e.children_):e.hasOwnProperty("items")&&e.items.length>0?i(e.items):this.findSuitableDOMChild(e)&&t.push(e);if("ErrorDisplay"===e.name_&&e.opened_){let i=e.el_.querySelector(".vjs-errors-ok-button-container");i&&i.querySelectorAll("button").forEach((e,i)=>{t.push({name:()=>"ModalButton"+(i+1),el:()=>e,getPositions:()=>{let t=e.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{x:t.left+t.width/2,y:t.top+t.height/2,width:0,height:0,top:t.top+t.height/2,right:t.left+t.width/2,bottom:t.top+t.height/2,left:t.left+t.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:e=>!0,focus:()=>e.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){return e.el()?function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let e=0;e<i.children.length;e++){let r=t(i.children[e]);if(r)return r}return null}(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();let t=e||document.activeElement;if(this.focusableComponents.length){for(let e of this.focusableComponents)if(e.el()===t)return e}}add(e){let t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){let t=this.getCurrentComponent();if(!t)return;let i=t.getPositions(),r=this.focusableComponents.filter(r=>r!==t&&this.isInDirection_(i.boundingClientRect,r.getPositions().boundingClientRect,e)),s=this.findBestCandidate_(i.center,r,e);s?this.focus(s):this.trigger({type:"endOfFocusableComponents",direction:e,focu
vendor: 4,606 bytes, line 1
1sedComponent:t})}findBestCandidate_(e,t,i){let r=1/0,s=null;for(let n of t){let t=n.getPositions().center,a=this.calculateDistance_(e,t,i);a<r&&(r=a,s=n)}return s}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name())return void this.focus(this.focusableComponents[e])}else this.focus(this.updateFocusableComponents()[0])}focus(e){"object"==typeof e&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,i){let r,s=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);switch(i){case"right":case"left":r=s+100*n;break;case"up":r=2*n+.5*s;break;case"down":r=5*n+s;break;default:r=s+n}return r}searchForTrackSelect_(){for(let e of this.updateFocusableComponents())if("TextTrackSelect"===e.constructor.name){this.focus(e);break}}}i8.registerComponent("MediaLoader",class extends i8{constructor(e,t,i){if(super(e,tT({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let i=0,r=t.playerOptions.techOrder;i<r.length;i++){let t=i2(r[i]),s=rB.getTech(t);if(t||(s=i8.getComponent(t)),s&&s.isSupported()){e.loadTech_(t);break}}}});class r1 extends i8{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&tp.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;let r=tJ(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(tJ("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=tJ("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===e)return this.controlText_||"Need Text";let i=this.localize(e);this.controlText_=e,t0(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){" "===e.key||"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}i8.registerComponent("ClickableComponent",r1);class r2 extends r1{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return tJ("div",{className:"vjs-poster"})}crossOrigin(e){return void 0===e?this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null:null!==e&&"anonymous"!==e&&"use-credentials"
1!==e?void this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`):void(this.$("img")&&(this.$("img").crossOrigin=e))}update(e){let t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(tJ("picture",{className:"vjs-poster",tabIndex:-1},{},tJ("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?rl(this.player_.play()):this.player_.pause())}}r2.prototype.crossorigin=r2.prototype.crossOrigin,i8.registerComponent("PosterImage",r2);let r4="#222",r5="#ccc",r8={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function r3(e,t){let i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else if(7===e.length)i=e.slice(1);else throw Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function r6(e,t,i){try{e.style[t]=i}catch(e){return}}function r7(e){return e?`${e}px`:""}i8.registerComponent("TextTrackDisplay",class extends i8{constructor(e,t,i){super(e,t,i);let r=e=>this.updateDisplay(e),s=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",e=>this.toggleDisplay(e)),e.on("useractive",r),e.on("userinactive",r),e.on("texttrackchange",r),e.on("loadedmetadata",e=>{this.updateDisplayOverlay(),this.preselectTrack(e)}),e.ready(iU(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",s),e.on("playerresize",s);let t=l.default.screen.orientation||l.default,i=l.default.screen.orientation?"change":"orientationchange";t.addEventListener(i,s),e.on("dispose",()=>t.removeEventListener(i,s));let r=this.options_.playerOptions.tracks||[];for(let e=0;e<r.length;e++)this.player_.addRemoteTextTrack(r[e],!0);this.preselectTrack()}))}preselectTrack(){let e,t,i,r={captions:1,subtitles:1},s=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage;for(let a=0;a<s.length;a++){let o=s[a];n&&n.enabled&&n.language&&n.language===o.language&&o.kind in r?o.kind===n.kind?i=o:i||(i=o):n&&!n.enabled?(i=null,e=null,t=null):o.default&&("descriptions"!==o.kind||e?o.kind in r&&!t&&(t=o):e=o)}i?i.mode="showing":t?t.mode="showing":e&&(e.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof l.default.WebVTT&&l.default.WebVTT.processCues(l.default,[],this.el_)}updateDisplay(){let e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){let t=[];for(let i=0;i<e.length;++i){let r=e[i];"showing"===r.mode&&t.push(r)}this.updateForTrack(t);return}let i=null,r=null,s=e.length;for(;s--;){let t=e[s];"showing"===t.mode&&("descriptions"===t.kind?i=t:r=t)}if(r?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):i&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),!l.default.CSS.supports("inset","10px")){let e=this.el_,t=e.querySelectorAll(".vjs-text-track-cue"),i=this.player_.controlBar.el_.getBoundingClientRect().height,r=this.player_.el_.getBoundingClientRect().height;e.style="",r6(e,"position","relative"),r6(e,"height",r-i+"px"),r6(e,"top","unset"),tV?r6(e,"bottom",r+"px"):r6(e,"bottom","0px"),t.length>0&&t.forEach(e=>{if(e.style.inset){let t=e.style.inset.split(" ");3===t.length&&Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!l.default.CSS.supports("inset-inline: 10px"))return;let e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,r=this.player_.videoWidth()/this.player_.videoHeight(),s=0,n=0;Math.abs(i-r)>.1&&(i>r?s=Math.round((e-t*r)/2):n=Math.round((t-e/r)/2)),r6(this.el_,"insetInline",r7(s)),r6(this.el_,"insetBlock",r7(n))}updateDisplayState(e){let t=this.player_.textTrackSettings.getValues(),i=e.activeCues,r=i.length;for(;r--;){let e=i[r];if(!e)continue;let s=e.displayState;if(t.color&&(s.firstChild.style.color=t.color),t.textOpacity&&r6(s.firstChild,"color",r3(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(s.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&r6(s.firstChild,"backgroundColor",r3(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?r6(s,"backgroundColor",r3(t.windowColor,t.windowOpacity)):s.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?s.firstChild.style.textShadow=`2px 2px 3px ${r4}, 2px 2px 4px ${r4}, 2px 2px 5px ${r4}`:"raised"===t.edgeStyle?s.firstChild.style.textShadow=`1px 1px ${r4}, 2px 2px ${r4}, 3px 3px ${r4}`:"depressed"===t.edgeStyle?s.firstChild.style.textShadow=`1px 1px ${r5}, 0 1px ${r5}, -1px -1px ${r4}, 0 -1px ${r4}`:"uniform"===t.edgeStyle&&(s.firstChild.style.textShadow=`0 0 4px ${r4}, 0 0 4px ${r4}, 0 0 4px ${r4}, 0 0 4px ${r4}`)),t.fontPercent&&1!==t.fontPercent){let e=l.default.parseFloat(s.style.fontSize);s.style.fontSize=e*t.fontPercent+"px",s.style.height="auto",s.style.top="auto"}
vendor: 6,257 bytes, line 1
1t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=r8[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof l.default.WebVTT||e.every(e=>!e.activeCues))return;let t=[];for(let i=0;i<e.length;++i){let r=e[i];for(let e=0;e<r.activeCues.length;++e)t.push(r.activeCues[e])}l.default.WebVTT.processCues(l.default,t,this.el_);for(let t=0;t<e.length;++t){let i=e[t];for(let e=0;e<i.activeCues.length;++e){let r=i.activeCues[e].displayState;t4(r,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:t)),i.language&&t9(r,"lang",i.language)}this.player_.textTrackSettings&&this.updateDisplayState(i)}}}),i8.registerComponent("LoadingSpinner",class extends i8{createEl(){let e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=tJ("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(i),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class r9 extends r1{createEl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e="button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i);let r=tJ(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(tJ("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.constructor.name;return tp.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),i8.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(" "===e.key||"Enter"===e.key)return void e.stopPropagation();super.handleKeyDown(e)}}i8.registerComponent("Button",r9);class se extends r9{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",e=>this.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){let t=this.player_.play();if("tap"===e.type||this.mouseused_&&"clientX"in e&&"clientY"in e){rl(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}let i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(!r)return void this.player_.tech(!0).focus();let s=()=>r.focus();ro(t)?t.then(s,()=>{}):this.setTimeout(s,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}se.prototype.controlText_="Play Video",i8.registerComponent("BigPlayButton",se),i8.registerComponent("CloseButton",class extends r9{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class st extends r9{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",e=>this.handlePlay(e)),this.on(e,"pause",e=>this.handlePause(e)),t.replay&&this.on(e,"ended",e=>this.handleEnded(e))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?rl(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}st.prototype.controlText_="Play",i8.registerComponent("PlayToggle",st);class si extends i8{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],e=>this.update(e)),this.updateTextNode_()}createEl(){let e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=tJ("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\u00a0`},{role:"presentation"});return t.appendChild(i),this.contentEl_=tJ("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;e=rr(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,tp.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=d.default.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}si.prototype.labelText_="Time",si.prototype.controlText_="Time",i8.registerComponent("TimeDisplay",si);class sr extends si{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():e&&e.target&&"function"==typeof e.target.pendingSeekTime?e.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}sr.prototype.labelText_="Current Time",sr.prototype.controlText_="Current Time",i8.registerComponent("CurrentTimeDisplay",sr);class ss extends si{constructor(e,t){super(e,t);let i=e=>this.updateContent(e);
vendor: 7,035 bytes, line 1
1this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){let t=this.player_.duration();this.updateTextNode_(t)}}ss.prototype.labelText_="Duration",ss.prototype.controlText_="Duration",i8.registerComponent("DurationDisplay",ss),i8.registerComponent("TimeDivider",class extends i8{createEl(){let e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}});class sn extends si{constructor(e,t){super(e,t),this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){let e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(tJ("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){let t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))}}sn.prototype.labelText_="Remaining Time",sn.prototype.controlText_="Remaining Time",i8.registerComponent("RemainingTimeDisplay",sn),i8.registerComponent("LiveDisplay",class extends i8{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){let e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=tJ("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(tJ("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\u00a0`})),this.contentEl_.appendChild(d.default.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class sa extends r9{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){let e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=tJ("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function so(e,t,i){return Math.min(i,Math.max(t,isNaN(e=Number(e))?t:e))}sa.prototype.controlText_="Seek to live, currently playing live",i8.registerComponent("SeekToLive",sa);var sl=Object.freeze({__proto__:null,clamp:so});class sd extends i8{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;let e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){let t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||tP||e.preventDefault(),it(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){let t=this.bar.el_.ownerDocument;ii(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;let e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{let t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"})),e}getProgress(){return Number(so(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){let t=ia(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){let t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,r=t&&t.horizontalSeek;i?r&&"ArrowLeft"===e.key||!r&&"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&"ArrowRight"===e.key||!r&&"ArrowUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):"ArrowUp"===e.key||"ArrowRight"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}i8.registerComponent("Slider",sd);let su=(e,t)=>
1so(e/t*100,0,100).toFixed(2)+"%";i8.registerComponent("LoadProgressBar",class extends i8{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",e=>this.update(e))}createEl(){let e=super.createEl("div",{className:"vjs-load-progress"}),t=tJ("span",{className:"vjs-control-text"}),i=tJ("span",{textContent:this.localize("Loaded")}),r=d.default.createTextNode(": ");return this.percentageEl_=tJ("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{let e=this.player_.liveTracker,t=this.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),s=this.partEls_,n=su(r,i);this.percent_!==n&&(this.el_.style.width=n,t0(this.percentageEl_,n),this.percent_=n);for(let e=0;e<t.length;e++){let i=t.start(e),n=t.end(e),a=s[e];a||(a=this.el_.appendChild(tJ()),s[e]=a),(a.dataset.start!==i||a.dataset.end!==n)&&(a.dataset.start=i,a.dataset.end=n,a.style.left=su(i,r),a.style.width=su(n-i,r))}for(let e=s.length;e>t.length;e--)this.el_.removeChild(s[e-1]);s.length=t.length})}}),i8.registerComponent("TimeTooltip",class extends i8{constructor(e,t){super(e,t),this.update=iB(iU(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){let r=is(this.el_),s=ir(this.player_.el()),n=e.width*t;if(!s||!r)return;let a=e.left-s.left+n,o=e.width-n+(s.right-e.right);o||(o=e.width-n,a=n);let l=r.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>r.width&&(l=r.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(i)}write(e){t0(this.el_,e)}updateTime(e,t,i,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let s,n=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){let e=this.player_.liveTracker.liveWindow(),i=e-t*e;s=(i<1?"":"-")+rr(i,e)}else s=rr(i,n);this.update(e,t,s),r&&r()})}});class sh extends i8{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=iB(iU(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,i){let r=this.getChild("timeTooltip");if(!r)return;let s=i&&i.target&&"function"==typeof i.target.pendingSeekTime?i.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,s)}}sh.prototype.options_={children:[]},tz||tk||sh.prototype.options_.children.push("timeTooltip"),i8.registerComponent("PlayProgressBar",sh);class sc extends i8{constructor(e,t){super(e,t),this.update=iB(iU(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){let i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}}sc.prototype.options_={children:["timeTooltip"]},i8.registerComponent("MouseTimeDisplay",sc);class sp extends sd{constructor(e,t){(t=tT(sp.prototype.options_,t)).children=[...t.children];let i=e.options_.disableSeekWhileScrubbingOnMobile&&(tz||tk)||e.options_.disableSeekWhileScrubbingOnSTV;(tz||tk)&&!i||t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=iU(this,this.update),this.update=iB(this.update_,30),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in d.default&&"visibilityState"in d.default&&this.on(d.default,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===d.default.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===d.default.visibilityState)return;
1let t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{let i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker,s=this.player_.duration();r&&r.isLive()&&(s=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),(this.currentTime_!==i||this.duration_!==s)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[rr(i,s),rr(s,s)],"{1} of {2}")),this.currentTime_=i,this.duration_=s),this.bar&&this.bar.update(ir(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(void 0!==e)if(null!==e){let t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){let e;if(null!==this.pendingSeekTime())return this.pendingSeekTime()/this.player_.duration();let t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e}handleMouseDown(e){ic(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e){let t,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!ic(e)||isNaN(this.player_.duration()))return;i||this.player_.scrubbing()||this.player_.scrubbing(!0);let r=this.calculateDistance(e),s=this.player_.liveTracker;if(s&&s.isLive()){if(r>=.99)return void s.seekToLiveEdge();let e=s.seekableStart(),i=s.liveCurrentTime();if((t=e+r*s.liveWindow())>=i&&(t=i),t<=e&&(t=e+.1),t===1/0)return}else(t=r*this.player_.duration())===this.player_.duration()&&(t-=.1);this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(t):this.userSeek_(t),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();let e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();let e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?rl(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();let t=null!==this.pendingSeekTime()?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){let t=this.player_.liveTracker;if(" "===e.key||"Enter"===e.key)e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if("Home"===e.key)e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if("End"===e.key)e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();let i=.1*parseInt(e.key,10);t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else"PageDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):"PageUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in d.default&&"visibilityState"in d.default&&this.off(d.default,"visibilitychange",this.toggleVisibility_),super.dispose()}}sp.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12},i8.registerComponent("SeekBar",sp);class sm extends i8{constructor(e,t){super(e,t),this.handleMouseMove=iB(iU(this,this.handleMouseMove),30),this.throttledHandleMouseSeek=iB(iU(this,this.handleMouseSeek),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){let t=this.getChild("seekBar");if(!t)return;let i=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!i&&!r)return;let s=t.el(),n=is(s),a=ia(s,e).x;a=so(a,0,1),r&&r.update(n,a),i&&i.update(n,t.getProgress())}handleMouseSeek(e){let t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}
1disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){let e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&rl(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){let e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){let t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){let t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}sm.prototype.options_={children:["seekBar"]},i8.registerComponent("ProgressControl",sm);class sf extends r9{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!("audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()))return void this.show();this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){d.default.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in l.default?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof d.default.exitPictureInPicture&&super.show()}}sf.prototype.controlText_="Picture-in-Picture",i8.registerComponent("PictureInPictureToggle",sf);class sg extends r9{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e)),!1===d.default[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}sg.prototype.controlText_="Fullscreen",i8.registerComponent("FullscreenToggle",sg);let sy=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})};i8.registerComponent("VolumeLevel",class extends i8{createEl(){let e=super.createEl("div",{className:"vjs-volume-level"});
vendor: 4,259 bytes, line 1
1return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}),i8.registerComponent("VolumeLevelTooltip",class extends i8{constructor(e,t){super(e,t),this.update=iB(iU(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){let i=ir(this.el_),r=ir(this.player_.el()),s=e.width*t;if(!r||!i)return;let n=e.left-r.left+s,a=e.width-s+(r.right-e.right),o=i.width/2;n<o?o+=o-n:a<o&&(o=a),o<0?o=0:o>i.width&&(o=i.width),this.el_.style.right=`-${o}px`}this.write(`${r}%`)}write(e){t0(this.el_,e)}updateVolume(e,t,i,r,s){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,r.toFixed(0)),s&&s()})}});class s_ extends i8{constructor(e,t){super(e,t),this.update=iB(iU(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){this.getChild("volumeLevelTooltip").updateVolume(e,t,i,100*t,()=>{i?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}s_.prototype.options_={children:["volumeLevelTooltip"]},i8.registerComponent("MouseVolumeLevelDisplay",s_);class sv extends sd{constructor(e,t){super(e,t),this.on("slideractive",e=>this.updateLastVolume_(e)),this.on(e,"volumechange",e=>this.updateARIAAttributes(e)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){ic(e)&&super.handleMouseDown(e)}handleMouseMove(e){let t=this.getChild("mouseVolumeLevelDisplay");if(t){let i=this.el(),r=ir(i),s=this.vertical(),n=ia(i,e);n=so(n=s?n.y:n.x,0,1),t.update(r,n,s)}ic(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){let t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){let e=this.player_.volume();this.one("sliderinactive",()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)})}}sv.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},tz||tk||sv.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),sv.prototype.playerEvent="volumechange",i8.registerComponent("VolumeBar",sv);class sb extends i8{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||tb(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),sy(this,e),this.throttledHandleMouseMove=iB(iU(this,this.handleMouseMove),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",e=>this.handleMouseDown(e)),this.on("touchstart",e=>this.handleMouseDown(e)),this.on("mousemove",e=>this.handleMouseMove(e)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){let t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){let t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}sb.prototype.options_={children:["volumeBar"]}
vendor: 4,281 bytes, line 1
1,i8.registerComponent("VolumeControl",sb);let sT=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})};class sA extends r9{constructor(e,t){super(e,t),sT(this,e),this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){let t=this.player_.volume(),i=this.player_.lastVolume_();0===t?(this.player_.volume(i<.1?.1:i),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){let e=this.player_.volume(),t=3;this.setIcon("volume-high"),tz&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),t5(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-${t}`,"")),t4(this.el_,`vjs-vol-${t}`)}updateControlText_(){let e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}sA.prototype.controlText_="Mute",i8.registerComponent("MuteToggle",sA);class sS extends i8{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||tb(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],e=>this.volumePanelState_(e)),this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e)),this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e)),this.on("keydown",e=>this.handleKeyPress(e)),this.on("mouseover",e=>this.handleMouseOver(e)),this.on("mouseout",e=>this.handleMouseOut(e)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){"Escape"===e.key&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),iL(d.default,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),iR(d.default,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){"Escape"===e.key&&this.handleMouseOut()}}sS.prototype.options_={children:["muteToggle","volumeControl"]},i8.registerComponent("VolumePanel",sS);class sE extends r9{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){let e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){let t;if(isNaN(this.player_.duration()))return;let i=this.player_.currentTime(),r=this.player_.liveTracker,s=r&&r.isLive()?r.seekableEnd():this.player_.duration();t=i+this.skipTime<=s?i+this.skipTime:s,this.player_.currentTime(t)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}sE.prototype.controlText_="Skip Forward",i8.registerComponent("SkipForward",sE);class sC extends r9{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1}
1 seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){let e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){let t,i=this.player_.currentTime(),r=this.player_.liveTracker,s=r&&r.isLive()&&r.seekableStart();t=s&&i-this.skipTime<=s?s:i>=this.skipTime?i-this.skipTime:0,this.player_.currentTime(t)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}sC.prototype.controlText_="Skip Backward",i8.registerComponent("SkipBackward",sC);class sw extends i8{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",e=>this.handleKeyDown(e)),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof i8&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof i8&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){let t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){let e=this.options_.contentElType||"ul";this.contentEl_=tJ(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");let t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),iL(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){let t=e.relatedTarget||d.default.activeElement;if(!this.children().some(e=>e.el()===t)){let e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();let t=this.children();if(!Array.isArray(t))return;let i=t.filter(t=>t.el()===e.target)[0];i&&"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}handleKeyDown(e){"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):("ArrowRight"===e.key||"ArrowUp"===e.key)&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}i8.registerComponent("Menu",sw);class sk extends i8{constructor(e,t={}){super(e,t),this.menuButton_=new r9(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");let i=r9.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;let r=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),iL(d.default,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",e=>this.handleMouseLeave(e)),this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){let e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){let e=new sw(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){let t=tJ("li",{className:"vjs-menu-title",textContent:i2(this.options_.title),tabIndex:-1}),i=new i8(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";!0===this.options_.inline?e+="-inline":e+="-popup";let t=r9.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),iR(d.default,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){"Escape"===e.key||"Tab"===e.key?(this.buttonPressed_&&this.unpressButton(),e.key):"Up"!==e.key&&("Down"!==e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)||this.buttonPressed_||(e.preventDefault(),this.pressButton())}handleMenuKeyUp(e){("Escape"===e.key||"Tab"===e.key)&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}
1handleSubmenuKeyDown(e){("Escape"===e.key||"Tab"===e.key)&&(this.buttonPressed_&&this.unpressButton(),e.key)}pressButton(){this.enabled_&&(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),tz&&tQ()||this.menu.focus())}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}i8.registerComponent("MenuButton",sk);class sx extends sk{constructor(e,t){let i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;let r=iU(this,this.update);i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),i.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r),i.removeEventListener("labelchange",r)})}}i8.registerComponent("TrackButton",sx);class sI extends r1{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;let r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),s=tJ("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(s):r.replaceChild(s,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}i8.registerComponent("MenuItem",sI);class sD extends sI{constructor(e,t){var i;let r=t.track,s=e.textTracks();t.label=r.label||r.language||"Unknown",t.selected="showing"===r.mode,super(e,t),i=this,this.track=r,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);let n=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];i.handleTracksChange.apply(i,t)},a=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];i.handleSelectedLanguageChange.apply(i,t)};if(e.on(["loadstart","texttrackchange"],n),s.addEventListener("change",n),s.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),s.removeEventListener("change",n),s.removeEventListener("selectedlanguagechange",a)}),void 0===s.onchange){let e;this.on(["tap","click"],function(){if("object"!=typeof l.default.Event)try{e=new l.default.Event("change")}catch(e){}e||(e=d.default.createEvent("Event")).initEvent("change",!0,!0),s.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){let t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let e=0;e<i.length;e++){let r=i[e];-1!==this.kinds.indexOf(r.kind)&&(r===t?"showing"!==r.mode&&(r.mode="showing"):"disabled"!==r.mode&&(r.mode="disabled"))}}handleTracksChange(e){let t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){let e=this.player_.cache_.selectedLanguage;e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind||(this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind})}}dispose(){this.track=null,super.dispose()}}i8.registerComponent("TextTrackMenuItem",sD);class sP extends sD{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){let t=this.player().textTracks(),i=!0;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(this.options_.kinds.indexOf(r.kind)>-1&&"showing"===r.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){let t=this.player().textTracks(),i=!0;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(["captions","descriptions","subtitles"].indexOf(r.kind)>-1&&"showing"===r.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}i8.registerComponent("OffTextTrackMenuItem",sP);class sL extends sx{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sD;this.label_&&(e=`${this.label_} off`),t.push(new sP(this.player_,{kinds:this.kinds_,kind:this.kind_,label:e})),this.hideThreshold_+=1;let r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let e=0;e<r.length;e++){let s=r[e];if(this.kinds_.indexOf(s.kind)>-1){let e=new i(this.player_,{track:s,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});e.addClass(`vjs-${s.kind}-menu-item`),t.push(e)}}return t}}i8.registerComponent("TextTrackButton",sL);class sR extends sI{constructor(e,t){let i=t.track,r=t.cue,s=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=s&&s<r.endTime,super(e,t),this.track=i,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}i8.registerComponent("ChaptersTrackMenuItem",sR);class sM extends sL{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>
1{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;let t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){let e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){let i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(i2(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){let e=[];
vendor: 8,685 bytes, line 1
1if(!this.track_)return e;let t=this.track_.cues;if(!t)return e;for(let i=0,r=t.length;i<r;i++){let r=t[i],s=new sR(this.player_,{track:this.track_,cue:r});e.push(s)}return e}}sM.prototype.kind_="chapters",sM.prototype.controlText_="Chapters",i8.registerComponent("ChaptersButton",sM);class sO extends sL{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");let r=e.textTracks(),s=iU(this,this.handleTracksChange);r.addEventListener("change",s),this.on("dispose",function(){r.removeEventListener("change",s)})}handleTracksChange(e){let t=this.player().textTracks(),i=!1;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(r.kind!==this.kind_&&"showing"===r.mode){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}sO.prototype.kind_="descriptions",sO.prototype.controlText_="Descriptions",i8.registerComponent("DescriptionsButton",sO);class sN extends sL{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}sN.prototype.kind_="subtitles",sN.prototype.controlText_="Subtitles",i8.registerComponent("SubtitlesButton",sN);class sj extends sD{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}i8.registerComponent("CaptionSettingsMenuItem",sj);class sU extends sL{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new sj(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}sU.prototype.kind_="captions",sU.prototype.controlText_="Captions",i8.registerComponent("CaptionsButton",sU);class sB extends sD{createEl(e,t,i){let r=super.createEl(e,t,i),s=r.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):s.appendChild(tJ("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(tJ("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}i8.registerComponent("SubsCapsMenuItem",sB);class sF extends sL{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(i2(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new sj(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,sB)}}sF.prototype.kinds_=["captions","subtitles"],sF.prototype.controlText_="Subtitles",i8.registerComponent("SubsCapsButton",sF);class sq extends sI{constructor(e,t){var i;let r=t.track,s=e.audioTracks();t.label=r.label||r.language||"Unknown",t.selected=r.enabled,super(e,t),i=this,this.track=r,this.addClass(`vjs-${r.kind}-menu-item`);let n=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];i.handleTracksChange.apply(i,t)};s.addEventListener("change",n),this.on("dispose",()=>{s.removeEventListener("change",n)})}createEl(e,t,i){let r=super.createEl(e,t,i),s=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(s.appendChild(tJ("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(tJ("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){let e=this.player_.audioTracks();for(let t=0;t<e.length;t++){let i=e[t];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}i8.registerComponent("AudioTrackMenuItem",sq);class sV extends sx{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.hideThreshold_=1;let t=this.player_.audioTracks();for(let i=0;i<t.length;i++){let r=t[i];e.push(new sq(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}sV.prototype.controlText_="Audio Track",i8.registerComponent("AudioTrackButton",sV);class s$ extends sI{constructor(e,t){let i=t.rate,r=parseFloat(i,10);t.label=i,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=r,this.on(e,"ratechange",e=>this.update(e))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}s$.prototype.contentElType="button",i8.registerComponent("PlaybackRateMenuItem",s$);class sH extends sk{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",e=>this.updateVisibility(e)),this.on(e,"ratechange",e=>this.updateLabel(e)),this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){let e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=tJ("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){let e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new s$(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){let e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}sH.prototype.controlText_="Playback Rate",i8.registerComponent("PlaybackRateMenuButton",sH);class sz extends i8{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}i8.registerComponent("Spacer",sz),i8.registerComponent("CustomControlSpacer",class extends sz{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"Â "})}});class sW extends i8{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}sW.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},i8.registerComponent("ControlBar",sW);class sG extends rc{constructor(e,t){super(e,t),this.on(e,"error",e=>{this.open(e)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){let e=this.player().error();return e?this.localize(e.message):""}}sG.prototype.options_=Object.assign({}
vendor: 14,422 bytes, line 1
1,rc.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),i8.registerComponent("ErrorDisplay",sG);class sX extends i8{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),tJ("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{let t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${iw++}`)+"-"+e[1].replace(/\W+/g,""),i=tJ("option",{id:t,value:this.localize(e[0]),textContent:this.localize(e[1])});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),i}))}}i8.registerComponent("TextTrackSelect",sX);class sY extends i8{constructor(e,t={}){super(e,t);let i=tJ("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});for(let t of(this.el().appendChild(i),this.options_.selects)){let i=this.options_.selectConfigs[t],r=i.className,s=i.id.replace("%s",this.options_.id_),n=null,a=`vjs_select_${iw++}`;if("colors"===this.options_.type){n=tJ("span",{className:r});let e=tJ("label",{id:s,className:"vjs-label",textContent:this.localize(i.label)});e.setAttribute("for",a),n.appendChild(e)}let o=new sX(e,{SelectOptions:i.options,legendId:this.options_.legendId,id:a,labelId:s});this.addChild(o),"colors"===this.options_.type&&(n.appendChild(o.el()),this.el().appendChild(n))}}createEl(){return tJ("fieldset",{className:this.options_.className})}}i8.registerComponent("TextTrackFieldset",sY);class sK extends i8{constructor(e,t={}){super(e,t);let i=this.options_.textTrackComponentid,r=new sY(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);let s=new sY(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s);let n=new sY(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n)}createEl(){return tJ("div",{className:"vjs-track-settings-colors"})}}i8.registerComponent("TextTrackSettingsColors",sK);class sQ extends i8{constructor(e,t={}){super(e,t);let i=this.options_.textTrackComponentid,r=new sY(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);let s=new sY(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s);let n=new sY(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n)}createEl(){return tJ("div",{className:"vjs-track-settings-font"})}}i8.registerComponent("TextTrackSettingsFont",sQ);class sZ extends i8{constructor(e,t={}){super(e,t);let i=new r9(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});i.el().classList.remove("vjs-control","vjs-button"),i.el().textContent=this.localize("Reset"),this.addChild(i);let r=this.localize("Done"),s=new r9(e,{controlText:r,className:"vjs-done-button"});s.el().classList.remove("vjs-control","vjs-button"),s.el().textContent=r,this.addChild(s)}createEl(){return tJ("div",{className:"vjs-track-settings-controls"})}}i8.registerComponent("TrackSettingsControls",sZ);let sJ="vjs-text-track-settings",s0=["#000","Black"],s1=["#00F","Blue"],s2=["#0FF","Cyan"],s4=["#0F0","Green"],s5=["#F0F","Magenta"],s8=["#F00","Red"],s3=["#FFF","White"],s6=["#FF0","Yellow"],s7=["1","Opaque"],s9=["0.5","Semi-Transparent"],ne=["0","Transparent"],nt={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[s0,s3,s8,s4,s1,s6,s5,s2],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[s7,s9,ne],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[s3,s0,s8,s4,s1,s6,s5,s2],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[s7,s9],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[ne,s9,s7],className:"vjs-window-opacity vjs-opacity"}};function ni(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}nt.windowColor.options=nt.backgroundColor.options,i8.registerComponent("TextTrackSettings",class extends rc{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=tJ("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){let t=new sK(e,{textTrackComponentid:this.id_,selectConfigs:nt,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);let i=new sQ(e,{textTrackComponentid:this.id_,selectConfigs:nt,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);let r=new sZ(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),ty(nt,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return t_(nt,(e,t,i)=>{var r,s;let n=(r=this.$(t.selector),s=t.parser,ni(r.options[r.options.selectedIndex].value,s));return void 0!==n&&(e[i]=n),e},{})}setValues(e){ty(nt,(t,i)=>{!function(e,t,i){if(t){for(let r=0;r<e.options.length;r++)if(ni(e.options[r].value,i)===t){e.selectedIndex=r;break}}}(this.$(t.selector),e[i],t.parser)})}setDefaults(){ty(nt,e=>{let t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(l.default.localStorage.getItem(sJ))}catch(e){tp.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;let e=this.getValues();try{Object.keys(e).length?l.default.localStorage.setItem(sJ,JSON.stringify(e)):l.default.localStorage.removeItem(sJ)}catch(e){tp.warn(e)}}updateDisplay(){let e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}),i8.registerComponent("ResizeManager",class extends i8{constructor(e,t){let i=t.ResizeObserver||l.default.ResizeObserver;null===t.ResizeObserver&&(i=!1),super(e,tT({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||l.default.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=iF(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;let e=this.debouncedHandler_,t=this.unloadListener_=function(){iR(this,"resize",e),iR(this,"unload",t),t=null};iL(this.el_.contentWindow,"unload",t),iL(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});let nr={trackingThreshold:20,liveTolerance:15};i8.registerComponent("LiveTracker",class extends i8{constructor(e,t){super(e,tT(nr,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",e=>this.handleDurationchange(e)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){let e=this.player_.seekable();if(!e||!e.length)return;let t=Number(l.default.performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;let r=this.liveCurrentTime(),s=this.player_.currentTime(),n=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-s)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(n=!1),n!==this.behindLiveEdge_&&(this.behindLiveEdge_=n,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){let e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){let e=this.player_.seekable(),t=[],i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){let e=this.player_.seekable(),t=[],i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){let e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){let e=this.seekableEnd();return -1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}),i8.registerComponent("TitleBar",class extends i8{constructor(e,t){super(e,t),this.on("statechanged",e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:tJ("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${iw++}`}),description:tJ("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${iw++}`})},tJ("div",{className:"vjs-title-bar"},{},tA(this.els))}updateDom_(){let e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};
1["title","description"].forEach(e=>{let r=this.state[e],s=this.els[e],n=i[e];il(s),r&&t0(s,r),t&&(t.removeAttribute(n),r&&t.setAttribute(n,s.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){let e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});let ns={initialDisplay:4e3,position:[],takeFocus:!1};i8.registerComponent("TransientButton",class extends r9{constructor(e,t){super(e,t=tT(ns,t)),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],e=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){let e=tJ("button",{},{type:"button",class:this.buildCSSClass()},tJ("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}});let nn=e=>{let t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;let i=e.$$("source"),r=[],s="";if(!i.length)return!1;for(let e=0;e<i.length;e++){let t=i[e].src;t&&-1===r.indexOf(t)&&r.push(t)}return!!r.length&&(1===r.length&&(s=r[0]),e.triggerSourceset(s),!0)},na=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){let t=d.default.createElement(this.nodeName.toLowerCase());t.innerHTML=e;let i=d.default.createDocumentFragment();for(;t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",l.default.Element.prototype.appendChild.call(this,i),this.innerHTML}}),no=(e,t)=>{let i={};for(let r=0;r<e.length&&(!(i=Object.getOwnPropertyDescriptor(e[r],t))||!i.set||!i.get);r++);return i.enumerable=!0,i.configurable=!0,i},nl=function(e){let t=e.el();if(t.resetSourceWatch_)return;let i={},r=no([e.el(),l.default.HTMLMediaElement.prototype,l.default.Element.prototype,na],"innerHTML"),s=i=>function(){for(var r=arguments.length,s=Array(r),n=0;n<r;n++)s[n]=arguments[n];let a=i.apply(t,s);return nn(e),a};["append","appendChild","insertAdjacentHTML"].forEach(e=>{t[e]&&(i[e]=t[e],t[e]=s(i[e]))}),Object.defineProperty(t,"innerHTML",tT(r,{set:s(r.set)})),t.resetSourceWatch_=()=>
1{t.resetSourceWatch_=null,Object.keys(i).forEach(e=>{t[e]=i[e]}),Object.defineProperty(t,"innerHTML",r)},e.one("sourceset",t.resetSourceWatch_)},nd=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?rw(l.default.Element.prototype.getAttribute.call(this,"src")):""},set(e){return l.default.Element.prototype.setAttribute.call(this,"src",e),e}}),nu=function(e){if(!e.featuresSourceset)return;let t=e.el();if(t.resetSourceset_)return;let i=no([e.el(),l.default.HTMLMediaElement.prototype,nd],"src"),r=t.setAttribute,s=t.load;Object.defineProperty(t,"src",tT(i,{set:r=>{let s=i.set.call(t,r);return e.triggerSourceset(t.src),s}})),t.setAttribute=(i,s)=>{let n=r.call(t,i,s);return/src/i.test(i)&&e.triggerSourceset(t.src),n},t.load=()=>{let i=s.call(t);return nn(e)||(e.triggerSourceset(""),nl(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):nn(e)||nl(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=s,t.setAttribute=r,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}};class nh extends rB{constructor(e,t){super(e,t);let i=e.source,r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){let e=this.el_.childNodes,t=e.length,i=[];for(;t--;){let s=e[t];"track"===s.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(s),this.remoteTextTracks().addTrack(s.track),this.textTracks().addTrack(s.track),!r&&!this.el_.hasAttribute("crossorigin")&&rx(s.src)&&(r=!0)):i.push(s))}for(let e=0;e<i.length;e++)this.el_.removeChild(i[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&tp.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(t$||tB)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),nh.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){nu(this)}restoreMetadataTracksInIOSNativePlayer_(){let e,t=this.textTracks(),i=()=>{e=[];for(let i=0;i<t.length;i++){let r=t[i];"metadata"===r.kind&&e.push({track:r,storedMode:r.mode})}};i(),t.addEventListener("change",i),this.on("dispose",()=>t.removeEventListener("change",i));let r=()=>{for(let t=0;t<e.length;t++){let i=e[t];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}t.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{t.removeEventListener("change",i),t.removeEventListener("change",r),t.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{t.removeEventListener("change",i),t.addEventListener("change",i),t.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;let i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(e=>{this.el()[`${i}Tracks`].removeEventListener(e,this[`${i}TracksListeners_`][e])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){let t=rN[e],i=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;let s={change:t=>{let i={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(i),"text"===e&&this[rj.remoteText.getterName]().trigger(i)},addtrack(e){r.addTrack(e.track)},removetrack(e){r.removeTrack(e.track)}},n=function(){let e=[];for(let t=0;t<r.length;t++){let s=!1;for(let e=0;e<i.length;e++)if(i[e]===r[t]){s=!0;break}s||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};
1this[t.getterName+"Listeners_"]=s,Object.keys(s).forEach(e=>{let t=s[e];i.addEventListener(e,t),this.on("dispose",r=>i.removeEventListener(e,t))}),this.on("loadstart",n),this.on("dispose",e=>this.off("loadstart",n))}proxyNativeTracks_(){rN.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){let t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),nh.disposeMediaElement(e),e=t}else{e=d.default.createElement("video");let t=tT({},this.options_.tag&&t6(this.options_.tag));t$&&!0===this.options_.nativeControlsForTouch||delete t.controls,t3(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&t9(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);let t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){let r=t[i],s=this.options_[r];void 0!==s&&(s?t9(e,r,r):ie(e,r),e[r]=s)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1,t=function(){e=!0};this.on("loadstart",t);let i=function(){e||this.trigger("loadstart")};this.on("loadedmetadata",i),this.ready(function(){this.off("loadstart",t),this.off("loadedmetadata",i),e||this.trigger("loadstart")});return}let t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&tW?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){tp(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&tk&&tP&&0===this.el_.currentTime){let e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;let e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){let e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)rl(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen)return void this.trigger("fullscreenerror",Error("The video is not fullscreen"));this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return tp.error("Invalid source URL."),!1;let i={src:e};t&&(i.type=t);let r=tJ("source",{},i);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return tp.error("Source URL is required to remove the source element."),!1;for(let t of this.el_.querySelectorAll("source"))if(t.src===e)return this.el_.removeChild(t),!0;return tp.warn(`No matching source element found with src: ${e}`),!1}reset(){nh.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);let t=d.default.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){let i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){let t=this.$$("track"),i=t.length;for(;i--;)(e===t[i]||e===t[i].track)&&this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();let e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),l.default.performance&&(e.creationTime=l.default.performance.now()),e}}tS(nh,"TEST_VID",function(){if(!tY())return;let e=d.default.createElement("video"),t=d.default.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}),nh.isSupported=function(){try{nh.TEST_VID.volume=.5}catch(e){return!1}return!!(nh.TEST_VID&&nh.TEST_VID.canPlayType)},nh.canPlayType=function(e){return nh.TEST_VID.canPlayType(e)},nh.canPlaySource=function(e,t){return nh.canPlayType(e.type)},nh.canControlVolume=function(){try{let e=nh.TEST_VID.volume;nh.TEST_VID.volume=e/2+.1;let t=e!==nh.TEST_VID.volume;if(t&&tz)return l.default.setTimeout(()=>{nh&&nh.prototype&&(nh.prototype.featuresVolumeControl=e!==nh.TEST_VID.volume)}),!1;return t}catch(e){return!1}},nh.canMuteVolume=function(){try{let e=nh.TEST_VID.muted;return nh.TEST_VID.muted=!e,nh.TEST_VID.muted?t9(nh.TEST_VID,"muted","muted"):ie(nh.TEST_VID,"muted","muted"),e!==nh.TEST_VID.muted}catch(e){return!1}},nh.canControlPlaybackRate=function(){if(tk&&tP&&tR<58)return!1;try{let e=nh.TEST_VID.playbackRate;return nh.TEST_VID.playbackRate=e/2+.1,e!==nh.TEST_VID.playbackRate}catch(e){return!1}},nh.canOverrideAttributes=function(){try{let e=()=>{};Object.defineProperty(d.default.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(d.default.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(d.default.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(d.default.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},nh.supportsNativeTextTracks=function(){return tW||tz&&tP},nh.supportsNativeVideoTracks=function(){return!!(nh.TEST_VID&&nh.TEST_VID.videoTracks)},nh.supportsNativeAudioTracks=function(){return!!(nh.TEST_VID&&nh.TEST_VID.audioTracks)},nh.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEac
vendor: 4,117 bytes, line 1
1h(function(e){let[t,i]=e;tS(nh.prototype,t,()=>nh[i](),!0)}),nh.prototype.featuresVolumeControl=nh.canControlVolume(),nh.prototype.movingMediaElementInDOM=!tz,nh.prototype.featuresFullscreenResize=!0,nh.prototype.featuresProgressEvents=!0,nh.prototype.featuresTimeupdateEvents=!0,nh.prototype.featuresVideoFrameCallback=!!(nh.TEST_VID&&nh.TEST_VID.requestVideoFrameCallback),nh.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},nh.resetMediaElement=function(e){if(!e)return;let t=e.querySelectorAll("source"),i=t.length;for(;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){nh.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){nh.prototype["set"+i2(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){nh.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){nh.prototype["set"+i2(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){nh.prototype[e]=function(){return this.el_[e]()}}),rB.withSourceHandlers(nh),nh.nativeSourceHandler={},nh.nativeSourceHandler.canPlayType=function(e){try{return nh.TEST_VID.canPlayType(e)}catch(e){return""}},nh.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return nh.nativeSourceHandler.canPlayType(e.type);if(e.src){let t=rk(e.src);return nh.nativeSourceHandler.canPlayType(`video/${t}`)}return""},nh.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},nh.nativeSourceHandler.dispose=function(){},nh.registerSourceHandler(nh.nativeSourceHandler),rB.registerTech("Html5",nh);let nc=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],np={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},nm=["tiny","xsmall","small","medium","large","xlarge","huge"],nf={};nm.forEach(e=>{let t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;nf[e]=`vjs-layout-${t}`});let ng={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class ny extends i8{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${iw++}`,(t=Object.assign(ny.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){let i=e.closest("[lang]");i&&(t.language=i.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.boundUpdatePlayerHeightOnAudioOnlyMode_=e=>this.updatePlayerHeightOnAudioOnlyMode_(e),this.isFullscreen_=!1,this.log=tm(this.id_),this.fsApi_=td,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHe
1ight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&t6(e),this.language(this.options_.language),t.languages){let e={};Object.getOwnPropertyNames(t.languages).forEach(function(i){e[i.toLowerCase()]=t.languages[i]}),this.languages_=e}else this.languages_=ny.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(e=>{if("function"!=typeof this[e])throw Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),iZ(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(iL(d.default,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);let r=tT(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){let e=new l.default.DOMParser(
vendor: 17,817 bytes, line 1
1).parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n </symbol>\n <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">\n <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n </symbol>\n </defs>\n</svg>',"image/svg+xml");if(e.querySelector("parsererror"))
vendor: 1,955 bytes, line 1
1tp.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{let t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new r0(this),this.addClass("vjs-spatial-navigation-enabled")),t$&&this.addClass("vjs-touch-enabled"),tz||this.addClass("vjs-workinghover"),ny.players[this.id_]=this;let s=tn.split(".")[0];this.addClass(`vjs-v${s}`),this.userActive(!0),this.reportUserActivity(),this.one("play",e=>this.listenForUserActivity_(e)),this.on("keydown",e=>this.handleKeyDown(e)),this.on("languagechange",e=>this.handleLanguagechange(e)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),iR(d.default,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),iR(d.default,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),ny.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),rq.hasOwnProperty(this.id())&&delete rq[this.id()],rU.names.forEac
1h(e=>{let t=this[rU[e].getterName]();t&&t.off&&t.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=t.parentNode:r||(e=this.el_=super.createEl("div"));let s=t6(t);if(r){for(e=this.el_=t,t=this.tag=d.default.createElement("video");e.children.length;)t.appendChild(e.firstChild);t2(e,"video-js")||t4(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach(i=>{try{t[i]=e[i]}catch(e){}})}t.setAttribute("tabindex","-1"),s.tabindex="-1",tP&&tj&&(t.setAttribute("role","application"),s.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach(function(i){r&&"class"===i||e.setAttribute(i,s[i]),r&&t.setAttribute(i,s[i])}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");let n=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(e=>tG[e]).map(e=>"vjs-device-"+e.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...n),!0!==l.default.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=iS("vjs-styles-dimensions");let e=ip(".vjs-styles-defaults"),t=ip("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);let a=t.getElementsByTagName("a");for(let e=0;e<a.length;e++){let t=a.item(e);t4(t,"vjs-hidden"),t.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(e,t),t1(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){return void 0===e?this.techGet_("crossOrigin"):null!==e&&"anonymous"!==e&&"use-credentials"!==e?void tp.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`):void(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e))}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){let i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t){this[i]=void 0,this.updateStyleEl_();return}let r=parseFloat(t);if(isNaN(r))return void tp.error(`Improper value "${t}" supplied for for ${e}`);this[i]=r,this.updateStyleEl_()}fluid(e){if(void 0===e)return!!this.fluid_;if(this.fluid_=!!e,iH(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e){var t;this.addClass("vjs-fluid"),this.fill(!1),t=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},iH(this)?t():(this.eventedCallbacks||(this.eventedCallbacks=[]),this.eventedCallbacks.push(t))}else this.removeClass("vjs-fluid");this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){let e,t,i;if(!0===l.default.VIDEOJS_NO_DYNAMIC_STYLE){let e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();i&&(e>=0&&(i.width=e),t>=0&&(i.height=t));return}let r=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),s=r[1]/r[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/s:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*s,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),iE(this.styleEl_,` 2 .${i} { 3 width: ${e}px; 4 height: ${t}px; 5 } 6 7 .${i}.vjs-fluid:not(.vjs-audio-only-mode) { 8 padding-top: ${100*s}%; 9 } 10 `)}loadTech_(e,t){this.tech_&&this.unloadTech_();let i=i2(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(rB.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let s=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(s=!1);let n={source:t,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};
10rU.names.forEach(e=>{let t=rU[e];n[t.getterName]=this[t.privateName]}),Object.assign(n,this.options_[i]),Object.assign(n,this.options_[r]),Object.assign(n,this.options_[e.toLowerCase()]),this.tag&&(n.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(n.startTime=this.cache_.currentTime);let a=rB.getTech(e);if(!a)throw Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new a(n),this.tech_.ready(iU(this,this.handleTechReady_),!0),ru.jsonToTextTracks(this.textTracksJson_||[],this.tech_),nc.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${i2(e)}_`](t))}),Object.keys(np).forEach(e=>{this.on(this.tech_,e,t=>{if(0===this.tech_.playbackRate()&&this.tech_.seeking())return void this.queuedCallbacks_.push({callback:this[`handleTech${np[e]}_`].bind(this),event:t});this[`handleTech${np[e]}_`](t)})}),this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e)),this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e)),this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e)),this.on(this.tech_,"ended",e=>this.handleTechEnded_(e)),this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e)),this.on(this.tech_,"play",e=>this.handleTechPlay_(e)),this.on(this.tech_,"pause",e=>this.handleTechPause_(e)),this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e)),this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,"error",e=>this.handleTechError_(e)),this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e)),this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e)),this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||t1(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){rU.names.forEach(e=>{let t=rU[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=ru.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&tp.warn("Using the tech directly can be dangerous. I hope you know
10what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}version(){return{"video.js":tn}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()&&this.hasStarted(!1),this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){let t;if(!this.tech_||"string"!=typeof e)return;let i=()=>{let e=this.muted();this.muted(!0);let t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);let i=this.play();if(ro(i))return i.catch(e=>{throw t(),Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)})};if("any"!==e||this.muted()?t="muted"!==e||this.muted()?this.play():i():ro(t=this.play())&&(t=t.catch(i)),ro(t))return t.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;let i=e.cache_.sources.filter(e=>e.src===t);if(i.length)return i[0].type;let r=e.$$("source");for(let e=0;e<r.length;e++){let i=r[e];if(i.type&&i.src&&i.src===t)return i.type}return rY(t)})(this,t)),this.cache_.source=tT({},e,{src:t,type:i});let r=this.cache_.sources.filter(e=>e.src&&e.src===t),s=[],n=this.$$("source"),a=[];for(let e=0;e<n.length;e++){let i=t6(n[e]);s.push(i),i.src&&i.src===t&&a.push(i.src)}a.length&&!r.length?this.cache_.sources=s:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e),i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],e=>{if("sourceset"===e.type)return;let t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");let e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}
10handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.click||!1!==this.options_.userActions.click)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?rl(this.play()):this.pause())}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!d.default.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){let t=e.target.player;if(t&&t!==this)return;let i=this.el(),r=d.default[this.fsApi_.fullscreenElement]===i;!r&&i.matches&&(r=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){let e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in rz){var i,r;return i=this.middleware_,r=this.tech_,r[e](i.reduce(rG(e),t))}if(e in rW)return r$(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw tp(e),e}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in rH){var t,i;return t=this.middleware_,i=this.tech_,t.reduceRight(rG(e),i[e]())}if(e in rW)return r$(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw tp(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw tp(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw tp(t),t}}}play(){return new Promise(e=>{this.play_(e)})}play_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rl;this.playCallbacks_.push(e);let t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(tW||tz);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&i&&this.load();return}let r=this.techGet_("play");
10i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===r?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){let e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})}runPlayCallbacks_(e){let t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||i7(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(void 0===e)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=i7(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=i7(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return rn(this.buffered(),this.duration())}bufferedEnd(){let e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;if(void 0!==e){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return isNaN(t=parseFloat(this.techGet_("volume")))?1:t}muted(e){return void 0!==e?void this.techCall_("setMuted",e):this.techGet_("muted")||!1}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0!==e&&0!==e){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){let t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();let t=this;return new Promise((i,r)=>{function s(){t.off("fullscreenerror",a),t.off("fullscreenchange",n)}function n(){s(),i()}function a(e,t){s(),r(t)}t.one("fullscreenchange",n),t.one("fullscreenerror",a);let o=t.requestFullscreenHelper_(e);o&&(o.then(s,s),o.then(i,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){let e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){let e=this;return new Promise((t,i)=>{function r(){e.off("fullscreenerror",n),e.off("fullscreenchange",s)}function s(){r(),t()}function n(e,t){r(),i(t)}e.one("fullscreenchange",s),e.one("fullscreenerror",n);let a=e.exitFullscreenHelper_();a&&(a.then(r,r),a.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){let e=d.default[this.fsApi_.exitFullscreen]();return e&&rl(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=d.default.documentElement.style.overflow,iL(d.default,"keydown",this.boundFullWindowOnEscKey_),d.default.documentElement.style.overflow="hidden",t4(d.default.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){"Escape"===e.key&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,iR(d.default,"keydown",this.boundFullWindowOnEscKey_),d.default.documentElement.style.overflow=this.docOrigOverflow,t5(d.default.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(void 0!==e){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&l.default.documentPictureInPicture){let e=d.default.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(tJ("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),l.default.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(iy(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",t=>{let i=t.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in d.default&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return l.default.documentPictureInPicture&&l.default.documentPictureInPicture.window?(l.default.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in d.default?d.default.exitPictureInPicture():void 0}handleKeyDown(e){let{userActions:t}=this.options_;t&&t.hotkeys&&((e=>{let t=e.tagName.toLowerCase();return!!e.isContentEditable||("input"===t?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(t))})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)))}handleHotkeys(e){let{fullscreenKey:t=t=>"f"===e.key.toLowerCase(),muteKey:i=t=>"m"===e.key.toLowerCase(),playPauseKey:r=t=>"k"===e.key.toLowerCase()||" "===e.key.toLowerCase()}=this.options_.userActions?this.options_.userActions.hotkeys:{};if(t.call(this,e)){e.preventDefault(),e.stopPropagation();let t=i8.getComponent("FullscreenToggle");!1!==d.default[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else i.call(this,e)?(e.preventDefault(),e.stopPropagation(),i8.getComponent("MuteToggle").prototype.handleClick.call(this,e)):r.call(this,e)&&(e.preventDefault(),e.stopPropagation(),i8.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,r=this.options_.techOrder;i<r.length;i++){let s=r[i],n=rB.getTech(s);if(n||(n=i8.getComponent(s)),!n){tp.error(`The "${s}" tech is undefined. Skipped browser support check for that tech.`);continue}if(n.isSupported()&&(t=n.canPlayType(e)))return t}return""}selectSource(e){let t,i=this.options_.techOrder.map(e=>[e,rB.getTech(e)]).filter(e=>{let[t,i]=e;return i?i.isSupported():(tp.error(`The "${t}" tech is undefined. Skipped browser support check for that tech.`),!1)}
10),r=function(e,t,i){let r;return e.some(e=>t.some(t=>{if(r=i(e,t))return!0})),r},s=(e,t)=>{let[i,r]=e;if(r.canPlaySource(t,this.options_[i.toLowerCase()]))return{source:t,tech:i}};if(this.options_.sourceOrder)t=r(e,i,(e,t)=>s(t,e));else t=r(i,e,s);return t||!1}handleSrc_(e,t){var i,r,s;if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();let n=rK(e);if(!n.length)return void this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);if(this.changingSrc_=!0,t||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),i=this,r=n[0],s=(e,i)=>{var r;if(this.middleware_=i,t||(this.cache_.sources=n),this.updateSourceCaches_(e),this.src_(e))return n.length>1?this.handleSrc_(n.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void this.triggerReady());r=this.tech_,i.forEach(e=>e.setTech&&e.setTech(r))},i.setTimeout(()=>(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],[o,...l]=i;if("string"==typeof o)e(t,rF[o],r,s,n,a);else if(o){let i=function(e,t){let i=rq[e.id()],r=null;if(null==i)return r=t(e),rq[e.id()]=[[t,r]],r;for(let e=0;e<i.length;e++){let[s,n]=i[e];s===t&&(r=n)}return null===r&&(r=t(e),i.push([t,r])),r}(s,o);if(!i.setSource)return n.push(i),e(t,l,r,s,n,a);i.setSource(Object.assign({},t),function(o,d){if(o)return e(t,l,r,s,n,a);n.push(i),e(d,t.type===d.type?l:rF[d.type],r,s,n,a)})}else l.length?e(t,l,r,s,n,a):a?r(t,n):e(t,rF["*"],r,s,n,!0)})(r,rF[r.type],s,i),1),n.length>1){let e=()=>{this.error(null),this.handleSrc_(n.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}src(e){return this.handleSrc_(e,!1)}src_(e){let t=this.selectSource([e]);return!t||(i4(t.tech,this.techName_)?this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1})),!1)}addSourceElement(e,t){return!!this.tech_&&this.tech_.addSourceElement(e,t)}removeSourceElement(e){return!!this.tech_&&this.tech_.removeSourceElement(e)}load(){if(this.tech_&&this.tech_.vhs)return void this.src(this.currentSource());this.techCall_("load")}reset(){this.paused()?this.doReset_():rl(this.play().then(()=>this.doReset_()))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),iH(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);let{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:s}=i||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),s&&(s.update(),s.loadProgressBar&&s.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){let e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(void 0!==e){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){let t;if(void 0===e)return this.options_.autoplay||!1;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(void 0!==e){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){let e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}
10controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(to("beforeerror").forEach(t=>{let i=t(this,e);if(!(tv(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i))return void this.log.error("please return a value that MediaError expects in beforeerror hooks");e=i}),this.options_.suppressNotSupportedError&&e&&4===e.code){let t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(null===e){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new ra(e),this.addClass("vjs-error"),tp.error(`(CODE:${this.error_.code} ${ra.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),to("error").forEach(e=>e(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i,r,s=iU(this,this.reportUserActivity),n=function(t){s(),this.clearInterval(e)};this.on("mousedown",function(){s(),this.clearInterval(e),e=this.setInterval(s,250)}),this.on("mousemove",function(e){(e.screenX!==t||e.screenY!==i)&&(t=e.screenX,i=e.screenY,s())}),this.on("mouseup",n),this.on("mouseleave",n);let a=this.getChild("controlBar");!a||tz||tk||(a.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),a.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",s),this.on("keyup",s),this.setInterval(function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(r);let e=this.options_.inactivityTimeout;e<=0||(r=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))},250)}playbackRate(e){return void 0!==e?void this.techCall_("setPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0!==e){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){let e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");let e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}
10),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){let e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return"boolean"!=typeof e||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e)?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),iH(this)&&this.trigger("languagechange"))}languages(){return tT(ny.prototype.options_.languages,this.languages_)}toJSON(){let e=tT(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let r=t[i];(r=tT(r)).player=void 0,e.tracks[i]=r}return e}createModal(e,t){(t=t||{}).content=e||"";let i=new rc(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;let e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<nm.length;i++){let r=nm[i];if(t<=this.breakpoints_[r]){if(e===r)return;e&&this.removeClass(nf[e]),this.addClass(nf[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){let e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},ng,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){if(void 0===e)return this.responsive_;e=!!e;let t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return nf[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;let i=this.crossOrigin();this.reset(),this.cache_.media=tT(e);let{artist:r,artwork:s,description:n,poster:a,src:o,textTracks:l,title:d}=this.cache_.media;!s&&a&&(this.cache_.media.artwork=[{src:a,type:rY(a)}]),i&&this.crossOrigin(i),o&&this.src(o),a&&this.poster(a),Array.isArray(l)&&l.forEach(e=>this.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:d,description:n||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){let e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:rY(t.poster)}]),t}return tT(this.cache_.media)}static getTagSettings(e){let t={sources:[],tracks:[]},i=t6(e),r=i["data-setup"];if(t2(e,"vjs-fill")&&(i.fill=!0),t2(e,"vjs-fluid")&&(i.fluid=!0),null!==r)try{Object.assign(i,JSON.parse(r||"{}"))}catch(e){tp.error("data-setup",e)}if(Object.assign(t,i),e.hasChildNodes()){let i=e.childNodes;for(let e=0,r=i.length;e<r;
10e++){let r=i[e],s=r.nodeName.toLowerCase();"source"===s?t.sources.push(t6(r)):"track"===s&&t.tracks.push(t6(r))}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every(e=>"number"==typeof e)&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}ny.prototype.videoTracks=()=>{},ny.prototype.audioTracks=()=>{},ny.prototype.textTracks=()=>{},ny.prototype.remoteTextTracks=()=>{},ny.prototype.remoteTextTrackEls=()=>{},rU.names.forEach(function(e){let t=rU[e];ny.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),ny.prototype.crossorigin=ny.prototype.crossOrigin,ny.players={};let n_=l.default.navigator;ny.prototype.options_={techOrder:rB.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:n_&&(n_.languages&&n_.languages[0]||n_.userLanguage||n_.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1},nc.forEach(function(e){ny.prototype[`handleTech${i2(e)}_`]=function(){return this.trigger(e)}}),i8.registerComponent("Player",ny);let nv="plugin",nb="activePlugins_",nT={},nA=e=>nT.hasOwnProperty(e),nS=e=>nA(e)?nT[e]:void 0,nE=(e,t)=>{e[nb]=e[nb]||{},e[nb][t]=!0},nC=(e,t,i)=>{let r=(i?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},nw=function(e,t){let i=function(){nC(this,{name:e,plugin:t,instance:null},!0);let i=t.apply(this,arguments);return nE(this,e),nC(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach(function(e){i[e]=t[e]}),i},nk=(e,t)=>(t.prototype.name=e,function(){for(var i=arguments.length,r=Array(i),s=0;s<i;s++)r[s]=arguments[s];nC(this,{name:e,plugin:t,instance:null},!0);let n=new t(...[this,...r]);return this[e]=()=>n,nC(this,n.getEventHash()),n});class nx{constructor(e){if(this.constructor===nx)throw Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),iZ(this),delete this.trigger,i0(this,this.constructor.defaultState),nE(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return iM(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){let{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[nb][e]=!1,this.player=this.state=null,t[e]=nk(e,nT[e])}static isBasic(e){let t="string"==typeof e?nS(e):e;return"function"==typeof t&&!nx.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(nA(e))tp.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(ny.prototype.hasOwnProperty(e))throw Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return nT[e]=t,e!==nv&&(nx.isBasic(t)?ny.prototype[e]=nw(e,t):ny.prototype[e]=nk(e,t)),t}static deregisterPlugin(e){if(e===nv)throw Error("Cannot de-register base plugin.");nA(e)&&(delete nT[e],delete ny.prototype[e])}static getPlugins(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(nT);return t.forEach(t=>{let i=nS(t);
10i&&((e=e||{})[t]=i)}),e}static getPluginVersion(e){let t=nS(e);return t&&t.VERSION||""}}function nI(e,t,i,r){var s;let n;return s=`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,n=!1,function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return n||tp.warn(s),n=!0,r.apply(this,t)}}nx.getPlugin=nS,nx.BASE_PLUGIN_NAME=nv,nx.registerPlugin(nv,nx),ny.prototype.usingPlugin=function(e){return!!this[nb]&&!0===this[nb][e]},ny.prototype.hasPlugin=function(e){return!!nA(e)};let nD=e=>0===e.indexOf("#")?e.slice(1):e;function nP(e,t,i){let r=nP.getPlayer(e);if(r)return t&&tp.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&r.ready(i),r;let s="string"==typeof e?ip("#"+nD(e)):e;if(!tK(s))throw TypeError("The element or ID supplied is not valid. (videojs)");let n="getRootNode"in s&&s.getRootNode()instanceof l.default.ShadowRoot?s.getRootNode():s.ownerDocument.body;return s.ownerDocument.defaultView&&n.contains(s)||tp.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(s.parentNode&&s.parentNode.hasAttribute&&s.parentNode.hasAttribute("data-vjs-player")?s.parentNode:s).cloneNode(!0)),to("beforesetup").forEach(e=>{let i=e(s,tT(t));if(!tv(i)||Array.isArray(i))return void tp.error("please return an object in beforesetup hooks");t=tT(t,i)}),r=new(i8.getComponent("Player"))(s,t,i),to("setup").forEach(e=>e(r)),r}if(nP.hooks_=ta,nP.hooks=to,nP.hook=function(e,t){to(e,t)},nP.hookOnce=function(e,t){to(e,[].concat(t).map(t=>{let i=function(){for(var r=arguments.length,s=Array(r),n=0;n<r;n++)s[n]=arguments[n];return tl(e,i),t(...s)};return i}))},nP.removeHook=tl,!0!==l.default.VIDEOJS_NO_DYNAMIC_STYLE&&tY()){let e=ip(".vjs-styles-defaults");if(!e){e=iS("vjs-styles-defaults");let t=ip("head");t&&t.insertBefore(e,t.firstChild),iE(e,` 11 .video-js { 12 width: 300px; 13 height: 150px; 14 } 15 16 .vjs-fluid:not(.vjs-audio-only-mode) { 17 padding-top: 56.25% 18 } 19 `)}}iT(1,nP),nP.VERSION=tn,nP.options=ny.prototype.options_,nP.getPlayers=()=>ny.players,nP.getPlayer=e=>{let t,i=ny.players;if("string"==typeof e){let r=nD(e),s=i[r];if(s)return s;t=ip("#"+r)}else t=e;if(tK(t)){let{player:e,playerId:r}=t;if(e||i[r])return e||i[r]}},nP.getAllPlayers=()=>Object.keys(ny.players).map(e=>ny.players[e]).filter(Boolean),nP.players=ny.players,nP.getComponent=i8.getComponent,nP.registerComponent=(e,t)=>(rB.isTech(t)&&tp.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),i8.registerComponent.call(i8,e,t)),nP.getTech=rB.getTech,nP.registerTech=rB.registerTech,nP.use=function(e,t){rF[e]=rF[e]||[],rF[e].push(t)},Object.defineProperty(nP,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(nP.middleware,"TERMINATOR",{value:rV,writeable:!1,enumerable:!0}),nP.browser=tG,nP.obj=tE,nP.mergeOptions=nI(9,"videojs.mergeOptions","videojs.obj.merge",tT),nP.defineLazyProperty=nI(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",tS),nP.bind=nI(9,"videojs.bind","native Function.prototype.bind",iU),nP.registerPlugin=nx.registerPlugin,nP.deregisterPlugin=nx.deregisterPlugin,nP.plugin=(e,t)=>(tp.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),nx.registerPlugin(e,t)),nP.getPlugins=nx.getPlugins,nP.getPlugin=nx.getPlugin,nP.getPluginVersion=nx.getPluginVersion,nP.addLanguage=function(e,t){return e=(""+e).toLowerCase(),nP.options.languages=tT(nP.options.languages,{[e]:t}),nP.options.languages[e]},nP.log=tp,nP.createLogger=tm,nP.time=rs,nP.createTimeRange=nI(9,"videojs.createTimeRange","videojs.time.createTimeRanges",i7),nP.createTimeRanges=nI(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",i7),nP.formatTime=nI(9,"videojs.formatTime","videojs.time.formatTime",rr),nP.setFormatTime=nI(9,"videojs.setFormatTime","videojs.time.setFormatTime",rt),nP.resetFormatTime=nI(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",ri),nP.parseUrl=nI(9,"videojs.parseUrl","videojs.url.parseUrl",rC),nP.isCrossOrigin=nI(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",rx),nP.EventTarget=iV,nP.any=iN,nP.on=iL,nP.one=iO,nP.off=iR,nP.trigger=iM,nP.xhr=u.default,nP.TrackList=rp,nP.TextTrack=rL,nP.TextTrackList=r_,nP.AudioTrack=rR,nP.AudioTrackList=rf,nP.VideoTrack=rM,nP.VideoTrackList=ry,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e
19=>{nP[e]=function(){return tp.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),i_[e].apply(null,arguments)}}),nP.computedStyle=nI(9,"videojs.computedStyle","videojs.dom.computedStyle",ig),nP.dom=i_,nP.fn=iq,nP.num=sl,nP.str=i5,nP.url=rI,nP.Error={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};class nL{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class nR extends nP.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;let i=this.levels_.length;return t=new nL(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){let i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}for(let e in nR.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"},nR.prototype.allowedEvents_)nR.prototype["on"+e]=null;var nM="4.1.0";let nO=function(e,t){let i=e.qualityLevels,r=new nR,s=function(){r.dispose(),e.qualityLevels=i,e.off("dispose",s)};return e.on("dispose",s),e.qualityLevels=()=>r,e.qualityLevels.VERSION=nM,r},nN=function(e){return nO(this,nP.obj.merge({},e))};nP.registerPlugin("qualityLevels",nN),nN.VERSION=nM;let nj=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,nU=e=>nP.log.debug?nP.log.debug.bind(nP,"VHS:",`${e} >`):function(){};function nB(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];let r=nP.obj||nP;return(r.merge||r.mergeOptions).apply(r,t)}function nF(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];let r=nP.time||nP;return(r.createTimeRanges||r.createTimeRanges).apply(r,t)}let nq=1/30,nV=1/30*3,n$=function(e,t){let i,r=[];if(e&&e.length)for(i=0;i<e.length;i++)t(e.start(i),e.end(i))&&r.push([e.start(i),e.end(i)]);return nF(r)},nH=function(e,t){return n$(e,function(e,i){return e-nV<=t&&i+nV>=t})},nz=function(e,t){return n$(e,function(e){return e-nq>=t})},nW=function(e){if(e.length<2)return nF();let t=[];for(let i=1;i<e.length;i++){let r=e.end(i-1),s=e.start(i);t.push([r,s])}return nF(t)},nG=function(e,t){let i=null,r=null,s=0,n=[],a=[];if(!e||!e.length||!t||!t.length)return nF();let o=e.length;for(;o--;)n.push({time:e.start(o),type:"start"}),n.push({time:e.end(o),type:"end"});for(o=t.length;o--;)n.push({time:t.start(o),type:"start"}),n.push({time:t.end(o),type:"end"});for(n.sort(function(e,t){return e.time-t.time}),o=0;o<n.length;o++)"start"===n[o].type?2==++s&&(i=n[o].time):"end"===n[o].type&&1==--s&&(r=n[o].time),null!==i&&null!==r&&(a.push([i,r]),i=null,r=null);return nF(a)},nX=e=>{let t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},nY=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return((e.length?e.end(e.length-1):0)-t)/i},nK=e=>{let t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},nQ=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e||e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1},nZ=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},nJ=function(e,t){let i=0;if(!e||!e.length)return i;for(let r=0;r<e.length;r++){let s=e.start(r),n=e.end(r);if(!(t>n)){if(t>s&&t<=n){i+=n-t;continue}i+=n-s}}return i},n0=(e,t)=>{if(!t.preload)return t.duration;let i=0;
19return(t.parts||[]).forEach(function(e){i+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(i+=e.partTargetDuration)}),i},n1=e=>(e.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(r,s){e.push({duration:r.duration,segmentIndex:i,partIndex:s,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),n2=e=>{let t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},n4=e=>{let{preloadSegment:t}=e;if(!t)return;let{parts:i,preloadHints:r}=t,s=(r||[]).reduce((e,t)=>e+ +("PART"===t.type),0);return s+(i&&i.length?i.length:0)},n5=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;let i=n2(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},n8=function(e,t){let i=0,r=t-e.mediaSequence,s=e.segments[r];if(s){if(void 0!==s.start)return{result:s.start,precise:!0};if(void 0!==s.end)return{result:s.end-s.duration,precise:!0}}for(;r--;){if(void 0!==(s=e.segments[r]).end)return{result:i+s.end,precise:!0};if(i+=n0(e,s),void 0!==s.start)return{result:i+s.start,precise:!0}}return{result:i,precise:!1}},n3=function(e,t){let i,r=0,s=t-e.mediaSequence;for(;s<e.segments.length;s++){if(void 0!==(i=e.segments[s]).start)return{result:i.start-r,precise:!0};if(r+=n0(e,i),void 0!==i.end)return{result:i.end-r,precise:!0}}return{result:-1,precise:!1}},n6=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;let r=n8(e,t);if(r.precise)return r.result;let s=n3(e,t);return s.precise?s.result:r.result+i},n7=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return l.default.Infinity}return n6(e,t,i)},n9=function(e){let{defaultDuration:t,durationList:i,startIndex:r,endIndex:s}=e,n=0;if(r>s&&([r,s]=[s,r]),r<0){for(let e=r;e<Math.min(0,s);e++)n+=t;r=0}for(let e=r;e<s;e++)n+=i[e].duration;return n},ae=function(e,t,i,r){if(!e||!e.segments)return null;if(e.endList)return n7(e);if(null===t)return null;t=t||0;let s=n6(e,e.mediaSequence+e.segments.length,t);return i&&(s-=r="number"==typeof r?r:n5(null,e)),Math.max(0,s)},at=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},ai=function(e){return e.excludeUntil&&e.excludeUntil===1/0},ar=function(e){let t=at(e);return!e.disabled&&!t},as=function(e,t){return t.attributes&&t.attributes[e]},an=(e,t)=>{if(1===e.playlists.length)return!0;let i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(e=>!!ar(e)&&(e.attributes.BANDWIDTH||0)<i).length},aa=(e,t)=>(!!e||!!t)&&(!!e||!t)&&(!e||!!t)&&(e===t||!!e.id&&!!t.id&&e.id===t.id||!!e.resolvedUri&&!!t.resolvedUri&&e.resolvedUri===t.resolvedUri||!!e.uri&&!!t.uri&&e.uri===t.uri),ao=function(e,t){let i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},r=!1;for(let e in i){for(let s in i[e])if(r=t(i[e][s]))break;if(r)break}return!!r},al=e=>{if(!e||!e.playlists||!e.playlists.length)return ao(e,e=>e.playlists&&e.playlists.length||e.uri);for(let t=0;t<e.playlists.length;t++){let i=e.playlists[t],r=i.attributes&&i.attributes.CODECS;if(!(r&&r.split(",").every(e=>L(e)))&&!ao(e,e=>aa(i,e)))return!1}return!0};var ad={liveEdgeDelay:n5,duration:n7,seekable:function(e,t,i){let r=t||0,s=ae(e,t,!0,i);return null===s?nF():(s<r&&(s=r),nF(r,s))},getMediaInfoForTime:function(e){let{playlist:t,currentTime:i,startingSegmentIndex:r,startingPartIndex:s,startTime:n,exactManifestTimings:a}=e,o=i-n,l=n1(t),d=0;for(let e=0;e<l.length;e++){let t=l[e];if(r===t.segmentIndex&&("number"!=typeof s||"number"!=typeof t.partIndex||s===t.partIndex)){d=e;break}}if(o<0){if(d>0)for(let e=d-1;e>=0;e--){let i=l[e];if(o+=i.duration,a){if(o<0)continue}else if(o+nq<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n-n9({defaultDuration:t.targetDuration,durationList:l,startIndex:d,endIndex:e})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i}}if(d<0){for(let e=d;e<0;e++)if((o-=t.targetDuration)<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i};d=0}for(let e=d;e<l.length;e++){let i=l[e];o-=i.duration;let r=i.duration>nq,s=0===o,u=r&&o+nq>=0;if(!s&&!u||e===l.length-1){if(a){if(o>0)continue}else if(o-nq>=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n+n9({defaultDuration:t.targetDuration,durationList:l,startIndex:d,endIndex:e})}}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:i}},isEnabled:ar,isDisabled:function(e){return e.disabled},isExcluded:at,isIncompatible:ai,playlistEnd:ae,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:as,estimateSegmentRequestTime:function(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return as("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*r)/t:NaN},isLowestEnabledRendition:an,isAudioOnly:al,playlistMatch:aa,segmentDurationWithParts:n0};let{log:au}=nP,ah=(e,t)=>`${e}-${t}`,ac=(e,t,i)=>`placeholder-uri-${e}-${t}-${i}`,ap=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(i=>
19{if(e.mediaGroups[i])for(let r in e.mediaGroups[i])for(let s in e.mediaGroups[i][r])t(e.mediaGroups[i][r][s],i,r,s)})},am=e=>{let{playlist:t,uri:i,id:r}=e;t.id=r,t.playlistErrors_=0,i&&(t.uri=i),t.attributes=t.attributes||{}},af=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ac;e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){let i=`placeholder-uri-${t}`;e.playlists[t].uri=i}let r=al(e);ap(e,(t,s,n,a)=>{if(!t.playlists||!t.playlists.length){if(r&&"AUDIO"===s&&!t.uri)for(let t=0;t<e.playlists.length;t++){let i=e.playlists[t];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===n)return}t.playlists=[(0,c.default)({},t)]}t.playlists.forEach(function(t,r){let o=i(s,n,a,t),l=ah(r,o);t.uri?t.resolvedUri=t.resolvedUri||m(e.uri,t.uri):(t.uri=0===r?o:l,t.resolvedUri=t.uri),t.id=t.id||l,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t})});let s=e.playlists.length;for(;s--;){let t=e.playlists[s];am({playlist:t,id:ah(s,t.uri)}),t.resolvedUri=m(e.uri,t.uri),e.playlists[t.id]=t,e.playlists[t.uri]=t,t.attributes.BANDWIDTH||au.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}ap(e,t=>{t.uri&&(t.resolvedUri=m(e.uri,t.uri))})};class ag{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null!==this.offset_||!e.length)return;let[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!e.length)return;let[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce((e,t)=>(e.set(t.id,t),e),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];let e={},t=[];for(let i of(this.pendingDateRanges_.forEach((i,r)=>{if(!this.processedDateRanges_.has(r)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){let t=e[i.class].push(i);i.classListIndex=t-1}else e[i.class]=[i],i.classListIndex=0}),t)){let t=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&t[i.classListIndex+1]?i.endTime=t[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,i)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(i)})}}let ay=e=>{let{requestType:t,request:i,error:r,parseFailure:s}=e,n=i.status<200||i.status>299,a=i.status>=400&&i.status<=499,o={uri:i.uri,requestType:t};return r&&a?(o.error=(0,c.default)({},r),o.errorType=nP.Error.NetworkRequestFailed):i.aborted?o.errorType=nP.Error.NetworkRequestAborted:i.timedout?o.errorType=nP.Error.NetworkRequestTimeout:(n&&!a||s)&&(o.errorType=s?nP.Error.NetworkBodyParserFailed:nP.Error.NetworkBadStatus,o.status=i.status,o.headers=i.headers),o},a_=nU("CodecUtils"),av=function(e){let t=e.attributes||{};if(t.CODECS)return D(t.CODECS)},ab=(e,t)=>{let i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},aT=function(e){let t={};return e.forEach(e=>{let{mediaType:i,type:r,details:s}=e;t[i]=t[i]||[],t[i].push(I(`${r}${s}`))}),Object.keys(t).forEach(function(e){if(t[e].length>1){a_(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),t[e]=null;return}t[e]=t[e][0]}),t},aA=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},aS=function(e,t){let i=t.attributes||{},r=aT(av(t)||[]);if(ab(e,t)&&!r.audio&&!((e,t)=>{if(!ab(e,t))return!0;let i=t.attributes||{},r=e.mediaGroups.AUDIO[i.AUDIO];for(let e in r)if(!r[e].uri&&!r[e].playlists)return!0;return!1})(e,t)){let t=aT(P(e,i.AUDIO)||[]);t.audio&&(r.audio=t.audio)}return r},{EventTarget:aE}=nP,aC=(e,t)=>{if(!e)return t;let i=nB(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let r=0;r<t.parts.length;r++)e.parts&&e.parts[r]&&(i.parts[r]=nB(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},aw=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=m(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=m(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=m(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=m(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEac
19h(e=>{e.resolvedUri||(e.resolvedUri=m(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(e=>{e.resolvedUri||(e.resolvedUri=m(t,e.uri))})},ak=function(e){let t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let e=0;e<i.preloadHints.length;e++)if("MAP"===i.preloadHints[e].type)return t}i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},ax=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,aI=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ax,r=nB(e,{}),s=r.playlists[t.id];if(!s||i(s,t))return null;t.segments=ak(t);let n=nB(s,t);if(n.preloadSegment&&!t.preloadSegment&&delete n.preloadSegment,s.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}n.segments=((e,t,i)=>{let r,s=e.slice(),n=t.slice();i=i||0;let a=[];for(let e=0;e<n.length;e++){let t=s[e+i],o=n[e];t?(r=t.map||r,a.push(aC(t,o))):(r&&!o.map&&(o.map=r),a.push(o))}return a})(s.segments,t.segments,t.mediaSequence-s.mediaSequence)}n.segments.forEach(e=>{aw(e,n.resolvedUri)});for(let e=0;e<r.playlists.length;e++)r.playlists[e].id===t.id&&(r.playlists[e]=n);return r.playlists[t.id]=n,r.playlists[t.uri]=n,ap(e,(e,i,r,s)=>{if(e.playlists)for(let i=0;i<e.playlists.length;i++)t.id===e.playlists[i].id&&(e.playlists[i]=n)}),r},aD=(e,t)=>{let i=e.segments||[],r=i[i.length-1],s=r&&r.parts&&r.parts[r.parts.length-1],n=s&&s.duration||r&&r.duration;return t&&n?1e3*n:500*(e.partTargetDuration||e.targetDuration||10)},aP=(e,t,i)=>{if(!e)return;let r=[];return e.forEach(e=>{if(!e.attributes)return;let{BANDWIDTH:t,RESOLUTION:i,CODECS:s}=e.attributes;r.push({id:e.id,bandwidth:t,resolution:i,codecs:s})}),{type:t,isLive:i,renditions:r}};class aL extends aE{constructor(e,t,i={}){if(super(),!e)throw Error("A non-empty playlist URL or object is required");this.logger_=nU("PlaylistLoader");let{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addD
19ateRangesToTextTrack;let s=t.options_;this.customTagParsers=s&&s.customTagParsers||[],this.customTagMappers=s&&s.customTagMappers||[],this.llhls=s&&s.llhls,this.dateRangesStorage_=new ag,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){let e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);let t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;let e=this.media(),t=m(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(t.endList||!t.serverControl)return e;let i={};if(t.serverControl.canBlockReload){let{preloadSegment:e}=t,r=t.mediaSequence+t.segments.length;if(e){let s=e.parts||[],n=n4(t)-1;n>-1&&n!==s.length-1&&(i._HLS_part=n),(n>-1||s.length)&&r--}i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){let t=new l.default.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){i.hasOwnProperty(e)&&t.searchParams.set(e,i[e])}),e=t.toString()}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(e,t)=>{if(this.request){if(e)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,i){let{uri:r,id:s}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[s],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:ay({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_(e){let{url:t,manifestString:i}=e;try{let e=(e=>{let{onwarn:t,oninfo:i,manifestString:r,customTagParsers:s=[],customTagMappers:n=[],llhls:a}=e,o=new C;t&&o.on("warn",t),i&&o.on("info",i),s.forEach(e=>
19o.addParser(e)),n.forEach(e=>o.addTagMapper(e)),o.push(r),o.end();let l=o.manifest;if(!a&&(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){l.hasOwnProperty(e)&&delete l[e]}),l.segments&&l.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!l.targetDuration){let e=10;l.segments&&l.segments.length&&(e=l.segments.reduce((e,t)=>Math.max(e,t.duration),0)),t&&t({message:`manifest has no targetDuration defaulting to ${e}`}),l.targetDuration=e}let d=n2(l);if(d.length&&!l.partTargetDuration){let e=d.reduce((e,t)=>Math.max(e,t.duration),0);t&&(t({message:`manifest has no partTargetDuration defaulting to ${e}`}),au.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),l.partTargetDuration=e}return l})({onwarn:e=>{let{message:i}=e;return this.logger_(`m3u8-parser warn for ${t}: ${i}`)},oninfo:e=>{let{message:i}=e;return this.logger_(`m3u8-parser info for ${t}: ${i}`)},manifestString:i,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});if(!e.playlists||!e.playlists.length)return e;return this.excludeAudioOnlyVariants(e.playlists),e}catch(e){this.error=e,this.error.metadata={errorType:nP.Error.StreamingHlsPlaylistParserError,error:e}}}excludeAudioOnlyVariants(e){let t=e=>{let{width:t,height:i}=(e.attributes||{}).RESOLUTION||{};return!!t&&!!i||!!aT(av(e)||[]).video};e.some(t)&&e.forEach(e=>{t(e)||(e.excludeUntil=1/0)})}haveMetadata(e){let{playlistString:t,playlistObject:i,url:r,id:s}=e;this.request=null,this.state="HAVE_METADATA";let n={playlistInfo:{type:"media",uri:r}};this.trigger({type:"playlistparsestart",metadata:n});let a=i||this.parseManifest_({url:r,manifestString:t});a.lastRequest=Date.now(),am({playlist:a,uri:r,id:s});let o=aI(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[s]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(aD(this.media(),!!o)),n.parsedPlaylist=aP(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),l.default.clearTimeout(this.mediaUpdateTimeout),l.default.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new ag,this.off()}stopRequest(){if(this.request){let e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(l.default.clearTimeout(this.finalRenditionTimeout),t){let t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=l.default.setTimeout(this.media.bind(this,e,!1),t);return}let i=this.state,r=!this.media_||e.id!==this.media_.id,s=this.main.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(aD(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;let n={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:n}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,r)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=nj(e.resolvedUri,r),t)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:n}),this.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(l.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(l.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);let t=this.media();if(e){let e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=l.default.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e);return}if(!this.started)return void this.start();t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(l.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=l.default.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}
19start(){if(this.started=!0,"object"==typeof this.src){this.src.uri||(this.src.uri=l.default.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}let e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:ay({requestType:i.requestType,request:i,error:t})},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=nj(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});let r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=aP(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,af(this.main,this.srcUri()),e.playlists.forEac
19h(e=>{e.segments=ak(e),e.segments.forEach(t=>{aw(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}let t=this.srcUri()||l.default.location.href;this.main=((e,t)=>{let i=ah(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:l.default.location.href,resolvedUri:l.default.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return r.playlists[i]=r.playlists[0],r.playlists[t]=r.playlists[0],r})(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){let i=this.main,r=e.ID,s=i.playlists.length;for(;s--;){let n=i.playlists[s];if(n.attributes["PATHWAY-ID"]===r){let a=n.resolvedUri,o=n.id;if(t){let t=this.createCloneURI_(n.resolvedUri,e),a=ah(r,t),o=this.createCloneAttributes_(r,n.attributes),l=this.createClonePlaylist_(n,a,e,o);i.playlists[s]=l,i.playlists[a]=l,i.playlists[t]=l}else i.playlists.splice(s,1);delete i.playlists[o],delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){let i=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{if(i.mediaGroups[e]&&i.mediaGroups[e][r]){for(let t in i.mediaGroups[e])if(t===r){for(let r in i.mediaGroups[e][t])i.mediaGroups[e][t][r].playlists.forEac
19h((e,t)=>{let r=i.playlists[e.id],s=r.id,n=r.resolvedUri;delete i.playlists[s],delete i.playlists[n]});delete i.mediaGroups[e][t]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.main,r=i.playlists.length,s=this.createCloneURI_(t.resolvedUri,e),n=ah(e.ID,s),a=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,n,e,a);i.playlists[r]=o,i.playlists[n]=o,i.playlists[s]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){let t=e.ID,i=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{if(r.mediaGroups[s]&&!r.mediaGroups[s][t]){for(let n in r.mediaGroups[s])if(n===i)for(let i in r.mediaGroups[s][t]={},r.mediaGroups[s][n]){let a=r.mediaGroups[s][n][i];r.mediaGroups[s][t][i]=(0,c.default)({},a);let o=r.mediaGroups[s][t][i],l=this.createCloneURI_(a.resolvedUri,e);o.resolvedUri=l,o.uri=l,o.playlists=[],a.playlists.forEach((n,a)=>{let l=r.playlists[n.id],d=ac(s,t,i),u=ah(t,d);if(l&&!r.playlists[u]){let t=this.createClonePlaylist_(l,u,e),i=t.resolvedUri;r.playlists[u]=t,r.playlists[i]=t}o.playlists[a]=this.createClonePlaylist_(n,u,e)})}}})}createClonePlaylist_(e,t,i,r){let s=this.createCloneURI_(e.resolvedUri,i),n={resolvedUri:s,uri:s,id:t};return e.segments&&(n.segments=[]),r&&(n.attributes=r),nB(e,n)}createCloneURI_(e,t){let i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;let r=t["URI-REPLACEMENT"].PARAMS;for(let e of Object.keys(r))i.searchParams.set(e,r[e]);return i.href}createCloneAttributes_(e,t){let i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(i[r]=e)}),i}getKeyIdSet(e){let t=new Set;if(!e||!e.contentProtection)return t;for(let i in e.contentProtection)if(e.contentProtection[i]&&e.contentProtection[i].attributes&&e.contentProtection[i].attributes.keyId){let r=e.contentProtection[i].attributes.keyId;t.add(r.toLowerCase())}return t}}let aR=function(e,t,i,r){let s="arraybuffer"===e.responseType?e.response:e.responseText;!t&&s&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=s.byteLength||s.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=Error("XHR Failed with a response of: "+(e&&(s||e.responseText)))),r(t,e)},aM=function(){let e=function e(t,i){t=nB({timeout:45e3},t);let r=e.beforeRequest||nP.Vhs.xhr.beforeRequest,s=e._requestCallbackSet||nP.Vhs.xhr._requestCallbackSet||new Set,n=e._responseCallbackSet||nP.Vhs.xhr._responseCallbackSet;r&&"function"==typeof r&&(nP.log.warn("beforeRequest is deprecated, use onRequest instead."),s.add(r));let a=!0===nP.Vhs.xhr.original?nP.xhr:nP.Vhs.xhr,o=((e,t)=>{if(!e||!e.size)return;let i=t;return e.forEach(e=>{i=e(i)}),i})(s,t);s.delete(r);let l=a(o||t,function(e,t){return n&&n.size&&n.forEach(i=>{i(l,e,t)}),aR(l,e,t,i)}),d=l.abort;return l.abort=function(){return l.aborted=!0,d.apply(l,arguments)},l.uri=t.uri,l.requestType=t.requestType,l.requestTime=Date.now(),l};return e.original=!0,e},aO=function(e){return"bytes="+e.offset+"-"+("bigint"==typeof e.offset||"bigint"==typeof e.length?l.default.BigInt(e.offset)+l.default.BigInt(e.length)-l.default.BigInt(1):e.offset+e.length-1)},aN=function(e){let t={};return e.byterange&&(t.Range=aO(e.byterange)),t},aj=function(e,t){let i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},aU=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},aB=function(e){let t={};return Object.keys(e).forEach(i=>{let r=e[i];F(r)?t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[i]=r}),t},aF=function(e){let t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},aq=function(e){return e.resolvedUri},aV=e=>{let t=Array.prototype.slice.call(e),i="";for(let e=0;e<t.length/16;e++)i+=t.slice(16*e,16*e+16).map(aj).join("")+" "+t.slice(16*e,16*e+16).map(aU).join("")+"\n";return i};var a$=Object.freeze({__proto__:null,createTransferableMessage:aB,initSegmentId:aF,segmentKeyId:aq,hexDump:aV,tagDump:e=>{let{bytes:t}=e;return aV(t)},textRanges:e=>{let t,i="";for(t=0;t<e.length;t++)i+=function(e,t){return e.start(t)+"-"+e.end(t)}(e,t)+" ";return i}});let aH=e=>{let{programTime:t,playlist:i,retryCount:r=2,seekTo:s,pauseAfterSeek:n=!0,tech:a,callback:o}=e;if(!o)throw Error("seekToProgramTime: callback must be provided");
19if(void 0===t||!i||!s)return o({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!i.endList&&!a.hasStarted_)return o({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0})(i))return o({message:"programDateTime tags must be provided in the manifest "+i.resolvedUri});let l=((e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let r=t.segments[0];if(i<new Date(r.dateTimeObject))return null;for(let e=0;e<t.segments.length-1&&(r=t.segments[e],!(i<new Date(t.segments[e+1].dateTimeObject)));e++);let s=t.segments[t.segments.length-1],n=s.dateTimeObject,a=s.videoTimingInfo?(e=>e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds)(s.videoTimingInfo):s.duration+.25*s.duration;return i>new Date(n.getTime()+1e3*a)?null:(i>new Date(n)&&(r=s),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:ad.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})})(t,i);if(!l)return o({message:`${t} was not found in the stream`});let d=l.segment,u=((e,t)=>{let i,r;try{i=new Date(e),r=new Date(t)}catch(e){}let s=i.getTime();return(r.getTime()-s)/1e3})(d.dateTimeObject,t);if("estimate"===l.type)return 0===r?o({message:`${t} is not buffered yet. Try again`}):(s(l.estimatedStart+u),void a.one("seeked",()=>{aH({programTime:t,playlist:i,retryCount:r-1,seekTo:s,pauseAfterSeek:n,tech:a,callback:o})}));let h=d.start+u;a.one("seeked",()=>o(null,a.currentTime())),n&&a.pause(),s(h)},az=(e,t)=>{if(4===e.readyState)return t()},{EventTarget:aW}=nP,aG=function(e,t){if(!ax(e,t)||e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length)||!e.sidx&&t.sidx||e.sidx&&!t.sidx||e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let i=0;i<e.segments.length;i++){let r=e.segments[i],s=t.segments[i];if(r.uri!==s.uri)return!1;if(!r.byterange&&!s.byterange)continue;let n=r.byterange,a=s.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},aX=(e,t,i,r)=>{let s=r.attributes.NAME||i;return`placeholder-uri-${e}-${t}-${s}`},aY=(e,t)=>(!!(!e.map&&!t.map)||!!(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,aK=(e,t)=>{let i={};for(let r in e){let s=e[r].sidx;if(s){let e=ef(s);if(!t[e])break;aY(t[e].sidxInfo,s)&&(i[e]=t[e])}}return i};class aQ extends aW{constructor(e,t,i={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);let{withCredentials:s=!1}=i;if(this.vhs_=t,this.withCredentials=s,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=nU("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,i){return!this.request||((this.request=null,e)?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){let r=e.sidx&&ef(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){l.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=l.default.setTimeout(()=>i(!1),0);return}let s=nj(e.sidx.resolvedUri),n=(s,n)=>{let a;if(this.requestErrored_(s,n,t))return;let o=this.mainPlaylistLoader_.sidxMapping_,{requestType:l}=n;try{a=(0,ez.default)(q(n.response).subarray(8))}catch(e){e.metadata=ay({requestType:l,request:n,parseFailure:!0}),this.requestErrored_(e,n,t);return}return o[r]={sidxInfo:e.sidx,sidx:a},ed(e,a,e.sidx.resolvedUri),i(!0)};this.request=((e,t,i,r)=>{let s,n=[],a=!1,o=function(e,t,r,s){return t.abort(),a=!0,i(e,t,r,s)},l=function(e,t){if(a)return;if(e)return e.metadata=ay({requestType:r,request:t,error:e}),o(e,t,"",n);let i=t.responseText.substring(n&&n.byteLength||0,t.responseText.length);if(n=X(n,G(i,!0)),s=s||eX(n),n.length<10||s&&n.length<s+2)return az(t,()=>o(e,t,"",n));let l=tr(n);return"ts"===l&&n.length<188||!l&&n.length<376?az(t,()=>o(e,t,"",n)):o(null,t,l,n)},d=t({uri:e,beforeSend(e){e.overrideMimeType("text/plain;
19 charset=x-user-defined"),e.addEventListener("progress",function(t){let{total:i,loaded:r}=t;return aR(e,null,{statusCode:e.status},l)})}},function(e,t){return aR(d,e,t,l)});return d})(s,this.vhs_.xhr,(t,i,r,a)=>{if(t)return n(t,i);if(!r||"mp4"!==r)return n({status:i.status,message:`Unsupported ${r||"unknown"} container type for sidx segment at URL: ${s}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},i);let{offset:o,length:l}=e.sidx.byterange;if(a.length>=l+o)return n(t,{response:a.subarray(o,o+l),status:i.status,uri:i.uri});this.request=this.vhs_.xhr({uri:s,responseType:"arraybuffer",requestType:"dash-sidx",headers:aN({byterange:e.sidx.byterange})},n)},"dash-sidx")}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},l.default.clearTimeout(this.minimumUpdatePeriodTimeout_),l.default.clearTimeout(this.mediaRequest_),l.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){let e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);let t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}let i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,i=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata(e){let{startingState:t,playlist:i}=e;this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,l.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(i.id),"HAVE_MAIN_MANIFEST"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),l.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(l.default.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){this.isPaused_=!1,l.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;let t=this.media();if(e){let e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=l.default.setTimeout(()=>this.load(),e);return}if(!this.started)return void this.start();t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){l.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=l.default.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){let t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,r)=>{if(i){let{requestType:e}=r;i.metadata=ay({requestType:e,request:r,error:i})}if(this.requestErrored_(i,r)){"HAVE_NOTHING"===this.state&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});let s=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=nj(this.mainPlaylistLoader_.srcUrl,r),s){this.handleMain_(),this.syncCl
19ientServerClock_(()=>e(r,s));return}return e(r,s)})}syncClientServerClock_(e){let t=(e=>{let t=eR(e,"UTCTiming")[0];if(!t)return null;let i=ej(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw Error(er.UNSUPPORTED_UTC_TIMING_SCHEME)}return i})(e$(this.mainPlaylistLoader_.mainXml_));return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:m(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,r)=>{let s;if(this.request){if(i){let{requestType:t}=r;return this.error.metadata=ay({requestType:t,request:r,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}s="HEAD"===t.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):this.mainLoaded_:Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=s-Date.now(),e()}}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){let e;l.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;let t=this.mainPlaylistLoader_.main,i={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:i});try{e=(e=>{let{mainXml:t,srcUrl:i,clientOffset:r,sidxMapping:s,previousManifest:n}=e,a=eH(t,{manifestUri:i,clientOffset:r,sidxMapping:s,previousManifest:n});return af(a,i,aX),a})({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:t})}catch(e){this.error=e,this.error.metadata={errorType:nP.Error.StreamingDashManifestParserError,error:e},this.trigger("error")}t&&(e=((e,t,i)=>{var r,s;let n=!0,a=nB(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){let r=t.playlists[e];if(r.sidx){let e=ef(r.sidx);i&&i[e]&&i[e].sidx&&ed(r,i[e].sidx,r.sidx.resolvedUri)}let s=aI(a,r,aG);s&&(a=s,n=!1)}return(ap(t,(e,t,i,r)=>{if(e.playlists&&e.playlists.length){let s=e.playlists[0].id,o=aI(a,e.playlists[0],aG);o&&(r in(a=o).mediaGroups[t][i]||(a.mediaGroups[t][i][r]=e),a.mediaGroups[t][i][r].playlists[0]=a.playlists[s],n=!1)}}),r=a,s=t,ap(r,(e,t,i,n)=>{s.mediaGroups[t][i]&&n in s.mediaGroups[t][i]||delete r.mediaGroups[t][i][n]}),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(n=!1),n)?null:a})(t,e,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=e||t;let r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!t||e&&e.minimumUpdatePeriod!==t.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(e),e){let{duration:t,endList:r}=e,s=[];
19e.playlists.forEach(e=>{s.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})}),i.parsedManifest={duration:t,isLive:!r,renditions:s},this.trigger({type:"manifestparsecomplete",metadata:i})}return!!e}updateMinimumUpdatePeriodTimeout_(){let e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(l.default.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){let t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=l.default.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{if(t){var i,r;let e;this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=(i=this.mainPlaylistLoader_.main,r=this.mainPlaylistLoader_.sidxMapping_,e=aK(i.playlists,r),ap(i,(t,i,s,n)=>{if(t.playlists&&t.playlists.length){let i=t.playlists;e=nB(e,aK(i,r))}}),e),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)})}})}refreshMedia_(e){if(!e)throw Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();let t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){let e=()=>{this.media().endList||(this.mediaUpdateTimeout=l.default.setTimeout(()=>{this.trigger("mediaupdatetimeout"),e()},aD(this.media(),!!i)))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){let e=this.mainPlaylistLoader_.main.eventStream.map(e=>({cueTime:e.start,frames:[{data:e.messageData}]}));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){let t=new Set;for(let i in e.contentProtection){let r=e.contentProtection[i].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var aZ={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};let aJ=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},a0=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(i){let t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}},a1=function(e){return function(){let t=a0(e),i=aJ(new Worker(t));i.objURL=t;let r=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},i}},a2=function(e){return`var browserWorkerPolyFill = ${aJ.toString()}; 20browserWorkerPolyFill(self); 21`+e},a4=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)};var a5=a1(a2(a4(function(){var t,i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:e.g,r=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var r;return!!e[t]&&(r=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(r,1),r>-1)},this.trigger=function(t){var i,r,s,n;if(i=e[t])if(2==arguments.length)for(r=0,s=i.length;r<s;++r)i[r].call(this,arguments[1]);else{for(n=[],r=arguments.length,r=1;r<arguments.length;++r)n.push(arguments[r]);for(r=0,s=i.length;r<s;++r)i[r].apply(this,n)}},this.dispose=function(){e={}}}};r.prototype.pipe=function(e){return this.on("data",function(t){e.push(t)}),this.on("done",function(t){e.flush(t)}),this.on("partialdone",function(t){e.partialFlush(t)}),this.on("endedtimeline",function(t){e.endTimeline(t)}),this.on("reset",function(t){e.reset(t)}),e},r.prototype.push=function(e){this.trigger("data",e)},r.prototype.flush=function(e){this.trigger("done",e)},r.prototype.partialFlush=function(e){this.trigger("partialdone",e)},r.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},r.prototype.reset=function(e){this.trigger("reset",e)};var s=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?
vendor: 14,890 bytes, line 21
21Number(t):t:0x100000000*i.getUint32(0)+i.getUint32(4)},n=0x100000000,a=n;if(e1={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(eM in e1)e1.hasOwnProperty(eM)&&(e1[eM]=[eM.charCodeAt(0),eM.charCodeAt(1),eM.charCodeAt(2),eM.charCodeAt(3)]);e2=new Uint8Array([105,115,111,109]),e5=new Uint8Array([97,118,99,49]),e4=new Uint8Array([0,0,0,1]),e8={video: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]),audio: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])},e7=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),e6=new Uint8Array([0,0,0,0,0,0,0,0]),te=e9=new Uint8Array([0,0,0,0,0,0,0,0]),tt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),ti=e9,e3=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}eF=function(e){var t,i,r=[],s=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);for(t=r.length;t--;)s+=r[t].byteLength;for(new DataView((i=new Uint8Array(s+8)).buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,s=8;t<r.length;t++)i.set(r[t],s),s+=r[t].byteLength;return i};eX=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),eF(e1.mdhd,t)},eG=function(e){var t;return eF(e1.mdia,eX(e),(t=e.type,eF(e1.hdlr,e8[t])),eq(e))},eq=function(e){return eF(e1.minf,"video"===e.type?eF(e1.vmhd,e3):eF(e1.smhd,e6),eF(e1.dinf,eF(e1.dref,e7)),eK(e))},eV=function(e){for(var t=e.length,i=[];t--;)i[t]=ez(e[t]);return eF.apply(null,[e1.moov,eH(0xffffffff)].concat(i).concat(e$(e)))},e$=function(e){for(var t=e.length,i=[];t--;)i[t]=eJ(e[t]);return eF.apply(null,[e1.mvex].concat(i))},eH=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(0xff000000&e)>>24,(0xff0000&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return eF(e1.mvhd,t)},eY=function(e){var t,i,r=e.samples||[],s=new Uint8Array(4+r.length);for(i=0;i<r.length;i++)t=r[i].flags,s[i+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return eF(e1.sdtp,s)},eK=function(e){return eF(e1.stbl,eQ(e),eF(e1.stts,ti),eF(e1.stsc,te),eF(e1.stsz,tt),eF(e1.stco,e9))},eQ=function(e){return eF(e1.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?eO(e):eN(e))},eO=function(e){var t,i,r=e.sps||[],s=e.pps||[],n=[],a=[];for(t=0;t<r.length;t++)n.push((65280&r[t].byteLength)>>>8),n.push(255&r[t].byteLength),n=n.concat(Array.prototype.slice.call(r[t]));for(t=0;t<s.length;t++)a.push((65280&s[t].byteLength)>>>8),a.push(255&s[t].byteLength),a=a.concat(Array.prototype.slice.call(s[t]));if(i=[e1.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,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]),eF(e1.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],n,[s.length],a))),eF(e1.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var o=e.sarRatio[0],l=e.sarRatio[1];i.push(eF(e1.pasp,new Uint8Array([(0xff000000&o)>>24,(0xff0000&o)>>16,(65280&o)>>8,255&o,(0xff000000&l)>>24,(0xff0000&l)>>16,(65280&l)>>8,255&l])))}return eF.apply(null,i)},eN=function(e){return eF(e1.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),eF(e1.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2])))},eW=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(0xff000000&e.id)>>24,(0xff0000&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(0xff000000&e.duration)>>24,(0xff0000&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return eF(e1.tkhd,t)},eZ=function(e){var t,i,r,s,n,o;return(t=eF(e1.tfhd,new Uint8Array([0,0,0,58,(0xff000000&e.id)>>24,(0xff0000&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),n=Math.floor(e.baseMediaDecodeTime/a),o=Math.floor(e.baseMediaDecodeTime%a),i=eF(e1.tfdt,new Uint8Array([1,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type)?(r=e0(e,92),eF(e1.traf,t,i,r)):(s=eY(e),r=e0(e,s.length+92),eF(e1.traf,t,i,r,s))},ez=function(e){return e.duration=e.duration||0xffffffff,eF(e1.trak,eW(e),eG(e))},eJ=function(e){var t=new Uint8Array([0,0,0,0,(0xff000000&e.id)>>24,(0xff0000&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),eF(e1.trex,t)},eB=function(e,t){var i=0,r=0,s=0,n=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(s=4),void 0!==e[0].compositionTimeOffset&&(n=8)),[0,0,i|r|s|n,1,(0xff000000&e.length)>>>24,(0xff0000&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(0xff000000&t)>>>24,(0xff0000&t)>>>16,(65280&t)>>>8,255&t]},eU=function(e,t){var i,r,s,n,a,o;for(t+=20+16*(n=e.samples||[]).length,(r=new Uint8Array((s=eB(n,t)).length+16*n.length)).set(s),i=s.length,o=0;o<n.length;o++)a=n[o],r[i++]=(0xff000000&a.duration)>>>24,r[i++]=(0xff0000&a.duration)>>>16,r[i++]=(65280&a.duration)>>>8,r[i++]=255&a.duration,r[i++]=(0xff000000&a.size)>>>24,r[i++]=(0xff0000&a.size)>>>16,r[i++]=(65280&a.size)>>>8,r[i++]=255&a.size,r[i++]=a.flags.isLeading<<2|a.flags.dependsOn,r[i++]=a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample,r[i++]=61440&a.flags.degradationPriority,r[i++]=15&a.flags.degradationPriority,r[i++]=(0xff000000&a.compositionTimeOffset)>>>24,r[i++]=(0xff0000&a.compositionTimeOffset)>>>16,r[i++]=(65280&a.compositionTimeOffset)>>>8,r[i++]=255&a.compositionTimeOffset;return eF(e1.trun,r)},ej=function(e,t){var i,r,s,n,a,o;for(t+=20+8*(n=e.samples||[]).length,(i=new Uint8Array((s=eB(n,t)).length+8*n.length)).set(s),r=s.length,o=0;o<n.length;o++)a=n[o],i[r++]=(0xff000000&a.duration)>>>24,i[r++]=(0xff0000&a.duration)>>>16,i[r++]=(65280&a.duration)>>>8,i[r++]=255&a.duration,i[r++]=(0xff000000&a.size)>>>24,i[r++]=(0xff0000&a.size)>>>16,i[r++]=(65280&a.size)>>>8,i[r++]=255&a.size;return eF(e1.trun,i)},e0=function(e,t){return"audio"===e.type?ej(e,t):eU(e,t)};var o=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},l=[33,16,5,32,164,27],d=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],u=function(e){for(var t=[];e--;)t.push(0);return t};ts=function(e){return 9e4*e},tn=function(e,t){return e*t},ta=function(e){return e/9e4},to=function(e,t){return e/t};var h=9e4,c=ts,p=ta,m=function(e,t){return ts(to(e,t))},f=function(e,t){return tn(ta(e),t)},g=function(e,t,i){return ta(i?e:e-t)},y=function(){if(!tr){var e;tr=Object.keys(e={96e3:[l,[227,64],u(154),[56]],88200:[l,[231],u(170),[56]],64e3:[l,[248,192],u(240),[56]],48e3:[l,[255,192],u(268),[55,148,128],u(54),[112]],44100:[l,[255,192],u(268),[55,163,128],u(84),[112]],32e3:[l,[255,192],u(268),[55,234],u(226),[112]],24e3:[l,[255,192],u(268),[55,255,128],u(268),[111,112],u(126),[224]],16e3:[l,[255,192],u(268),[55,255,128],u(268),[111,255],u(269),[223,108],u(195),[1,192]],12e3:[d,u(268),[3,127,248],u(268),[6,255,240],u(268),[13,255,224],u(268),[27,253,128],u(259),[56]],11025:[d,u(268),[3,127,248],u(268),[6,255,240],u(268),[13,255,224],u(268),[27,255,192],u(268),[55,175,128],u(108),[112]],8e3:[d,u(268),[3,121,16],u(47),[7]]}).reduce(function(t,i){return t[i]=new Uint8Array(e[i].reduce(function(e,t){return e.concat(t)},[])),t},{})}return tr},_=function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i},v=function(e){for(var t=0,i={payloadType:-1,payloadSize:0},r=0,s=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)r+=255,t++;for(r+=e[t++];255===e[t];)s+=255,t++;if(s+=e[t++],!i.payload&&4===r){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=r,i.payloadSize=s,i.payload=e.subarray(t,t+s);break}i.payload=void 0}t+=s,r=0,s=0}return i},b=function(e){return 181!==e.payload[0]||(e.payload[1]<<8|e.payload[2])!=49||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},T=function(e,t){var i,r,s,n,a=[];if(!(64&t[0]))return a;for(i=0,r=31&t[0];i<r;i++)n={type:3&t[(s=3*i)+2],pts:e},4&t[s+2]&&(n.ccData=t[s+3]<<8|t[s+4],a.push(n));return a},A=function(e){for(var t,i,r=e.byteLength,s=[],n=1;n<r-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(s.push(n+2),n+=2):n++;if(0===s.length)return e;i=new Uint8Array(t=r-s.length);var a=0;for(n=0;n<t;a++,n++)a===s[0]&&(a++,s.shift()),i[n]=e[a];return i},S=4,E=function(e){e=e||{},E.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new O(0,0),new O(0,1),new O(1,0),new O(1,1)],this.parse708captions_&&(this.cc708Stream_=new D({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};E.prototype=new r,E.prototype.push=function(e){var t,i,r;if("sei_rbsp"===e.nalUnitType&&(t=v(e.escapedRBSP)).payload&&t.payloadType===S&&(i=b(t))){if(e.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}r=T(e.pts,i),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},E.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)},E.prototype.flushStream=function(e){if(!this.captionPackets_.length)return void this.flushCCStreams(e);this.captionPackets_.forEach(function(e,t){e.presortIndex=t}),this.captionPackets_.sort(function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts}),this.captionPackets_.forEach(function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)},this),this.captionPackets_.length=0,this.flushCCStreams(e)},E.prototype.flush=function(){return this.flushStream("flush")},E.prototype.partialFlush=function(){return this.flushStream("partialFlush")},E.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},E.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},E.prototype.setsChannel1Active=function(e){return(30720&e.ccData)==4096},E.prototype.setsChannel2Active=function(e){return(30720&e.ccData)==6144},E.prototype.setsTextOrXDSActive=function(e){return(28928&e.ccData)==256||(30974&e.ccData)==4138||(30974&e.ccData)==6186},E.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var C={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},w=function(e){var t=C[e]||e;return 4096&e&&e===t?"":String.fromCharCode(t)},k=function(e){return 32<=e&&e<=127||160<=e&&e<=255},x=function(e){this.windowNum=e,this.reset()};x.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},x.prototype.getText=function(){return this.rows.join("\n")},x.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},x.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},x.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},x.prototype.addText=function(e){this.rows[this.rowIdx]+=e},x.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var I=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new x(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};I.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new x(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},I.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},I.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var D=function(e){e=e||{},D.prototype.init.call(this);var t,i=this,r=e.captionServices||{},s={};
21Object.keys(r).forEach(e=>{t=r[e],/^SERVICE/.test(e)&&(s[e]=t.encoding)}),this.serviceEncodings=s,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?i.new708Packet():null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e)}};D.prototype=new r,D.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},D.prototype.add708Bytes=function(e){var t=e.ccData;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(t>>>8),this.current708Packet.data.push(255&t)},D.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,r=null,s=0,n=t[s++];for(e.seq=n>>6,e.sizeCode=63&n;s<t.length;s++)i=(n=t[s++])>>5,r=31&n,7===i&&r>0&&(i=n=t[s++]),this.pushServiceBlock(i,s,r),r>0&&(s+=r-1)},D.prototype.pushServiceBlock=function(e,t,i){var r,s=t,n=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,s));s<t+i&&s<n.length;s++)k(r=n[s])?s=this.handleText(s,a):24===r?s=this.multiByteCharacter(s,a):16===r?s=this.extendedCommands(s,a):128<=r&&r<=135?s=this.setCurrentWindow(s,a):152<=r&&r<=159?s=this.defineWindow(s,a):136===r?s=this.clearWindows(s,a):140===r?s=this.deleteWindows(s,a):137===r?s=this.displayWindows(s,a):138===r?s=this.hideWindows(s,a):139===r?s=this.toggleWindows(s,a):151===r?s=this.setWindowAttributes(s,a):144===r?s=this.setPenAttributes(s,a):145===r?s=this.setPenColor(s,a):146===r?s=this.setPenLocation(s,a):143===r?a=this.reset(s,a):8===r?a.currentWindow.backspace():12===r?a.currentWindow.clearText():13===r?a.currentWindow.pendingNewLine=!0:14===r?a.currentWindow.clearText():141===r&&s++},D.prototype.extendedCommands=function(e,t){return k(this.current708Packet.data[++e])&&(e=this.handleText(e,t,{isExtended:!0})),e},D.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},D.prototype.initService=function(e,t){var i,r="SERVICE"+e,s=this;return r in this.serviceEncodings&&(i=this.serviceEncodings[r]),this.services[e]=new I(e,i,s),this.services[e].init(this.getPts(t),function(t){s.flushDisplayed(t,s.services[e])}),this.services[e]},D.prototype.handleText=function(e,t,i){var r,s,n=i&&i.isExtended,a=i&&i.isMultiByte,o=this.current708Packet.data,l=o[e],d=o[e+1],u=t.currentWindow;return a?(s=[l,d],e++):s=[l],r=t.textDecoder_&&!n?t.textDecoder_.decode(new Uint8Array(s)):a?String.fromCharCode(parseInt(s.map(e=>("0"+(255&e).toString(16)).slice(-2)).join(""),16)):w(4096*!!n|l),u.pendingNewLine&&!u.isEmpty()&&u.newLine(this.getPts(e)),u.pendingNewLine=!1,u.addText(r),e},D.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,r=i[e+1],s=i[e+2];return k(r)&&k(s)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},D.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data[e];return t.setCurrentWindow(7&i),e},D.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,r=i[e],s=7&r;t.setCurrentWindow(s);var n=t.currentWindow;return n.visible=(32&(r=i[++e]))>>5,n.rowLock=(16&r)>>4,n.columnLock=(8&r)>>3,n.priority=7&r,n.relativePositioning=(128&(r=i[++e]))>>7,n.anchorVertical=127&r,n.anchorHorizontal=r=i[++e],n.anchorPoint=(240&(r=i[++e]))>>4,n.rowCount=15&r,n.columnCount=63&(r=i[++e]),n.windowStyle=(56&(r=i[++e]))>>3,n.penStyle=7&r,n.virtualRowCount=n.rowCount+1,e},D.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,r=i[e],s=t.currentWindow.winAttr;return s.fillOpacity=(192&(r=i[++e]))>>6,s.fillRed=(48&r)>>4,s.fillGreen=(12&r)>>2,s.fillBlue=3&r,s.borderType=(192&(r=i[++e]))>>6,s.borderRed=(48&r)>>4,s.borderGreen=(12&r)>>2,s.borderBlue=3&r,r=i[++e],s.borderType+=(128&r)>>5,s.wordWrap=(64&r)>>6,s.printDirection=(48&r)>>4,s.scrollDirection=(12&r)>>2,s.justify=3&r,s.effectSpeed=(240&(r=i[++e]))>>4,s.effectDirection=(12&r)>>2,s.displayEffect=3&r,e},D.prototype.flushDisplayed=function(e,t){for(var i=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&i.push(t.windows[r].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},D.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream
vendor: 8,534 bytes, line 21
21:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},D.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible=1);return e},D.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible=0);return e},D.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible^=1);return e},D.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)i&1<<s&&t.windows[s].clearText();return e},D.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)i&1<<s&&t.windows[s].reset();return e},D.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,r=i[e],s=t.currentWindow.penAttr;return s.textTag=(240&(r=i[++e]))>>4,s.offset=(12&r)>>2,s.penSize=3&r,s.italics=(128&(r=i[++e]))>>7,s.underline=(64&r)>>6,s.edgeType=(56&r)>>3,s.fontStyle=7&r,e},D.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,r=i[e],s=t.currentWindow.penColor;return s.fgOpacity=(192&(r=i[++e]))>>6,s.fgRed=(48&r)>>4,s.fgGreen=(12&r)>>2,s.fgBlue=3&r,s.bgOpacity=(192&(r=i[++e]))>>6,s.bgRed=(48&r)>>4,s.bgGreen=(12&r)>>2,s.bgBlue=3&r,s.edgeRed=(48&(r=i[++e]))>>4,s.edgeGreen=(12&r)>>2,s.edgeBlue=3&r,e},D.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,r=i[e],s=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,s.row=15&i[++e],s.column=63&i[++e],e},D.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var P={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},L=function(e){return null===e?"":String.fromCharCode(e=P[e]||e)},R=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],M=function(){for(var e=[],t=15;t--;)e.push({text:"",indent:0,offset:0});return e},O=function(e,t){O.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(e){var t,i,r,s,n;if((t=32639&e.ccData)===this.lastControlCode_){this.lastControlCode_=null;return}if((61440&t)==4096?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),r=t>>>8,s=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=M();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=M();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=M()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(r,s))n=L((r=(3&r)<<8)|s),this[this.mode_](e.pts,n),this.column_++;else if(this.isExtCharacter(r,s))"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),n=L((r=(3&r)<<8)|s),this[this.mode_](e.pts,n),this.column_++;else if(this.isMidRowCode(r,s))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,(14&s)==14&&this.addFormatting(e.pts,["i"]),(1&s)==1&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(r,s)){let e=3&s;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(r,s)){var a=R.indexOf(7968&t);if("rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&a>=0&&a<=14&&(this.clearFormatting(e.pts),this.row_=a),1&s&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),(16&t)==16){let e=(14&t)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(s)&&(14&s)==14&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(r)&&(0===s&&(s=null),n=L(r)+L(s),this[this.mode_](e.pts,n),this.column_+=n.length)}};O.prototype=new r,O.prototype.flushDisplayed=function(e){let t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},i=[];this.displayed_.forEach((e,r)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){t(r)}e.text.length&&i.push({text:e.text,line:r+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&t(r)}),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_})},O.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=M(),this.nonDisplayed_=M(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},O.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},O.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},O.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},O.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},O.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},O.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},O.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},O.prototype.isNormalChar=function(e){return e>=32&&e<=127},O.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=M(),this.displayed_=M()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},O.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,i)},O.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},"");this.formatting_=[],this[this.mode_](e,t)}},O.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t,this.nonDisplayed_[this.row_].text=i},O.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i},O.prototype.shiftRowsUp_=function(){var e;
21for(e=0;e<this.topRow_;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.row_+1;e<15;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},O.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i};var N=E,j=O,U=D,B={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},F="shared",q=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>0x100000000;)e+=0x200000000*i;return e},V=function(e){var t,i;V.prototype.init.call(this),this.type_=e||F,this.push=function(e){if("metadata"===e.type)return void this.trigger("data",e);(this.type_===F||e.type===this.type_)&&(void 0===i&&(i=e.dts),e.dts=q(e.dts,i),e.pts=q(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};V.prototype=new r;var $=(e,t,i)=>{if(!e)return -1;for(var r=i;r<e.length;r++)if(e[r]===t)return r;return -1},H=function(e,t,i){var r,s="";for(r=t;r<i;r++)s+="%"+("00"+e[r].toString(16)).slice(-2);return s},z=function(e,t,i){return decodeURIComponent(H(e,t,i))},W=function(e,t,i){return unescape(H(e,t,i))},G=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},X={APIC:function(e){var t,i,r=1;!(3!==e.data[0]||(t=$(e.data,0,r))<0)&&(e.mimeType=W(e.data,r,t),r=t+1,e.pictureType=e.data[r],r++,(i=$(e.data,0,r))<0||(e.description=z(e.data,r,i),r=i+1,"-->"===e.mimeType?e.url=W(e.data,r,e.data.length):e.pictureData=e.data.subarray(r,e.data.length)))},"T*":function(e){3===e.data[0]&&(e.value=z(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;3===e.data[0]&&-1!==(t=$(e.data,0,1))&&(e.description=z(e.data,1,t),e.value=z(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=W(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;3===e.data[0]&&-1!==(t=$(e.data,0,1))&&(e.description=z(e.data,1,t),e.url=W(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=W(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},Y=function(e){var t,i=10,r=0,s=[];if(!(e.length<10)&&73===e[0]&&68===e[1]&&51===e[2]){r=G(e.subarray(6,10))+10,64&e[5]&&(i+=4,i+=G(e.subarray(10,14)),r-=G(e.subarray(16,20)));do{if((t=G(e.subarray(i+4,i+8)))<1)break;var n={id:String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]),data:e.subarray(i+10,i+t+10)};n.key=n.id,X[n.id]?X[n.id](n):"T"===n.id[0]?X["T*"](n):"W"===n.id[0]&&X["W*"](n),s.push(n),i+=10,i+=t}while(i<r)return s}},K=G,Q=X;(tl=function(e){var t,i={descriptor:e&&e.descriptor},r=0,s=[],n=0;if(tl.prototype.init.call(this),this.dispatchType=B.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,a,o,l;if("timed-metadata"===e.type){if(e.dataAlignmentIndicator&&(n=0,s.length=0),0===s.length&&(e.data.length<10||73!==e.data[0]||68!==e.data[1]||51!==e.data[2]))return void this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});if(s.push(e),n+=e.data.byteLength,1===s.length&&(r=K(e.data.subarray(6,10))+10),!(n<r)){for(l=0,t={data:new Uint8Array(r),frames:[],pts:s[0].pts,dts:s[0].dts};l<r;)t.data.set(s[0].data.subarray(0,r-l),l),l+=s[0].data.byteLength,n-=s[0].data.byteLength,s.shift();i=10,64&t.data[5]&&(i+=4,i+=K(t.data.subarray(10,14)),r-=K(t.data.subarray(16,20)));do{if((a=K(t.data.subarray(i+4,i+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((o={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+a+10)}).key=o.id,Q[o.id]?Q[o.id](o):"T"===o.id[0]?Q["T*"](o):"W"===o.id[0]&&Q["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var d=o.data,u=(1&d[3])<<30|d[4]<<22|d[5]<<14|d[6]<<6|d[7]>>>2;u*=4,o.timeStamp=u+=3&d[7],void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=a}while(i<r)this.trigger("data",t)}}}}).prototype=new r;var Z=tl;(td=function(){var e=new Uint8Array(188),t=0;td.prototype.init.call(this),this.push=function(i){var r,s=0,n=188;for(t?((r=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),r.set(i,t),t=0):r=i;n<r.byteLength;){if(71===r[s]&&71===r[n]){this.trigger("data",r.subarray(s,n)),s+=188,n+=188;continue}s++,n++}s<r.byteLength&&(e.set(r.subarray(s),0),t=r.byteLength-s)},this.flush=function(){188===t&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new r,(tu=function(){var e,t,i,r;tu.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var s=0;r.payloadUnitStartIndicator&&(s+=e[s]+1),"pat"===r.type?t(e.subarray(s),r):i(e.subarray(s),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=r.pmtPid},i=function(e,t){var i,s;if(1&e[5]){for(r.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,s=12+((15&e[10])<<8|e[11]);s<i;){var n=e[s],a=(31&e[s+1])<<8|e[s+2];n===B.H264_STREAM_TYPE&&null===r.programMapTable.video?r.programMapTable.video=a:n===B.ADTS_STREAM_TYPE&&null===r.programMapTable.audio?r.programMapTable.audio=a:n===B.METADATA_STREAM_TYPE&&(r.programMapTable["timed-metadata"][a]=n),s+=((15&e[s+3])<<8|e[s+4])+5}t.programMapTable=r.programMapTable}},this.push=function(t){var i={},r=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(r+=t[r]+1),0===i.pid)i.type="pat",e(t.subarray(r),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(r),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());
vendor: 2,982 bytes, line 21
21else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,i]):this.processPes_(t,r,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=B.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=B.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new r,tu.STREAM_TYPES={h264:27,adts:15},(th=function(){var e,t=this,i=!1,r={data:[],size:0},s={data:[],size:0},n={data:[],size:0},a=function(e,t){var i;let r=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===r&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=(4&e[6])!=0,192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))},o=function(e,i,r){var s,n=new Uint8Array(e.size),o={type:i},l=0,d=0,u=!1;if(e.data.length&&!(e.size<9)){for(l=0,o.trackId=e.data[0].pid;l<e.data.length;l++)s=e.data[l],n.set(s.data,d),d+=s.data.byteLength;a(n,o),u="video"===i||o.packetLength<=e.size,(r||u)&&(e.size=0,e.data.length=0),u&&t.trigger("data",o)}};th.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,t;switch(a.streamType){case B.H264_STREAM_TYPE:e=r,t="video";break;case B.ADTS_STREAM_TYPE:e=s,t="audio";break;case B.METADATA_STREAM_TYPE:e=n,t="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&o(e,t,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};null!==(e=a.programMapTable).video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",r)}})[a.type]()},this.reset=function(){r.size=0,r.data.length=0,s.size=0,s.data.length=0,this.trigger("reset")},this.flushStreams_=function(){o(r,"video"),o(s,"audio"),o(n,"timed-metadata")},this.flush=function(){if(!i&&e){var r={type:"metadata",tracks:[]};null!==e.video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",r)}i=!1,this.flushStreams_(),this.trigger("done")}}).prototype=new r;var J={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:td,TransportParseStream:tu,ElementaryStream:th,TimestampRolloverStream:V,CaptionStream:N,Cea608Stream:j,Cea708Stream:U,MetadataStream:Z};for(var ee in B)B.hasOwnProperty(ee)&&(J[ee]=B[ee]);var et=h,ei=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(tc=function(e){var t,i=0;tc.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts ski
21ping bytes ${e} to ${t} in frame ${i} outside syncword`})},this.push=function(r){var s,n,a,o,l,d,u=0;if(e||(i=0),"audio"===r.type){for(t&&t.length?((t=new Uint8Array((o=t).byteLength+r.data.byteLength)).set(o),t.set(r.data,o.byteLength)):t=r.data;u+7<t.length;){if(255!==t[u]||(246&t[u+1])!=240){"number"!=typeof s&&(s=u),u++;continue}if("number"==typeof s&&(this.skipWarn_(s,u),s=null),a=(1&~t[u+1])*2,n=(3&t[u+3])<<11|t[u+4]<<3|(224&t[u+5])>>5,d=(l=((3&t[u+6])+1)*1024)*et/ei[(60&t[u+2])>>>2],t.byteLength-u<n)break;this.trigger("data",{pts:r.pts+i*d,dts:r.dts+i*d,sampleCount:l,audioobjecttype:(t[u+2]>>>6&3)+1,channelcount:(1&t[u+2])<<2|(192&t[u+3])>>>6,samplerate:ei[(60&t[u+2])>>>2],samplingfrequencyindex:(60&t[u+2])>>>2,samplesize:16,data:t.subarray(u+7+a,u+n)}),i++,u+=n}"number"==typeof s&&(this.skipWarn_(s,u),s=null),t=t.subarray(u)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new r;var er=tc,es=function(e){var t=e.byteLength,i=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var s=e.byteLength-t,n=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw Error("no bytes available");n.set(e.subarray(s,s+a)),i=new DataView(n.buffer).getUint32(0),r=8*a,t-=a},this.skipBits=function(e){var s;r>e||(e-=r,s=Math.floor(e/8),e-=8*s,t-=s,this.loadWord()),i<<=e,r-=e},this.readBits=function(e){var s=Math.min(r,e),n=i>>>32-s;return((r-=s)>0?i<<=s:t>0&&this.loadWord(),(s=e-s)>0)?n<<s|this.readBits(s):n},this.skipLeadingZeros=function(){var e;for(e=0;e<r;++e)if((i&0x80000000>>>e)!=0)return i<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(tm=function(){var e,t,i=0;tm.prototype.init.call(this),this.push=function(r){t?((s=new Uint8Array(t.byteLength+r.data.byteLength)).set(t),s.set(r.data,t.byteLength),t=s):t=r.data;for(var s,n=t.byteLength;i<n-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<n;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do e++;while(1!==t[e]&&e<n)i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new r,tf={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(tp=function(){var e,t,i,r,s,n,a,o=new tm;tp.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,r=e.dts,o.push(e))},o.on("data",function(a){var o={trackId:t,pts:i,dts:r,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=s(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=s(a.subarray(1)),o.config=n(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)}),o.on("done",function(){e.trigger("done")}),o.on("partialdone",function(){e.trigger("partialdone")}),o.on("reset",function(){e.trigger("reset")}),o.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){var i,r=8,s=8;for(i=0;i<e;i++)0!==s&&(s=(r+t.readExpGolomb()+256)%256),r=0===s?r:s},s=function(e){for(var t,i,r=e.byteLength,s=[],n=1;n<r-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(s.push(n+2),n+=2):n++;if(0===s.length)return e;i=new Uint8Array(t=r-s.length);var a=0;for(n=0;n<t;a++,n++)a===s[0]&&(a++,s.shift()),i[n]=e[a];return i},n=function(e){var t,i,r,s,n,o,l,d,u,h,c,p,m=0,f=0,g=0,y=0,_=[1,1];if(i=(t=new es(e)).readUnsignedByte(),s=t.readUnsignedByte(),r=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),tf[i]&&(3===(n=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(p=0,c=3!==n?8:12;p<c;p++)t.readBoolean()&&(p<6?a(16,t):a(64,t));if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),p=0;p<l;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),d=t.readUnsignedExpGolomb(),u=t.readUnsignedExpGolomb(),0===(h=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),f=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:_=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}_[0],_[1]}return{profileIdc:i,levelIdc:r,profileCompatibility:s,width:(d+1)*16-2*m-2*f,height:(2-h)*(u+1)*16-2*g-2*y,sarRatio:_}}}).prototype=new r;var en=tp,ea=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],eo=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(i=i>=0?i:0,(16&e[t+5])>>4)?i+20:i+10},el=function(e,t){return e.length-t<10||73!==e[t]||68!==e[t+1]||51!==e[t+2]?t:(t+=eo(e,t),el(e,t))},ed=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},eu=function(e,t,i){var r,s="";for(r=t;r<i;r++)s+="%"+("00"+e[r].toString(16)).slice(-2);return s},eh={isLikelyAacData:function(e){var t=el(e,0);return e.length>
21=t+2&&(255&e[t])==255&&(240&e[t+1])==240&&(22&e[t+1])==16},parseId3TagSize:eo,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,r=e[t+4]<<3;return 6144&e[t+3]|r|i},parseType:function(e,t){return 73===e[t]&&68===e[t+1]&&51===e[t+2]?"timed-metadata":!0&e[t]&&(240&e[t+1])==240?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255!==e[t]||(246&e[t+1])!=240){t++;continue}return ea[(60&e[t+2])>>>2]}return null},parseAacTimestamp:function(e){var t,i,r;t=10,64&e[5]&&(t+=4,t+=ed(e.subarray(10,14)));do{if((i=ed(e.subarray(t+4,t+8)))<1)break;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+i+10);for(var s=0;s<r.byteLength;s++)if(0===r[s]){if("com.apple.streaming.transportStreamTimestamp"===unescape(eu(r,0,s))){var n=r.subarray(s+1),a=(1&n[3])<<30|n[4]<<22|n[5]<<14|n[6]<<6|n[7]>>>2;return a*=4,a+=3&n[7]}break}}t+=10,t+=i}while(t<e.byteLength)return null}};(tg=function(){var e=new Uint8Array,t=0;tg.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var r,s,n,a=0,o=0;for(e.length?(n=e.length,(e=new Uint8Array(i.byteLength+n)).set(e.subarray(0,n)),e.set(i,n)):e=i;e.length-o>=3;){if(73===e[o]&&68===e[o+1]&&51===e[o+2]){if(e.length-o<10||(a=eh.parseId3TagSize(e,o),o+a>e.length))break;r={type:"timed-metadata",data:e.subarray(o,o+a)},this.trigger("data",r),o+=a;continue}if((255&e[o])==255&&(240&e[o+1])==240){if(e.length-o<7||(a=eh.parseAdtsSize(e,o),o+a>e.length))break;s={type:"audio",data:e.subarray(o,o+a),pts:t,dts:t},this.trigger("data",s),o+=a;continue}o++}e=e.length-o>0?e.subarray(o):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new r;var ec=tg,ep=function(e){return eF(e1.mdat,e)},em=function(e,t){for(var i=[],r=t.length;r--;)i[r]=eZ(t[r]);return eF.apply(null,[e1.moof,eF(e1.mfhd,new Uint8Array([0,0,0,0,(0xff000000&e)>>24,(0xff0000&e)>>16,(65280&e)>>8,255&e]))].concat(i))},ef=function(e){var t,i=eF(e1.ftyp,e2,e4,e2,e5),r=eV(e);return(t=new Uint8Array(i.byteLength+r.byteLength)).set(i),t.set(r,i.byteLength),t},eg=function(e){var t,i,r=[],s=[];for(t=0,s.byteLength=0,s.nalCount=0,s.duration=0,r.byteLength=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(r.length&&(r.duration=i.dts-r.dts,s.byteLength+=r.byteLength,s.nalCount+=r.length,s.duration+=r.duration,s.push(r)),(r=[i]).byteLength=i.data.byteLength,r.pts=i.pts,r.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(r.keyFrame=!0),r.duration=i.dts-r.dts,r.byteLength+=i.data.byteLength,r.push(i));return s.length&&(!r.duration||r.duration<=0)&&(r.duration=s[s.length-1].duration),s.byteLength+=r.byteLength,s.nalCount+=r.length,s.duration+=r.duration,s.push(r),s},ey=function(e){var t,i,r=[],s=[];for(t=0,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,s.byteLength=0,s.nalCount=0,s.duration=0,s.pts=e[0].pts,s.dts=e[0].dts;t<e.length;t++)(i=e[t]).keyFrame?(r.length&&(s.push(r),s.byteLength+=r.byteLength,s.nalCount+=r.nalCount,s.duration+=r.duration),(r=[i]).nalCount=i.length,r.byteLength=i.byteLength,r.pts=i.pts,r.dts=i.dts,r.duration=i.duration):(r.duration+=i.duration,r.nalCount+=i.length,r.byteLength+=i.byteLength,r.push(i));return s.length&&r.duration<=0&&(r.duration=s[s.length-1].duration),s.byteLength+=r.byteLength,s.nalCount+=r.nalCount,s.duration+=r.duration,s.push(r),s},e_=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},ev=function(e,t){var i,r,s,n,a=t||0,l=[];for(i=0;i<e.length;i++)for(r=0,n=e[i];r<n.length;r++)s=o(n[r],a),a+=s.size,l.push(s);return l},eb=function(e){var t,i,r,s,n,a,o=0,l=new Uint8Array(e.byteLength+4*e.nalCount),d=new DataView(l.buffer);for(t=0;t<e.length;t++)for(i=0,s=e[t];i<s.length;i++)for(r=0,n=s[i];r<n.length;r++)a=n[r],d.setUint32(o,a.data.byteLength),o+=4,l.set(a.data,o),o+=a.data.byteLength;return l},eT=function(e,t,i,r){var s,n,a,o,l=0,d=0,u=0;if(t.length&&(s=m(e.baseMediaDecodeTime,e.samplerate),l=Math.ceil(h/(e.samplerate/1024)),i&&r&&(u=(d=Math.floor((s-Math.max(i,r))/l))*l),!(d<1)&&!(u>h/2))){for((n=y()[e.samplerate])||(n=t[0].data),a=0;a<d;a++)o=t[0],t.splice(0,0,{data:n,dts:o.dts-l,pts:o.pts-l});return e.baseMediaDecodeTime-=Math.floor(f(u,e.samplerate)),u}},eA=function(e){var t,i=[];for(t=0;t<e.length;t++)i.push({size:e[t].data.byteLength,duration:1024});return i},eS=function(e){var t,i,r=0,s=new Uint8Array(_(e));for(t=0;t<e.length;t++)i=e[t],s.set(i.data,r),r+=i.data.byteLength;return s},eE=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},eC=function(e,t){var i,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),i=Math.max(0,i=e.timelineStartInfo.baseMediaDecodeTime+r),"audio"===e.type&&(i*=e.samplerate/h,i=Math.floor(i)),i},ew=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},ek=eh.isLikelyAacData,ex=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],eI=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],eD=function(e,t){t.stream=e,this.trigger("log",t)},eP=function(e,t){for(var i=Object.keys(t),r=0;r<i.length;r++){var s=i[r];"headOfPipeline"!==s&&t[s].on&&t[s].on("log",eD.bind(e,s))}},eL=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},eR=function(e,t,i,r,s,n){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(r-t),pts:e+(s-i)},prependedContentDuration:n,baseMediaDecodeTime:e}};(t_=function(e,t){var i,r=[],s=0,n=0,a=1/0;i=(t=t||{}).firstSequenceNumber||0,t_.prototype.init.call(this),this.push=function(t){ew(e,t),e&&ex.forEach(function(i){e[i]=t[i]}),r.push(t)},this.setEarliestDts=function(e){s=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){n=e},this.flush=function(){var o,l,d,u,c,p,f,g,y,_;if(0===r.length)return void this.trigger("done","AudioSegmentStream");g=r,y=e,_=s,o=y.minSegmentDts>=_?g:(y.minSegmentDts=1/0,g.filter(function(e){return e.dts>=_&&(y.minSegmentDts=Math.min(y.minSegmentDts,e.dts),y.minSegmentPts=y.minSegmentDts,!0)})),e.baseMediaDecodeTime=eC(e,t.keepOriginalTimestamps),f=eT(e,o,n,a),e.samples=eA(o),d=ep(eS(o)),r=[],u=new Uint8Array((l=em(i,[e])).byteLength+d.byteLength),i++,u.set(l),u.set(d,l.byteLength),eE(e),c=Math.ceil(1024*h/e.samplerate),o.length&&(p=o.length*c,this.trigger("segmentTimingInfo",eR(m(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+p,o[0].pts+p,f||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+p})),this.trigger("data",{track:e,boxes:u}),this.trigger("done","AudioSegmentStream")},this.reset=function(){eE(e),r=[],this.trigger("reset")}}).prototype=new r,(ty=function(e,t){var i,r,s,n=[],a=[];i=(t=t||{}).firstSequenceNumber||0,ty.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){ew(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.config,e.sps=[t.data],eI.forEach(function(t){e[t]=r[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||s||(s=t.data,e.pps=[t.data]),n.push(t)},this.flush=function(){for(var r,s,o,l,d,u,h,c,p=0;n.length&&"access_unit_delimiter_rbsp"!==n[0].nalUnitType;)n.shift();
21if(0===n.length){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if((o=ey(eg(n)))[0][0].keyFrame||((s=this.getGopForFusion_(n[0],e))?(p=s.duration,o.unshift(s),o.byteLength+=s.byteLength,o.nalCount+=s.nalCount,o.pts=s.pts,o.dts=s.dts,o.duration+=s.duration):o=e_(o)),a.length){if(!(r=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o))){this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),n=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}eE(e),o=r}ew(e,o),e.samples=ev(o),d=ep(eb(o)),e.baseMediaDecodeTime=eC(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),h=o[0],c=o[o.length-1],this.trigger("segmentTimingInfo",eR(e.baseMediaDecodeTime,h.dts,h.pts,c.dts+c.duration,c.pts+c.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),n=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=new Uint8Array((l=em(i,[e])).byteLength+d.byteLength),i++,u.set(l),u.set(d,l.byteLength),this.trigger("data",{track:e,boxes:u}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),n=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){eE(e),r=void 0,s=void 0},this.getGopForFusion_=function(t){var i,r,s,n,a,o=1/0;for(a=0;a<this.gopCache_.length;a++)s=(n=this.gopCache_[a]).gop,e.pps&&eL(e.pps[0],n.pps[0])&&e.sps&&eL(e.sps[0],n.sps[0])&&!(s.dts<e.timelineStartInfo.dts)&&(i=t.dts-s.dts-s.duration)>=-1e4&&i<=45e3&&(!r||o>i)&&(r=n,o=i);return r?r.gop:null},this.alignGopsAtStart_=function(e){var t,i,r,s,n,o,l,d;for(n=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;t<a.length&&i<e.length&&(r=a[t],s=e[i],r.pts!==s.pts);){if(s.pts>r.pts){t++;continue}i++,n-=s.byteLength,o-=s.nalCount,l-=s.duration}return 0===i?e:i===e.length?null:((d=e.slice(i)).byteLength=n,d.duration=l,d.nalCount=o,d.pts=d[0].pts,d.dts=d[0].dts,d)},this.alignGopsAtEnd_=function(e){for(t=a.length-1,i=e.length-1,n=null,o=!1;t>=0&&i>=0;){if(r=a[t],s=e[i],r.pts===s.pts){o=!0;break}if(r.pts>s.pts){t--;continue}t===a.length-1&&(n=i),i--}if(!o&&null===n)return null;if(0===(l=o?i:n))return e;var t,i,r,s,n,o,l,d=e.slice(l),u=d.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return d.byteLength=u.byteLength,d.duration=u.duration,d.nalCount=u.nalCount,d.pts=d[0].pts,d.dts=d[0].dts,d},this.alignGopsWith=function(e){a=e}}).prototype=new r,(tb=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,tb.prototype.init.call(this),this.push=function(e){return e.content||e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):void(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),"audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes)))}}).prototype=new r,tb.prototype.flush=function(e){var t,i,r,s,n=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;else if(this.remuxTracks)return;else if(0===this.pendingTracks.length){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,eI.forEach(function(e){a.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,ex.forEach(function(e){a.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,a.initSegment=new Uint8Array((r=ef(this.pendingTracks)).byteLength),a.initSegment.set(r),a.data=new Uint8Array(this.pendingBytes),s=0;s<this.pendingBoxes.length;s++)a.data.set(this.pendingBoxes[s],n),n+=this.pendingBoxes[s].byteLength;for(s=0;s<this.pendingCaptions.length;s++)(t=this.pendingCaptions[s]).startTime=g(t.startPts,o,this.keepOriginalTimestamps),t.endTime=g(t.endPts,o,this.keepOriginalTimestamps),a.captionStream
vendor: 6,917 bytes, line 21
21s[t.stream]=!0,a.captions.push(t);for(s=0;s<this.pendingMetadata.length;s++)(i=this.pendingMetadata[s]).cueTime=g(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);for(a.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",a),s=0;s<a.captions.length;s++)t=a.captions[s],this.trigger("caption",t);for(s=0;s<a.metadata.length;s++)i=a.metadata[s],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},tb.prototype.setRemux=function(e){this.remuxTracks=e},(tv=function(e){var t,i,r=this,s=!0;tv.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="aac",s.metadataStream=new J.MetadataStream,s.aacStream=new ec,s.audioTimestampRolloverStream=new J.TimestampRolloverStream("audio"),s.timedMetadataTimestampRolloverStream=new J.TimestampRolloverStream("timed-metadata"),s.adtsStream=new er,s.coalesceStream=new tb(e,s.metadataStream),s.headOfPipeline=s.aacStream,s.aacStream.pipe(s.audioTimestampRolloverStream).pipe(s.adtsStream),s.aacStream.pipe(s.timedMetadataTimestampRolloverStream).pipe(s.metadataStream).pipe(s.coalesceStream),s.metadataStream.on("timestamp",function(e){s.aacStream.setTimestamp(e.timeStamp)}),s.aacStream.on("data",function(n){"timed-metadata"!==n.type&&"audio"!==n.type||s.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new t_(i,e),s.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream),r.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))}),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),eP(this,s)},this.setupTsPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="ts",s.metadataStream=new J.MetadataStream,s.packetStream=new J.TransportPacketStream,s.parseStream=new J.TransportParseStream,s.elementaryStream=new J.ElementaryStream,s.timestampRolloverStream=new J.TimestampRolloverStream,s.adtsStream=new er,s.h264Stream=new en,s.captionStream=new J.CaptionStream(e),s.coalesceStream=new tb(e,s.metadataStream),s.headOfPipeline=s.packetStream,s.packetStream.pipe(s.parseStream).pipe(s.elementaryStream).pipe(s.timestampRolloverStream),s.timestampRolloverStream.pipe(s.h264Stream),s.timestampRolloverStream.pipe(s.adtsStream),s.timestampRolloverStream.pipe(s.metadataStream).pipe(s.coalesceStream),s.h264Stream.pipe(s.captionStream).pipe(s.coalesceStream),s.elementaryStream.on("data",function(n){var a;if("metadata"===n.type){for(a=n.tracks.length;a--;)t||"video"!==n.tracks[a].type?i||"audio"!==n.tracks[a].type||((i=n.tracks[a]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=n.tracks[a]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime;t&&!s.videoSegmentStream&&(s.coalesceStream.numberOfTracks++,s.videoSegmentStream=new ty(t,e),s.videoSegmentStream.on("log",r.getLogTrigger_("videoSegmentStream")),s.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,s.audioSegmentStream.setEarliestDts(t.dts-r.baseMediaDecodeTime))}),s.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),s.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),s.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&s.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),s.videoSegmentStream.on("timingInfo",r.trigger.bind(r,"videoTimingInfo")),s.h264Stream.pipe(s.videoSegmentStream).pipe(s.coalesceStream)),i&&!s.audioSegmentStream&&(s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new t_(i,e),s.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),s.audioSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"audioSegmentTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream)),r.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}}),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("id3Frame",function(e){e.dispatchType=s.metadataStream.dispatchType,r.trigger("id3Frame",e)}),s.coalesceStream.on("caption",this.trigger.bind(this,"caption")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),eP(this,s)},this.setBaseMediaDecodeTime=function(r){var s=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,eE(i),s.audioTimestampRolloverStream&&s.audioTimestampRolloverStream.discontinuity()),t&&(s.videoSegmentStream&&(s.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,eE(t),s.captionStream.reset()),s.timestampRolloverStream&&s.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(s){var t=ek(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),s=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){s=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new r;var eM,eO,eN,ej,eU,eB,eF,eq,eV,e$,eH,ez,eW,eG,eX,eY,eK,eQ,eZ,eJ,e0,e1,e2,e4,e5,e8,e3,e6,e7,e9,te,tt,ti,tr,ts,tn,ta,to,tl,td,tu,th,tc,tp,tm,tf,tg,ty,t_,tv,tb,tT,tA,tS=tv,tE=function(e){return e>>>0},tC=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},tw=function(e,t){var i,r,s,n,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)r=tE(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),s=tC(e.subarray(i+4,i+8)),n=r>1?i+r:e.byteLength,s===t[0]&&(1===t.length?o.push(e.subarray(i+8,n)):(a=tw(e.subarray(i+8,n),t.slice(1))).length&&(o=o.c
vendor: 9,064 bytes, line 21
21oncat(a))),i=n;return o},tk=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=s(e.subarray(4)):t.baseMediaDecodeTime=tE(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},tx=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},s=1&r.flags[2],n=2&r.flags[2],a=8&r.flags[2],o=16&r.flags[2],l=32&r.flags[2],d=65536&r.flags[0],u=131072&r.flags[0];return t=8,s&&(t+=4,r.baseDataOffset=i.getUint32(12),t+=4),n&&(r.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(r.defaultSampleDuration=i.getUint32(t),t+=4),o&&(r.defaultSampleSize=i.getUint32(t),t+=4),l&&(r.defaultSampleFlags=i.getUint32(t)),d&&(r.durationIsEmpty=!0),!s&&u&&(r.baseDataOffsetIsMoof=!0),r},tI=s,tD=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},tP=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},r=new DataView(e.buffer,e.byteOffset,e.byteLength),s=1&i.flags[2],n=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],d=8&i.flags[1],u=r.getUint32(4),h=8;for(s&&(i.dataOffset=r.getInt32(h),h+=4),n&&u&&(t={flags:tD(e.subarray(h,h+4))},h+=4,a&&(t.duration=r.getUint32(h),h+=4),o&&(t.size=r.getUint32(h),h+=4),d&&(1===i.version?t.compositionTimeOffset=r.getInt32(h):t.compositionTimeOffset=r.getUint32(h),h+=4),i.samples.push(t),u--);u--;)t={},a&&(t.duration=r.getUint32(h),h+=4),o&&(t.size=r.getUint32(h),h+=4),l&&(t.flags=tD(e.subarray(h,h+4)),h+=4),d&&(1===i.version?t.compositionTimeOffset=r.getInt32(h):t.compositionTimeOffset=r.getUint32(h),h+=4),i.samples.push(t);return i},tL=s,tR=function(e){return new Date(1e3*e-20828448e5)},tM=function(e){var t,i,r=new DataView(e.buffer,e.byteOffset,e.byteLength),s=[];for(t=0;t+4<e.length;t+=i){if(i=r.getUint32(t),t+=4,i<=0){s.push("<span style='color:red;'>MALFORMED DATA</span>");continue}switch(31&e[t]){case 1:s.push("slice_layer_without_partitioning_rbsp");break;case 5:s.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:s.push("sei_rbsp");break;case 7:s.push("seq_parameter_set_rbsp");break;case 8:s.push("pic_parameter_set_rbsp");break;case 9:s.push("access_unit_delimiter_rbsp");break;default:s.push("UNKNOWN NAL - "+e[t]&31)}}return s},tO={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:tT(e.subarray(78,e.byteLength))}},avcC:function(e){var t,i,r,s,n=new DataView(e.buffer,e.byteOffset,e.byteLength),a={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(s=0,r=6;s<o;s++)i=n.getUint16(r),r+=2,a.sps.push(new Uint8Array(e.subarray(r,r+i))),r+=i;for(t=e[r],r++,s=0;s<t;s++)i=n.getUint16(r),r+=2,a.pps.push(new Uint8Array(e.subarray(r,r+i))),r+=i;return a},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},edts:function(e){return{boxes:tT(e)}},elst:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),edits:[]},s=i.getUint32(4);for(t=8;s;s--)0===r.version?(r.edits.push({segmentDuration:i.getUint32(t),mediaTime:i.getInt32(t+4),mediaRate:i.getUint16(t+8)+i.getUint16(t+10)/65536}),t+=12):(r.edits.push({segmentDuration:tL(e.subarray(t)),mediaTime:tL(e.subarray(t+8)),mediaRate:i.getUint16(t+16)+i.getUint16(t+18)/65536}),t+=20);return r},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:tC(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},r=8;r<e.byteLength;)i.compatibleBrands.push(tC(e.subarray(r,r+4))),r+=4;return i},dinf:function(e){return{boxes:tT(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:tT(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:tC(e.subarray(8,12)),name:""},i=8;for(i=24;i<e.byteLength;i++){if(0===e[i]){i++;break}t.name+=String.fromCharCode(e[i])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:tM(e)}},mdhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=4,s={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===s.version?(r+=4,s.creationTime=tR(i.getUint32(r)),r+=8,s.modificationTime=tR(i.getUint32(r)),r+=4,s.timescale=i.getUint32(r),r+=8):(s.creationTime=tR(i.getUint32(r)),r+=4,s.modificationTime=tR(i.getUint32(r)),r+=4,s.timescale=i.getUint32(r),r+=4),s.duration=i.getUint32(r),r+=4,t=i.getUint16(r),s.language+=String.fromCharCode((t>>10)+96),s.language+=String.fromCharCode(((992&t)>>5)+96),s.language+=String.fromCharCode((31&t)+96),s},mdia:function(e){return{boxes:tT(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:tT(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(i.streamDescriptor=tT(e.subarray(28))[0]),i},moof:function(e){return{boxes:tT(e)}},moov:function(e){return{boxes:tT(e)}},mvex:function(e){return{boxes:tT(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,r={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===r.version?(i+=4,r.creationTime=tR(t.getUint32(i)),i+=8,r.modificationTime=tR(t.getUint32(i)),i+=4,r.timescale=t.getUint32(i),i+=8):(r.creationTime=tR(t.getUint32(i)),i+=4,r.modificationTime=tR(t.getUint32(i)),i+=4,r.timescale=t.getUint32(i),i+=4),r.duration=t.getUint32(i),i+=4,r.rate=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,r.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=12,r.matrix=new Uint32Array(e.subarray(i,i+36)),i+=60,r.nextTrackId=t.getUint32(i),r},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)i.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return i},sidx:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},r=12;0===i.version?(i.earliestPresentationTime=t.getUint32(r),i.firstOffset=t.getUint32(r+4),r+=8):(i.earliestPresentationTime=tI(e.subarray(r)),i.firstOffset=tI(e.subarray(r+8)),r+=16),r+=2;var s=t.getUint16(r);for(r+=2;s>0;r+=12,s--)i.references.push({referenceType:(128&e[r])>>>7,referencedSize:0x7fffffff&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:0xfffffff&t.getUint32(r+8)});return i},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:tT(e)}},ctts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),compositionOffsets:[]},s=i.getUint32(4);for(t=8;s;t+=8,s--)r.compositionOffsets.push({sampleCount:i.getUint32(t),sampleOffset:i[0===r.version?"getUint32":"getInt32"](t+4)});return r},stss:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),syncSamples:[]},s=i.getUint32(4);for(t=8;s;t+=4,s--)r.syncSamples.push(i.getUint32(t));return r},stco:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},s=i.getUint32(4);for(t=8;s;t+=4,s--)r.chunkOffsets.push(i.getUint32(t));return r},stsc:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=i.getUint32(4),s={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;r;
vendor: 6,299 bytes, line 21
21t+=12,r--)s.sampleToChunks.push({firstChunk:i.getUint32(t),samplesPerChunk:i.getUint32(t+4),sampleDescriptionIndex:i.getUint32(t+8)});return s},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:tT(e.subarray(8))}},stsz:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)r.entries.push(i.getUint32(t));return r},stts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},s=i.getUint32(4);for(t=8;s;t+=8,s--)r.timeToSamples.push({sampleCount:i.getUint32(t),sampleDelta:i.getUint32(t+4)});return r},styp:function(e){return tO.ftyp(e)},tfdt:tk,tfhd:tx,tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,r={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===r.version?(i+=4,r.creationTime=tR(t.getUint32(i)),i+=8,r.modificationTime=tR(t.getUint32(i)),i+=4,r.trackId=t.getUint32(i),i+=12):(r.creationTime=tR(t.getUint32(i)),i+=4,r.modificationTime=tR(t.getUint32(i)),i+=4,r.trackId=t.getUint32(i),i+=8),r.duration=t.getUint32(i),i+=12,r.layer=t.getUint16(i),i+=2,r.alternateGroup=t.getUint16(i),i+=2,r.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=4,r.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,r.width=t.getUint16(i)+t.getUint16(i+2)/65536,i+=4,r.height=t.getUint16(i)+t.getUint16(i+2)/65536,r},traf:function(e){return{boxes:tT(e)}},trak:function(e){return{boxes:tT(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:tP,"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}},tN={inspect:tT=function(e){for(var t,i,r,s,n,a=0,o=[],l=new ArrayBuffer(e.length),d=new Uint8Array(l),u=0;u<e.length;++u)d[u]=e[u];for(t=new DataView(l);a<e.byteLength;)i=t.getUint32(a),r=tC(e.subarray(a+4,a+8)),s=i>1?a+i:e.byteLength,(n=(tO[r]||function(e){return{data:e}})(e.subarray(a+8,s))).size=i,n.type=r,o.push(n),a=s;return o},textify:tA=function(e,t){var i;return i=Array(2*(t=t||0)+1).join(" "),e.map(function(e,r){return i+e.type+"\n"+Object.keys(e).filter(function(e){return"type"!==e&&"boxes"!==e}).map(function(t){var r=i+" "+t+": ",s=e[t];if(s instanceof Uint8Array||s instanceof Uint32Array){var n=Array.prototype.slice.call(new Uint8Array(s.buffer,s.byteOffset,s.byteLength)).map(function(e){return" "+("00"+e.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return n?1===n.length?r+"<"+n.join("").slice(1)+">":r+"<\n"+n.map(function(e){return i+" "+e}).join("\n")+"\n"+i+" >":r+"<>"}return r+JSON.stringify(s,null,2).split("\n").map(function(e,t){return 0===t?e:i+" "+e}).join("\n")}).join("\n")+(e.boxes?"\n"+tA(e.boxes,t+1):"")}).join("\n")},parseType:tC,findBox:tw,parseTraf:tO.traf,parseTfdt:tO.tfdt,parseHdlr:tO.hdlr,parseTfhd:tO.tfhd,parseTrun:tO.trun,parseSidx:tO.sidx},tj=function(e){for(var t=0,i=String.fromCharCode(e[0]),r="";"\0"!==i;)r+=i,i=String.fromCharCode(e[++t]);return r+i},tU=function(e,t){var i="\0"!==t.scheme_id_uri,r=0===e&&tB(t.presentation_time_delta)&&i,s=1===e&&tB(t.presentation_time)&&i;return!(e>1)&&r||s},tB=function(e){return void 0!==e||null!==e},tF="undefined"!=typeof window?window:void 0!==i?i:"undefined"!=typeof self?self:{},tq=function(e){return("00"+e.toString(16)).slice(-2)},tV=function(e){var t,i,r,n,a,o,l,d=4,u=e[0];if(0===u){t=tj(e.subarray(d)),d+=t.length,i=tj(e.subarray(d)),d+=i.length;var h=new DataView(e.buffer);r=h.getUint32(d),d+=4,a=h.getUint32(d),d+=4,o=h.getUint32(d),d+=4,l=h.getUint32(d),d+=4}else if(1===u){var h=new DataView(e.buffer);r=h.getUint32(d),d+=4,n=s(e.subarray(d)),d+=8,o=h.getUint32(d),d+=4,l=h.getUint32(d),d+=4,t=tj(e.subarray(d)),d+=t.length,i=tj(e.subarray(d)),d+=i.length}var c={scheme_id_uri:t,value:i,timescale:r||1,presentation_time:n,presentation_time_delta:a,event_duration:o,id:l,message_data:new Uint8Array(e.subarray(d,e.byteLength))};return tU(u,c)?c:void 0},t$=function(e,t,i,r){return e||0===e?e/t:r+i/t},tH={findBox:tw,parseType:tC,timescale:function(e){return tw(e,["moov","trak"]).reduce(function(e,t){var i,r,s,n;return(i=tw(t,["tkhd"])[0])&&(r=0===i[0]?12:20,s=tE(i[r]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3]),n=tw(t,["mdia","mdhd"])[0])?(r=0===n[0]?12:20,e[s]=tE(n[r]<<24|n[r+1]<<16|n[r+2]<<8|n[r+3]),e):null},{})},startTime:function(e,t){var i=tw(t,["moof","traf"]).reduce(function(t,i){let r;var n,a=tw(i,["tfhd"])[0],o=e[tE(a[4]<<24|a[5]<<16|a[6]<<8|a[7])]||9e4,l=tw(i,["tfdt"])[0],d=new DataView(l.buffer,l.byteOffset,l.byteLength);return"bigint"==typeof(n=1===l[0]?s(l.subarray(4,12)):d.getUint32(4))?r=n/tF.BigInt(o):"number"!=typeof n||isNaN(n)||(r=n/o),r<Number.MAX_SAFE_INTEGER&&(r=Number(r)),r<t&&(t=r),t},1/0);return"bigint"==typeof i||isFinite(i)?i:0},compositionStartTime:function(e,t){var i,r=tw(t,["moof","traf"]),s=0,n=0;if(r&&r.length){var a=tw(r[0],["tfhd"])[0],o=tw(r[0],["trun"])[0],l=tw(r[0],["tfdt"])[0];if(a&&(i=tx(a).trackId),l&&(s=tk(l).baseMediaDecodeTime),o){var d=tP(o);d.samples&&d.samples.length&&(n=d.samples[0].compositionTimeOffset||0)}}var u=e[i]||9e4;"bigint"==typeof s&&(n=tF.BigInt(n),u=tF.BigInt(u));var h=(s+n)/u;return"bigint"==typeof h&&h<Number.MAX_SAFE_INTEGER&&(h=Number(h)),h},videoTrackIds:function(e){var t=tw(e,["moov","trak"]),i=[];return t.forEach(function(e){var t=tw(e,["mdia","hdlr"]),r=tw(e,["tkhd"]);t.forEach(function(e,t){var s,n,a=tC(e.subarray(8,12)),o=r[t];"vide"===a&&(n=0===(s=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?s.getUint32(12):s.getUint32(20),i.push(n))})}),i},tracks:function(e){var i=tw(e,["moov","trak"]),r=[];
21return i.forEach(function(e){var i={},s=tw(e,["tkhd"])[0];s&&(i.id=0===(l=new DataView(s.buffer,s.byteOffset,s.byteLength)).getUint8(0)?l.getUint32(12):l.getUint32(20));var n=tw(e,["mdia","hdlr"])[0];if(n){var a=tC(n.subarray(8,12));"vide"===a?i.type="video":"soun"===a?i.type="audio":i.type=a}var o=tw(e,["mdia","minf","stbl","stsd"])[0];if(o){var l,d,u=o.subarray(8);i.codec=tC(u.subarray(4,8));var h=tw(u,[i.codec])[0];h&&(/^[asm]vc[1-9]$/i.test(i.codec)?"avcC"===tC((d=h.subarray(78)).subarray(4,8))&&d.length>11?(i.codec+=".",i.codec+=tq(d[9]),i.codec+=tq(d[10]),i.codec+=tq(d[11])):i.codec="avc1.4d400d":/^mp4[a,v]$/i.test(i.codec)?"esds"===tC((d=h.subarray(28)).subarray(4,8))&&d.length>20&&0!==d[19]?(i.codec+="."+tq(d[19]),i.codec+="."+tq(d[20]>>>2&63).replace(/^0/,"")):i.codec="mp4a.40.2":i.codec=i.codec.toLowerCase())}var c=tw(e,["mdia","mdhd"])[0];c&&(i.timescale=t(c)),r.push(i)}),r},getTimescaleFromMediaHeader:t=function(e){var t=0===e[0]?12:20;return tE(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},getEmsgID3:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return tw(e,["emsg"]).map(e=>{var i=tV(new Uint8Array(e)),r=Y(i.message_data);return{cueTime:t$(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:t$(i.event_duration,i.timescale),frames:r}})}};let{parseTrun:tz}=tN,{findBox:tW}=tH;var tG={getMdatTrafPairs:function(e){var t=tW(e,["moof","traf"]),i=tW(e,["mdat"]),r=[];return i.forEach(function(e,i){var s=t[i];r.push({mdat:e,traf:s})}),r},parseSamples:function(e,t,i){var r=t,s=i.defaultSampleDuration||0,n=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach(function(e){var t=tz(e).samples;t.forEach(function(e){void 0===e.duration&&(e.duration=s),void 0===e.size&&(e.size=n),e.trackId=a,e.dts=r,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof r?(e.pts=r+tF.BigInt(e.compositionTimeOffset),r+=tF.BigInt(e.duration)):(e.pts=r+e.compositionTimeOffset,r+=e.duration)}),o=o.concat(t)}),o}},tX=A,{getMdatTrafPairs:tY,parseSamples:tK}=tG,tQ=function(e,t){for(var i=e,r=0;r<t.length;r++){var s=t[r];if(i<s.size)return s;i-=s.size}return null},tZ=function(e,t,i){var r,s,n,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(s=0;s+4<e.length;s+=n)if(n=o.getUint32(s),s+=4,!(n<=0))switch(31&e[s]){case 6:var d=e.subarray(s+1,s+1+n),u=tQ(s,t);if(r={nalUnitType:"sei_rbsp",size:n,data:d,escapedRBSP:tX(d),trackId:i},u)r.pts=u.pts,r.dts=u.dts,a=u;else if(a)r.pts=a.pts,r.dts=a.dts;else{l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+s+" for trackId "+i+". See mux.js#223."});break}l.seiNals.push(r)}return l},tJ=function(e,t){var i={};return tY(e).forEach(function(e){var r,s=e.mdat,n=e.traf,a=tx(tw(n,["tfhd"])[0]),o=a.trackId,l=tw(n,["tfdt"]),d=l.length>0?tk(l[0]).baseMediaDecodeTime:0,u=tw(n,["trun"]);t===o&&u.length>0&&(r=tZ(s,tK(u,d,a),o),i[o]||(i[o]={seiNals:[],logs:[]}),i[o].seiNals=i[o].seiNals.concat(r.seiNals),i[o].logs=i[o].logs.concat(r.logs))}),i},t0=function(e,t,i){if(null===t)return null;var r=tJ(e,t)[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:i}},t1=function(){var e,t,i,r,s,n,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new N,a=!0,n=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/r,e.endTime=e.endPts/r,s.captions.push(e),s.captionStreams[e.stream]=!0}),e.on("log",function(e){s.logs.push(e)})},this.isNewInit=function(e,t){return(!e||0!==e.length)&&(!t||"object"!=typeof t||0!==Object.keys(t).length)&&(i!==e[0]||r!==t[i])},this.parse=function(e,n,a){var o;if(!this.isInitialized()||!n||!a)return null;if(this.isNewInit(n,a))r=a[i=n[0]];else if(null===i||!r)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,n,a)}return((o=t0(e,i,r))&&o.logs&&(s.logs=s.logs.concat(o.logs)),null!==o&&o.seiNals)?(this.pushNals(o.seiNals),this.flushStream(),s):s.logs.length?{logs:s.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;n?e.partialFlush():e.flush()}
21,this.clearParsedCaptions=function(){s.captions=[],s.captionStreams={},s.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,r=null,s?this.clearParsedCaptions():s={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()};let{parseTfdt:t2}=tN,{getTimescaleFromMediaHeader:t4}=tH,{parseSamples:t5,getMdatTrafPairs:t8}=tG;var t3=function(){let e=9e4;this.init=function(t){let i=tw(t,["moov","trak","mdia","mdhd"])[0];i&&(e=t4(i))},this.parseSegment=function(t){let i=[],r=t8(t),s=0;return r.forEach(function(t){let r=t.mdat,n=t.traf,a=tw(n,["tfdt"])[0],o=tw(n,["tfhd"])[0],l=tw(n,["trun"]);if(a&&(s=t2(a).baseMediaDecodeTime),l.length&&o){let t=t5(l,s,o),n=0;t.forEach(function(t){let s=new TextDecoder("utf-8"),a=r.slice(n,n+t.size);if(tw(a,["vtte"])[0]){n+=t.size;return}tw(a,["vttc"]).forEach(function(r){let n,a,o=tw(r,["payl"])[0],l=tw(r,["sttg"])[0],d=t.pts/e,u=(t.pts+t.duration)/e;if(o)try{n=s.decode(o)}catch(e){console.error(e)}if(l)try{a=s.decode(l)}catch(e){console.error(e)}t.duration&&n&&i.push({cueText:n,start:d,end:u,settings:a})}),n+=t.size})}}),i}},t6=function(e){var t=31&e[1];return t<<=8,t|=e[2]},t7=function(e){return!!(64&e[1])},t9=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},ie=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},it={};it.ts={parseType:function(e,t){var i=t6(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=t7(e),i=4+t9(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t,i={},r=t7(e),s=4+t9(e);if(r&&(s+=e[s]+1),1&e[s+5]){t=3+((15&e[s+1])<<8|e[s+2])-4;for(var n=12+((15&e[s+10])<<8|e[s+11]);n<t;){var a=s+n;i[(31&e[a+1])<<8|e[a+2]]=e[a],n+=((15&e[a+3])<<8|e[a+4])+5}return i}},parsePayloadUnitStartIndicator:t7,parsePesType:function(e,t){switch(t[t6(e)]){case B.H264_STREAM_TYPE:return"video";case B.ADTS_STREAM_TYPE:return"audio";case B.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!t7(e))return null;var t,i=4+t9(e);if(i>=e.byteLength)return null;var r=null;return 192&(t=e[i+7])&&((r={}).pts=(14&e[i+9])<<27|(255&e[i+10])<<20|(254&e[i+11])<<12|(255&e[i+12])<<5|(254&e[i+13])>>>3,r.pts*=4,r.pts+=(6&e[i+13])>>>1,r.dts=r.pts,64&t&&(r.dts=(14&e[i+14])<<27|(255&e[i+15])<<20|(254&e[i+16])<<12|(255&e[i+17])<<5|(254&e[i+18])>>>3,r.dts*=4,r.dts+=(6&e[i+18])>>>1)),r},videoPacketContainsKeyFrame:function(e){for(var t,i=4+t9(e),r=e.subarray(i),s=0,n=0,a=!1;n<r.byteLength-3;n++)if(1===r[n+2]){s=n+5;break}for(;s<r.byteLength;)switch(r[s]){case 0:if(0!==r[s-1]){s+=2;break}if(0!==r[s-2]){s++;break}n+3!==s-2&&"slice_layer_without_partitioning_rbsp_idr"===ie(31&r[n+3])&&(a=!0);do s++;while(1!==r[s]&&s<r.length)n=s-2,s+=3;break;case 1:if(0!==r[s-1]||0!==r[s-2]){s+=3;break}"slice_layer_without_partitioning_rbsp_idr"===ie(31&r[n+3])&&(a=!0),n=s-2,s+=3;break;default:s+=3}return r=r.subarray(n),s-=n,n=0,r&&r.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===ie(31&r[n+3])&&(a=!0),a}},it.aac=eh;var ii=h,ir=function(e,t){for(var i,r=0,s=188;s<e.byteLength;){if(71===e[r]&&71===e[s]){switch(i=e.subarray(r,s),it.ts.parseType(i,t.pid)){case"pat":t.pid=it.ts.parsePat(i);break;case"pmt":var n=it.ts.parsePmt(i);t.table=t.table||{},Object.keys(n).forEach(function(e){t.table[e]=n[e]})}r+=188,s+=188;continue}r++,s++}},is=function(e,t,i){for(var r,s,n,a,o,l=0,d=188,u=!1;d<=e.byteLength;){if(71===e[l]&&(71===e[d]||d===e.byteLength)){if(r=e.subarray(l,d),"pes"===it.ts.parseType(r,t.pid)&&(n=it.ts.parsePesType(r,t.table),a=it.ts.parsePayloadUnitStartIndicator(r),"audio"===n&&a&&(o=it.ts.parsePesTime(r))&&(o.type="audio",i.audio.push(o),u=!0)),u)break;l+=188,d+=188;continue}l++,d++}for(l=(d=e.byteLength)-188,u=!1;l>=0;){if(71===e[l]&&(71===e[d]||d===e.byteLength)){if(r=e.subarray(l,d),"pes"===it.ts.parseType(r,t.pid)&&(n=it.ts.parsePesType(r,t.table),a=it.ts.parsePayloadUnitStartIndicator(r),"audio"===n&&a&&(o=it.ts.parsePesTime(r))&&(o.type="audio",i.audio.push(o),u=!0)),u)break;l-=188,d-=188;continue}l--,d--}},ia=function(e,t,i){for(var r,s,n,a,o,l,d,u,h=0,c=188,p=!1,m={data:[],size:0};c<e.byteLength;){if(71===e[h]&&71===e[c]){if(r=e.subarray(h,c),"pes"===it.ts.parseType(r,t.pid)&&(n=it.ts.parsePesType(r,t.table),a=it.ts.parsePayloadUnitStartIndicator(r),"video"===n)&&(a&&!p&&(o=it.ts.parsePesTime(r))&&(o.type="video",i.video.push(o),p=!0),!i.firstKeyFrame)){if(a&&0!==m.size){for(l=new Uint8Array(m.size),d=0;m.data.length;)u=m.data.shift(),l.set(u,d),d+=u.byteLength;if(it.ts.videoPacketContainsKeyFrame(l)){var f=it.ts.parsePesTime(l);f?(i.firstKeyFrame=f,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}m.size=0}m.data.push(r),m.size+=r.byteLength}if(p&&i.firstKeyFrame)break;h+=188,c+=188;continue}h++,c++}for(h=(c=e.byteLength)-188,p=!1;h>=0;){if(71===e[h]&&71===e[c]){if(r=e.subarray(h,c),"pes"===it.ts.parseType(r,t.pid)&&(n=it.ts.parsePesType(r,t.table),a=it.ts.parsePayloadUnitStartIndicator(r),"video"===n&&a&&(o=it.ts.parsePesTime(r))&&(o.type="video",i.video.push(o),p=!0)),p)break;h-=188,c-=188;continue}h--,c--}},io=function(e,t){if(e.audio&&e.audio.length){var i=t;
21(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach(function(e){e.dts=q(e.dts,i),e.pts=q(e.pts,i),e.dtsTime=e.dts/ii,e.ptsTime=e.pts/ii})}if(e.video&&e.video.length){var r=t;if((void 0===r||isNaN(r))&&(r=e.video[0].dts),e.video.forEach(function(e){e.dts=q(e.dts,r),e.pts=q(e.pts,r),e.dtsTime=e.dts/ii,e.ptsTime=e.pts/ii}),e.firstKeyFrame){var s=e.firstKeyFrame;s.dts=q(s.dts,r),s.pts=q(s.pts,r),s.dtsTime=s.dts/ii,s.ptsTime=s.pts/ii}}},il=function(e){for(var t,i=!1,r=0,s=null,n=null,a=0,o=0;e.length-o>=3;){switch(it.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10||(a=it.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===n&&(t=e.subarray(o,o+a),n=it.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7||(a=it.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=it.aac.parseSampleRate(t)),r++,o+=a;break;default:o++}if(i)return null}if(null===s||null===n)return null;var l=ii/s;return{audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+1024*r*l,pts:n+1024*r*l}]}},id=function(e){var t={pid:null,table:null},i={};for(var r in ir(e,t),t.table)if(t.table.hasOwnProperty(r))switch(t.table[r]){case B.H264_STREAM_TYPE:i.video=[],ia(e,t,i),0===i.video.length&&delete i.video;break;case B.ADTS_STREAM_TYPE:i.audio=[],is(e,t,i),0===i.audio.length&&delete i.audio}return i},iu=function(e,t){var i;return(i=it.aac.isLikelyAacData(e)?il(e):id(e))&&(i.audio||i.video)?(io(i,t),i):null};let ih=function(e,t){t.on("data",function(t){let i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};let r=t.data;t.data=r.buffer,e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])}),t.on("done",function(t){e.postMessage({action:"done"})}),t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t})}),t.on("videoSegmentTimingInfo",function(t){let i={start:{decode:p(t.start.dts),presentation:p(t.start.pts)},end:{decode:p(t.end.dts),presentation:p(t.end.pts)},baseMediaDecodeTime:p(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=p(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}),t.on("audioSegmentTimingInfo",function(t){let i={start:{decode:p(t.start.dts),presentation:p(t.start.pts)},end:{decode:p(t.end.dts),presentation:p(t.end.pts)},baseMediaDecodeTime:p(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=p(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t})}),t.on("caption",function(t){e.postMessage({action:"caption",caption:t})}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t})}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:p(t.start),end:p(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:p(t.start),end:p(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})};class ic{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new tS(this.options),ih(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new t1,this.captionParser.init());let t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}initMp4WebVttParser(e){this.webVttParser||(this.webVttParser=new t3);let t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.webVttParser.init(t)}getMp4WebVttText(e){this.webVttParser||(this.webVttParser=new t3);let t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.webVttParser.parseSegment(t);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:i||[],data:t.buffer},[t.buffer])}probeMp4StartTime(e){let{timescales:t,data:i}=e,r=tH.startTime(t,i);this.self.postMessage({action:"probeMp4StartTime",startTime:r,data:i},[i.buffer])}probeMp4Tracks(e){let{data:t}=e,i=tH.tracks(t);this.self.postMessage({action:"probeMp4Tracks",tracks:i,data:t},[t.buffer])}probeEmsgID3(e){let{data:t,offset:i}=e,r=tH.getEmsgID3(t,i);this.self.postMessage({action:"probeEmsgID3",id3Frames:r,emsgData:t},[t.buffer])}probeTs(e){let{data:t,baseStartTime:i}=e,r=iu(t,"number"!=typeof i||isNaN(i)?void 0:i*h),s=null;r&&((s={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1}).hasVideo&&(s.videoStart=r.video[0].ptsTime),s.hasAudio&&(s.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:s,data:t},[t.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){let t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){let t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(c(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(c(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){if("init"===e.data.action&&e.data.options){this.messageHandlers=new ic(self,e.data.options);return}this.messageHandlers||(this.messageHandlers=new ic(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data)}})));let a8=e=>{let{transmuxer:t,bytes:i,audioAppendStart:r,gopsToAlignWith:s,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:d,onVideoSegmentTimingInfo:u,onAudioSegmentTimingInfo:h,onId3:c,onCaptions:p,onDone:m,onEndedTimeline:f,onTransmuxerLog:g,isEndOfTimeline:y,segment:_,triggerSegmentEventFn:v}=e,b={buffer:[]},T=y;if(t.onmessage=i=>{if(t.currentTransmux===e)"data"===i.data.action&&((e,t,i)=>
21{let{type:r,initSegment:s,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:d}=e.data.segment;t.buffer.push({captions:n,captionStreams:a,metadata:o});let u=e.data.segment.boxes||{data:e.data.segment.data},h={type:r,data:new Uint8Array(u.data,u.data.byteOffset,u.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};void 0!==l&&(h.videoFrameDtsTime=l),void 0!==d&&(h.videoFramePtsTime=d),i(h)})(i,b,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&(b.gopInfo=i.data.gopInfo),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&d(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&u(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&h(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&c([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(T=!1,f()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(T||(t.onmessage=null,(e=>{let{transmuxedData:t,callback:i}=e;t.buffer=[],i(t)})({transmuxedData:b,callback:m}),a3(t)))},t.onerror=()=>{m(null,{message:"Received an error message from the transmuxer worker",metadata:{errorType:nP.Error.StreamingFailedToTransmuxSegment,segmentInfo:oM({segment:_})}})},r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(s)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:s}),void 0!==n&&t.postMessage({action:"setRemux",remux:n}),i.byteLength){let e=i instanceof ArrayBuffer?i:i.buffer,r=i instanceof ArrayBuffer?0:i.byteOffset;v({type:"segmenttransmuxingstart",segment:_}),t.postMessage({action:"push",data:e,byteOffset:r,byteLength:i.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},a3=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():a8(e.currentTransmux))},a6=(e,t)=>{e.postMessage({action:t}),a3(e)};var a7={reset:e=>{((e,t)=>{if(!t.currentTransmux){t.currentTransmux=e,a6(t,e);return}t.transmuxQueue.push(a6.bind(null,t,e))})("reset",e)},createTransmuxer:e=>{let t=new a5;t.currentTransmux=null,t.transmuxQueue=[];let i=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t}};let a9=function(e){let t=e.transmuxer,i=e.endAction||e.action,r=e.callback,s=(0,c.default)({},e,{endAction:null,transmuxer:null,callback:null}),n=s=>{s.data.action===i&&(t.removeEventListener("message",n),s.data.data&&(s.data.data=new Uint8Array(s.data.data,e.byteOffset||0,e.byteLength||s.data.data.byteLength),e.data&&(e.data=s.data.data)),r(s.data))};if(t.addEventListener("message",n),e.data){let i=e.data instanceof ArrayBuffer;s.byteOffset=i?0:e.data.byteOffset,s.byteLength=e.data.byteLength;let r=[i?e.data:e.data.buffer];t.postMessage(s,r)}else t.postMessage(s)},oe={FAILURE:2,TIMEOUT:-101,ABORTED:-102},ot="wvtt",oi=e=>{e.forEach(e=>{e.abort()})},or=(e,t)=>{let{requestType:i}=t,r=ay({requestType:i,request:t,error:e});return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:oe.TIMEOUT,xhr:t,metadata:r}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:oe.ABORTED,xhr:t,metadata:r}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:oe.FAILURE,xhr:t,metadata:r}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:oe.FAILURE,xhr:t,metadata:r}:null},os=(e,t,i,r)=>(s,n)=>{let a=n.response,o=or(s,n);if(o)return i(o,e);if(16!==a.byteLength)return i({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:oe.FAILURE,xhr:n},e);let l=new DataView(a),d=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=d;return r({type:"segmentkeyloadcomplete",segment:e,keyInfo:{uri:n.uri}}),i(null,e)},on=(e,t)=>{let i=tr(e.map.bytes);if("mp4"!==i){let r=e.map.resolvedUri||e.map.uri,s=i||"unknown";return t({internal:!0,message:`Found unsupported ${s} container for initialization segment at URL: ${r}`,code:oe.FAILURE,metadata:{mediaType:s}})}a9({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:i=>{let{tracks:r,data:s}=i;return e.map.bytes=s,r.forEach(function(t){(e.map.tracks=e.map.tracks||{},!e.map.tracks[t.type])&&(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale),"text"===t.type&&t.codec===ot&&e.transmuxer.postMessage({action:"initMp4WebVttParser",data:e.map.bytes}))}),t(null)}})},oa=e=>{let{segment:t,bytes:i,trackInfoFn:r,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h,doneFn:c,onTransmuxerLog:p,triggerSegmentEventFn:m}=e,f=new Uint8Array(i);if(eQ(f,["moof"]).length>0){t.isFmp4=!0;let{tracks:e}=t.map;if(e.text&&(!e.audio||!e.video)){h(t,{data:f,type:"text"}),((e,t,i)=>{t===ot&&a9({action:"getMp4WebVttText",data:e.bytes,transmuxer:e.transmuxer,callback:t=>{let{data:r,mp4VttCues:s}=t;e.bytes=r,i(null,e,{mp4VttCues:s})}})})(t,e.text.codec,c);return}let n={isFmp4:!0,hasVideo:!!e.video,hasAudio:!!e.audio};e.audio&&e.audio.codec&&"enca"!==e.audio.codec&&(n.audioCodec=e.audio.codec),e.video&&e.video.codec&&"encv"!==e.video.codec&&(n.videoCodec=e.video.codec),e.video&&e.audio&&(n.isMuxed=!0),r(t,n);let a=(e,i)=>{h(t,{data:f,type:n.hasAudio&&!n.isMuxed?"audio":"video"}),i&&i.length&&o(t,i),e&&e.length&&l(t,e),c(null,t,{})};a9({action:"probeMp4StartTime",timescales:t.map.timescales,data:f,transmuxer:t.transmuxer,callback:r=>{let{data:o,startTime:l}=r;i=o.buffer,t.bytes=f=o,n.hasAudio&&!n.isMuxed&&s(t,"audio","start",l),n.hasVideo&&s(t,"video","start",l),a9({action:"probeEmsgID3",data:f,transmuxer:t.transmuxer,offset:l,callback:r=>{let{emsgData:s,id3Frames:n}=r;if(i=s.buffer,t.bytes=f=s,!e.video||!s.byteLength||!t.transmuxer)return void a(void 0,n);a9({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:f,timescales:t.map.timescales,trackIds:[e.video.id],callback:e=>
21{i=e.data.buffer,t.bytes=f=e.data,e.logs.forEach(function(e){p(nB(e,{stream:"mp4CaptionParser"}))}),a(e.captions,n)}})}})}});return}if(!t.transmuxer)return void c(null,t,{});if(void 0===t.container&&(t.container=tr(f)),"ts"!==t.container&&"aac"!==t.container){r(t,{hasAudio:!1,hasVideo:!1}),c(null,t,{});return}(e=>{let{segment:t,bytes:i,trackInfoFn:r,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h,doneFn:c,onTransmuxerLog:p,triggerSegmentEventFn:m}=e,f=t.map&&t.map.tracks||{},g=!!(f.audio&&f.video),y=s.bind(null,t,"audio","start"),_=s.bind(null,t,"audio","end"),v=s.bind(null,t,"video","start"),b=s.bind(null,t,"video","end");a9({action:"probeTs",transmuxer:t.transmuxer,data:i,baseStartTime:t.baseStartTime,callback:e=>{t.bytes=i=e.data;let s=e.result;s&&(r(t,{hasAudio:s.hasAudio,hasVideo:s.hasVideo,isMuxed:g}),r=null),(e=>{if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,a8(e);return}e.transmuxer.transmuxQueue.push(e)})({bytes:i,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:g,onData:e=>{e.type="combined"===e.type?"video":e.type,h(t,e)},onTrackInfo:e=>{r&&(g&&(e.isMuxed=!0),r(t,e))},onAudioTimingInfo:e=>{y&&void 0!==e.start&&(y(e.start),y=null),_&&void 0!==e.end&&_(e.end)},onVideoTimingInfo:e=>{v&&void 0!==e.start&&(v(e.start),v=null),b&&void 0!==e.end&&b(e.end)},onVideoSegmentTimingInfo:e=>{m({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:{pts:{start:e.start.presentation,end:e.end.presentation},dts:{start:e.start.decode,end:e.end.decode}}}),n(e)},onAudioSegmentTimingInfo:e=>{m({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:{pts:{start:e.start.pts,end:e.end.pts},dts:{start:e.start.dts,end:e.end.dts}}}),a(e)},onId3:(e,i)=>{o(t,e,i)},onCaptions:e=>{l(t,[e])},isEndOfTimeline:d,onEndedTimeline:()=>{u()},onTransmuxerLog:p,onDone:(e,i)=>{c&&(e.type="combined"===e.type?"video":e.type,m({type:"segmenttransmuxingcomplete",segment:t}),c(i,t,e))},segment:t,triggerSegmentEventFn:m})}})})({segment:t,bytes:i,trackInfoFn:r,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h,doneFn:c,onTransmuxerLog:p,triggerSegmentEventFn:m})},oo=function(e,t){let i,{id:r,key:s,encryptedBytes:n,decryptionWorker:a,segment:o,doneFn:l}=e,d=e=>{if(e.data.source===r){a.removeEventListener("message",d);let i=e.data.decrypted;t(new Uint8Array(i.bytes,i.byteOffset,i.byteLength))}};a.onerror=()=>{let e="An error occurred in the decryption worker",t=oM({segment:o});l({message:e,metadata:{error:Error(e),errorType:nP.Error.StreamingFailedToDecryptSegment,segmentInfo:t,keyInfo:{uri:o.key.resolvedUri||o.map.key.resolvedUri}}},o)},a.addEventListener("message",d),i=s.bytes.slice?s.bytes.slice():new Uint32Array(Array.prototype.slice.call(s.bytes)),a.postMessage(aB({source:r,encrypted:n,key:i,iv:s.iv}),[n.buffer,i.buffer])},ol=nU("PlaylistSelector"),od=function(e){if(!e||!e.playlist)return;let t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},ou=function(e,t){if(!e)return"";let i=l.default.getComputedStyle(e);return i?i[t]:""},oh=function(e,t){let i=e.slice();e.sort(function(e,r){let s=t(e,r);return 0===s?i.indexOf(e)-i.indexOf(r):s})},oc=function(e,t){let i,r;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||l.default.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),i-(r=r||l.default.Number.MAX_VALUE)},op=function(e){let t,i,r,s,{main:n,bandwidth:a,playerWidth:o,playerHeight:d,playerObjectFit:u,limitRenditionByPlayerDimensions:h,playlistController:c}=e;if(!n)return;let p={bandwidth:a,width:o,height:d,limitRenditionByPlayerDimensions:h},m=n.playlists;ad.isAudioOnly(n)&&(m=c.getAudioTrackPlaylists_(),p.audioOnly=!0);let f=m.map(e=>{let t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||l.default.Number.MAX_VALUE,width:t,height:i,playlist:e}});oh(f,(e,t)=>e.bandwidth-t.bandwidth);let g=(f=f.filter(e=>!ad.isIncompatible(e.playlist))).filter(e=>ad.isEnabled(e.playlist));g.length||(g=f.filter(e=>!ad.isDisabled(e.playlist)));let y=g.filter(e=>e.bandwidth*aZ.BANDWIDTH_VARIANCE<a),_=y[y.length-1],v=y.filter(e=>e.bandwidth===_.bandwidth)[0];if(!1===h){let e=v||g[0]||f[0];if(e&&e.playlist){let t="sortedPlaylistReps";return v&&(t="bandwidthBestRep"),g[0]&&(t="enabledPlaylistReps"),ol(`choosing ${od(e)} using ${t} with options`,p),e.playlist}return ol("could not choose a playlist with options",p),null}let b=y.filter(e=>e.width&&e.height);oh(b,(e,t)=>e.width-t.width);let T=b.filter(e=>e.width===o&&e.height===d);_=T[T.length-1];let A=T.filter(e=>e.bandwidth===_.bandwidth)[0];if(A||(_=(i=(t=b.filter(e=>"cover"===u?e.width>o&&e.height>d:e.width>o||e.height>d)).filter(e=>e.width===t[0].width&&e.height===t[0].height))[i.length-1],r=i.filter(e=>e.bandwidth===_.bandwidth)[0]),c.leastPixelDiffSelector){let e=b.map(e=>(e.pixelDiff=Math.abs(e.width-o)+Math.abs(e.height-d),e));oh(e,(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),s=e[0]}let S=s||r||A||v||g[0]||f[0];if(S&&S.playlist){let e="sortedPlaylistReps";return s?e="leastPixelDiffRep":r?e="resolutionPlusOneRep":A?e="resolutionBestRep":v?e="bandwidthBestRep":g[0]&&(e="enabledPlaylistReps"),ol(`choosing ${od(S)} using ${e} with options`,p),S.playlist}return ol("could not choose a playlist with options",p),null},om=function(){let e=this.useDevicePixelRatio&&l.default.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),op({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(ou(this.tech_.el(),"width"),10)*e,playerHe
21ight:parseInt(ou(this.tech_.el(),"height"),10)*e,playerObjectFit:this.usePlayerObjectFit?ou(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},of=function(e){let{main:t,currentTime:i,bandwidth:r,duration:s,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,d=t.playlists.filter(e=>!ad.isIncompatible(e)),u=d.filter(ad.isEnabled);u.length||(u=d.filter(e=>!ad.isDisabled(e)));let h=u.filter(ad.hasAttribute.bind(null,"BANDWIDTH")).map(e=>{let t=l.getSyncPoint(e,s,o,i),d=ad.estimateSegmentRequestTime(n,r,e);return{playlist:e,rebufferingImpact:d*(t?1:2)-a}}),c=h.filter(e=>e.rebufferingImpact<=0);return(oh(c,(e,t)=>oc(t.playlist,e.playlist)),c.length)?c[0]:(oh(h,(e,t)=>e.rebufferingImpact-t.rebufferingImpact),h[0]||null)};function og(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(e){return""}}let oy=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let r=i;/^cc708_/.test(i)&&(r="SERVICE"+i.split("_")[1]);let s=t.textTracks().getTrackById(r);if(s)e[i]=s;else{let s=t.options_.vhs&&t.options_.vhs.captionServices||{},n=i,a=i,o=!1,l=s[r];l&&(n=l.label,a=l.language,o=l.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:r,default:o,label:n,language:a},!1).track}}},o_=function(e){let{inbandTextTracks:t,captionArray:i,timestampOffset:r}=e;if(!i)return;let s=l.default.WebKitDataCue||l.default.VTTCue;i.forEach(e=>{let i=e.stream;e.content?e.content.forEach(n=>{let a=new s(e.startTime+r,e.endTime+r,n.text);a.line=n.line,a.align="left",a.position=n.position,a.positionAlign="line-left",t[i].addCue(a)}):t[i].addCue(new s(e.startTime+r,e.endTime+r,e.text))})},ov=function(e){Object.defineProperties(e.frame,{id:{get:()=>(nP.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(nP.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(nP.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})},ob={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},oT=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),oA=(e,t,i)=>{!e.metadataTrack_&&(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,nP.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},oS=function(e,t,i){let r,s;if(i&&i.cues)for(r=i.cues.length;r--;)(s=i.cues[r]).startTime>=e&&s.endTime<=t&&i.removeCue(s)},oE=function(e){let t=e.cues;if(!t)return;let i={};for(let r=t.length-1;r>=0;r--){let s=t[r],n=`${s.startTime}-${s.endTime}-${s.text}`;i[n]?e.removeCue(s):i[n]=s}},oC=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;let i=Object.keys(e).sort(),r=Object.keys(t).sort();if(i.length!==r.length)return!1;for(let s=0;s<i.length;s++){let n=i[s];if(n!==r[s]||e[n]!==t[n])return!1}return!0},ow=function(e,t,i){t=t||[];let r=[],s=0;for(let n=0;n<t.length;n++){let a=t[n];if(e===a.timeline&&(r.push(n),(s+=a.duration)>i))return n}return 0===r.length?0:r[r.length-1]},ok=e=>"number"==typeof e&&isFinite(e),ox=1/60,oI=e=>{let{startOfSegment:t,duration:i,segment:r,part:s,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:d,timeline:u}=e,h=o.length-1,c="mediaIndex/partIndex increment";e.getMediaInfoForTime?c=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(c="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(c+=` with independent ${e.independent}`);let p="number"==typeof d,m=e.segment.uri?"segment":"pre-segment",f=p?n4({preloadSegment:r})-1:0;return`${m} [${n+l}/${n+h}]`+(p?` part [${d}/${f}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(p?` part start/end [${s.start} => ${s.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${u}]`+` selected by [${c}]`+` playlist [${a}]`},oD=e=>`${e}TimingInfo`,oP=e=>{let{timelineChangeController:t,currentTimeline:i,segmentTimeline:r,loaderType:s,audioDisabled:n}=e;if(i===r)return!1;if("audio"===s){let e=t.lastTimelineChange({type:"main"});return!e||e.to!==r}if("main"===s&&n){let e=t.pendingTimelineChange({type:"audio"});return!e||e.to!==r}return!1},oL=e=>{let t=e.pendingSegment_;if(t&&oP({timelineChangeController:e.timelineChangeController_,currentTimeline:e.currentTimeline_,segmentTimeline:t.timeline,loaderType:e.loaderType_,audioDisabled:e.audioDisabled_})&&(e=>{if(!e)return!1;let t=e.pendingTimelineChange({type:"audio"}),i=e.pendingTimelineChange({type:"main"}),r=t&&i,s=r&&t.to!==i.to;return!!r&&-1!==t.from&&-1!==i.from&&!!s})(e.timelineChangeController_)){if((e=>{let t=e.timelineChangeController_.pendingTimelineChange({type:"audio"}),i=e.timelineChangeController_.pendingTimelineChange({type:"main"});return t&&i&&t.to<i.to})(e))return void e.timelineChangeController_.trigger("audioTimelineBehind");e.timelineChangeController_.trigger("fixBadTimelineChange")}},oR=e=>{let{segmentDuration:t,maxDuration:i}=e;return!!t&&Math.round(t)>i+nq},oM=e=>{let{type:t,segment:i}=e;if(!i)return;let r=!!(i.key||i.map&&i.map.ke),s=!!(i.map&&!i.map.bytes),n=void 0===i.startOfSegment?i.start:i.startOfSegment;return{type:t||i.type,uri:i.resolvedUri||i.uri,start:n,duration:i.duration,isEncrypted:r,isMediaInitialization:s}};class oO extends nP.EventTarget{constructor(e,t={}){if(super(),!e)throw TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw TypeError("No currentTime getter specified");if(!e.mediaSource)throw TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={}
21,this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=nU(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():oL(this)}),this.sourceUpdater_.on("codecschange",e=>{this.trigger((0,c.default)({type:"codecschange"},e))}),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():oL(this)}),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",e=>{this.trigger((0,c.default)({type:"timelinechange"},e)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():oL(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():oL(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return a7.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&l.default.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if("WAITING"!==this.state){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,l.default.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&a7.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){let e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return nF();if("main"===this.loaderType_){let{hasAudio:t,hasVideo:i,isMuxed:r}=e;if(i&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;let i=aF(e),r=this.initSegments_[i];return t&&!r&&e.bytes&&(this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;let i=aq(e),r=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[i]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});let s={resolvedUri:(r||e).resolvedUri};return r&&(s.bytes=r.bytes),s}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_){if("INIT"===this.state&&this.couldBeginLoading_())return this.init_();this.couldBeginLoading_()&&("READY"===this.state||"INIT"===this.state)&&(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;let i=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let s=null;if(i&&(i.id?s=i.id:i.uri&&(s=i.uri)),this.logger_(`playlist update [${s} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: 22currentTime: ${this.currentTime_()} 23bufferedEnd: ${nZ(this.buffered_())} 24`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){null!==this.mediaIndex&&(e.endList||"number"!=typeof e.partTargetDuration?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}let n=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${n}]`),null!==this.mediaIndex)if(this.mediaIndex-=n,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{let e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){let e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}r&&(r.mediaIndex-=n,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(l.default.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}
24resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&a7.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;let e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;"hls"!==this.sourceType_||e||(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{},r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let s=1,n=()=>{0==--s&&i()};for(let i in(r||!this.audioDisabled_)&&(s++,this.sourceUpdater_.removeAudio(e,t,n)),(r||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,i,r)=>{let s=Math.ceil((t-r)*ts.ONE_SECOND_IN_TS),n=Math.ceil((i-r)*ts.ONE_SECOND_IN_TS),a=e.slice(),o=e.length;for(;o--&&!(e[o].pts<=n););if(-1===o)return a;let l=o+1;for(;l--&&!(e[l].pts<=s););return l=Math.max(l,0),a.splice(l,o-l+1),a})(this.gopBuffer_,e,t,this.timeMapping_),s++,this.sourceUpdater_.removeVideo(e,t,n)),this.inbandTextTracks_)oS(e,t,this.inbandTextTracks_[i]);oS(e,t,this.segmentMetadataTrack_),n()}monitorBuffer_(){this.checkBufferTimeout_&&l.default.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=l.default.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&l.default.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=l.default.setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;let e=this.chooseNextRequest_();if(!e)return;let t={segmentInfo:oM({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.mediaIndex,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.playlist_,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.partIndex;if(!t||!this.mediaSource_)return!1;let r="number"==typeof e&&t.segments[e],s=e+1===t.segments.length,n=!r||!r.parts||i+1===r.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&s&&n}chooseNextRequest_(){let e=this.buffered_(),t=nZ(e)||0,i=nJ(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,s=i>=this.goalBufferLength_(),n=this.playlist_.segments;if(!n.length||r||s)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);let a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(a.isSyncRequest)a.mediaIndex=ow(this.currentTimeline_,n,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${a.mediaIndex}`);else if(null!==this.mediaIndex){let e=n[this.mediaIndex],i="number"==typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[i+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=i+1):a.mediaIndex=this.mediaIndex+1}else{let e,i,r,s=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: 25For TargetTime: ${s}. 26CurrentTime: ${this.currentTime_()} 27BufferedEnd: ${t} 28Fetch At Buffer: ${this.fetchAtBuffer_} 29`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){let t=this.getSyncInfoFromMediaSequenceSync_(s);if(!t){let e="No sync info found while using media sequence sync";return this.error({message:e,metadata:{errorType:nP.Error.StreamingFailedToSelectNextSegment,error:Error(e)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --> ${t.end})`),e=t.segmentIndex,i=t.partIndex,r=t.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");let t=ad.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:s,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,i=t.partIndex,r=t.startTime}a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${s}`:`currentTime ${s}`,a.mediaIndex=e,a.startOfSegment=r,a.partIndex=i,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}let o=n[a.mediaIndex],l=o&&"number"==typeof a.partIndex&&o.parts&&o.parts[a.partIndex];if(!o||"number"==typeof a.partIndex&&!l)return null;"number"!=typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]);let d=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!d&&!l.independent)if(0===a.partIndex){let e=n[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(a.mediaIndex-=1,a.partIndex=e.parts.length-1,a.independent="previous segment")}else o.parts[a.partIndex-1].independent&&(a.partIndex-=1,a.independent="previous part");let u=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=n.length-1&&u&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,a.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(a))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;let t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);let i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;let r=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){let{independent:t,playlist:i,mediaIndex:r,startOfSegment:s,isSyncRequest:n,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,d=i.segments[r],u="number"==typeof a&&d.parts[a],h={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||d.resolvedUri,mediaIndex:r,partIndex:u?a:null,isSyncRequest:n,startOfSegment:s,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:d.timeline,duration:u&&u.duration||d.duration,segment:d,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},c=void 0!==o?o:this.isPendingTimestampOffset_;h.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:d.timeline,currentTimeline:this.currentTimeline_,startOfSegment:s,buffered:this.buffered_(),overrideCheck:c});
29let p=nZ(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(h.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(h.gopsToAlignWith=((e,t,i)=>{let r;if(null==t||!e.length)return[];let s=Math.ceil((t-i+3)*ts.ONE_SECOND_IN_TS);for(r=0;r<e.length&&!(e[r].pts>s);r++);return e.slice(r)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),h}timestampOffsetForSegment_(e){return(e=>{let{segmentTimeline:t,currentTimeline:i,startOfSegment:r,buffered:s,overrideCheck:n}=e;return n||t!==i?t<i?r:s.length?s.end(s.length-1):r:null})(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;let t=this.currentTime_(),i=e.bandwidth,r=this.pendingSegment_.duration,s=ad.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),n=nY(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(s<=n)return;let a=of({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:n,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;let o=s-n-a.rebufferingImpact,l=.5;n<=nq&&(l=1),a.playlist&&a.playlist.uri!==this.playlist_.uri&&!(o<l)&&(this.bandwidth=a.playlist.attributes.BANDWIDTH*aZ.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${oI(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){let{hasAudio:i,hasVideo:r}=t,s={segmentInfo:oM({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:s}),this.earlyAbortWhenNeeded_(e.stats),!(this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t))&&(t=t||{},oC(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():oL(this)))}handleTimingInfo_(e,t,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;let s=this.pendingSegment_,n=oD(t);s[n]=s[n]||{},s[n][i]=r,this.logger_(`timinginfo: ${t} - ${i} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():oL(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));let i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach(e=>{r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};let t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)}),Object.keys(r).forEach(e=>{let{startTime:t,endTime:s,captions:n}=r[e],a=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${s} for ${e}`),oy(a,this.vhs_.tech_,e),oS(t,s,a[e]),o_({captionArray:n,inbandTextTracks:a,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));this.addMetadataToTextTrack(i,t,this.duration_())}}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){let e=this.callQueue_;this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){let e=this.loadQueue_;
29this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;let e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!oP({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pendingSegment_;return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pendingSegment_;return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;let e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;let{hasAudio:i,hasVideo:r,isMuxed:s}=t;return!(r&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!s&&!e.audioTimingInfo||oP({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){oL(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}let i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[oD(t.type)].start;else{let e,t=this.getCurrentMediaInfo_(),r="main"===this.loaderType_&&t&&t.hasVideo;r&&(e=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:r,firstVideoFrameTimeForData:e,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});let e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_(e){let{type:t,initSegment:i,map:r,playlist:s}=e;if(r){let e=aF(r);if(this.activeInitSegmentId_===e)return null;i=this.initSegmentForMap(r,!0).bytes,this.activeInitSegmentId_=e}return i&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=s,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,i):null}handleQuotaExceededError_(e,t){let{segmentInfo:i,type:r,bytes:s}=e,n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+nK(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+nK(a).join(", "));let o=n.length?n.start(0):0,d=n.length?n.end(n.length-1):0,u=a.length?a.start(0):0,h=a.length?a.end(a.length-1):0;if(d-o<=1&&h-u<=1){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${s.byteLength}, audio buffer: ${nK(n).join(", ")}, video buffer: ${nK(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:i,type:r,bytes:s}));let c=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${c}`),this.remove(0,c,()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=l.default.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3)},!0)}handleAppendError_(e,t){let{segmentInfo:i,type:r,bytes:s}=e;if(t){if(22===t.code)return void this.handleQuotaExceededError_({segmentInfo:i,type:r,bytes:s});this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error({message:`${r} append of ${s.length}b failed for segment #${i.mediaIndex} in playlist ${i.playlist.id}`,metadata:{errorType:nP.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_(e){let{segmentInfo:t,type:i,initSegment:r,data:s,bytes:n}=e;if(!n){var a;let e,t,i=[s],o=s.byteLength;r&&(i.unshift(r),o+=r.byteLength),t=0,(a={bytes:o,segments:i}
29).bytes&&(e=new Uint8Array(a.bytes),a.segments.forEach(i=>{e.set(i,t),t+=i.byteLength})),n=e}let o={segmentInfo:oM({type:this.loaderType_,segment:t})};this.trigger({type:"segmentappendstart",metadata:o}),this.sourceUpdater_.appendBuffer({segmentInfo:t,type:i,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:t,type:i,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;let r=this.pendingSegment_.segment,s=`${e}TimingInfo`;r[s]||(r[s]={}),r[s].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[s].transmuxedPresentationStart=i.start.presentation,r[s].transmuxedDecodeStart=i.start.decode,r[s].transmuxedPresentationEnd=i.end.presentation,r[s].transmuxedDecodeEnd=i.end.decode,r[s].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){let{type:i,data:r}=t;if(!r||!r.byteLength||"audio"===i&&this.audioDisabled_)return;let s=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:s,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){oL(this),this.loadQueue_.push(()=>{let t=(0,c.default)({},e,{forceTimestampOffset:!0});(0,c.default)(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));let t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,s=e.timeline!==this.currentTimeline_&&e.timeline>0;this.logger_(`Requesting 30${og(e.uri)} 31${oI(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=(e=>{let{xhr:t,xhrOptions:i,decryptionWorker:r,segment:s,abortFn:n,progressFn:a,trackInfoFn:o,timingInfoFn:l,videoSegmentTimingInfoFn:d,audioSegmentTimingInfoFn:u,id3Fn:h,captionsFn:c,isEndOfTimeline:p,endedTimelineFn:m,dataFn:f,doneFn:g,onTransmuxerLog:y,triggerSegmentEventFn:_}=e,v=[],b=(e=>{let{activeXhrs:t,decryptionWorker:i,trackInfoFn:r,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h,doneFn:c,onTransmuxerLog:p,triggerSegmentEventFn:m}=e,f=0,g=!1;return(e,y)=>{if(!g){if(e)return g=!0,oi(t),c(e,y);if((f+=1)===t.length){let e=function(){if(y.encryptedBytes)return(e=>{let{decryptionWorker:t,segment:i,trackInfoFn:r,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h,doneFn:c,onTransmuxerLog:p,triggerSegmentEventFn:m}=e;m({type:"segmentdecryptionstart"}),oo({id:i.requestId,key:i.key,encryptedBytes:i.encryptedBytes,decryptionWorker:t,segment:i,doneFn:c},e=>{i.bytes=e,m({type:"segmentdecryptioncomplete",segment:i}),oa({segment:i,bytes:i.bytes,trackInfoFn:r,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h,doneFn:c,onTransmuxerLog:p,triggerSegmentEventFn:m})})})({decryptionWorker:i,segment:y,trackInfoFn:r,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h,doneFn:c,onTransmuxerLog:p,triggerSegmentEventFn:m});oa({segment:y,bytes:y.bytes,trackInfoFn:r,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h,doneFn:c,onTransmuxerLog:p,triggerSegmentEventFn:m})};if(y.endOfAllRequests=Date.now(),y.map&&y.map.encryptedBytes&&!y.map.bytes)return m({type:"segmentdecryptionstart",segment:y}),oo({decryptionWorker:i,id:y.requestId+"-init",encryptedBytes:y.map.encryptedBytes,key:y.map.
31key,segment:y,doneFn:c},i=>{y.map.bytes=i,m({type:"segmentdecryptioncomplete",segment:y}),on(y,i=>{if(i)return oi(t),c(i,y);e()})});e()}}}})({activeXhrs:v,decryptionWorker:r,trackInfoFn:o,timingInfoFn:l,videoSegmentTimingInfoFn:d,audioSegmentTimingInfoFn:u,id3Fn:h,captionsFn:c,isEndOfTimeline:p,endedTimelineFn:m,dataFn:f,doneFn:g,onTransmuxerLog:y,triggerSegmentEventFn:_});if(s.key&&!s.key.bytes){let e=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&e.push(s.map.key);let r=nB(i,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),n=os(s,e,b,_),a={uri:s.key.resolvedUri};_({type:"segmentkeyloadstart",segment:s,keyInfo:a});let o=t(r,n);v.push(o)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){let e=nB(i,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),r=os(s,[s.map.key],b,_),n={uri:s.map.key.resolvedUri};_({type:"segmentkeyloadstart",segment:s,keyInfo:n});let a=t(e,r);v.push(a)}let e=nB(i,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:aN(s.map),requestType:"segment-media-initialization"}),r=(e=>{let{segment:t,finishProcessingFn:i,triggerSegmentEventFn:r}=e;return(e,s)=>{let n=or(e,s);if(n)return i(n,t);let a=new Uint8Array(s.response);if(r({type:"segmentloaded",segment:t}),t.map.key)return t.map.encryptedBytes=a,i(null,t);t.map.bytes=a,on(t,function(e){if(e)return e.xhr=s,e.status=s.status,i(e,t);i(null,t)})}})({segment:s,finishProcessingFn:b,triggerSegmentEventFn:_});_({type:"segmentloadstart",segment:s});let n=t(e,r);v.push(n)}let T=nB(i,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:aN(s),requestType:"segment"}),A=(e=>{let{segment:t,finishProcessingFn:i,responseType:r,triggerSegmentEventFn:s}=e;return(e,n)=>{let a,o=or(e,n);if(o)return i(o,t);s({type:"segmentloaded",segment:t});let l="arraybuffer"!==r&&n.responseText?(e=>{let t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer})(n.responseText.substring(t.lastReachedChar||0)):n.response;return t.stats={bandwidth:(a=n).bandwidth,bytesReceived:a.bytesReceived||0,roundTripTime:a.roundTripTime||0},t.key?t.encryptedBytes=new Uint8Array(l):t.bytes=new Uint8Array(l),i(null,t)}})({segment:s,finishProcessingFn:b,responseType:T.responseType,triggerSegmentEventFn:_});_({type:"segmentloadstart",segment:s});let S=t(T,A);S.addEventListener("progress",(e=>{let{segment:t,progressFn:i,trackInfoFn:r,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h}=e;return e=>{if(!e.target.aborted)return t.stats=nB(t.stats,(e=>{let t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8e3),i})(e)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),i(e,t)}})({segment:s,progressFn:a,trackInfoFn:o,timingInfoFn:l,videoSegmentTimingInfoFn:d,audioSegmentTimingInfoFn:u,id3Fn:h,captionsFn:c,isEndOfTimeline:p,endedTimelineFn:m,dataFn:f})),v.push(S);let E={};return v.forEach(e=>{e.addEventListener("loadend",(e=>{let{loadendState:t,abortFn:i}=e;return e=>{e.target.aborted&&i&&!t.calledAbortFn&&(i(),t.calledAbortFn=!0)}})({loadendState:E,abortFn:n}))}),()=>oi(v)})({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:i||r&&s,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:t=>
31{let{message:i,level:r,stream:s}=t;this.logger_(`${oI(e)} logged from transmuxer stream ${s} as a ${r}: ${i}`)},triggerSegmentEventFn:e=>{let{type:t,segment:i,keyInfo:r,trackInfo:s,timingInfo:n}=e,a={segmentInfo:oM({segment:i})};r&&(a.keyInfo=r),s&&(a.trackInfo=s),n&&(a.timingInfo=n),this.trigger({type:t,metadata:a})}})}trimBackBuffer_(e){var t,i,r;let s,n=(t=this.seekable_(),i=this.currentTime_(),r=this.playlist_.targetDuration||10,s=i-aZ.BACK_BUFFER_LENGTH,t.length&&(s=Math.max(s,t.start(0))),Math.min(i-r,s));n>0&&this.remove(0,n)}createSimplifiedSegmentObj_(e){let t=e.segment,i=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,s=e.segment.map&&!e.segment.map.bytes,n={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:s},a=e.playlist.segments[e.mediaIndex-1];if(a&&a.timeline===t.timeline&&(a.videoTimingInfo?n.baseStartTime=a.videoTimingInfo.transmuxedDecodeEnd:a.audioTimingInfo&&(n.baseStartTime=a.audioTimingInfo.transmuxedDecodeEnd)),t.key){let i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=i}return t.map&&(n.map=this.initSegmentForMap(t.map)),n}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<ox)return void this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${ox}`);let i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e)return(this.pendingSegment_=null,this.state="READY",e.code===oe.ABORTED)?void 0:(this.pause(),e.code===oe.TIMEOUT)?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"));let r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=((e,t,i)=>{if(!t.length)return e;if(i)return t.slice();let r=t[0].pts,s=0;for(;s<e.length&&!(e[s].pts>=r);s++);return e.slice(0,s).concat(t)})(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){let t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_(e){let{currentStart:t,playlist:i,mediaIndex:r,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:o,audioTimingInfo:l}=e;if(void 0!==t)return t;if(!a)return l.start;let d=i.segments[r-1];return 0!==r&&d&&void 0!==d.start&&d.end===s+n?o.start:s}waitForAppendsToComplete_(e){let t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}let{hasAudio:i,hasVideo:r,isMuxed:s}=t,n="main"===this.loaderType_&&r,a=!this.audioDisabled_&&i&&!s;if(e.waitingOnAppends=0,!e.hasAppendedData_){e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}n&&e.waitingOnAppends++,a&&e.waitingOnAppends++,n&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}
31checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){var t,i;let r=(t=this.loaderType_,i=this.getCurrentMediaInfo_(),"main"===t&&i&&e?e.hasAudio||e.hasVideo?i.hasVideo&&!e.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!i.hasVideo&&e.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null);return!!r&&(this.error({message:r,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_(e){let{videoTimingInfo:t,audioTimingInfo:i,timingInfo:r}=e;return this.useDtsForTimestampOffset_?t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i&&"number"==typeof i.transmuxedDecodeStart?i.transmuxedDecodeStart:r.start:r.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};let t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){let e={segmentInfo:oM({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:e})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}let e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});let t=((e,t)=>{var i;let r;if("hls"!==t)return null;let s=(i={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},r=0,["video","audio"].forEach(function(e){let t,s=i[`${e}TimingInfo`];if(!s)return;let{start:n,end:a}=s;"bigint"==typeof n||"bigint"==typeof a?t=l.default.BigInt(a)-l.default.BigInt(n):"number"==typeof n&&"number"==typeof a&&(t=a-n),void 0!==t&&t>r&&(r=t)}),"bigint"==typeof r&&r<Number.MAX_SAFE_INTEGER&&(r=Number(r)),r);if(!s)return null;let n=e.playlist.targetDuration,a=oR({segmentDuration:s,maxDuration:2*n}),o=oR({segmentDuration:s,maxDuration:n}),d=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${s} when the reported duration is ${e.duration} and the target duration is ${n}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return a||o?{severity:a?"warn":"info",message:d}:null})(e,this.sourceType_);if(t&&("warn"===t.severity?nP.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${oI(e)}`);this.logger_(`Appended ${oI(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");let i=e.segment,r=e.part,s=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,n=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(s||n){this.logger_(`bad ${s?"segment":"part"} ${oI(e)}`),this.resetEverything();return}null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_
31(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<ox)return void this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${ox}`);let t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/i*8e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;let t=e.segment,i=t.start,r=t.end;if(!ok(i)||!ok(r))return;oS(i,r,this.segmentMetadataTrack_);let s=l.default.WebKitDataCue||l.default.VTTCue,n={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:r},a=new s(i,r,JSON.stringify(n));a.value=n,this.segmentMetadataTrack_.addCue(a)}}function oN(){}let oj=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())},oU=["video","audio"],oB=(e,t)=>{let i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]},oF=(e,t)=>{if(0===t.queue.length)return;let i=0,r=t.queue[i];if("mediaSource"===r.type){t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),r.action(t),r.doneFn&&r.doneFn(),oF("audio",t),oF("video",t));return}if("mediaSource"!==e&&!(!t.ready()||"closed"===t.mediaSource.readyState||oB(e,t))){if(r.type!==e){if(null===(i=((e,t)=>{for(let i=0;i<t.length;i++){let r=t[i];if("mediaSource"===r.type)break;if(r.type===e)return i}return null})(e,t.queue)))return;r=t.queue[i]}if(t.queue.splice(i,1),t.queuePending[e]=r,r.action(e,t),!r.doneFn){t.queuePending[e]=null,oF(e,t);return}}},oq=(e,t)=>{let i=t[`${e}Buffer`],r=oj(e);i&&(i.removeEventListener("updateend",t[`on${r}UpdateEnd_`]),i.removeEventListener("error",t[`on${r}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},oV=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),o$={appendBuffer:(e,t,i)=>(r,s)=>{let n=s[`${r}Buffer`];if(oV(s.mediaSource,n)){s.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${r}Buffer`);try{n.appendBuffer(e)}catch(e){s.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${r}Buffer`),s.queuePending[r]=null,i(e)}}},remove:(e,t)=>(i,r)=>{let s=r[`${i}Buffer`];if(oV(r.mediaSource,s)){r.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{s.remove(e,t)}catch(s){r.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},timestampOffset:e=>(t,i)=>{let r=i[`${t}Buffer`];oV(i.mediaSource,r)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),r.timestampOffset=e)},callback:e=>(t,i)=>{e()},endOfStream:e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){nP.log.warn("Failed to call media source endOfStream",e)}}},duration:e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){nP.log.warn("Failed to set media source duration",e)}},abort:()=>(e,t)=>{if("open"!==t.mediaSource.readyState)return;let i=t[`${e}Buffer`];if(oV(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){nP.log.warn(`Failed to abort on ${e}Buffer`,t)}}},addSourceBuffer:(e,t)=>i=>{let r=oj(e),s=R(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);let n=i.mediaSource.addSourceBuffer(s);n.addEventListener("updateend",i[`on${r}UpdateEnd_`]),n.addEventListener("error",i[`on${r}Error_`]),i.codecs[e]=t,i[`${e}Buffer`]=n},removeSourceBuffer:e=>t=>{let i=t[`${e}Buffer`];if(oq(e,t),oV(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(t){nP.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},changeType:e=>(t,i)=>{let r=i[`${t}Buffer`],s=R(e);if(!oV(i.mediaSource,r))return;let n=e.substring(0,e.indexOf(".")),a=i.codecs[t];if(a.substring(0,a.indexOf("."))===n)return;let o={codecsChangeInfo:{from:a,to:e}};i.trigger({type:"codecschange",metadata:o}),i.logger_(`changing ${t}Buffer codec from ${a} to ${e}`);try{r.changeType(s),i.codecs[t]=e}catch(e){o.errorType=nP.Error.StreamingCodecsChangeError,o.error=e,e.metadata=o,i.error_=e,i.trigger("error"),nP.log.warn(`Failed to changeType on ${t}Buffer`,e)}}},oH=e=>{let{type:t,sourceUpdater:i,action:r,doneFn:s,name:n}=e;i.queue.push({type:t,action:r,doneFn:s,name:n}),oF(t,i)},oz=(e,t)=>
vendor: 1,489 bytes, lines 31-32
31i=>{let r=function(e){if(0===e.length)return"Buffered Ranges are empty";let t="Buffered Ranges: \n";for(let i=0;i<e.length;i++){let r=e.start(i),s=e.end(i);t+=`${r} --> ${s}. Duration (${s-r}) 32`}return t}(t[`${e}Buffered`]());if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,r),t.queuePending[e]){let i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`])}oF(e,t)};class oW extends nP.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>oF("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=nU("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=oz("video",this),this.onAudioUpdateEnd_=oz("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}
32triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){oH({type:"mediaSource",sourceUpdater:this,action:o$.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){oH({type:e,sourceUpdater:this,action:o$.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer())return void nP.log.error("removeSourceBuffer is not supported!");oH({type:"mediaSource",sourceUpdater:this,action:o$.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!nP.browser.IS_FIREFOX&&l.default.MediaSource&&l.default.MediaSource.prototype&&"function"==typeof l.default.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return l.default.SourceBuffer&&l.default.SourceBuffer.prototype&&"function"==typeof l.default.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType())return void nP.log.error("changeType is not supported!");oH({type:e,sourceUpdater:this,action:o$.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{let i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){let{segmentInfo:i,type:r,bytes:s}=e;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${s.length} until video append`);return}if(oH({type:r,sourceUpdater:this,action:o$.appendBuffer(s,i||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;let e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){return oV(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:nF()}videoBuffered(){return oV(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:nF()}buffered(){let e=oV(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=oV(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():nG(this.audioBuffered(),this.videoBuffered())}setDuration(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oN;oH({type:"mediaSource",sourceUpdater:this,action:o$.duration(e),name:"duration",doneFn:t})}endOfStream(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oN;"string"!=typeof e&&(e=void 0),oH({type:"mediaSource",sourceUpdater:this,action:o$.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:oN;if(!this.audioBuffered().length||0===this.audioBuffered().end(0))return void i();oH({type:"audio",sourceUpdater:this,action:o$.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:oN;if(!this.videoBuffered().length||0===this.videoBuffered().end(0))return void i();oH({type:"video",sourceUpdater:this,action:o$.remove(e,t),doneFn:i,name:"remove"})}updating(){return!!(oB("audio",this)||oB("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(oH({type:"audio",sourceUpdater:this,action:o$.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(oH({type:"video",sourceUpdater:this,action:o$.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&oH({type:"audio",sourceUpdater:this,action:o$.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&oH({type:"video",sourceUpdater:this,action:o$.callback(e),name:"callback"})}
32dispose(){this.trigger("dispose"),oU.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>oq(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}let oG=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),oX=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class oY extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class oK extends oO{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return nF();let e=this.subtitlesTrack_.cues;return nF([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;let i=aF(e),r=this.initSegments_[i];if(t&&!r&&e.bytes){let t=new Uint8Array(oX.byteLength+e.bytes.byteLength);t.set(e.bytes),t.set(oX,e.bytes.byteLength),this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:t}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){oS(e,t,this.subtitlesTrack_)}fillBuffer_(){let e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){let e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",e),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===oe.TIMEOUT&&this.handleTimeout_(),e.code===oe.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}let r=this.pendingSegment_,s=i.mp4VttCues&&i.mp4VttCues.length;s&&(r.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");let n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof l.default.WebVTT&&"function"==typeof this.loadVttJs){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}n.requested=!0;try{this.parseVTTCues_(r)}catch(e){this.stopForError({message:e.message,metadata:{errorType:nP.Error.StreamingVttParserError,error:e}});return}if(s||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new l.default.VTTCue(e.startTime,e.endTime,e.text):e)}),oE(this.subtitlesTrack_),this.handleAppendsDone_()}
32handleData_(e,t){let i=e&&"vtt"===e.type,r=t&&"text"===t.type;i&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){let t=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(i=>{let r=i.start+t,s=i.end+t,n=new l.default.VTTCue(r,s,i.cueText);i.settings&&i.settings.split(" ").forEach(e=>{let t=e.split(":"),i=t[0],r=t[1];n[i]=isNaN(r)?r:Number(r)}),e.cues.push(n)})}parseVTTCues_(e){let t,i=!1;if("function"!=typeof l.default.WebVTT)throw new oY;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues)return void this.parseMp4VttCues_(e);"function"==typeof l.default.TextDecoder?t=new l.default.TextDecoder("utf8"):(t=l.default.WebVTT.StringDecoder(),i=!0);let r=new l.default.WebVTT.Parser(l.default,l.default.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=t=>{e.timestampmap=t},r.onparsingerror=e=>{nP.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=oG(t)),r.parse(t)}let s=e.bytes;i&&(s=oG(s)),r.parse(s),r.flush()}updateTimeMapping_(e,t,i){let r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}let{MPEGTS:s,LOCAL:n}=e.timestampmap,a=s/ts.ONE_SECOND_IN_TS-n+t.mapping;if(e.cues.forEach(e=>{let i=e.endTime-e.startTime,r=this.handleRollover_(e.startTime+a,t.time);e.startTime=Math.max(r,0),e.endTime=Math.max(r+i,0)}),!i.syncInfo){let t=e.cues[0].startTime,s=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,s-r.duration)}}}handleRollover_(e,t){let i;if(null===t)return e;let r=e*ts.ONE_SECOND_IN_TS,s=t*ts.ONE_SECOND_IN_TS;for(i=s<r?-0x200000000:0x200000000;Math.abs(r-s)>0x100000000;)r+=i;return r/ts.ONE_SECOND_IN_TS}}let oQ=function(e,t){let i=e.cues;for(let e=0;e<i.length;e++){let r=i[e];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},oZ=function(e,t){let i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!e.segments)return;let s=r;for(let r=0;r<e.segments.length;r++){let n=e.segments[r];if(i||(i=oQ(t,s+n.duration/2)),i){if("cueIn"in n){i.endTime=s,i.adEndTime=s,s+=n.duration,i=null;continue}if(s<i.endTime){s+=n.duration;continue}i.endTime+=n.duration}else if("cueOut"in n&&((i=new l.default.VTTCue(s,s+n.duration,n.cueOut)).adStartTime=s,i.adEndTime=s+parseFloat(n.cueOut),t.addCue(i)),"cueOutCont"in n){let[e,r]=n.cueOutCont.split("/").map(parseFloat);(i=new l.default.VTTCue(s,s+n.duration,"")).adStartTime=s-e,i.adEndTime=i.adStartTime+r,t.addCue(i)}s+=n.duration}};class oJ{constructor({start:e,end:t,segmentIndex:i,partIndex:r=null,appended:s=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=r,this.appended_=s}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class o0{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class o1{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){let{mediaSequence:i,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(i,r),this.isReliable_)return this.updateStorage_(r,i,this.calculateBaseTime_(i,r,t))}getSyncInfoForTime(e){for(let{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(let t of i)if(t.isInRange(e))return t}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}
32updateStorage_(e,t,i){let r=new Map,s="\n",n=i,a=t;this.start_=n,e.forEach((e,t)=>{let i=this.storage_.get(a),o=n,l=o+e.duration,d=!!(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended),u=new oJ({start:o,end:l,appended:d,segmentIndex:t});e.syncInfo=u;let h=n,c=(e.parts||[]).map((e,r)=>{let n=h,o=h+e.duration,l=!!(i&&i.partsSyncInfo&&i.partsSyncInfo[r]&&i.partsSyncInfo[r].isAppended),d=new oJ({start:n,end:o,appended:l,segmentIndex:t,partIndex:r});return h=o,s+=`Media Sequence: ${a}.${r} | Range: ${n} --> ${o} | Appended: ${l} 33`,e.syncInfo=d,d});r.set(a,new o0(u,c)),s+=`${og(e.resolvedUri)} | Media Sequence: ${a} | Range: ${o} --> ${l} | Appended: ${d} 34`,a++,n=l}),this.end_=n,this.storage_=r,this.diagnostics_=s}calculateBaseTime_(e,t,i){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;let r=Math.min(...this.storage_.keys());if(e<r){let i=r-e,s=this.storage_.get(r).segmentSyncInfo.start;for(let e=0;e<i;e++)s-=t[e].duration;return s}return i}isReliablePlaylist_(e,t){return null!=e&&Array.isArray(t)&&t.length}}class o2 extends o1{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,i){if(!this.storage_.size){let t=this.parent_.getSyncInfoForMediaSequence(e);return t?t.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,i)}}let o4=[{name:"VOD",run:(e,t,i,r,s)=>i!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(e,t,i,r,s,n)=>{let a=e.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;let o=a.getSyncInfoForTime(s);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(e,t,i,r,s)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let n=null,a=null,o=n1(t);s=s||0;for(let i=0;i<o.length;i++){let r=t.endList||0===s?i:o.length-(i+1),l=o[r],d=l.segment,u=e.timelineToDatetimeMappings[d.timeline];if(!u||!d.dateTimeObject)continue;let h=d.dateTimeObject.getTime()/1e3+u;if(d.parts&&"number"==typeof l.partIndex)for(let e=0;e<l.partIndex;e++)h+=d.parts[e].duration;let c=Math.abs(s-h);if(null!==a&&(0===c||a<c))break;a=c,n={time:h,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}return n}},{name:"Segment",run:(e,t,i,r,s)=>{let n=null,a=null;s=s||0;let o=n1(t);for(let e=0;e<o.length;e++){let i=t.endList||0===s?e:o.length-(e+1),l=o[i],d=l.segment,u=l.part&&l.part.start||d&&d.start;if(d.timeline===r&&void 0!==u){let e=Math.abs(s-u);if(null!==a&&a<e)break;(!n||null===a||a>=e)&&(a=e,n={time:u,segmentIndex:l.segmentIndex,partIndex:l.partIndex})}}return n}},{name:"Discontinuity",run:(e,t,i,r,s)=>{let n=null;if(s=s||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let r=0;r<t.discontinuityStarts.length;r++){let a=t.discontinuityStarts[r],o=t.discontinuitySequence+r+1,l=e.discontinuities[o];if(l){let e=Math.abs(s-l.time);if(null!==i&&i<e)break;(!n||null===i||i>=e)&&(i=e,n={time:l.time,segmentIndex:a,partIndex:null})}}}return n}},{name:"Playlist",run:(e,t,i,r,s)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class o5 extends nP.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};let t=new o1,i=new o2(t),r=new o2(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=nU("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,r,s){if(t!==1/0)return o4.find(e=>{let{name:t}=e;return"VOD"===t}).run(this,e,t);let n=this.runStrategies_(e,t,i,r,s);if(!n.length)return null;for(let t of n){let{syncPoint:i,strategy:s}=t,{segmentIndex:n,time:a}=i;if(n<0)continue;let o=a+e.segments[n].duration;if(this.logger_(`Strategy: ${s}. Current time: ${r}. selected segment: ${n}. Time: [${a} -> ${o}]}`),r>=a&&r<o)return this.logger_("Found sync point with exact match: ",i),i}return this.selectSyncPoint_(n,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;let i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;let r=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+n9({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.
34segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,s){let n=[];for(let a=0;a<o4.length;a++){let o=o4[a],l=o.run(this,e,t,i,r,s);l&&(l.strategy=o.name,n.push({strategy:o.name,syncPoint:l}))}return n}selectSyncPoint_(e,t){let i=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),s=e[0].strategy;for(let n=1;n<e.length;n++){let a=Math.abs(e[n].syncPoint[t.key]-t.value);a<r&&(r=a,i=e[n].syncPoint,s=e[n].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${s}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+("number"==typeof i.partIndex?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){let i=t.mediaSequence-e.mediaSequence;if(i>86400)return void nP.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);for(let r=i-1;r>=0;r--){let i=e.segments[r];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+r,time:i.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){let t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo(e){let{segmentInfo:t,shouldSaveTimelineMapping:i}=e,r=this.calculateSegmentTimeMapping_(t,t.timingInfo,i),s=t.segment;r&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:s.start}));let n=s.dateTimeObject;s.discontinuity&&i&&n&&(this.timelineToDatetimeMappings[s.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){let r,s,n=e.segment,a=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),r=e.startOfSegment,s=t.end+o.mapping;else{if(!o)return!1;r=t.start+o.mapping,s=t.end+o.mapping}return a&&(a.start=r,a.end=s),(!n.start||r<n.start)&&(n.start=r),n.end=s,!0}saveDiscontinuitySyncInfo_(e){let t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){let s=t.discontinuityStarts[r],n=t.discontinuitySequence+r+1,a=s-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[n]||this.discontinuities[n].accuracy>o){let r;r=a<0?i.start-n9({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:s}):i.end+n9({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:s}),this.discontinuities[n]={time:r,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class o8 extends nP.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange(e){let{type:t,from:i,to:r}=e;return"number"==typeof i&&"number"==typeof r&&(this.pendingTimelineChanges_[t]={type:t,from:i,to:r},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]}lastTimelineChange(e){let{type:t,from:i,to:r}=e;return"number"==typeof i&&"number"==typeof r&&(this.lastTimelineChanges_[t]={type:t,from:i,to:r},delete this.pendingTimelineChanges_[t],this.trigger({type:"timelinechange",metadata:{timelineChangeInfo:{from:i,to:r}}})),this.lastTimelineChanges_[t]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}var o3=a1(a2(a4(function(){var t,i,r=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2==arguments.length)for(var i=t.length,r=0;r<i;++r)t[r].call(this,arguments[1]);
34else for(var s=Array.prototype.slice.call(arguments,1),n=t.length,a=0;a<n;++a)t[a].apply(this,s)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}();let s=function(){let e,t,i,r,s,n,a,o,l=[[[],[],[],[],[]],[[],[],[],[],[]]],d=l[0],u=l[1],h=d[4],c=u[4],p=[],m=[];for(e=0;e<256;e++)m[(p[e]=e<<1^(e>>7)*283)^e]=e;for(t=i=0;!h[t];t^=r||1,i=m[i]||1)for(e=0,n=(n=i^i<<1^i<<2^i<<3^i<<4)>>8^255&n^99,h[t]=n,c[n]=t,o=0x1010101*p[s=p[r=p[t]]]^65537*s^257*r^0x1010100*t,a=257*p[n]^0x1010100*n;e<4;e++)d[e][t]=a=a<<24^a>>>8,u[e][n]=o=o<<24^o>>>8;for(e=0;e<5;e++)d[e]=d[e].slice(0),u[e]=u[e].slice(0);return l},n=null;class a{constructor(e){let t,i,r;n||(n=s()),this._tables=[[n[0][0].slice(),n[0][1].slice(),n[0][2].slice(),n[0][3].slice(),n[0][4].slice()],[n[1][0].slice(),n[1][1].slice(),n[1][2].slice(),n[1][3].slice(),n[1][4].slice()]];let a=this._tables[0][4],o=this._tables[1],l=e.length,d=1;if(4!==l&&6!==l&&8!==l)throw Error("Invalid aes key size");let u=e.slice(0),h=[];for(this._key=[u,h],t=l;t<4*l+28;t++)r=u[t-1],(t%l==0||8===l&&t%l==4)&&(r=a[r>>>24]<<24^a[r>>16&255]<<16^a[r>>8&255]<<8^a[255&r],t%l==0&&(r=r<<8^r>>>24^d<<24,d=d<<1^(d>>7)*283)),u[t]=u[t-l]^r;for(i=0;t;i++,t--)r=u[3&i?t:t-4],t<=4||i<4?h[i]=r:h[i]=o[0][a[r>>>24]]^o[1][a[r>>16&255]]^o[2][a[r>>8&255]]^o[3][a[255&r]]}decrypt(e,t,i,r,s,n){let a,o,l,d,u=this._key[1],h=e^u[0],c=r^u[1],p=i^u[2],m=t^u[3],f=u.length/4-2,g=4,y=this._tables[1],_=y[0],v=y[1],b=y[2],T=y[3],A=y[4];for(d=0;d<f;d++)a=_[h>>>24]^v[c>>16&255]^b[p>>8&255]^T[255&m]^u[g],o=_[c>>>24]^v[p>>16&255]^b[m>>8&255]^T[255&h]^u[g+1],l=_[p>>>24]^v[m>>16&255]^b[h>>8&255]^T[255&c]^u[g+2],m=_[m>>>24]^v[h>>16&255]^b[c>>8&255]^T[255&p]^u[g+3],g+=4,h=a,c=o,p=l;for(d=0;d<4;d++)s[(3&-d)+n]=A[h>>>24]<<24^A[c>>16&255]<<16^A[p>>8&255]<<8^A[255&m]^u[g++],a=h,h=c,c=p,p=m,m=a}}class o extends r{constructor(){super(r),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}let l=function(e){return e<<24|(65280&e)<<8|(0xff0000&e)>>8|e>>>24},d=function(e,t,i){let r,s,n,o,d,u,h,c,p,m=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),f=new a(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),y=new Int32Array(g.buffer);for(p=0,r=i[0],s=i[1],n=i[2],o=i[3];p<m.length;p+=4)d=l(m[p]),u=l(m[p+1]),h=l(m[p+2]),c=l(m[p+3]),f.decrypt(d,u,h,c,y,p),y[p]=l(y[p]^r),y[p+1]=l(y[p+1]^s),y[p+2]=l(y[p+2]^n),y[p+3]=l(y[p+3]^o),r=d,s=u,n=h,o=c;return g};class u{constructor(e,t,i,r){let s=u.STEP,n=new Int32Array(e.buffer),a=new Uint8Array(e.byteLength),d=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(n.subarray(d,d+s),t,i,a)),d=s;d<n.length;d+=s)i=new Uint32Array([l(n[d-4]),l(n[d-3]),l(n[d-2]),l(n[d-1])]),this.asyncStream_.push(this.decryptChunk_(n.subarray(d,d+s),t,i,a));this.asyncStream_.push(function(){r(null,a.subarray(0,a.byteLength-a[a.byteLength-1]))})}static get STEP(){return 32e3}decryptChunk_(e,t,i,r){return function(){let s=d(e,t,i);r.set(s,e.byteOffset)}}}var h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:e.g,c=("undefined"!=typeof window?window:void 0!==h?h:"undefined"!=typeof self?self:{}).BigInt||Number;c("0x1"),c("0x100"),c("0x10000"),c("0x1000000"),c("0x100000000"),c("0x10000000000"),c("0x1000000000000"),c("0x100000000000000"),c("0x10000000000000000"),255===(i=new Uint8Array((t=new Uint16Array([65484])).buffer,t.byteOffset,t.byteLength))[0]||i[0];let p=function(e){let t={};return Object.keys(e).forEach(i=>{let r=e[i];("function"===ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer)?t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[i]=r}),t};self.onmessage=function(e){let t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength);new u(i,new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4),function(e,i){self.postMessage(p({source:t.source,decrypted:i}),[i.buffer])})}})));let o6=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},o7=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},o9=(e,t)=>{t.activePlaylistLoader=e,e.load()},le={AUDIO:(e,t)=>
34()=>{let{mediaTypes:{[e]:i},excludePlaylist:r}=t,s=i.activeTrack(),n=i.activeGroup(),a=(n.filter(e=>e.default)[0]||n[0]).id,o=i.tracks[a];if(s===o)return void r({error:{message:"Problem encountered loading the default audio track."}});for(let e in nP.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),i.tracks)i.tracks[e].enabled=i.tracks[e]===o;i.onTrackChanged()},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:i}}=t;nP.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");let r=i.activeTrack();r&&(r.mode="disabled"),i.onTrackChanged()}},lt={AUDIO:(e,t,i)=>{if(!t)return;let{tech:r,requestOptions:s,segmentLoaders:{[e]:n}}=i;t.on("loadedmetadata",()=>{let e=t.media();n.playlist(e,s),(!r.paused()||e.endList&&"none"!==r.preload())&&n.load()}),t.on("loadedplaylist",()=>{n.playlist(t.media(),s),r.paused()||n.load()}),t.on("error",le[e](e,i))},SUBTITLES:(e,t,i)=>{let{tech:r,requestOptions:s,segmentLoaders:{[e]:n},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{let e=t.media();n.playlist(e,s),n.track(a.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&n.load()}),t.on("loadedplaylist",()=>{n.playlist(t.media(),s),r.paused()||n.load()}),t.on("error",le[e](e,i))}},li={AUDIO:(e,t)=>{let{vhs:i,sourceType:r,segmentLoaders:{[e]:s},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:d}},mainPlaylistLoader:u}=t,h=al(u.main);for(let s in(!a[e]||0===Object.keys(a[e]).length)&&(a[e]={main:{default:{default:!0}}},h&&(a[e].main.default.playlists=u.main.playlists)),a[e])for(let c in o[s]||(o[s]=[]),a[e][s]){let p,m=a[e][s][c];if(h?(d(`AUDIO group '${s}' label '${c}' is a main playlist`),m.isMainPlaylist=!0,p=null):p="vhs-json"===r&&m.playlists?new aL(m.playlists[0],i,n):m.resolvedUri?new aL(m.resolvedUri,i,n):m.playlists&&"dash"===r?new aQ(m.playlists[0],i,n,u):null,m=nB({id:c,playlistLoader:p},m),lt[e](e,m.playlistLoader,t),o[s].push(m),void 0===l[c]){let e=new nP.AudioTrack({id:c,kind:o6(m),enabled:!1,language:m.language,default:m.default,label:c});l[c]=e}}s.on("error",le[e](e,t))},SUBTITLES:(e,t)=>{let{tech:i,vhs:r,sourceType:s,segmentLoaders:{[e]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:d}},mainPlaylistLoader:u}=t;for(let n in o[e])for(let h in l[n]||(l[n]=[]),o[e][n]){let c;if(!r.options_.useForcedSubtitles&&o[e][n][h].forced)continue;let p=o[e][n][h];if("hls"===s)c=new aL(p.resolvedUri,r,a);else if("dash"===s){if(!p.playlists.filter(e=>e.excludeUntil!==1/0).length)return;c=new aQ(p.playlists[0],r,a,u)}else"vhs-json"===s&&(c=new aL(p.playlists?p.playlists[0]:p.resolvedUri,r,a));if(p=nB({id:h,playlistLoader:c},p),lt[e](e,p.playlistLoader,t),l[n].push(p),void 0===d[h]){let e=i.addRemoteTextTrack({id:h,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:h},!1).track;d[h]=e}}n.on("error",le[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{let{tech:i,main:{mediaGroups:r},mediaTypes:{[e]:{groups:s,tracks:n}}}=t;for(let t in r[e])for(let a in s[t]||(s[t]=[]),r[e][t]){let o=r[e][t][a];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;let l=i.options_.vhs&&i.options_.vhs.captionServices||{},d={label:a,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[d.instreamId]&&(d=nB(d,l[d.instreamId])),void 0===d.default&&delete d.default,s[t].push(nB({id:a},o)),void 0===n[a]){let e=i.addRemoteTextTrack({id:d.instreamId,
34kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;n[a]=e}}}},lr=(e,t)=>{for(let i=0;i<e.length;i++)if(aa(t,e[i])||e[i].playlists&&lr(e[i].playlists,t))return!0;return!1},ls={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:i}}}=t;for(let e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:i}}}=t;for(let e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}};class ln{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=m(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(e=>[e.ID,e])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class la extends nP.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new ln,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=nU("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";let i=t.serverUri||t.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error");return}if(i.startsWith("data:"))return void this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));this.steeringManifest.reloadUri=m(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){let t=this.steeringManifest.reloadUri;if(!t)return;let i=e?t:this.getRequestURI(t);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}let r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(e,t)=>{let s;if(e){if(410===t.status){this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),this.excludedSteeringManifestURLs.add(i);return}if(429===t.status){let i=t.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${i} seconds.`),this.startTTLTimeout_(parseInt(i,10));return}this.logger_(`manifest failed to load ${e}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});try{s=JSON.parse(this.request_.responseText)}catch(t){let e={errorType:nP.Error.StreamingContentSteeringParserError,error:t};this.trigger({type:"error",metadata:e})}this.assignSteeringProperties_(s);let n={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:n}),this.startTTLTimeout_()})}setProxyServerUrl_(e){let t=new l.default.URL(e),i=new l.default.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){let t=JSON.parse(l.default.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){let t=new l.default.URL(e),i=this.getPathway(),r=this.getBandwidth_();if(i){let e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,i)}if(r){let e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for c
34ontent steering. Ending content steering."),this.trigger("error"),this.dispose());let t=(e=>{for(let t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;let t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){let i=this.setProxyServerUrl_(e);if(!t(i))return i}let i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.steeringManifest.ttl;this.ttlTimeout_=l.default.setTimeout(()=>{this.requestSteeringManifest()},1e3*e)}clearTTLTimeout_(){l.default.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new ln}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(m(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let lo=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],ll=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},ld=function(e){let{currentPlaylist:t,buffered:i,currentTime:r,nextPlaylist:s,bufferLowWaterLine:n,bufferHighWaterLine:a,duration:o,bufferBasedABR:l,log:d}=e;if(!s)return nP.log.warn("We received no playlist to switch to. Please check your stream."),!1;let u=`allowing switch ${t&&t.id||"null"} -> ${s.id}`;if(!t)return d(`${u} as current playlist is not set`),!0;if(s.id===t.id)return!1;let h=!!nH(i,r).length;if(!t.endList)return h||"number"!=typeof t.partTargetDuration?(d(`${u} as current playlist is live`),!0):(d(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);let c=nJ(i,r),p=l?aZ.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:aZ.MAX_BUFFER_LOW_WATER_LINE;if(o<p)return d(`${u} as duration < max low water line (${o} < ${p})`),!0;let m=s.attributes.BANDWIDTH,f=t.attributes.BANDWIDTH;if(m<f&&(!l||c<a)){let e=`${u} as next bandwidth < current bandwidth (${m} < ${f})`;return l&&(e+=` and forwardBuffer < bufferHighWaterLine (${c} < ${a})`),d(e),!0}if((!l||m>f)&&c>=n){let e=`${u} as forwardBuffer >= bufferLowWaterLine (${c} >= ${n})`;return l&&(e+=` and next bandwidth > current bandwidth (${m} > ${f})`),d(e),!0}return d(`not ${u} as no switching criteria met`),!1};class lu extends nP.EventTarget{constructor(e){super(),this.fastQualityChange_=((e,t)=>{let i=null;return function(){for(var r=arguments.length,s=Array(r),n=0;n<r;n++)s[n]=arguments[n];clearTimeout(i),i=setTimeout(()=>{e.apply(null,s)},t)}})(this.fastQualityChange_.bind(this),100);let{src:t,withCredentials:i,tech:r,bandwidth:s,externVhs:n,useCueTags:o,playlistExclusionDuration:d,enableLowInitialPlaylist:u,sourceType:h,cacheEncryptionKeys:c,bufferBasedABR:p,leastPixelDiffSelector:m,captionServices:f,experimentalUseMMS:g}=e;if(!t)throw Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:y}=e;null==y&&(y=1/0),a=n,this.bufferBasedABR=!!p,this.leastPixelDiffSelector=!!m,this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=h,this.useCueTags_=o,this.playlistExclusionDuration=d,this.maxPlaylistRetries=y,this.enableLowInitialPlaylist=u,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:y,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{let e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:oN,activeTrack:oN,getActiveGroup:oN,onGroupChanged:oN,onTrackChanged:oN,lastTrack_:null,logger_:nU(`MediaGroups[${t}]`)}}),e})(),g&&l.default.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new l.default.ManagedMediaSource,this.usingManagedMediaSource_=!0,nP.log("Using ManagedMediaSource")):l.default.MediaSource&&(this.mediaSource=new l.default.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=nF(),this.hasPlayed_=!1,this.syncController_=new o5(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new o3,this.sourceUpdater_=new oW(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new o8,this.keyStatusMap_=new Map;let _={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:f,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:c,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new aQ(t,this.vhs_,nB(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new aL(t,this.vhs_,nB(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new oO(nB(_,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new oO(nB(_,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new oK(nB(_,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>
34{function i(){r.off("vttjserror",s),e()}function s(){r.off("vttjsloaded",i),t()}r.one("vttjsloaded",i),r.one("vttjserror",s),r.addWebVttScript_()})}),e);let v=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new la(this.vhs_.xhr,v),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),lo.forEach(e=>{this[e+"_"]=ll.bind(this,e)}),this.logger_=nU("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;let b="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(b,()=>{let e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){let e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return -1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"abr",t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){let r=this.media(),s=r&&(r.id||r.uri),n=e&&(e.id||e.uri);if(s&&s!==n){this.logger_(`switch media ${s} -> ${n} from ${t}`);let i={renditionInfo:{id:n,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:i}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{let t=this.mediaTypes_[e],i=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(i&&r){let t=(i.length?i[0].playlists:i.playlists).filter(e=>e.attributes.serviceLocation===r);t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=l.default.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(l.default.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){let e,t=this.main(),i=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return i;let r=t.mediaGroups.AUDIO,s=Object.keys(r);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)e=this.mediaTypes_.AUDIO.activeTrack();else{let t=r.main||s.length&&r[s[0]];for(let i in t)if(t[i].default){e={label:i};break}}if(!e)return i;let n=[];for(let i in r)if(r[i][e.label]){let s=r[i][e.label];if(s.playlists&&s.playlists.length)n.push.apply(n,s.playlists);else if(s.uri)n.push(s);else if(t.playlists.length)for(let e=0;e<t.playlists.length;e++){let r=t.playlists[e];r.attributes&&r.attributes.AUDIO&&r.attributes.AUDIO===i&&n.push(r)}}return n.length?n:i}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{let e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;an(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),(e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{li[t](t,e)});let{mediaTypes:t,mainPlaylistLoader:i,tech:r,vhs:s,segmentLoaders:{AUDIO:n,main:a}}=e;["AUDIO","SUBTITLES"].forEach(i=>{let r,s,n,a,o,l,d,u;t[i].activeGroup=(r=i,s=e,e=>{let{mainPlaylistLoader:t,mediaTypes:{[r]:{groups:i}}}=s,n=t.media();if(!n)return null;let a=null;n.attributes[r]&&(a=i[n.attributes[r]]);let o=Object.keys(i);if(!a)if("AUDIO"===r&&o.length>1&&al(s.main))for(let e=0;e<o.length;e++){let t=i[o[e]];if(lr(t,n)){a=t;break}}else i.main?a=i.main:1===o.length&&(a=i[o[0]]);return void 0===e?a:null!==e&&a&&a.filter(t=>t.id===e.id)[0]||null}),t[i].activeTrack=ls[i](i,e),t[i].onGroupChanged=(n=i,a=e,()=>{let{segmentLoaders:{[n]:e,main:t},mediaTypes:{[n]:i}}=a,r=i.activeTrack(),s=i.getActiveGroup(),o=i.activePlaylistLoader,l=i.lastGroup_;if((!s||!l||s.id!==l.id)&&(i.lastGroup_=s,i.lastTrack_=r,o7(e,i),s&&!s.isMainPlaylist)){if(!s.playlistLoader){o&&t.resetEverything();return}e.resyncLoader(),o9(s.playlistLoader,i)}}),t[i].onGroupChanging=(o=i,l=e,()=>{let{segmentLoaders:{[o]:e},mediaTypes:{[o]:t}}=l;t.lastGroup_=null,e.abort(),e.pause()}),t[i].onTrackChanged=(d=i,u=e,()=>{let{mainPlaylistLoader:e,segmentLoaders:{[d]:t,main:i},mediaTypes:{[d]:r}}=u,s=r.activeTrack(),n=r.getActiveGroup(),a=r.activePlaylistLoader,o=r.lastTrack_;
34if((!o||!s||o.id!==s.id)&&(r.lastGroup_=n,r.lastTrack_=s,o7(t,r),n)){if(n.isMainPlaylist){if(!s||!o||s.id===o.id)return;let t=u.vhs.playlistController_,n=t.selectPlaylist();if(t.media()===n)return;r.logger_(`track change. Switching main audio from ${o.id} to ${s.id}`),e.pause(),i.resetEverything(),t.fastQualityChange_(n);return}if("AUDIO"===d){if(!n.playlistLoader){i.setAudio(!0),i.resetEverything();return}t.setAudio(!0),i.setAudio(!1)}if(a===n.playlistLoader)return void o9(n.playlistLoader,r);t.track&&t.track(s),t.resetEverything(),o9(n.playlistLoader,r)}}),t[i].getActiveGroup=((e,t)=>{let{mediaTypes:i}=t;return()=>{let t=i[e].activeTrack();return t?i[e].activeGroup(t):null}})(i,e)});let o=t.AUDIO.activeGroup();if(o){let e=(o.filter(e=>e.default)[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});let l=()=>{t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};for(let e in r.audioTracks().addEventListener("change",l),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),s.on("dispose",()=>{r.audioTracks().removeEventListener("change",l),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),r.clearTracks("audio"),t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[e])})({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!("vhs-json"===this.sourceType_&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{let e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{let e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;an(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{let e=this.mainPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(e
34=>{this.mainPlaylistLoader_.on(e,e=>{this.player_.trigger((0,c.default)({},e))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),!this.tech_.paused()&&(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){let i=e.mediaGroups||{},r=!0,s=Object.keys(i.AUDIO);for(let e in i.AUDIO)for(let t in i.AUDIO[e])i.AUDIO[e][t].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),a.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),s.length&&Object.keys(i.AUDIO[s[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){let t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),s=this.bufferHighWaterLine();return ld({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{let e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>
34{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{let e=this.audioSegmentLoader_.pendingSegment_;if(!e||!e.segment||!e.segment.syncInfo)return;let t=e.segment.syncInfo.end+.01;this.tech_.setCurrentTime(t)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))});let e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();let e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>
34{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(e=>{this.mainSegmentLoader_.on(e,e=>{this.player_.trigger((0,c.default)({},e))}),this.audioSegmentLoader_.on(e,e=>{this.player_.trigger((0,c.default)({},e))}),this.subtitleSegmentLoader_.on(e,e=>{this.player_.trigger((0,c.default)({},e))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectPlaylist();if(e&&e===this.mainPlaylistLoader_.media())return void this.logger_("skipping fastQualityChange because new media is same as old");this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();let e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){let e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){let t=this.seekable();if(!t.length)return!1;let i=t.end(0),r=i;if(e.start){let s=e.start.timeOffset;r=s<0?Math.max(i+s,t.start(0)):Math.min(i,s)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){let e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,e=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;let e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;let t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){let t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;let t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;let i=a.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return i-r<=nV;let n=s.end(s.length-1);return n-r<=nV&&i-n<=nV}excludePlaylist(e){let t,{playlistToExclude:i=this.mainPlaylistLoader_.media(),error:r={},playlistExclusionDuration:s}=e;if(i=i||this.mainPlaylistLoader_.media(),s=s||r.playlistExclusionDuration||this.playlistExclusionDuration,!i){this.error=r,"open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}i.playlistErrors_++;let n=this.mainPlaylistLoader_.main.playlists,a=n.filter(ar),o=1===a.length&&a[0]===i;if(1===n.length&&s!==1/0)return nP.log.warn(`Problem encountered with playlist ${i.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(o);if(o){if(this.main().contentSteering){let e=this.pathwayAttribute_(i),t=1e3*this.contentSteeringController_.steeringManifest.ttl;this.contentSteeringController_.excludePathway(e),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(e)},t);return}let e=!1;
34n.forEach(t=>{if(t===i)return;let r=t.excludeUntil;void 0!==r&&r!==1/0&&(e=!0,delete t.excludeUntil)}),e&&(nP.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}t=i.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*s,i.excludeUntil=t,r.reason&&(i.lastExcludeReason_=r.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});let l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}let d=r.internal?this.logger_:nP.log.warn,u=r.message?" "+r.message:"";d(`${r.internal?"Internal problem":"Problem"} encountered with playlist ${i.id}.${u} Switching to playlist ${l.id}.`),l.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);let h=l.targetDuration/2*1e3||5e3,c="number"==typeof l.lastRequest&&Date.now()-l.lastRequest<=h;return this.switchMedia_(l,"exclude",o||c)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){let i=[],r="all"===e;(r||"main"===e)&&i.push(this.mainPlaylistLoader_);let s=[];(r||"audio"===e)&&s.push("AUDIO"),(r||"subtitle"===e)&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach(e=>{let t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)}),["main","audio","subtitle"].forEach(t=>{let r=this[`${t}SegmentLoader_`];r&&(e===t||"all"===e)&&i.push(r)}),i.forEach(e=>t.forEach(t=>{"function"==typeof e[t]&&e[t]()}))}setCurrentTime(e){let t=nH(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:void(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;let e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:a.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){let i=e.media();if(!i)return null;let r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){let e=r.start,t=r.end;if(!isFinite(e)||!isFinite(t))return null;let s=Math.max(e,t-a.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return nF([[e,s]])}let s=this.syncController_.getExpiredTime(i,this.duration());if(null===s)return null;let n=a.Playlist.seekable(i,s,a.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return n.length?n:null}computeFinalSeekable_(e,t){if(!t)return e;let i=e.start(0),r=e.end(0),s=t.start(0),n=t.end(0);return s>r||i>n?e:nF([[Math.max(i,s),Math.min(r,n)]])}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!t||this.mediaTypes_.AUDIO.activePlaylistLoader&&!(e=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio")))return;let i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(t,e),!this.seekable_||i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${nX(this.seekable_)}]`);let r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){let e=this.seekable();if(!e.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1));return}let t=this.tech_.buffered(),i=a.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e
34=>{let t=this.mediaTypes_[e].groups;for(let e in t)t[e].forEach(e=>{e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){let e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!!t&&!!i}getCodecsOrExclude_(){let e,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},i=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;let r=aS(this.main(),i),s={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(s.video=r.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(s.video+=`,${r.audio||t.main.audioCodec||N}`),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||n)&&(s.audio=r.audio||t.main.audioCodec||t.audio.audioCodec||N,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),!s.audio&&!s.video)return void this.excludePlaylist({playlistToExclude:i,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});let a=(e,t)=>e?M(t,this.usingManagedMediaSource_):O(t),o={};if(["video","audio"].forEach(function(i){if(s.hasOwnProperty(i)&&!a(t[i].isFmp4,s[i])){let r=t[i].isFmp4?"browser":"muxer";o[r]=o[r]||[],o[r].push(s[i]),"audio"===i&&(e=r)}}),n&&e&&i.attributes.AUDIO){let t=i.attributes.AUDIO;
34this.main().playlists.forEach(e=>{(e.attributes&&e.attributes.AUDIO)===t&&e!==i&&(e.excludeUntil=1/0)}),this.logger_(`excluding audio group ${t} as ${e} does not support codec(s): "${s.audio}"`)}if(Object.keys(o).length){let e=Object.keys(o).reduce((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${o[t].join(",")}"`),"")+".";this.excludePlaylist({playlistToExclude:i,error:{internal:!0,message:e},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){let e=[];if(["video","audio"].forEach(t=>{let i=(D(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(D(s[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${s[t]}"`)}),e.length)return void this.excludePlaylist({playlistToExclude:i,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return s}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;let e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);let t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){let e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{let r=e[i];if(-1!==t.indexOf(r.id))return;t.push(r.id);let s=aS(this.main,r),n=[];!s.audio||O(s.audio)||M(s.audio,this.usingManagedMediaSource_)||n.push(`audio codec ${s.audio}`),!s.video||O(s.video)||M(s.video,this.usingManagedMediaSource_)||n.push(`video codec ${s.video}`),s.text&&"stpp.ttml.im1t"===s.text&&n.push(`text codec ${s.text}`),n.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${n.join(", ")}`))})}excludeIncompatibleVariants_(e){let t=[],i=this.main().playlists,r=aT(D(e)),s=aA(r),n=r.video&&D(r.video)[0]||null,a=r.audio&&D(r.audio)[0]||null;
34Object.keys(i).forEach(e=>{let r=i[e];if(-1!==t.indexOf(r.id)||r.excludeUntil===1/0)return;t.push(r.id);let o=[],l=aS(this.mainPlaylistLoader_.main,r),d=aA(l);if(l.audio||l.video){if(d!==s&&o.push(`codec count "${d}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){let e=l.video&&D(l.video)[0]||null,t=l.audio&&D(l.audio)[0]||null;e&&n&&e.type.toLowerCase()!==n.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${n.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id}: ${o.join(" && ")}`))}})}updateAdCues_(e){let t=0,i=this.seekable();i.length&&(t=i.start(0)),oZ(e,this.cueTagsTrack_,t)}goalBufferLength(){let e=this.tech_.currentTime(),t=aZ.GOAL_BUFFER_LENGTH,i=aZ.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,aZ.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){let e=this.tech_.currentTime(),t=aZ.BUFFER_LOW_WATER_LINE,i=aZ.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,aZ.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(t,aZ.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?s:r)}bufferHighWaterLine(){return aZ.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){oA(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(e=>{let{inbandTextTracks:t,dateRanges:i}=e,r=t.metadataTrack_;if(!r)return;let s=l.default.WebKitDataCue||l.default.VTTCue;i.forEach(e=>{for(let t of Object.keys(e)){if(oT.has(t))continue;let i=new s(e.startTime,e.endTime,"");i.id=e.id,i.type="com.apple.quicktime.HLS",i.value={key:ob[t],data:e[t]},("scte35Out"===t||"scte35In"===t)&&(i.value.data=new Uint8Array(i.value.data.match(/[\da-f]{2}/gi)).buffer),r.addCue(i)}e.processDateRange()})})({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){let r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();oA(this.inbandTextTracks_,e,this.tech_),(e=>{let{inbandTextTracks:t,metadataArray:i,timestampOffset:r,videoDuration:s}=e;if(!i)return;let n=l.default.WebKitDataCue||l.default.VTTCue,a=t.metadataTrack_;if(!a||(i.forEach(e=>{let t=e.cueTime+r;!("number"!=typeof t||l.default.isNaN(t))&&!(t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach(e=>{let i=new n(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,ov(i),a.addCue(i)})}),!a.cues||!a.cues.length))return;let o=a.cues,d=[];for(let e=0;e<o.length;e++)o[e]&&d.push(o[e]);let u=d.reduce((e,t)=>{let i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e},{}),h=Object.keys(u).sort((e,t)=>Number(e)-Number(t));h.forEach((e,t)=>{let i=u[e],r=isFinite(s)?s:e,n=Number(h[t+1])||r;i.forEach(e=>{e.endTime=n})})})({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){let e=this.main();if(e.contentSteering){for(let t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart)return void this.contentSteeringController_.requestSteeringManifest(!0);this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.contentSteeringController_.on(e,e=>{this.trigger((0,c.default)({},e))})}),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{let e=this.main(),t=this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering),i=()=>{let t=this.contentSteeringController_.getAvailablePathways(),i=[];for(let r of e.playlists){let e=r.attributes.serviceLocation;if(e&&(i.push(e),!t.has(e)))return!0}return!i.length&&!!t.size};
34(t||i())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){let e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();let t=this.main().playlists,i=new Set,r=!1;Object.keys(t).forEach(s=>{let n=t[s],a=this.pathwayAttribute_(n),o=a&&e!==a;n.excludeUntil!==1/0||"content-steering"!==n.lastExcludeReason_||o||(delete n.excludeUntil,delete n.lastExcludeReason_,r=!0);let l=!n.excludeUntil&&n.excludeUntil!==1/0;!i.has(n.id)&&o&&l&&(i.add(n.id),n.excludeUntil=1/0,n.lastExcludeReason_="content-steering",this.logger_(`excluding ${n.id} for ${n.lastExcludeReason_}`))}),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach(t=>{let i=this.mediaTypes_[t];if(i.activePlaylistLoader){let t=i.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){let e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(let[e,r]of t.entries())i.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(r),this.contentSteeringController_.excludePathway(e));for(let[r,s]of i.entries()){let i=t.get(r);if(!i){e.filter(e=>
34e.attributes["PATHWAY-ID"]===s["BASE-ID"]).forEach(e=>{this.mainPlaylistLoader_.addClonePathway(s,e)}),this.contentSteeringController_.addAvailablePathway(r);continue}this.equalPathwayClones_(i,s)||(this.mainPlaylistLoader_.updateOrDeleteClone(s,!0),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;let i=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(let e in i)if(i[e]!==r[e])return!1;for(let e in r)if(i[e]!==r[e])return!1;return!0}changeSegmentPathway_(){let e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0,t="non-usable";
34this.mainPlaylistLoader_.main.playlists.forEach(i=>{let r=this.mainPlaylistLoader_.getKeyIdSet(i);r&&r.size&&r.forEach(r=>{let s="usable",n=this.keyStatusMap_.has(r)&&this.keyStatusMap_.get(r)===s,a=i.lastExcludeReason_===t&&i.excludeUntil===1/0;n?n&&a&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${r} is ${s}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${r} doesn't exist in the keyStatusMap or is not ${s}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(e=>{let i=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,r=e.excludeUntil===1/0&&e.lastExcludeReason_===t;i&&r&&(delete e.excludeUntil,nP.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){let i=("string"==typeof e?e:Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join("")).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}class lh{constructor(e,t,i){let{playlistController_:r}=e,s=r.fastQualityChange_.bind(r);if(t.attributes){let e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=aS(r.main(),t),this.playlist=t,this.id=i,this.enabled=((e,t,i)=>r=>{let s=e.main.playlists[t],n=ai(s),a=ar(s);if(void 0===r)return a;r?delete s.disabled:s.disabled=!0;let o={renditionInfo:{id:t,bandwidth:s.attributes.BANDWIDTH,resolution:s.attributes.RESOLUTION,codecs:s.attributes.CODECS},cause:"fast-quality"};return r===a||n||(r?(i(s),e.trigger({type:"renditionenabled",metadata:o})):e.trigger({type:"renditiondisabled",metadata:o})),r})(e.playlists,t.id,s)}}let lc=function(e){e.representations=()=>{let t=e.playlistController_.main(),i=al(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(e=>!ai(e)).map((t,i)=>new lh(e,t,t.id)):[]}},lp=["seeking","seeked","pause","playing","error"];class lm extends nP.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=nU("PlaybackWatcher"),this.logger_("initialize");let t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),s=()=>this.resetTimeUpdate_(),n=this.playlistController_,a=["main","subtitle","audio"],o={};a.forEach(e=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},n[`${e}SegmentLoader_`].on("appendsdone",o[e].updateend),n[`${e}SegmentLoader_`].on("playlistupdate",o[e].reset),this.tech_.on(["seeked","seeking"],o[e].reset)});let d=e=>{["main","audio"].forEach(t=>{n[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),d("off"))},this.clearSeekingAppendCheck_=()=>d("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),d("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(lp,s),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(lp,s),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),a.forEach(e
34=>{n[`${e}SegmentLoader_`].off("appendsdone",o[e].updateend),n[`${e}SegmentLoader_`].off("playlistupdate",o[e].reset),this.tech_.off(["seeked","seeking"],o[e].reset)}),this.checkCurrentTimeTimeout_&&l.default.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&l.default.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=l.default.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){let t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){let t=this.playlistController_,i=t[`${e}SegmentLoader_`],r=i.buffered_(),s=nQ(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,s){t.trigger({type:"bufferedrangeschanged",metadata:{bufferedRanges:r}}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:nK(r)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;let e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+nV>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(nF([this.lastRecordedTime,e]));let t={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:t}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){let e;if(!this.tech_.seeking())return!1;let t=this.seekable(),i=this.tech_.currentTime();if(this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){let i=t.start(0);e=i+(i===t.end(0)?0:nV)}if(void 0!==e)return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${nX(t)}. Seeking to ${e}.`),this.tech_.setCurrentTime(e),!0;let r=this.playlistController_.sourceUpdater_,s=this.tech_.buffered(),n=r.audioBuffer?r.audioBuffered():null,a=r.videoBuffer?r.videoBuffered():null,o=this.media(),l=o.partTargetDuration?o.partTargetDuration:(o.targetDuration-nq)*2,d=[n,a];for(let e=0;e<d.length;e++)if(d[e]&&nJ(d[e],i)<l)return!1;let u=nz(s,i);return 0!==u.length&&(e=u.start(0)+nV,this.logger_(`Buffered region starts (${u.start(0)}) just beyond seek point (${i}). Seeking to ${e}.`),this.tech_.setCurrentTime(e),!0)}waiting_(){if(this.techWaiting_())return;let e=this.tech_.currentTime(),t=nH(this.tech_.buffered(),e);if(t.length&&e+3<=t.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${t.start(0)} -> ${t.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){let e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){let i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${i}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}let i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;let s=nz(r,t);return s.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${s.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e.length)return!1;let s=e.end(e.length-1)+nV,n=!i.endList,a="number"==typeof i.partTargetDuration;return n&&(a||r)&&(s=e.end(e.length-1)+3*i.targetDuration),t>s}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_(e){let t,{videoBuffered:i,audioBuffered:r,currentTime:s}=e;if(i){if(i.length&&r.length){let e=nH(i,s-3),n=nH(i,s),a=nH(r,s);a.length&&!n.length&&e.length&&(t={start:e.end(0),end:a.end(0)})}else nz(i,s).length||(t=this.gapFromVideoUnderflow_(i,s));return!!t&&(this.logger_(`Encountered a gap in video from ${t.start} to ${t.end}. Seeking to current time ${s}`),!0)}}skipTheGap_(e){let t=this.tech_.buffered(),i=this.tech_.currentTime(),r=nz(t,i);if(this.resetTimeUpdate_(),0===r.length||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+nq);let s={gapInfo:{from:i,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:s}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){let i=nW(e);for(let e=0;e<i.length;e++){let r=i.start(e),s=i.end(e);if(t-r<4&&t-r>2)return{start:r,end:s}}return null}}let lf={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},lg=function(e,t){let i=0,r=0,s=nB(lf,t);e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});let n=function(){r&&e.currentTime(r)},a=function(t){null!=t&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",n),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){return Date.now()-i<1e3*s.errorInterval?void e.trigger({type:"usage",name:"vhs-error-reload-canceled"}):s.getSource&&"function"==typeof s.getSource?(i=Date.now(),s.getSource.call(e,a)):void nP.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function(){e.off("loadedmetadata",n),e.off("error",o),e.off("dispose",l)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=function(t){l(),lg(e,t)}};var ly="3.17.2";let l_={PlaylistLoader:aL,Playlist:ad,utils:a$,STANDARD_PLAYLIST_SELECTOR:om,INITIAL_PLAYLIST_SELECTOR:function(){let e=this.playlists.main.playlists.filter(ad.isEnabled);return oh(e,(e,t)=>oc(e,t)),e.filter(e=>!!aS(this.playlists.main,e).video)[0]||null},lastBandwidthSelector:om,movingAverageBandwidthSelector:function(e){let t=-1,i=-1;
34if(e<0||e>1)throw Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let r=this.useDevicePixelRatio&&l.default.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(r=this.customPixelRatio),t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),op({main:this.playlists.main,bandwidth:t,playerWidth:parseInt(ou(this.tech_.el(),"width"),10)*r,playerHeight:parseInt(ou(this.tech_.el(),"height"),10)*r,playerObjectFit:this.usePlayerObjectFit?ou(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},comparePlaylistBandwidth:oc,comparePlaylistResolution:function(e,t){let i,r;return(e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||l.default.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),i===(r=r||l.default.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH)?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-r},xhr:aM()};Object.keys(aZ).forEach(e=>{Object.defineProperty(l_,e,{get:()=>(nP.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),aZ[e]),set(t){if(nP.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0)return void nP.log.warn(`value of Vhs.${e} must be greater than or equal to 0`);aZ[e]=t}})});let lv="videojs-vhs",lb=function(e,t){let i=t.media(),r=-1;for(let t=0;t<e.length;t++)if(e[t].id===i.id){r=t;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})},lT=function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)}),lb(e,t.playlists)};l_.canPlaySource=function(){return nP.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};let lA=()=>{if(!l.default.localStorage)return null;let e=l.default.localStorage.getItem(lv);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},lS=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},lE=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},lC=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},lw=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};l_.supportsNativeHls=function(){if(!d.default||!d.default.createElement)return!1;let e=d.default.createElement("video");return!!nP.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(e.canPlayType(t))})}(),l_.supportsNativeDash=!!d.default&&!!d.default.createElement&&!!nP.getTech("Html5").isSupported()&&/maybe|probably/i.test(d.default.createElement("video").canPlayType("application/dash+xml")),l_.supportsTypeNatively=e=>"hls"===e?l_.supportsNativeHls:"dash"===e&&l_.supportsNativeDash,l_.isSupported=function(){return nP.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},l_.xhr.onRequest=function(e){lS(l_.xhr,e)},l_.xhr.onResponse=function(e){lE(l_.xhr,e)},l_.xhr.offRequest=function(e){lC(l_.xhr,e)},l_.xhr.offResponse=function(e){lw(l_.xhr,e)};let lk=nP.getComponent("Component");class lx extends lk{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=nU("VhsHandler"),t.options_&&t.options_.playerId){let e=nP.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(d.default,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{let t=d.default.fullscreenElement||d.default.webkitFullscreenElement||d.default.mozFullScreenElement||d.default.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.options_=nB(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||
34!1,this.options_.useNetworkInformationApi=void 0===this.options_.useNetworkInformationApi||this.options_.useNetworkInformationApi,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){let e=lA();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=aZ.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===aZ.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;let t=this.options_.customPixelRatio;"number"==typeof t&&t>=0&&(this.customPixelRatio=t)}setOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setOptions_(e)}src(e,t){var i;if(!e)return;this.setOptions_(),this.options_.src=0===(i=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(i.substring(i.indexOf(",")+1)):i,this.options_.tech=this.tech_,this.options_.externVhs=l_,this.options_.sourceType=B(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new lu(this.options_);let r=nB({liveRangeSafeTimeDelta:nV},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new lm(r),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{let e=nP.players[this.tech_.options_.playerId],t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});let s=this.options_.bufferBasedABR?l_.movingAverageBandwidthSelector(.55):l_.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this),this.playlistController_.selectInitialPlaylist=l_.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth,t=l.default.navigator.connection||l.default.navigator.mozConnection||l.default.navigator.webkitConnection;if(this.options_.useNetworkInformationApi&&t){let i=1e3*t.downlink*1e3;e=i>=1e7&&e>=1e7?Math.max(e,i):i}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){return Math.floor(1/(1/(this.bandwidth||1)+(this.throughput>0?1/this.throughput:0)))},set(){nP.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>nK(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>nK(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&(e=>{if(!l.default.localStorage)return;let t=lA();t=t?nB(t,e):e;try{l.default.localStorage.setItem(lv,JSON.stringify(t))}catch(e){return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{lc(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=l.default.URL.createObjectURL(this.playlistController_.mediaSource),(nP.browser.IS_ANY_SAFARI||nP.browser.IS_IOS)&&this.options_.overrideNative&&"hls"===this.options_.sourceType&&"function"==typeof this.tech_.addSourceElement?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),(e=>{let t,i,{player:r,sourceKeySystems:s,audioMedia:n,mainPlaylists:a}=e;if(!r.eme.initializeMediaKeys)return Promise.resolve();let o=(t=n?a.concat([n]):a,i=Object.keys(s),t.reduce((e,t)=>
34{if(!t.contentProtection)return e;let r=i.reduce((e,i)=>{let r=t.contentProtection[i];return r&&r.pssh&&(e[i]={pssh:r.pssh}),e},{});return Object.keys(r).length&&e.push(r),e},[])),l=[],d=[];return o.forEach(e=>{d.push(new Promise((e,t)=>{r.tech_.one("keysessioncreated",e)})),l.push(new Promise((t,i)=>{r.eme.initializeMediaKeys({keySystems:e},e=>{if(e)return void i(e);t()})}))}),Promise.race([Promise.all(l),Promise.race(d)])})({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=(e=>{let{player:t,sourceKeySystems:i,media:r,audioMedia:s}=e,n=((e,t,i)=>{if(!e)return e;let r={};t&&t.attributes&&t.attributes.CODECS&&(r=aT(D(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(r.audio=i.attributes.CODECS);let s=R(r.video),n=R(r.audio),a={};for(let i in e)a[i]={},n&&(a[i].audioContentType=n),s&&(a[i].videoContentType=s),t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh&&(a[i].pssh=t.contentProtection[i].pssh),"string"==typeof e[i]&&(a[i].url=e[i]);return nB(e,a)})(i,r,s);return!!n&&(t.currentSource().keySystems=n,!n||!!t.eme||(nP.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))})({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t)return void this.playlistController_.sourceUpdater_.initializedEme();this.createKeySessions_()}setupQualityLevels_(){let e=nP.players[this.tech_.options_.playerId];
34e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{lT(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{lb(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":ly,"mux.js":"7.1.0","mpd-parser":"1.3.1","m3u8-parser":"7.2.0","aes-decrypter":"4.0.2"}}version(){return this.constructor.version()}canChangeType(){return oW.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&l.default.URL.revokeObjectURL&&(l.default.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return(e=>{let{playlist:t,time:i,callback:r}=e;if(!r)throw Error("getProgramTime: callback must be provided");if(!t||void 0===i)return r({message:"getProgramTime: playlist and time must be provided"});let s=((e,t)=>{let i;if(!t||!t.segments||0===t.segments.length)return null;let r=0;for(let s=0;s<t.segments.length&&!(e<=(r=(i=t.segments[s]).videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:r+i.duration));s++);let s=t.segments[t.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>r){if(e>r+.25*s.duration)return null;i=s}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:r-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}})(i,t);if(!s)return r({message:"valid programTime was not found"});if("estimate"===s.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});let n={mediaSeconds:i},a=((e,t)=>{if(!t.dateTimeObject)return null;let i=t.videoTimingInfo.transmuxerPrependedSeconds,r=t.videoTimingInfo.transmuxedPresentationStart;return new Date(t.dateTimeObject.getTime()+1e3*(e-(r+i)))})(i,s.segment);return a&&(n.programDateTime=a.toISOString()),r(null,n)})({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return aH({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{lS(this.xhr,e)},this.xhr.onResponse=e=>{lE(this.xhr,e)},this.xhr.offRequest=e=>{lC(this.xhr,e)},this.xhr.offResponse=e=>{lw(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.playlistController_.on(e,e=>{this.player_.trigger((0,c.default)({},e))})}),["gapjumped","playedrangeschanged"].forEach(e=>{this.playbackWatcher_.on(e,e=>{this.player_.trigger((0,c.default)({},e))})})}}let lI={name:"videojs-http-streaming",VERSION:ly,canHandleSource(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=nB(nP.options,t);return(!!i.vhs.experimentalUseMMS||!!M("avc1.4d400d,mp4a.40.2",!1))&&lI.canPlayType(e.type,i)},handleSource(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.vhs=new lx(e,t,nB(nP.options,i)),t.vhs.xhr=aM(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){let i=B(e);if(!i)return"";let r=lI.getOverrideNative(t);return!l_.supportsTypeNatively(i)||r?"maybe":""},getOverrideNative(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{vhs:t={}}=e,i=!(nP.browser.IS_ANY_SAFARI||nP.browser.IS_IOS),{overrideNative:r=i}=t;return r}};M("avc1.4d400d,mp4a.40.2",!0)&&nP.getTech("Html5").registerSourceHandler(lI,0),nP.VhsH
vendor: 9,866 bytes, line 34
34andler=lx,nP.VhsSourceHandler=lI,nP.Vhs=l_,nP.use||nP.registerComponent("Vhs",l_),nP.options.vhs=nP.options.vhs||{},nP.getPlugin&&nP.getPlugin("reloadSourceOnError")||nP.registerPlugin("reloadSourceOnError",function(e){lg(this,e)})},311726,(e,t,i)=>{!function(i,r){var s=e.r(861288);t.exports=r(s.default||s)}(e.e,function(e){"use strict";var t,i,r,s,n,a,o=e.browser.IS_IOS||e.browser.IS_NATIVE_ANDROID,l=e.getTech("Tech");class d extends l{constructor(e,t){super(e,t),this.setPoster(e.poster),this.setSrc(this.options_.source,!0),this.setTimeout((function(){this.el_&&(this.el_.parentNode.className+=" vjs-youtube",o&&(this.el_.parentNode.className+=" vjs-youtube-mobile"),d.isApiReady?this.initYTPlayer():d.apiReadyQueue.push(this))}).bind(this))}dispose(){if(this.ytPlayer)this.ytPlayer.stopVideo&&this.ytPlayer.stopVideo(),this.ytPlayer.destroy&&this.ytPlayer.destroy();else{var e=d.apiReadyQueue.indexOf(this);-1!==e&&d.apiReadyQueue.splice(e,1)}this.ytPlayer=null,this.el_.parentNode.className=this.el_.parentNode.className.replace(" vjs-youtube","").replace(" vjs-youtube-mobile",""),this.el_.parentNode.removeChild(this.el_),l.prototype.dispose.call(this)}createEl(){var e=document.createElement("div");e.setAttribute("id",this.options_.techId),e.setAttribute("style","width:100%;height:100%;top:0;left:0;position:absolute"),e.setAttribute("class","vjs-tech");var t=document.createElement("div");if(t.appendChild(e),!o&&!this.options_.ytControls){var i=document.createElement("div");i.setAttribute("class","vjs-iframe-blocker"),i.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%"),i.onclick=(function(){this.pause()}).bind(this),t.appendChild(i)}return t}initYTPlayer(){var e={controls:0,modestbranding:1,rel:0,showinfo:0,loop:+!!this.options_.loop};if(void 0!==this.options_.autohide&&(e.autohide=this.options_.autohide),void 0!==this.options_.cc_load_policy&&(e.cc_load_policy=this.options_.cc_load_policy),void 0!==this.options_.ytControls&&(e.controls=this.options_.ytControls),void 0!==this.options_.disablekb&&(e.disablekb=this.options_.disablekb),void 0!==this.options_.color&&(e.color=this.options_.color),e.controls?void 0!==this.options_.fs&&(e.fs=this.options_.fs):e.fs=0,-1!==this.options_.source.src.indexOf("end=")){var t=this.options_.source.src.match(/end=([0-9]*)/);this.options_.end=parseInt(t[1])}if(void 0!==this.options_.end&&(e.end=this.options_.end),void 0!==this.options_.hl?e.hl=this.options_.hl:void 0!==this.options_.language&&(e.hl=this.options_.language.substr(0,2)),void 0!==this.options_.iv_load_policy&&(e.iv_load_policy=this.options_.iv_load_policy),void 0!==this.options_.list?e.list=this.options_.list:this.url&&void 0!==this.url.listId&&(e.list=this.url.listId),void 0!==this.options_.listType&&(e.listType=this.options_.listType),void 0!==this.options_.modestbranding&&(e.modestbranding=this.options_.modestbranding),void 0!==this.options_.playlist&&(e.playlist=this.options_.playlist),void 0!==this.options_.playsinline&&(e.playsinline=this.options_.playsinline),void 0!==this.options_.rel&&(e.rel=this.options_.rel),void 0!==this.options_.showinfo&&(e.showinfo=this.options_.showinfo),-1!==this.options_.source.src.indexOf("start=")){var i=this.options_.source.src.match(/start=([0-9]*)/);this.options_.start=parseInt(i[1])}if(void 0!==this.options_.start&&(e.start=this.options_.start),void 0!==this.options_.theme&&(e.theme=this.options_.theme),void 0!==this.options_.customVars){var r=this.options_.customVars;Object.keys(r).forEach(function(t){e[t]=r[t]})}this.activeVideoId=this.url?this.url.videoId:null,this.activeList=e.list;var s={videoId:this.activeVideoId,playerVars:e,events:{onReady:this.onPlayerReady.bind(this),onPlaybackQualityChange:this.onPlayerPlaybackQualityChange.bind(this),onPlaybackRateChange:this.onPlayerPlaybackRateChange.bind(this),onStateChange:this.onPlayerStateChange.bind(this),onVolumeChange:this.onPlayerVolumeChange.bind(this),onError:this.onPlayerError.bind(this)}};void 0!==this.options_.enablePrivacyEnhancedMode&&this.options_.enablePrivacyEnhancedMode&&(s.host="https://www.youtube-nocookie.com"),this.ytPlayer=new YT.Player(this.options_.techId,s)}onPlayerReady(){this.options_.muted&&this.ytPlayer.mute(),this.ytPlayer.getAvailablePlaybackRates().length>1&&(this.featuresPlaybackRate=!0),this.playerReady_=!0,this.triggerReady(),this.playOnReady?this.play():this.cueOnReady&&(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)}onPlayerPlaybackQualityChange(){}onPlayerPlaybackRateChange(){this.trigger("ratechange")}onPlayerStateChange(e){var t=e.data;if(t!==this.lastState&&!this.errorNumber)switch(this.lastState=t,t){case -1:this.trigger("loadstart"),this.trigger("loadedmetadata"),this.trigger("durationchange"),this.trigger("ratechange");break;case YT.PlayerState.ENDED:this.trigger("ended");break;case YT.PlayerState.PLAYING:this.trigger("timeupdate"),this.trigger("durationchange"),this.trigger("playing"),this.trigger("play"),this.isSeeking&&this.onSeeked();break;case YT.PlayerState.PAUSED:this.trigger("canplay"),this.isSeeking?this.onSeeked():this.trigger("pause");break;case YT.PlayerState.BUFFERING:this.player_.trigger("timeupdate"),this.player_.trigger("waiting")}}onPlayerVolumeChange(){this.trigger("volumechange")}onPlayerError(e){this.errorNumber=e.data,this.trigger("pause"),this.trigger("error")}error(){var e=1e3+this.errorNumber;switch(this.errorNumber){case 5:return{code:e,message:"Error while trying to play the video"};case 2:case 100:return{code:e,message:"Unable to find the video"};case 101:case 150:return{code:e,message:"Playback on other Websites has been disabled by the video owner."}}return{code:e,message:"YouTube unknown error ("+this.errorNumber+")"}}loadVideoById_(e){var t={videoId:e};this.options_.start&&(t.startSeconds=this.options_.start),this.options_.end&&(t.endSeconds=this.options_.end),this.ytPlayer.loadVideoById(t)}cueVideoById_(e){var t={videoId:e};this.options_.start&&(t.startSeconds=this.options_.start),this.options_.end&&(t.endSeconds=this.options_.end),this.ytPlayer.cueVideoById(t)}src(e){return e&&this.setSrc({src:e}),this.source}poster(){return o?null:this.poster_}setPoster(e){this.poster_=e}setSrc(e){e&&e.src&&(delete this.errorNumber,this.source=e,this.url=d.parseUrl(e.src),!this.options_.poster&&this.url.videoId&&(this.poster_="https://img.youtube.com/vi/"+this.url.videoId+"/0.jpg",this.trigger("posterchange"),this.checkHighResPoster()),this.options_.autoplay&&!o?this.isReady_?this.play():this.playOnReady=!0:this.activeVideoId!==this.url.videoId&&(this.isReady_?(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId):this.cueOnReady=!0))}autoplay(){return this.options_.autoplay}setAutoplay(e){this.options_.autoplay=e}loop(){return this.options_.loop}setLoop(e){this.options_.loop=e}play(){this.url&&this.url.videoId&&(this.wasPausedBeforeSeek=!1,this.isReady_?(this.url.listId&&(this.activeList===this.url.listId?this.ytPlayer.playVideo():(this.ytPlayer.loadPlaylist(this.url.listId),this.activeList=this.url.listId)),this.activeVideoId===this.url.videoId?this.ytPlayer.playVideo():(this.loadVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)):(this.trigger("waiting"),this.playOnReady=!0))}pause(){this.ytPlayer&&this.ytPlayer.pauseVideo()}paused(){return!this.ytPlayer||this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING}currentTime(){return this.ytPlayer?this.ytPlayer.getCurrentTime():0}setCurrentTime(e){this.lastState===YT.PlayerState.PAUSED&&(this.timeBeforeSeek=this.currentTime()),this.isSeeking||(this.wasPausedBeforeSeek=this.paused()),this.ytPlayer.seekTo(e,!0),this.trigger("timeupdate"),this.trigger("seeking"),this.isSeeking=!0,this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==e&&(clearInterval(this.checkSeekedInPauseInterval),this.checkSeekedInPauseInterval=setInterval((function(){this.lastState===YT.PlayerState.PAUSED&&this.isSeeking?this.currentTime()!==this.timeBeforeSeek&&(this.trigger("timeupdate"),this.onSeeked()):clearInterval(this.checkSeekedInPauseInterval)}).bind(this),250))}seeking(){return this.isSeeking}seekable(){return this.ytPlayer?e.createTimeRange(0,this.ytPlayer.getDuration()):e.createTimeRange()}onSeeked(){clearInterval(this.checkSeekedInPauseInterval),this.isSeeking=!1,this.wasPausedBeforeSeek&&this.pause(),this.trigger("seeked")}playbackRate(){return this.ytPlayer?this.ytPlayer.getPlaybackRate():1}setPlaybackRate(e){this.ytPlayer&&this.ytPlayer.setPlaybackRate(e)}duration(){return this.ytPlayer?this.ytPlayer.getDuration():0}currentSrc(){return this.source&&this.source.src}ended(){return!!this.ytPlayer&&this.lastState===YT.PlayerState.ENDED}volume(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1}setVolume(e){this.ytPlayer&&this.ytPlayer.setVolume(100*e)}muted(){return!!this.ytPlayer&&this.ytPlayer.isMuted()}setMuted(e){this.ytPlayer&&(this.muted(!0),e?this.ytPlayer.mute():this.ytPlayer.unMute(),this.setTimeout(function(){this.trigger("volumechange")},50))}buffered(){if(!this.ytPlayer||!this.ytPlayer.getVideoLoadedFraction)return e.createTimeRange();var t=this.ytPlayer.getVideoLoadedFraction()*this.ytPlayer.getDuration();return e.createTimeRange(0,t)}preload(){}load(){}reset(){}networkState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case -1:return 0;case 3:return 2;default:return 1}}readyState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case -1:return 0;case 5:return 1;case 3:return 2;default:return 4}}supportsFullScreen(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}checkHighResPoster(){var e="https://img.youtube.com/vi/"+this.url.videoId+"/maxresdefault.jpg";try{var t=new Image;t.onload=(function(){if("naturalHeight"in t){if(t.naturalHeight<=90||t.naturalWi
34dth<=120)return}else if(t.height<=90||t.width<=120)return;this.poster_=e,this.trigger("posterchange")}).bind(this),t.onerror=function(){},t.src=e}catch(e){}}}d.isSupported=function(){return!0},d.canPlaySource=function(e){return d.canPlayType(e.type)},d.canPlayType=function(e){return"video/youtube"===e},d.parseUrl=function(e){var t={videoId:null},i=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return i&&11===i[2].length&&(t.videoId=i[2]),(i=e.match(/[?&]list=([^#\&\?]+)/))&&i[1]&&(t.listId=i[1]),t},d.apiReadyQueue=[],"undefined"!=typeof document&&(t=function(){YT.ready(function(){d.isApiReady=!0;for(var e=0;e<d.apiReadyQueue.length;++e)d.apiReadyQueue[e].initYTPlayer()})},i=!1,r=document.createElement("script"),(s=document.getElementsByTagName("script")[0])&&(s.parentNode.insertBefore(r,s),r.onload=function(){i||(i=!0,t())},r.onreadystatechange=function(){i||"complete"!==this.readyState&&"loaded"!==this.readyState||(i=!0,t())},r.src="https://www.youtube.com/iframe_api"),n=document.head||document.getElementsByTagName("head")[0],(a=document.createElement("style")).type="text/css",a.styleSheet?a.styleSheet.cssText=".vjs-youtube .vjs-iframe-blocker { display: none; }.vjs-youtube.vjs-user-inactive .vjs-iframe-blocker { display: block; }.vjs-youtube .vjs-poster { background-size: cover; }.vjs-youtube-mobile .vjs-big-play-button { display: none; }":a.appendChild(document.createTextNode(".vjs-youtube .vjs-iframe-blocker { display: none; }.vjs-youtube.vjs-user-inactive .vjs-iframe-blocker { display: block; }.vjs-youtube .vjs-poster { background-size: cover; }.vjs-youtube-mobile .vjs-big-play-button { display: none; }")),n.appendChild(a)),void 0!==e.registerTech?e.registerTech("Youtube",d):e.registerComponent("Youtube",d)})},641636,e=>{e.v({container:"VideoPlayer-module__VicuHW__container",placeholder:"VideoPlayer-module__VicuHW__placeholder",placeholderHidden:"VideoPlayer-module__VicuHW__placeholderHidden",video:"VideoPlayer-module__VicuHW__video"})},918824,e=>{e.v({actions:"VideoEndCard-module__zFG-La__actions",buttonInvert:"VideoEndCard-module__zFG-La__buttonInvert",buttonOutline:"VideoEndCard-module__zFG-La__buttonOutline",container:"VideoEndCard-module__zFG-La__container",imageContainer:"VideoEndCard-module__zFG-La__imageContainer",noUpNext:"VideoEndCard-module__zFG-La__noUpNext",overlay:"VideoEndCard-module__zFG-La__overlay"})},161670,e=>{e.v({headerOverlay:"VideoTitleOverlay-module__q43_fq__headerOverlay"})},652458,365651,651335,621121,e=>{"use strict";let t,i;e.s(["default",()=>tP],652458);var r,s=e.i(857727),n=e.i(271645),a=e.i(861288);let o=e=>{let t=e.playlist.autoadvance_;t.timeout&&e.clearTimeout(t.timeout),t.trigger&&e.off("ended",t.trigger),t.abortOrErrorHandler&&e.off(["abort","error"],t.abortOrErrorHandler),t.timeout=null,t.trigger=null,t.abortOrErrorHandler=null},l=(e,t)=>{if(o(e),!(e=>"number"==typeof e&&!isNaN(e)&&e>=0&&e<1/0)(t)){e.playlist.autoadvance_.delay=null;return}e.playlist.autoadvance_.delay=t,e.playlist.autoadvance_.trigger=function(){let i=()=>l(e,t);e.one("play",i),e.playlist.autoadvance_.timeout=e.setTimeout(()=>{o(e),e.off("play",i),e.one("loadstart",function(){e.playlist.isAutoadvancing=!0}),e.playlist.next(!0)},1e3*t)},e.playlist.autoadvance_.abortOrErrorHandler=function(){e.playlist.isAutoadvancing=!1},e.one("ended",e.playlist.autoadvance_.trigger),e.one(["abort","error"],e.playlist.autoadvance_.abortOrErrorHandler)},d=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!e.paused()||e.ended(),s=()=>{e.audioPosterMode()&&e.poster(t.poster||"")};e.trigger("beforeplaylistitem",t.originalValue||t),t.playlistItemId_&&(e.playlist.currentPlaylistItemId_=t.playlistItemId_),e.poster(i?"":t.poster||""),e.off("audiopostermodechange",s),e.one("audiopostermodechange",s),e.src(t.sources);let n=e.remoteTextTracks(),a=n&&n.length||0;for(;a--;)e.removeRemoteTextTrack(n[a]);return e.ready(()=>{if((t.textTracks||[]).forEach(e.addRemoteTextTrack.bind(e)),e.trigger("playlistitem",t.originalValue||t),r){let t=e.play();void 0!==t&&"function"==typeof t.then&&t.then(null,e=>{})}l(e,e.playlist.autoadvance_.delay)}),e},u=1,h=e=>{let t=e;return e&&"object"==typeof e||((t=Object(e)).originalValue=e),t.playlistItemId_=u++,t},c=e=>e.map(h),p=(e,t)=>{let i=e,r=t;return"object"==typeof e&&(i=e.src),"object"==typeof t&&(r=t.src),/^\/\//.test(i)&&(r=r.slice(r.indexOf("//"))),/^\/\//.test(r)&&(i=i.slice(i.indexOf("//"))),i===r},m=(e,t)=>
34{for(let i=0;i<e.length;i++){let r=e[i].sources;if(Array.isArray(r))for(let e=0;e<r.length;e++){let s=r[e];if(s&&p(s,t))return i}}return -1},f=a.default.registerPlugin||a.default.plugin,g=function(e,t){!function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=null,s=!1,n=e.playlist=function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(s)throw Error("do not call playlist() during a playlist change");if(Array.isArray(t)){let a=Array.isArray(r)?r.slice():null;r=c(t),s=!0,e.trigger({type:"duringplaylistchange",nextIndex:i,nextPlaylist:t,previousIndex:n.currentIndex_,previousPlaylist:a||[]}),s=!1,-1!==i&&n.currentItem(i),a&&e.setTimeout(()=>{e.trigger({type:"playlistchange",action:"change"})},0)}return r.map(e=>e.originalValue||e)};e.on("loadstart",()=>{-1===n.currentItem()&&o(e)}),n.currentIndex_=-1,n.player_=e,n.autoadvance_={},n.repeat_=!1,n.currentPlaylistItemId_=null,n.currentItem=(e,t)=>{if(s)return n.currentIndex_;if("number"==typeof e&&n.currentIndex_!==e&&e>=0&&e<r.length)return n.currentIndex_=e,d(n.player_,r[n.currentIndex_],t),n.currentIndex_;let i=n.player_.currentSrc()||"";if(n.currentPlaylistItemId_){let e=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].playlistItemId_===t)return i;return -1})(r,n.currentPlaylistItemId_),t=r[e];if(t&&Array.isArray(t.sources)&&m([t],i)>-1)return n.currentIndex_=e,n.currentIndex_;n.currentPlaylistItemId_=null}return n.currentIndex_=n.indexOf(i),n.currentIndex_},n.add=(t,i)=>{if(s)throw Error("cannot modify a playlist that is currently changing");("number"!=typeof i||i<0||i>r.length)&&(i=r.length),Array.isArray(t)||(t=[t]),r.splice(i,0,...c(t)),e.trigger({type:"playlistchange",action:"add"}),e.trigger({type:"playlistadd",count:t.length,index:i})},n.remove=function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(s)throw Error("cannot modify a playlist that is currently changing");"number"!=typeof t||t<0||t>r.length||(r.splice(t,i),e.trigger({type:"playlistchange",action:"remove"}),e.trigger({type:"playlistremove",count:i,index:t}))},n.contains=e=>-1!==n.indexOf(e),n.indexOf=e=>{if("string"==typeof e)return m(r,e);let t=Array.isArray(e)?e:e.sources;for(let e=0;e<t.length;e++){let i=t[e];if("string"==typeof i)return m(r,i);if(i.src)return m(r,i.src)}return -1},n.currentIndex=()=>n.currentItem(),n.lastIndex=()=>r.length-1,n.nextIndex=()=>{let e=n.currentItem();if(-1===e)return -1;let t=n.lastIndex();return n.repeat_&&e===t?0:Math.min(e+1,t)},n.previousIndex=()=>{let e=n.currentItem();return -1===e?-1:n.repeat_&&0===e?n.lastIndex():Math.max(e-1,0)},n.first=()=>{if(s)return;let e=n.currentItem(0);if(r.length)return r[e].originalValue||r[e];n.currentIndex_=-1},n.last=()=>{if(s)return;let e=n.currentItem(n.lastIndex());if(r.length)return r[e].originalValue||r[e];n.currentIndex_=-1},n.next=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(s)return;let t=n.nextIndex();if(t!==n.currentIndex_){let i=n.currentItem(t,e);return r[i].originalValue||r[i]}},n.previous=()=>{if(s)return;let e=n.previousIndex();if(e!==n.currentIndex_){let t=n.currentItem(e);return r[t].originalValue||r[t]}},n.autoadvance=e=>{l(n.player_,e)},n.repeat=e=>void 0===e?n.repeat_:"boolean"!=typeof e?void a.default.log.error("videojs-playlist: Invalid value for repeat",e):(n.repeat_=!!e,n.repeat_),n.sort=t=>{r.length&&(r.sort(t),s||e.trigger("playlistsorted"))},n.reverse=()=>{r.length&&(r.reverse(),s||e.trigger("playlistsorted"))},n.shuffle=function(){let{rest:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=0,a=r;t&&(i=n.currentIndex_+1,a=r.slice(i)),!(a.length<=1)&&((e=>{let t=-1,i=e.length-1;for(;++t<e.length;){let r=t+Math.floor(Math.random()*(i-t+1)),s=e[r];e[r]=e[t],e[t]=s}})(a),t&&r.splice(...[i,a.length].concat(a)),s||e.trigger("playlistsorted"))},Array.isArray(t)?n(t,i):r=[]}(this,e,t)};f("playlist",g),g.VERSION="5.2.0";var y=e.i(729265),_="6.2.0";let v=a.default.obj&&a.default.obj.merge||a.default.mergeOptions,b={header:"",code:"",message:"",timeout:45e3,backgroundTimeout:3e5,dismiss:!a.default.browser.IS_IPHONE,errors:{1:{type:"MEDIA_ERR_ABORTED",headline:"The video download was cancelled"},2:{type:"MEDIA_ERR_NETWORK",headline:"The video connection was lost, please confirm you are connected to the internet"},3:{type:"MEDIA_ERR_DECODE",headline:"The video is bad or in a format that cannot be played on your browser"},4:{type:"MEDIA_ERR_SRC_NOT_SUPPORTED",headline:"This video is either unavailable or not supported in this browser"},5:{type:"MEDIA_ERR_ENCRYPTED",headline:"The video you are trying to watch is encrypted and we do not know how to decrypt it"},unknown:{type:"MEDIA_ERR_UNKNOWN",headline:"An unanticipated problem was encountered, check back soon and try again"},"-1":{type:"PLAYER_ERR_NO_SRC",headline:"No video has been loaded"},"-2":{type:"PLAYER_ERR_TIMEOUT",headline:"It looks like you're having playback issues. Reloading the video may help."},PLAYER_ERR_DOMAIN_RESTRICTED:{headline:"This video is restricted from playing on your current domain"},PLAYER_ERR_IP_RESTRICTED:{headline:"This video is restricted at your current IP address"},PLAYER_ERR_GEO_RESTRICTED:{headline:"This video is restricted from playing in your current geographic region"}}},T=function(e,t){let i,r,s,n=[],a=function(e){t.errors=v(t.errors,e),Object.keys(t.errors).forEac
34h(e=>{let i=t.errors[e];i.type||(i.type=e)})};a();let o=function(){e.error()&&-2===e.error().code&&e.error(null),e.clearTimeout(r),e.clearTimeout(i),s&&(s=!1,e.removeClass("vjs-waiting"));let n=[1/0,-1],a=(e,t)=>-1!==e.indexOf(t);"hidden"===y.default.visibilityState&&(e.muted()||a(n,t.backgroundTimeout))||"visible"===y.default.visibilityState&&a(n,t.timeout)||(r=e.setTimeout(function(){e.error()||e.paused()||e.ended()||(s=!0,e.addClass("vjs-waiting"))},1e3),i=e.setTimeout(function(){e.error()||e.paused()||e.ended()||e.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},"hidden"===y.default.visibilityState?t.backgroundTimeout:t.timeout))},l=function(){let t;for(;n.length;)t=n.shift(),e.off(t[0],t[1]);e.clearTimeout(i),e.clearTimeout(r)},d=function(t,i){let r=function(){if(!e.error()&&(e.paused()||e.ended()))return o();i.call(this)};e.on(t,r),n.push([t,r])},u=function(){let t=0;l(),o(),d(["timeupdate","adtimeupdate"],function(){let i=e.currentTime();i!==t&&(t=i,o())}),e.off(y.default,"visibilitychange",u),e.on(y.default,"visibilitychange",u)},h=function(){e.currentSrc()||e.error({code:-1,type:"PLAYER_ERR_NO_SRC"})},c=function(){let i="",r=e.error(),s=y.default.createElement("div"),n="";if(!r)return;e.off(y.default,"visibilitychange",u),(r=v(r,t.errors[r.code||r.type||0])).message&&(i=`<div class="vjs-errors-details">${e.localize("Technical details")} 35 : <div class="vjs-errors-message">${e.localize(r.message)}</div> 36 </div>`);let a=e.getChild("errorDisplay");s.className="vjs-errors-dialog";let o=`<div class="vjs-errors-code"><b>${this.localize("Error Code")}:</b> ${r.type||r.code}</div>`,l=-2===r.code;n=`<div class="vjs-errors-content-container"> 37 <h2 class="vjs-errors-headline">${this.localize(r.headline)}</h2> 38 ${l?"":o} 39 ${l?"":i} 40 </div>`;let d=a.closeable(!("dismiss"in r)||r.dismiss);if(l){s.innerHTML=n+=`<div class="vjs-errors-timeout-button-container"> 41 <button>${this.localize("Reload Video")}</button> 42 <button>${this.localize("Dismiss")}</button> 43 </div>`,a.fillWith(s),a.getChild("closeButton").hide();let t=a.el().querySelector(".vjs-errors-timeout-button-container > button:first-child"),i=a.el().querySelector(".vjs-errors-timeout-button-container > button:last-child"),r=()=>{let t=e.currentSource();e.reset(),e.src(t)};e.on(t,"click",r),a.one("modalclose",()=>{e.off(t,"click",r),e.off(i,"click",a.close)})}else if(d){s.innerHTML=n+=`<div class="vjs-errors-ok-button-container"> 44 <button class="vjs-errors-ok-button">${this.localize("OK")}</button> 45 </div>`,a.fillWith(s),a.contentEl().firstChild.appendChild(a.getChild("closeButton").el());let t=a.el().querySelector(".vjs-errors-ok-button");e.on(t,"click",function(){a.close()})}else s.innerHTML=n,a.fillWith(s);(600>=e.currentWidth()||250>=e.currentHeight())&&a.addClass("vjs-xs"),a.one("modalclose",()=>e.error(null))},p=function(){l(),e.removeClass("vjs-errors"),e.off("play",u),e.off(y.default,"visibilitychange",u),e.off("play",h),e.off("dispose",p),e.off(["aderror","error"],c)},m=function(t){p(),T(e,v(b,t))};m.extend=e=>a(e),m.getAll=()=>v(t.errors),m.timeout=function(i){if(void 0===i)return t.timeout;i!==t.timeout&&(t.timeout=i,e.paused()||u())},m.backgroundTimeout=function(i){if(void 0===i)return t.backgroundTimeout;i!==t.backgroundTimeout&&(t.backgroundTimeout=i,e.paused()||u())},m.disableProgress=()=>{},e.on("play",u),e.on("play",h),e.on("dispose",p),e.on(["aderror","contenterror","error"],c),e.ready(()=>{e.addClass("vjs-errors")}),e.paused()||u(),m.VERSION=_,e.errors=m},A=function(e){T(this,v(b,e))};["extend","getAll"].forEach(e=>{A[e]=function(){a.default.log.warn(`The errors.${e}() method is not available until the plugin has been initialized!`)}}),A.VERSION=_,a.default.registerPlugin("errors",A);var S=e.i(325273),E="7.5.2",C=function(e,t){t.isImmediatePropagationStopped=function(){return!0},t.cancelBubble=!0,t.isPropagationStopped=function(){return!0}},w=function(e,t,i){C(e,i),e.trigger({type:t+i.type,originalEvent:i})},k=function(e,t){e.ads.isInAdMode()&&(e.ads.isContentResuming()?e.ads._contentEnding&&w(e,"content",t):w(e,"ad",t))},x=function(e,t){e.ads.isInAdMode()?e.ads.isContentResuming()?(C(e,t),e.trigger("resumeended")):w(e,"ad",t):e.ads._contentHasEnded||e.ads.stitchedAds()||(w(e,"content",t),e.trigger("readyforpostroll"))},I=function(e,t){if(("loadstart"!==t.type||e.ads._hasThereBeenALoadStartDuringPlayerLife)&&("loadeddata"!==t.type||e.ads._hasThereBeenALoadedData)&&("loadedmetadata"!==t.type||e.ads._hasThereBeenALoadedMetaData))if(e.ads.inAdBreak())w(e,"ad",t);else{if(e.currentSrc()!==e.ads.contentSrc)return;w(e,"content",t)}},D=function(e,t){e.ads.inAdBreak()?w(e,"ad",t):e.ads.isContentResuming()&&w(e,"content",t)};function P(e){"playing"===e.type?k(this,e):"ended"===e.type?x(this,e):"loadstart"===e.type||"loadeddata"===e.type||"loadedmetadata"===e.type?I(this,e):"play"===e.type?D(this,e):this.ads.isInAdMode()&&(this.ads.isContentResuming()?w(this,"content",e):w(this,"ad",e))}function L(){return(L=Object.assign.bind()).apply(this,arguments)}function R(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,M(e,t)}
45function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var O={},N=function(e){if(a.default.dom.isInFrame()&&"function"!=typeof S.default.__tcfapi){for(var t,i=S.default,r={};i;){try{if(i.frames.__tcfapiLocator){t=i;break}}catch(e){}if(i===S.default.top)break;i=i.parent}t&&(S.default.__tcfapi=function(e,i,s,n){var a=Math.random()+"";r[a]=s,t.postMessage({__tcfapiCall:{command:e,parameter:n,version:i,callId:a}},"*")},S.default.addEventListener("message",function(e){var t={};try{t="string"==typeof e.data?JSON.parse(e.data):e.data}catch(e){}var i=t.__tcfapiReturn;i&&"function"==typeof r[i.callId]&&(r[i.callId](i.returnValue,i.success),r[i.callId]=null)},!1))}},j=function(){N(),"function"==typeof S.default.__tcfapi&&S.default.__tcfapi("addEventListener",2,function(e,t){t&&(O=e)})},U=function(e){for(var t=e.parent;t!==e.top;){try{if(t.frames&&t.frames.__uspapiLocator)return t}catch(e){}t=t.parent}try{if(e.top.frames&&e.top.frames.__uspapiLocator)return e.top}catch(e){}return null},B="",F=function(e,t){if(void 0===t&&(t=S.default),t.__uspapi)t.__uspapi("getUSPData",1,function(t,i){var r=i?t.uspString:null;B=r,e(r)});else{var i=U(t);if(!i)return void e(null);var r=Math.random().toString(36).substring(2);t.addEventListener("message",function i(s){if(s&&s.data&&s.data.__uspapiReturn&&s.data.__uspapiReturn.callId===r){t.removeEventListener("message",i,!1);var n=s.data.__uspapiReturn,a=n.returnValue,o=n.success?a.uspString:null;B=o,e(o)}},!1),i.postMessage({__uspapiCall:{command:"getUSPData",version:1,callId:r}},"*")}},q={AdsBeforePrerollError:"ads-before-preroll-error",AdsPrerollError:"ads-preroll-error",AdsMidrollError:"ads-midroll-error",AdsPostrollError:"ads-postroll-error",AdsMacroReplacementFailed:"ads-macro-replacement-failed",AdsResumeContentFailed:"ads-resume-content-failed"},V=function(e,t){return t?encodeURIComponent(e):e},$=function(e,t,i){if(e&&e[i])for(var r=e[i],s=Object.keys(r),n=0;n<s.length;n++)t["{mediainfo."+i+"."+s[n]+"}"]=r[s[n]]},H=function(e,t){var i={};return["description","tags","reference_id","ad_keys"].forEach(function(r){e&&e[r]?i["{mediainfo."+r+"}"]=e[r]:t["{mediainfo."+r+"}"]?i["{mediainfo."+r+"}"]=t["{mediainfo."+r+"}"]:i["{mediainfo."+r+"}"]=""}),["custom_fields","customFields"].forEach(function(t){$(e,i,t)}),i},z=function(e){var t={},i=e.replace(/{([^}=]+)=([^}]*)}/g,function(e,i,r){return t["{"+i+"}"]=r,"{"+i+"}"});return{defaults:t,modifiedString:i}},W=function(e){var t={};return Object.keys(e).forEach(function(i){t["{tcf."+i+"}"]=e[i]}),t["{tcf.gdprAppliesInt}"]=+!!e.gdprApplies,t},G=function(e,t,i){var r=RegExp("{pageVariable\\.([^}]+)}","g"),s={},n=(e.match(r)||[]).concat(Object.keys(i).filter(function(t){return r.test(t)&&e.includes(i[t])}));if(n)return n.forEach(function(e){for(var i,r=e.slice(14,-1),n=r.split("."),o=S.default,l=0;l<n.length;l++)if(l===n.length-1)i=o[n[l]];else if(void 0===(o=o[n[l]]))break;var d=typeof i;null===i?s[e]="null":void 0===i?t[e]?s[e]=t[e]:(a.default.log.warn('Page variable "'+r+'" not found'),s[e]=""):"string"!==d&&"number"!==d&&"boolean"!==d?(a.default.log.warn('Page variable "'+r+'" is not a supported type'),s[e]=""):s[e]=i}),s},X=function(e,t,i,r,s){for(var n in void 0===r&&(r={}),t){var o=r.hasOwnProperty(n)?r[n]:n;if(o.startsWith("r:"))try{var l=RegExp(o.slice(2),"g");e=e.replace(l,V(t[n],i))}catch(e){s.ads.error({errorType:q.AdsMacroReplacementFailed,macro:n,error:e}),a.default.log.warn('Unable to replace macro with regex "'+o+'". The provided regex may be invalid.')}else e=e.split(o).join(V(t[n],i))}return e};function Y(e,t,i){void 0===t&&(t=!1),void 0===i&&(i={});var r,s=i.disableDefaultMacros||!1,n=i.macroNameOverrides||{};delete i.disableDefaultMacros,delete i.macroNameOverrides;var o=i;if(s)return X(e,o,t,n);var l=z(e),d=l.defaults;for(var u in e=l.modifiedString,L(o,(r=this,{"{player.id}":r.options_["data-player"]||r.id_,"{player.height}":r.currentHeight(),"{player.width}":r.currentWidth(),"{player.heightInt}":Math.round(r.currentHeight()),"{player.widthInt}":Math.round(r.currentWidth()),"{player.autoplay}
45":+!!r.autoplay(),"{player.muted}":+!!r.muted(),"{player.language}":r.language()||"","{mediainfo.id}":r.mediainfo?r.mediainfo.id:"","{mediainfo.name}":r.mediainfo?r.mediainfo.name:"","{mediainfo.duration}":r.mediainfo?r.mediainfo.duration:"","{player.duration}":r.duration(),"{player.durationInt}":Math.round(r.duration()),"{player.live}":+(r.duration()===1/0),"{player.pageUrl}":a.default.dom.isInFrame()?y.default.referrer:S.default.location.href,"{playlistinfo.id}":r.playlistinfo?r.playlistinfo.id:"","{playlistinfo.name}":r.playlistinfo?r.playlistinfo.name:"","{timestamp}":new Date().getTime(),"{document.referrer}":y.default.referrer,"{window.location.href}":S.default.location.href,"{random}":Math.floor(1e12*Math.random())}),H(this.mediainfo,d),W(O),{"{usp.uspString}":B},G(e,d,n)),e=X(e,o,t,n,this),d)e=e.replace(u,d[u]);return e}var K={};K.processMetadataTracks=function(e,t){for(var i=e.textTracks(),r=function(i){"metadata"===i.kind&&(e.ads.cueTextTracks.setMetadataTrackMode(i),t(e,i))},s=0;s<i.length;s++)r(i[s]);i.addEventListener("addtrack",function(e){r(e.track)})},K.setMetadataTrackMode=function(e){},K.getSupportedAdCue=function(e,t){return t},K.isSupportedAdCue=function(e,t){return!0},K.getCueId=function(e,t){return t.id};var Q=function(e,t){void 0!==t&&""!==t&&(e.ads.includedCues[t]=!0)};function Z(){!1!==this.ads._shouldBlockPlay&&(this.paused()||(this.ads.debug("Playback was canceled by cancelContentPlay"),this.pause()),this.ads._cancelledPlay=!0)}K.processAdTrack=function(e,t,i,r){e.ads.includedCues={};for(var s=0;s<t.length;s++){var n=t[s],o=this.getSupportedAdCue(e,n);if(!this.isSupportedAdCue(e,n))return void a.default.log.warn("Skipping as this is not a supported ad cue.",n);var l=this.getCueId(e,n),d=n.startTime;if(void 0!==l&&e.ads.includedCues[l])return void a.default.log("Skipping ad already seen with ID "+l);r&&r(e,o,l,d),i(e,o,l,d),Q(e,l)}};var J={},ee=a.default;J.isMiddlewareMediatorSupported=function(){if(ee.browser.IS_IOS||ee.browser.IS_ANDROID);else if(ee.use&&ee.middleware&&ee.middleware.TERMINATOR)return!0;return!1},J.playMiddleware=function(e){return{setSource:function(e,t){t(null,e)},callPlay:function(){if(e.ads&&!0===e.ads._shouldBlockPlay)return e.ads.debug("Using playMiddleware to block content playback"),e.ads._playBlocked=!0,ee.middleware.TERMINATOR},play:function(t,i){e.ads&&e.ads._playBlocked&&t?(e.ads.debug("Play call to Tech was terminated."),e.trigger("play"),e.addClass("vjs-has-started"),e.ads._playBlocked=!1):i&&i.catch&&i.catch(function(t){"NotAllowedError"!==t.name||a.default.browser.IS_SAFARI||e.trigger("pause")})}}},J.testHook=function(e){ee=e};var et=J.playMiddleware,ei=J.isMiddlewareMediatorSupported,er={src:"data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAAxJtZGF03ABMYXZjNjEuMy4xMDAAQiAIwRg4AAACrgYF//+q3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE2NCByMzEwOCAzMWUxOWY5IC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAyMyAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MzoweDExMyBtZT1oZXggc3VibWU9NyBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0xIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MSA4eDhkY3Q9MSBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0tMiB0aHJlYWRzPTcgbG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0zIGJfcHlyYW1pZD0yIGJfYWRhcHQ9MSBiX2JpYXM9MCBkaXJlY3Q9MSB3ZWlnaHRiPTEgb3Blbl9nb3A9MCB3ZWlnaHRwPTIga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAAn//71sXwKaunqigzoMi7hlyTJrrYi4m0AwABFxzcqWKGahTaoBcQAAMWK4AlcFlIICBeldSEQBGCMHAAABVNtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAAIgABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAACQXRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAIgAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAABQAAAAPAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAACIAAAAAAAEAAAAAAbltZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAADwAAAACAFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAFkbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABJHN0YmwAAADAc3RzZAAAAAAAAAABAAAAsGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAABQADwAEgAAABIAAAAAAAAAAEUTGF2YzYxLjMuMTAwIGxpYngyNjQAAAAAAAAAAAAAAAAY//8AAAA2YXZjQwFkAA3/4QAZZ2QADazZQUH7ARAAAAMAEAAAAwPA8UKZYAEABmjr48siwP34+AAAAAAQcGFzcAAAAAEAAAABAAAAFGJ0cnQAAAAAAALAEAACwBAAAAAYc3R0cwAAAAAAAAABAAAAAQAAAgAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAC7wAAAAEAAAAUc3RjbwAAAAAAAAABAAAARQAAAj10cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAAABgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAAXAAAEAAABAAAAAAG1bWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAACsRAAACABVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABYG1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABJHN0YmwAAAB+c3RzZAAAAAAAAAABAAAAbm1wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAACsRAAAAAAANmVzZHMAAAAAA4CAgCUAAgAEgICAF0AVAAAAAAH0AAAAEisFgICABRIQVuUABoCAgAECAAAAFGJ0cnQAAAAAAAH0AAAAEisAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAAVAAAABgAAABhzdGNvAAAAAAAAAAIAAAAwAAADNAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAACAAAAAQAAAGF1ZHRhAAAAWW1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALGlsc3QAAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjEuMS4xMDA=",type:"video/mp4"},es=function(){function e(){}return e.getState=function(t){if(t&&e.states_&&e.states_[t])return e.states_[t]},e.registerState=function(t,i){if("string"!=typeof t||!t)throw Error('Illegal state name, "'+t+'"; must be a non-empty string.');return e.states_||(e.states_={}),e.states_[t]=i,i},e}(),en=function(){function e(e){this.player=e}e._getName=function(){return"Anonymous State"};var t=e.prototype;return t.transitionTo=function(e){var t=this.player;this.cleanup(t);var i=new e(t);t.ads._state=i,t.ads.debug(this.constructor._getName()+" -> "+i.constructor._getName());for(var r=arguments.length,s=Array(r>1?r-1:0),n=1;n<r;n++)s[n-1]=arguments[n];i.init.apply(i,[t].concat(s))},t.init=function(){},t.cleanup=function(){},t.onPlay=function(){},t.onPlaying=function(){},t.onEnded=function(){},t.onAdEnded=function(){},t.onAdsReady=function(){a.default.log.warn("Unexpected adsready event")},t.onAdsError=function(){},t.onAdsCanceled=function(){},t.onAdTimeout=function(){},t.onAdStarted=function(){},t.onAdSkipped=function(){},t.onContentChanged=function(){},t.onContentResumed=function(){},t.onReadyForPostroll=function(){a.default.log.warn("Unexpected readyforpostroll event")},t.onNoPreroll=function(){},t.onNoPostroll=function(){},t.startLinearAdMode=function(){a.default.log.warn("Unexpected startLinearAdMode invocation (State via "+this.constructor._getName()+")")},t.endLinearAdMode=function(){a.default.log.warn("Unexpected endLinearAdMode invocation (State via "+this.constructor._getName()+")")},t.skipLinearAdMode=function(){a.default.log.warn("Unexpected skipLinearAdMode invocation (State via "+this.constructor._getName()+")")},t.isAdState=function(){throw Error("isAdState unimplemented for "+this.constructor._getName())},t.isWaitingForAdBreak=function(){return!1},t.isContentResuming=function(){return!1},t.inAdBreak=function(){return!1},t.handleEvent=function(e){var t=this.player;"play"===e?this.onPlay(t):"adsready"===e?this.onAdsReady(t):"adserror"===e?this.onAdsError(t):"adscanceled"===e?this.onAdsCanceled(t):"adtimeout"===e?this.onAdTimeout(t):"ads-ad-started"===e?this.onAdStarted(t):"ads-ad-skipped"===e?this.onAdSkipped(t):"contentchanged"===e?this.onContentChanged(t):"contentresumed"===e?this.onContentResumed(t):"readyforpostroll"===e?this.onReadyForPostroll(t):"playing"===e?this.onPlaying(t):"ended"===e?this.onEnded(t):"nopreroll"===e?this.onNoPreroll(t):"nopostroll"===e?this.onNoPostroll(t):"adended"===e&&this.onAdEnded(t)},e}();es.registerState("State",en);var ea=function(e){function t(t){var i;return(i=e.call(this,t)||this).contentResuming=!1,i.waitingForAdBreak=!1,i}R(t,e);var i=t.prototype;return i.isAdState=function(){return!0},i.onPlaying=function(){var e=es.getState("ContentPlayback");this.contentResuming&&this.transitionTo(e)},i.onContentResumed=function(){var e=es.getState("ContentPlayback");this.contentResuming&&this.transitionTo(e)},i.isWaitingForAdBreak=function(){return this.waitingForAdBreak},i.isContentResuming=function(){return this.contentResuming},i.inAdBreak=function(){return!0===this.player.ads._inLinearAdMode},t}(en);es.registerState("AdState",ea);var eo=function(e){function t(){return e.apply(this,arguments)||this}R(t,e);var i=t.prototype;return i.isAdState=function(){return!1},i.onContentChanged=function(e){var t=es.getState("BeforePreroll"),i=es.getState("Preroll");e.ads.debug("Received contentchanged event (ContentState)"),e.paused()?this.transitionTo(t):(this.transitionTo(i,!1),e.pause(),e.ads._pausedOnContentupdate=!0)},t}(en);es.registerState("ContentState",eo);var el=function(e){function t(){return e.apply(this,arguments)||this}R(t,e),t._getName=function(){return"AdsDone"};var i=t.prototype;return i.init=function(e){e.ads._contentHasEnded=!0,e.trigger("ended")},i.startLinearAdMode=function(){a.default.log.warn("Unexpected startLinearAdMode invocation (AdsDone)")},t}(es.getState("ContentState"));es.registerState("AdsDone",el);var ed={start:function(e){e.ads.debug("Starting ad break"),e.ads._inLinearAdMode=!0,e.trigger("adstart"),e.ads.shouldTakeSnapshots()&&(e.ads.snapshot=function(e){var t=a.default.browser.IS_IOS&&e.ads.isLive(e)&&e.seekable().length>0?e.currentTime()-e.seekable().end(0):e.currentTime(),i=e.$(".vjs-tech"),r=e.textTracks?e.textTracks():[],s=[],n={ended:e.ended(),currentSrc:e.currentSrc(),sources:e.currentSources(),src:e.tech_.src(),currentTime:t,type:e.currentType()};i&&(n.style=i.getAttribute("style"));for(var o=0;o<r.length;o++){var l=r[o];s.push({track:l,mode:l.mode}),l.mode="disabled"}return n.suppressedTracks=s,n}(e)),e.ads.shouldPlayContentBehindAd(e)&&!e.ads.settings.stitchedAds&&(e.ads.preAdVolume_=e.volume(),e.volume(0)),e.addClass("vjs-ad-playing"),e.hasClass("vjs-live")&&e.removeClass("vjs-live"),e.ads.removeNativePoster(),e.ads.preAdPlaybackRate_=e.playbackRate(),e.playbackRate(1),e.controlBar&&e.controlBar.playbackRateMenuButton&&e.controlBar.playbackRateMenuButton.playbackRateSupported&&!e.controlBar.playbackRateMenuButton.hasClass("vjs-hidden")?(e.controlBar.playbackRateMenuButton.hide(),e.ads.showPlaybackMenuOnAdEnd_=!0):e.ads.showPlaybackMenuOnAdEnd_=!1},end:function(e,t){e.ads.debug("Ending ad break"),void 0===t&&(t=function(){}),e.ads.adType=null,e.ads._inLinearAdMode=!1,e.trigger("adend"),e.removeClass("vjs-ad-playing"),e.ads.isLive(e)&&e.addClass("vjs-live"),e.ads.shouldTakeSnapshots()?function(e,t){var i,s=e.ads.snapshot;if(void 0===t&&(t=function(){}),!0===e.ads.disableNextSnapshotRestore){e.ads.disableNextSnapshotRestore=!1,delete e.ads.snapshot,t();return}var n=e.$(".vjs-tech"),o=20,l=s.suppressedTracks,d=function(){for(var e=0;e<l.length;e++)(i=l[e]).track.mode=i.mode},u=function(){var t;if(a.default.browser.IS_IOS&&e.ads.isLive(e)){if(s.currentTime<0&&(t=e.seekable().length>0?e.seekable().end(0)+s.currentTime:e.currentTime(),e.currentTime(t)),e.paused()){var i=e.play();i&&i.catch&&i.catch(function(e){a.default.log.warn("Play promise rejected in IOS snapshot resume",e)})}}else if(s.ended)e.currentTime(e.duration());else{e.currentTime(s.currentTime);var r=e.play();r&&r.catch&&r.catch(function(e){a.default.log.warn("Play promise rejected in snapshot resume",e)})}e.ads.shouldRemoveAutoplay_&&(e.autoplay(!1),e.ads.shouldRemoveAutoplay_=!1)},h=function t(){if(e.off("contentcanplay",t),r&&e.clearTimeout(r),(n=e.el().querySelector(".vjs-tech")).readyState>1||void 0===n.seekable||n.seekable.length>0)return u();if(o--)e.setTimeout(t,50);else try{u()}catch(t){e.ads.error({errorType:q.AdsResumeContentFailed,error:t}),a.default.log.warn("Failed to resume the content after an advertisement",t)}};if("style"in s&&n.setAttribute("style",s.style||""),e.ads.videoElementRecycled())e.one("resumeended",function(){delete e.ads.snapshot,t()}),e.one("contentloadedmetadata",d),a.default.browser.IS_IOS&&!e.autoplay()&&"function"==typeof e.techCall_&&(e.techCall_("setAutoplay",!0),e.ads.shouldRemoveAutoplay_=!0),e.src(s.sources),e.one("contentcanplay",h),r=e.setTimeout(h,2e3);else{if(d(),!e.ended()){var c=e.play();c&&c.catch&&c.catch(function(e){a.default.log.warn("Play promise rejected in snapshot restore",e)})}delete e.ads.snapshot,t()}}(e,t):(e.ads.preAdVolume_&&e.volume(e.ads.preAdVolume_),t()),e.playbackRate(e.ads.preAdPlaybackRate_),e.ads.showPlaybackMenuOnAdEnd_&&e.controlBar.playbackRateMenuButton.show()}},eu=function(e){function t(){return e.apply(this,arguments)||this}R(t,e),t._getName=function(){return"Preroll"};var i=t.prototype;return i.init=function(e,t,i){if(this.waitingForAdBreak=!0,e.addClass("vjs-ad-loading"),i||e.ads.nopreroll_)return this.resumeAfterNoPreroll(e);var r=e.ads.settings.timeout;"number"==typeof e.ads.settings.prerollTimeout&&(r=e.ads.settings.prerollTimeout),this._timeout=e.setTimeout(function(){e.trigger("adtimeout")},r),t?this.handleAdsReady():this.adsReady=!1},i.onAdsReady=function(e){e.ads.inAdBreak()?a.default.log.warn("Unexpected adsready event (Preroll)"):(e.ads.debug("Received adsready event (Preroll)"),this.handleAdsReady())},i.handleAdsReady=function(){this.adsReady=!0,this.readyForPreroll()},i.afterLoadStart=function(e){var t=this.player;t.ads._hasThereBeenALoadStartDuringPlayerLife?e():(t.ads.debug("Waiting for loadstart..."),t.one("loadstart",function(){t.ads.debug("Received loadstart event"),e()}))},i.noPreroll=function(){var e=this;this.afterLoadStart(function(){e.player.ads.debug("Skipping prerolls due to nopreroll event (Preroll)"),e.resumeAfterNoPreroll(e.player)})},i.readyForPreroll=function(){var e=this.player;this.afterLoadStart(function(){e.ads.debug("Triggered readyforpreroll event (Preroll)"),e.trigger("readyforpreroll")})},i.onAdsCanceled=function(e){var t=this;e.ads.debug("adscanceled (Preroll)"),this.afterLoadStart(function(){t.resumeAfterNoPreroll(e)})},i.onAdsError=function(e){var t=this;a.default.log("adserror (Preroll)"),e.ads.error({errorType:q.AdsPrerollError}),this.inAdBreak()?e.ads.endLinearAdMode():this.afterLoadStart(function(){t.resumeAfterNoPreroll(e)})},i.startLinearAdMode=function(){var e=this.player;!this.adsReady||e.ads.inAdBreak()||this.isContentResuming()?a.default.log.warn("Unexpected startLinearAdMode invocation (Preroll)"):(this.clearTimeout(e),e.ads.adType="preroll",this.waitingForAdBreak=!1,ed.start(e),e.ads._shouldBlockPlay=!1)},i.onAdStarted=function(e){e.removeClass("vjs-ad-loading")},i.endLinearAdMode=function(){var e=this.player;this.inAdBreak()&&(e.removeClass("vjs-ad-loading"),e.addClass("vjs-ad-content-resuming"),this.contentResuming=!0,ed.end(e))},i.skipLinearAdMode=function(){var e=this,t=this.player;t.ads.inAdBreak()||this.isContentResuming()?a.default.log.warn("Unexpected skipLinearAdMode invocation"):this.afterLoadStart(function(){t.trigger("adskip"),t.ads.debug("skipLinearAdMode (Preroll)"),e.resumeAfterNoPreroll(t)})},i.onAdTimeout=function(e){var t=this;this.afterLoadStart(function(){e.ads.debug("adtimeout (Preroll)"),t.resumeAfterNoPreroll(e)})},i.onNoPreroll=function(e){e.ads.inAdBreak()||this.isContentResuming()?a.default.log.warn("Unexpected nopreroll event (Preroll)"):this.noPreroll()},i.resumeAfterNoPreroll=function(e){if(this.contentResuming=!0,e.ads._shouldBlockPlay=!1,this.cleanupPartial(e),e.ads._playRequested||e.ads._pausedOnContentupdate)if(e.paused()){e.ads.debug("resumeAfterNoPreroll: attempting to resume playback (Preroll)");var t=e.play();t&&t.then&&t.then(null,function(e){})}else e.ads.debug("resumeAfterNoPreroll: already playing (Preroll)"),e.trigger("play"),e.trigger("playing")},i.cleanup=function(e){e.ads._hasThereBeenALoadStartDuringPlayerLife||a.default.log.warn("Leaving Preroll state before loadstart event can cause issues."),this.cleanupPartial(e)},i.cleanupPartial=function(e){e.removeClass("vjs-ad-loading"),e.removeClass("vjs-ad-content-resuming"),this.cle
vendor: 9,917 bytes, line 45
45arTimeout(e)},i.clearTimeout=function(e){e.clearTimeout(this._timeout),this._timeout=null},t}(es.getState("AdState"));es.registerState("Preroll",eu);var eh=function(e){function t(){return e.apply(this,arguments)||this}R(t,e),t._getName=function(){return"BeforePreroll"};var i=t.prototype;return i.init=function(e){this.adsReady=!1,this.shouldResumeToContent=!1,e.ads._shouldBlockPlay=!e.ads.settings.allowVjsAutoplay||!e.autoplay()},i.onAdsReady=function(e){e.ads.debug("Received adsready event (BeforePreroll)"),this.adsReady=!0},i.onPlay=function(e){var t=es.getState("Preroll");e.ads.debug("Received play event (BeforePreroll)"),this.transitionTo(t,this.adsReady,this.shouldResumeToContent)},i.onAdsCanceled=function(e){e.ads.debug("adscanceled (BeforePreroll)"),this.shouldResumeToContent=!0},i.onAdsError=function(){this.player.ads.debug("adserror (BeforePreroll)"),this.player.ads.error({errorType:q.AdsBeforePrerollError}),this.shouldResumeToContent=!0},i.onNoPreroll=function(){this.player.ads.debug("Skipping prerolls due to nopreroll event (BeforePreroll)"),this.shouldResumeToContent=!0},i.skipLinearAdMode=function(){var e=this.player;e.trigger("adskip"),e.ads.debug("skipLinearAdMode (BeforePreroll)"),this.shouldResumeToContent=!0},i.onContentChanged=function(){this.init(this.player)},t}(es.getState("ContentState"));es.registerState("BeforePreroll",eh);var ec=function(e){function t(){return e.apply(this,arguments)||this}R(t,e),t._getName=function(){return"Midroll"};var i=t.prototype;return i.init=function(e){e.ads.adType="midroll",ed.start(e),e.addClass("vjs-ad-loading")},i.onAdStarted=function(e){e.removeClass("vjs-ad-loading")},i.endLinearAdMode=function(){var e=this.player;this.inAdBreak()&&(this.contentResuming=!0,e.addClass("vjs-ad-content-resuming"),e.removeClass("vjs-ad-loading"),ed.end(e))},i.onAdsError=function(e){e.ads.error({errorType:q.AdsMidrollError}),this.inAdBreak()&&e.ads.endLinearAdMode()},i.cleanup=function(e){e.removeClass("vjs-ad-loading"),e.removeClass("vjs-ad-content-resuming")},t}(es.getState("AdState"));es.registerState("Midroll",ec);var ep=function(e){function t(){return e.apply(this,arguments)||this}R(t,e),t._getName=function(){return"Postroll"};var i=t.prototype;return i.init=function(e){if(this.waitingForAdBreak=!0,e.ads._contentEnding=!0,e.ads.nopostroll_){this.resumeContent(e);var t=es.getState("AdsDone");this.transitionTo(t)}else{e.addClass("vjs-ad-loading");var i=e.ads.settings.timeout;"number"==typeof e.ads.settings.postrollTimeout&&(i=e.ads.settings.postrollTimeout),this._postrollTimeout=e.setTimeout(function(){e.trigger("adtimeout")},i)}},i.startLinearAdMode=function(){var e=this.player;e.ads.inAdBreak()||this.isContentResuming()?a.default.log.warn("Unexpected startLinearAdMode invocation (Postroll)"):(e.ads.adType="postroll",e.clearTimeout(this._postrollTimeout),this.waitingForAdBreak=!1,ed.start(e))},i.onAdStarted=function(e){e.removeClass("vjs-ad-loading")},i.endLinearAdMode=function(){var e=this,t=this.player,i=es.getState("AdsDone");this.inAdBreak()&&(t.removeClass("vjs-ad-loading"),this.resumeContent(t),ed.end(t,function(){e.transitionTo(i)}))},i.skipLinearAdMode=function(){var e=this.player;e.ads.inAdBreak()||this.isContentResuming()?a.default.log.warn("Unexpected skipLinearAdMode invocation"):(e.ads.debug("Postroll abort (skipLinearAdMode)"),e.trigger("adskip"),this.abort(e))},i.onAdTimeout=function(e){e.ads.debug("Postroll abort (adtimeout)"),this.abort(e)},i.onAdsError=function(e){e.ads.debug("Postroll abort (adserror)"),e.ads.error({errorType:q.AdsPostrollError}),e.ads.inAdBreak()?e.ads.endLinearAdMode():this.abort(e)},i.onContentChanged=function(e){if(this.isContentResuming()){var t=es.getState("BeforePreroll");this.transitionTo(t)}else if(!this.inAdBreak()){var i=es.getState("Preroll");this.transitionTo(i)}},i.onNoPostroll=function(e){this.isContentResuming()||this.inAdBreak()?a.default.log.warn("Unexpected nopostroll event (Postroll)"):this.abort(e)},i.resumeContent=function(e){this.contentResuming=!0,e.addClass("vjs-ad-content-resuming")},i.abort=function(e){var t=es.getState("AdsDone");this.resumeContent(e),e.removeClass("vjs-ad-loading"),this.transitionTo(t)},i.cleanup=function(e){e.removeClass("vjs-ad-content-resuming"),e.clearTimeout(this._postrollTimeout),e.ads._contentEnding=!1},t}(es.getState("AdState"));es.registerState("Postroll",ep);var em=function(e){function t(){return e.apply(this,arguments)||this}R(t,e),t._getName=function(){return"ContentPlayback"};var i=t.prototype;return i.init=function(e){e.ads._shouldBlockPlay=!1},i.onAdsReady=function(e){e.ads.debug("Received adsready event (ContentPlayback)"),e.ads.nopreroll_||(e.ads.debug("Triggered readyforpreroll event (ContentPlayback)"),e.trigger("readyforpreroll"))},i.onReadyForPostroll=function(e){var t=es.getState("Postroll");e.ads.debug("Received readyforpostroll event"),this.transitionTo(t)},i.startLinearAdMode=function(){var e=es.getState("Midroll");this.transitionTo(e)},t}(es.getState("ContentState"));es.registerState("ContentPlayback",em);var ef=function(e){function t(){return e.apply(this,arguments)||this}R(t,e),t._getName=function(){return"StitchedContentPlayback"};var i=t.prototype;return i.init=function(){this.player.ads._shouldBlockPlay=!1},i.onContentChanged=function(){this.player.ads.debug("Received contentchanged event ("+this.constructor._getName()+")")},i.startLinearAdMode=function(){var e=es.getState("StitchedAdRoll");this.transitionTo(e)},t}(es.getState("ContentState"));es.registerState("StitchedContentPlayback",ef);var eg=function(e){function t(){return e.apply(this,arguments)||this}R(t,e),t._getName=function(){return"StitchedAdRoll"};var i=t.prototype;return i.init=function(){this.waitingForAdBreak=!1,this.contentResuming=!1,this.player.ads.adType="stitched",ed.start(this.player)},i.onPlaying=function(){},i.onContentResumed=function(){},i.onAdEnded=function(){this.endLinearAdMode(),this.player.trigger("ended")},i.endLinearAdMode=function(){var e=es.getState("StitchedContentPlayback");ed.end(this.player),this.transitionTo(e)},t}(es.getState("AdState"));es.registerState("StitchedAdRoll",eg);var ey=function(e){function t(){return e.apply(this,arguments)||this}R(t,e),t._getName=function(){return"OutstreamPending"};var i=t.prototype;return i.init=function(e){this.adsReady=!1},i.onPlay=function(e){var t=es.getState("OutstreamPlayback");e.ads.debug("Received play event (OutstreamPending)"),this.transitionTo(t,this.adsReady)},i.onAdsReady=function(e){e.ads.debug("Received adsready event (OutstreamPending)"),this.adsReady=!0},i.onAdsError=function(){this.player.ads.debug("adserror (OutstreamPending)"),this.adsReady=!1},t}(es.getState("AdState"));es.registerState("OutstreamPending",ey);var e_=function(e){function t(){return e.apply(this,arguments)||this}R(t,e),t._getName=function(){return"OutstreamPlayback"};var i=t.prototype;return i.init=function(e,t){e.addClass("vjs-ad-loading"),t?this.handleAdsReady():this.abort(e)},i.onAdsReady=function(e){e.ads.inAdBreak()?a.default.log.warn("Unexpected adsready event (Preroll)"):(e.ads.debug("Received adsready event (Preroll)"),this.handleAdsReady())},i.abort=function(e){var t=es.getState("OutstreamDone");e.removeClass("vjs-ad-loading"),this.transitionTo(t)},i.onAdStarted=function(e){e.removeClass("vjs-ad-loading")},i.handleAdsReady=function(){this.adsReady=!0,this.readyForOutstreamPlayback()},i.readyForOutstreamPlayback=function(){var e=this.player;this.afterLoadStart(function(){e.trigger("readyforoutstream")})},i.startLinearAdMode=function(){var e=this.player;this.adsReady&&!e.ads.inAdBreak()&&ed.start(e)},i.cleanup=function(e){e.ads._hasThereBeenALoadStartDuringPlayerLife||a.default.log.warn("Leaving OutstreamPlayback state before loadstart event can cause issues."),this.cleanupPartial(e)},i.cleanupPartial=function(e){e.removeClass("vjs-ad-loading"),e.removeClass("vjs-ad-content-resuming"),this.clearTimeout(e)},i.clearTimeout=function(e){e.clearTimeout(this._timeout),this._timeout=null},i.onAdStarted=function(e){e.removeClass("vjs-ad-loading")},i.onAdsError=function(e){var t=this;a.default.log("adserror (OutstreamPlayback)"),this.inAdBreak()?e.ads.endLinearAdMode():this.afterLoadStart(function(){t.abort(e)})},i.onAdTimeout=function(e){var t=this;this.afterLoadStart(function(){e.ads.debug("adtimeout (OutstreamPlayback)"),t.abort(e)})},i.onAdsCanceled=function(e){var t=this;e.ads.debug("adscanceled (OutstreamPlaybac)"),this.afterLoadStart(function(){t.abort(e)})},i.endLinearAdMode=function(){var e=this;if(this.inAdBreak()){this.player.removeClass("vjs-ad-loading");var t=es.getState("OutstreamDone");ed.end(this.player,function(){e.transitionTo(t)})}},i.afterLoadStart=function(e){var t=this.player;t.ads._hasThereBeenALoadStartDuringPlayerLife?e():(t.ads.debug("Waiting for loadstart..."),t.one("loadstart",function(){t.ads.debug("Received loadstart event"),e()}))},i.skipLinearAdMode=function(){var e=this,t=this.player,i=es.getState("OutstreamDone");this.inAdBreak()?a.default.log.warn("Unexpected skipLinearAdMode invocation"):this.afterLoadStart(function(){t.trigger("adskip"),t.ads.debug("skipLinearAdMode (OutstreamPlayback)"),e.transitionTo(i)})},t}(es.getState("AdState"));es.registerState("OutstreamPlayback",e_);var ev=function(e){function t(){return e.apply(this,arguments)||this}R(t,e),t._getName=function(){return"OutstreamDone"};var i=t.prototype;return i.init=function(e){e.trigger("ended")},i.startLinearAdMode=function(){a.default.log.warn("Unexpected startLinearAdMode invocation (OutstreamDone)")},t}(es.getState("AdState"));es.registerState("OutstreamDone",ev);var eb=J.isMiddlewareMediatorSupported,eT=a.default.getTech("Html5").Events,eA={timeout:5e3,prerollTimeout:void 0,postrollTimeout:void 0,debug:!1,stitchedAds:!1,contentIsLive:void 0,liveCuePoints:!0,allowVjsAutoplay:a.default.options.normalizeAutoplay||!1},eS=function(e){var t=this,i=a.default.obj.merge(eA,e),r=[];
45eT.concat(["firstplay","loadedalldata"]).forEach(function(e){-1===r.indexOf(e)&&r.push(e)}),t.on(r,P),eb()||(i.debug&&a.default.log("Using cancelContentPlay to block content playback"),t.on("play",Z)),t.setTimeout(function(){t.ads._hasThereBeenALoadStartDuringPlayerLife||""===t.src()||a.default.log.error("videojs-contrib-ads has not seen a loadstart event 5 seconds after being initialized, but a source is present. This indicates that videojs-contrib-ads was initialized too late. It must be initialized immediately after video.js in the same tick. As a result, some ads will not play and some media events will be incorrect. For more information, see http://videojs.github.io/videojs-contrib-ads/integrator/getting-started.html")},5e3),t.on("ended",function(){t.hasClass("vjs-has-started")||t.addClass("vjs-has-started")}),t.on("contenttimeupdate",function(){t.removeClass("vjs-waiting")}),t.on(["addurationchange","adcanplay"],function(){if(!(t.ads.settings.stitchedAds||t.hasStarted())&&(!t.ads.snapshot||t.currentSrc()!==t.ads.snapshot.currentSrc)&&t.ads.inAdBreak()){var e=t.play();e&&e.catch&&e.catch(function(e){a.default.log.warn("Play promise rejected when playing ad",e)})}}),t.on("nopreroll",function(){t.ads.debug("Received nopreroll event"),t.ads.nopreroll_=!0}),t.on("nopostroll",function(){t.ads.debug("Received nopostroll event"),t.ads.nopostroll_=!0}),t.on("playing",function(){t.ads._cancelledPlay=!1,t.ads._pausedOnContentupdate=!1}),t.on("play",function(){t.ads._playRequested=!0}),t.one("loadstart",function(){t.ads._hasThereBeenALoadStartDuringPlayerLife=!0}),t.on("loadeddata",function(){t.ads._hasThereBeenALoadedData=!0}),t.on("loadedmetadata",function(){t.ads._hasThereBeenALoadedMetaData=!0}),t.ads={disableNextSnapshotRestore:!1,_contentEnding:!1,_contentHasEnded:!1,_hasThereBeenALoadStartDuringPlayerLife:!1,_hasThereBeenALoadedData:!1,_hasThereBeenALoadedMetaData:!1,_inLinearAdMode:!1,_shouldBlockPlay:!1,_playBlocked:!1,_playRequested:!1,_error:null,adType:null,VERSION:E,reset:function(){t.ads.disableNextSnapshotRestore=!1,t.ads._contentEnding=!1,t.ads._contentHasEnded=!1,t.ads.snapshot=null,t.ads.adType=null,t.ads._hasThereBeenALoadedData=!1,t.ads._hasThereBeenALoadedMetaData=!1,t.ads._cancelledPlay=!1,t.ads._shouldBlockPlay=!1,t.ads._playBlocked=!1,t.ads.nopreroll_=!1,t.ads.nopostroll_=!1,t.ads._playRequested=!1,t.ads._error=null},startLinearAdMode:function(){t.ads._state.startLinearAdMode()},endLinearAdMode:function(){t.ads._state.endLinearAdMode()},skipLinearAdMode:function(){t.ads._state.skipLinearAdMode()},stitchedAds:function(e){return void 0!==e&&(a.default.log.warn("Using player.ads.stitchedAds() as a setter is deprecated, it should be set as an option upon initialization of contrib-ads."),this.settings.stitchedAds=!!e),this.settings.stitchedAds},videoElementRecycled:function(){if(t.ads.shouldPlayContentBehindAd(t))return!1;if(!this.snapshot)throw Error("You cannot use videoElementRecycled while there is no snapshot.");var e=t.tech_.src()!==this.snapshot.src,i=t.currentSrc()!==this.snapshot.currentSrc;return e||i},isLive:function(e){return(void 0===e&&(e=t),"boolean"==typeof e.ads.settings.contentIsLive)?e.ads.settings.contentIsLive:e.duration()===1/0||"8"===a.default.browser.IOS_VERSION&&0===e.duration()||!1},shouldPlayContentBehindAd:function(e){if(void 0===e&&(e=t),e)if(!e.ads.settings.liveCuePoints)return!1;else return!a.default.browser.IS_IOS&&!a.default.browser.IS_ANDROID&&e.duration()===1/0;throw Error("shouldPlayContentBehindAd requires a player as a param")},shouldTakeSnapshots:function(e){return void 0===e&&(e=t),!this.shouldPlayContentBehindAd(e)&&!this.stitchedAds()},isInAdMode:function(){return this._state.isAdState()},isWaitingForAdBreak:function(){return this._state.isWaitingForAdBreak()},isContentResuming:function(){return this._state.isContentResuming()},isAdPlaying:function(){return this._state.inAdBreak()},inAdBreak:function(){return this._state.inAdBreak()},removeNativePoster:function(){var e=t.$(".vjs-tech");e&&e.removeAttribute("poster")},debug:function(){if(this.settings.debug){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];1===t.length&&"string"==typeof t[0]?a.default.log("ADS: "+t[0]):a.default.log.apply(a.default,["ADS:"].concat(t))}},error:function(e){if(void 0===e)return this._error||null;if(null===e||!e.errorType){this._error=null;return}this._error=e,a.default.log.error("An error with Ads occured. Type: "+e.errorType+"."),t.trigger({type:"vjsadserror",error:this._error})}},t.ads.settings=i,i.stitchedAds=!!i.stitchedAds,"outstream"===i.playerMode?(t.src(er),t.ads._state=new(e
45s.getState("OutstreamPending"))(t)):i.stitchedAds?t.ads._state=new(es.getState("StitchedContentPlayback"))(t):t.ads._state=new(es.getState("BeforePreroll"))(t),t.ads._state.init(t),t.ads.cueTextTracks=K,t.ads.adMacroReplacement=Y.bind(t),t.ads.contentSrc=t.currentSrc(),t.ads._seenInitialLoadstart=!1,t.on("loadstart",function(){if(!t.ads.inAdBreak()){var e=t.currentSrc();e!==t.ads.contentSrc&&(t.ads._seenInitialLoadstart&&t.trigger({type:"contentchanged"}),t.trigger({type:"contentupdate",oldValue:t.ads.contentSrc,newValue:e}),t.ads.contentSrc=e),t.ads._seenInitialLoadstart=!0}}),t.on("contentchanged",t.ads.reset);var s=function(){var e=t.textTracks();if(!t.ads.shouldPlayContentBehindAd(t)&&t.ads.inAdBreak()&&t.tech_.featuresNativeTextTracks&&a.default.browser.IS_IOS&&!Array.isArray(t.textTracks()))for(var i=0;i<e.length;i++){var r=e[i];"showing"===r.mode&&(r.mode="disabled")}};t.ready(function(){t.textTracks().addEventListener("change",s)}),t.on(["play","playing","ended","adsready","adscanceled","adskip","adserror","adtimeout","adended","ads-ad-started","ads-ad-skipped","contentchanged","dispose","contentresumed","readyforpostroll","nopreroll","nopostroll"],function(e){t.ads._state.handleEvent(e.type)}),t.on("dispose",function(){t.ads.reset(),t.textTracks().removeEventListener("change",s)}),j(),F(function(){}),t.ads.listenToTcf=j,t.ads.updateUsPrivacyString=function(e){return F(e)}};function eE(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function eC(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function ew(e,t,i){return Object.defineProperty(e,"prototype",{writable:!1}),e}function ek(e){return(ek="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}eS.Error=q,eS.VERSION=E,function(){if(a.default.getPlugin)return!!a.default.getPlugin("ads");var e=a.default.getComponent("Player");return!!(e&&e.prototype.ads)}(a.default)||((a.default.registerPlugin||a.default.plugin)("ads",eS),ei()&&!a.default.usingContribAdsMiddleware_&&(a.default.use("*",et),a.default.usingContribAdsMiddleware_=!0,a.default.log.debug("Play middleware has been registered with videojs")));var ex=function(e,t,i){this.vjsPlayer=e,this.controller=i,this.contentTrackingTimer=null,this.contentComplete=!1,this.updateTimeIntervalHandle=null,this.updateTimeInterval=1e3,this.seekCheckIntervalHandle=null,this.seekCheckInterval=1e3,this.resizeCheckIntervalHandle=null,this.resizeCheckInterval=250,this.seekThreshold=100,this.contentEndedListeners=[],this.contentSource="",this.contentSourceType="",this.contentPlayheadTracker={currentTime:0,previousTime:0,seeking:!1,duration:0},this.vjsPlayerDimensions={width:this.getPlayerWidth(),height:this.getPlayerHeight()},this.vjsControls=this.vjsPlayer.getChild("controlBar"),this.h5Player=null,this.vjsPlayer.one("play",this.setUpPlayerIntervals.bind(this)),this.boundContentEndedListener=this.localContentEndedListener.bind(this),this.vjsPlayer.on("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.on("dispose",this.playerDisposedListener.bind(this)),this.vjsPlayer.on("readyforpreroll",this.onReadyForPreroll.bind(this)),this.vjsPlayer.on("adtimeout",this.onAdTimeout.bind(this)),this.vjsPlayer.ready(this.onPlayerReady.bind(this)),"onPlay"===this.controller.getSettings().requestMode&&this.vjsPlayer.one("play",this.controller.requestAds.bind(this.controller)),this.vjsPlayer.ads||window.console.warn("You may be using a version of videojs-contrib-ads that is not compatible with your version of video.js."),this.vjsPlayer.ads(t)};ex.prototype.setUpPlayerIntervals=function(){this.updateTimeIntervalHandle&&clearInterval(this.updateTimeIntervalHandle),this.seekCheckIntervalHandle&&clearInterval(this.seekCheckIntervalHandle),this.resizeCheckIntervalHandle&&clearInterval(this.resizeCheckIntervalHandle),this.updateTimeIntervalHandle=setInterval(this.updateCurrentTime.bind(this),this.updateTimeInterval),this.seekCheckIntervalHandle=setInterval(this.checkForSeeking.bind(this),this.seekCheckInterval),this.resizeCheckIntervalHandle=setInterval(this.checkForResize.bind(this),this.resizeCheckInterval)},ex.prototype.updateCurrentTime=function(){this.contentPlayheadTracker.seeking||(this.contentPlayheadTracker.currentTime=this.vjsPlayer.currentTime())},ex.prototype.checkForSeeking=function(){Math.abs((this.vjsPlayer.currentTime()-this.contentPlayheadTracker.previousTime)*1e3)>this.seekCheckInterval+this.seekThreshold?this.contentPlayheadTracker.seeking=!0:this.contentPlayheadTracker.seeking=!1,this.contentPlayheadTracker.previousTime=this.vjsPlayer.currentTime()},ex.prototype.checkForResize=function(){var e=this.getPlayerWidth(),t=this.getPlayerHeight();(e!=this.vjsPlayerDimensions.width||t!=this.vjsPlayerDimensions.height)&&(this.vjsPlayerDimensions.width=e,this.vjsPlayerDimensions.height=t,this.controller.onPlayerResize(e,t))},ex.prototype.localContentEndedListener=function(){for(var e in this.contentComplete||(this.contentComplete=!0,this.controller.onContentComplete()),this.contentEndedListeners)"function"==typeof this.contentEndedListeners[e]&&this.contentEndedListeners[e]();
vendor: 16,556 bytes, line 45
45this.vjsPlayer.el()&&this.vjsPlayer.one("play",this.setUpPlayerIntervals.bind(this))},ex.prototype.onNoPostroll=function(){this.vjsPlayer.trigger("nopostroll")},ex.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.controller.onPlayerDisposed(),this.contentComplete=!0,this.vjsPlayer.off("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.ads.adTimeoutTimeout&&clearTimeout(this.vjsPlayer.ads.adTimeoutTimeout);var e=[this.updateTimeIntervalHandle,this.seekCheckIntervalHandle,this.resizeCheckIntervalHandle];for(var t in e)e[t]&&clearInterval(e[t])},ex.prototype.onReadyForPreroll=function(){this.controller.onPlayerReadyForPreroll()},ex.prototype.onAdTimeout=function(){this.controller.onAdTimeout()},ex.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName("vjs-tech")[0],this.h5Player.hasAttribute("autoplay")&&this.controller.setSetting("adWillAutoPlay",!0),this.onVolumeChange(),this.vjsPlayer.on("fullscreenchange",this.onFullscreenChange.bind(this)),this.vjsPlayer.on("volumechange",this.onVolumeChange.bind(this)),this.controller.onPlayerReady()},ex.prototype.onFullscreenChange=function(){this.vjsPlayer.isFullscreen()?this.controller.onPlayerEnterFullscreen():this.controller.onPlayerExitFullscreen()},ex.prototype.onVolumeChange=function(){var e=this.vjsPlayer.muted()?0:this.vjsPlayer.volume();this.controller.onPlayerVolumeChanged(e)},ex.prototype.injectAdContainerDiv=function(e){this.vjsControls.el().parentNode.appendChild(e)},ex.prototype.getContentPlayer=function(){return this.h5Player},ex.prototype.getVolume=function(){return this.vjsPlayer.muted()?0:this.vjsPlayer.volume()},ex.prototype.setVolume=function(e){this.vjsPlayer.volume(e),0==e?this.vjsPlayer.muted(!0):this.vjsPlayer.muted(!1)},ex.prototype.unmute=function(){this.vjsPlayer.muted(!1)},ex.prototype.mute=function(){this.vjsPlayer.muted(!0)},ex.prototype.play=function(){this.vjsPlayer.play()},ex.prototype.togglePlayback=function(){this.vjsPlayer.paused()?this.vjsPlayer.play():this.vjsPlayer.pause()},ex.prototype.getPlayerWidth=function(){var e=(getComputedStyle(this.vjsPlayer.el())||{}).width;return e&&0!==parseFloat(e)||(e=(this.vjsPlayer.el().getBoundingClientRect()||{}).width),parseFloat(e)||this.vjsPlayer.width()},ex.prototype.getPlayerHeight=function(){var e=(getComputedStyle(this.vjsPlayer.el())||{}).height;return e&&0!==parseFloat(e)||(e=(this.vjsPlayer.el().getBoundingClientRect()||{}).height),parseFloat(e)||this.vjsPlayer.height()},ex.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_},ex.prototype.getPlayerId=function(){return this.vjsPlayer.id()},ex.prototype.toggleFullscreen=function(){this.vjsPlayer.isFullscreen()?this.vjsPlayer.exitFullscreen():this.vjsPlayer.requestFullscreen()},ex.prototype.getContentPlayheadTracker=function(){return this.contentPlayheadTracker},ex.prototype.onAdError=function(e){this.vjsControls.show();var t=void 0!==e.getError?e.getError():e.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:t,AdErrorEvent:e}})},ex.prototype.onAdLog=function(e){var t=e.getAdData(),i=void 0!==t.adError?t.adError.getMessage():void 0;this.vjsPlayer.trigger({type:"adslog",data:{AdError:i,AdEvent:e}})},ex.prototype.onAdBreakStart=function(){this.contentSource=this.vjsPlayer.currentSrc(),this.contentSourceType=this.vjsPlayer.currentType(),this.vjsPlayer.off("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.ads.startLinearAdMode(),this.vjsControls.hide(),this.vjsPlayer.pause()},ex.prototype.onAdBreakEnd=function(){this.vjsPlayer.on("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.vjsControls.show()},ex.prototype.onAdStart=function(){this.vjsPlayer.trigger("ads-ad-started")},ex.prototype.onAllAdsCompleted=function(){!0==this.contentComplete&&(this.contentSource&&this.vjsPlayer.currentSrc()!=this.contentSource&&this.vjsPlayer.src({src:this.contentSource,type:this.contentSourceType}),this.controller.onContentAndAdsCompleted())},ex.prototype.onAdsReady=function(){this.vjsPlayer.trigger("adsready")},ex.prototype.changeSource=function(e){this.vjsPlayer.currentSrc()&&(this.vjsPlayer.currentTime(0),this.vjsPlayer.pause()),e&&this.vjsPlayer.src(e),this.vjsPlayer.one("loadedmetadata",this.seekContentToZero.bind(this))},ex.prototype.seekContentToZero=function(){this.vjsPlayer.currentTime(0)},ex.prototype.triggerPlayerEvent=function(e,t){this.vjsPlayer.trigger(e,t)},ex.prototype.addContentEndedListener=function(e){this.contentEndedListeners.push(e)},ex.prototype.reset=function(){this.vjsPlayer.off("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.on("readyforpostroll",this.boundContentEndedListener),this.vjsControls.show(),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.contentPlayheadTracker.currentTime=0,this.contentComplete=!1};var eI=function(e){this.controller=e,this.adContainerDiv=document.createElement("div"),this.controlsDiv=document.createElement("div"),this.countdownDiv=document.createElement("div"),this.seekBarDiv=document.createElement("div"),this.progressDiv=document.createElement("div"),this.playPauseDiv=document.createElement("div"),this.muteDiv=document.createElement("div"),this.sliderDiv=document.createElement("div"),this.sliderLevelDiv=document.createElement("div"),this.fullscreenDiv=document.createElement("div"),this.boundOnMouseUp=this.onMouseUp.bind(this),this.boundOnMouseMove=this.onMouseMove.bind(this),this.adPlayheadTracker={currentTime:0,duration:0,isPod:!1,adPosition:0,totalAds:0},this.controlPrefix=this.controller.getPlayerId()+"_",this.showCountdown=!0,!1===this.controller.getSettings().showCountdown&&(this.showCountdown=!1),this.isAdNonlinear=!1,this.createAdContainer()};eI.prototype.createAdContainer=function(){this.assignControlAttributes(this.adContainerDiv,"ima-ad-container"),this.adContainerDiv.classList.add("hide-ad-container"),this.adContainerDiv.addEventListener("mouseenter",this.showAdControls.bind(this),!1),this.adContainerDiv.addEventListener("mouseleave",this.hideAdControls.bind(this),!1),this.adContainerDiv.addEventListener("click",this.onAdContainerClick.bind(this),!1),this.createControls(),this.controller.injectAdContainerDiv(this.adContainerDiv)},eI.prototype.createControls=function(){this.assignControlAttributes(this.controlsDiv,"ima-controls-div"),this.controlsDiv.style.width="100%",this.controller.getIsMobile()?this.countdownDiv.style.display="none":(this.assignControlAttributes(this.countdownDiv,"ima-countdown-div"),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel,this.countdownDiv.style.display=this.showCountdown?"block":"none"),this.assignControlAttributes(this.seekBarDiv,"ima-seek-bar-div"),this.seekBarDiv.style.width="100%",this.assignControlAttributes(this.progressDiv,"ima-progress-div"),this.assignControlAttributes(this.playPauseDiv,"ima-play-pause-div"),this.addClass(this.playPauseDiv,"ima-playing"),this.playPauseDiv.addEventListener("click",this.onAdPlayPauseClick.bind(this),!1),this.assignControlAttributes(this.muteDiv,"ima-mute-div"),this.addClass(this.muteDiv,"ima-non-muted"),this.muteDiv.addEventListener("click",this.onAdMuteClick.bind(this),!1),this.assignControlAttributes(this.sliderDiv,"ima-slider-div"),this.sliderDiv.addEventListener("mousedown",this.onAdVolumeSliderMouseDown.bind(this),!1),this.controller.getIsIos()&&(this.sliderDiv.style.display="none"),this.assignControlAttributes(this.sliderLevelDiv,"ima-slider-level-div"),this.assignControlAttributes(this.fullscreenDiv,"ima-fullscreen-div"),this.addClass(this.fullscreenDiv,"ima-non-fullscreen"),this.fullscreenDiv.addEventListener("click",this.onAdFullscreenClick.bind(this),!1),this.adContainerDiv.appendChild(this.controlsDiv),this.controlsDiv.appendChild(this.countdownDiv),this.controlsDiv.appendChild(this.seekBarDiv),this.controlsDiv.appendChild(this.playPauseDiv),this.controlsDiv.appendChild(this.muteDiv),this.controlsDiv.appendChild(this.sliderDiv),this.controlsDiv.appendChild(this.fullscreenDiv),this.seekBarDiv.appendChild(this.progressDiv),this.sliderDiv.appendChild(this.sliderLevelDiv)},eI.prototype.onAdPlayPauseClick=function(){this.controller.onAdPlayPauseClick()},eI.prototype.onAdMuteClick=function(){this.controller.onAdMuteClick()},eI.prototype.onAdFullscreenClick=function(){this.controller.toggleFullscreen()},eI.prototype.onAdsPaused=function(){this.controller.sdkImpl.adPlaying=!1,this.addClass(this.playPauseDiv,"ima-paused"),this.removeClass(this.playPauseDiv,"ima-playing"),this.showAdControls()},eI.prototype.onAdsResumed=function(){this.onAdsPlaying(),this.showAdControls()},eI.prototype.onAdsPlaying=function(){this.controller.sdkImpl.adPlaying=!0,this.addClass(this.playPauseDiv,"ima-playing"),this.removeClass(this.playPauseDiv,"ima-paused")},eI.prototype.updateAdUi=function(e,t,i,r,s){var n=Math.floor(t/60),a=Math.floor(t%60);a.toString().length<2&&(a="0"+a);var o=": ";s>1&&(o=" ("+r+" "+this.controller.getSettings().adLabelNofN+" "+s+"): "),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel+o+n+":"+a,this.progressDiv.style.width=e/i*100+"%"},eI.prototype.unmute=function(){this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted"),this.sliderLevelDiv.style.width=100*this.controller.getPlayerVolume()+"%"},eI.prototype.mute=function(){this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted"),this.sliderLevelDiv.style.width="0%"},eI.prototype.onAdVolumeSliderMouseDown=function(){document.addEventListener("mouseup",this.boundOnMouseUp,!1),document.addEventListener("mousemove",this.boundOnMouseMove,!1)},eI.prototype.onMouseMove=function(e){this.changeVolume(e)},eI.prototype.onMouseUp=function(e){this.changeVolume(e),document.removeEventListener("mouseup",this.boundOnMouseUp),document.removeEventListener("mousemove",this.boundOnMouseMove)},eI.prototype.changeVolume=function(e){var t=(e.clientX-this.sliderDiv.getBoundingClientRect().left)/this.sliderDiv.offsetWidth;t*=100,t=Math.min(Math.max(t,0),100),this.sliderLevelDiv.style.width=t+"%",0==this.percent?(this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted")):(this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted")),this.controller.setVolume(t/100)},eI.prototype.showAdContainer=function(){this.adContainerDiv.classList.remove("hide-ad-container")},eI.prototype.hideAdContainer=function(){this.adContainerDiv.classList.add("hide-ad-container")},eI.prototype.onAdContainerClick=function(){this.isAdNonlinear&&this.controller.togglePlayback()},eI.prototype.reset=function(){this.hideAdContainer()},eI.prototype.onAdError=function(){this.hideAdContainer()},eI.prototype.onAdBreakStart=function(e){this.showAdContainer(),"application/javascript"!==e.getAd().getContentType()||this.controller.getSettings().showControlsForJSAds?this.controlsDiv.style.display="block":this.controlsDiv.style.display="none",this.onAdsPlaying(),this.hideAdControls()},eI.prototype.onAdBreakEnd=function(){var e=this.controller.getCurrentAd();(null==e||e.isLinear())&&this.hideAdContainer(),this.controlsDiv.style.display="none",this.countdownDiv.innerHTML=""},eI.prototype.onAllAdsCompleted=function(){this.hideAdContainer()},eI.prototype.onLinearAdStart=function(){this.removeClass(this.adContainerDiv,"bumpable-ima-ad-container"),this.isAdNonlinear=!1},eI.prototype.onNonLinearAdLoad=function(){this.addClass(this.adContainerDiv,"bumpable-ima-ad-container"),this.isAdNonlinear=!0},eI.prototype.onPlayerEnterFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-non-fullscreen")},eI.prototype.onPlayerExitFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-non-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-fullscreen")},eI.prototype.onPlayerVolumeChanged=function(e){0==e?(this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted"),this.sliderLevelDiv.style.width="0%"):(this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted"),this.sliderLevelDiv.style.width=100*e+"%")},eI.prototype.showAdControls=function(){this.controller.getSettings().disableAdControls||this.addClass(this.controlsDiv,"ima-controls-div-showing")},eI.prototype.hideAdControls=function(){this.removeClass(this.controlsDiv,"ima-controls-div-showing")},eI.prototype.assignControlAttributes=function(e,t){e.id=this.controlPrefix+t,e.className=this.controlPrefix+t+" "+t},eI.prototype.getClassRegexp=function(e){return RegExp("(^|[^A-Za-z-])"+e+"((?![A-Za-z-])|$)","gi")},eI.prototype.elementHasClass=function(e,t){return this.getClassRegexp(t).test(e.className)},eI.prototype.addClass=function(e,t){e.className=e.className.trim()+" "+t},eI.prototype.removeClass=function(e,t){var i=this.getClassRegexp(t);e.className=e.className.trim().replace(i,"")},eI.prototype.getAdContainerDiv=function(){return this.adContainerDiv},eI.prototype.setShowCountdown=function(e){this.showCountdown=e,this.countdownDiv.style.display=this.showCountdown?"block":"none"};var eD={version:"2.5.0"},eP=function(e){this.controller=e,this.adDisplayContainer=null,this.adDisplayContainerInitialized=!1,this.adsLoader=null,this.adsManager=null,this.adsRenderingSettings=null,this.adsResponse=null,this.currentAd=null,this.adTrackingTimer=null,this.allAdsCompleted=!1,this.adsActive=!1,this.adPlaying=!1,this.adMuted=!1,this.adBreakReadyListener=void 0,this.contentCompleteCalled=!1,this.isAdTimedOut=!1,this.adsManagerDimensions={width:0,height:0},this.autoPlayAdBreaks=!0,!1===this.controller.getSettings().autoPlayAdBreaks&&(this.autoPlayAdBreaks=!1),this.controller.getSettings().locale&&google.ima.settings.setLocale(this.controller.getSettings().locale),this.controller.getSettings().disableFlashAds&&google.ima.settings.setDisableFlashAds(this.controller.getSettings().disableFlashAds),this.controller.getSettings().disableCustomPlaybackForIOS10Plus&&google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.controller.getSettings().disableCustomPlaybackForIOS10Plus),this.controller.getSettings().ppid&&google.ima.settings.setPpid(this.controller.getSettings().ppid),this.controller.getSettings().featureFlags&&google.ima.settings.setFeatureFlags(this.controller.getSettings().featureFlags)};eP.prototype.initAdObjects=function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.controller.getAdContainerDiv(),this.controller.getContentPlayer()),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),!1==this.controller.getSettings().vpaidAllowed&&this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.DISABLED),void 0!==this.controller.getSettings().vpaidMode&&this.adsLoader.getSettings().setVpaidMode(this.controller.getSettings().vpaidMode),this.controller.getSettings().locale&&this.adsLoader.getSettings().setLocale(this.controller.getSettings().locale),this.controller.getSettings().numRedirects&&this.adsLoader.getSettings().setNumRedirects(this.controller.getSettings().numRedirects),this.controller.getSettings().sessionId&&this.adsLoader.getSettings().setSessionId(this.controller.getSettings().sessionId),this.adsLoader.getSettings().setPlayerType("videojs-ima"),this.adsLoader.getSettings().setPlayerVersion(eD.version),this.adsLoader.getSettings().setAutoPlayAdBreaks(this.autoPlayAdBreaks),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoaded.bind(this),!1),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdsLoaderError.bind(this),!1),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-loader",adsLoader:this.adsLoader})},eP.prototype.requestAds=function(){var e=new google.ima.AdsRequest;if(this.controller.getSettings().adTagUrl?e.adTagUrl=this.controller.getSettings().adTagUrl:e.adsResponse=this.controller.getSettings().adsResponse,this.controller.getSettings().forceNonLinearFullSlot&&(e.forceNonLinearFullSlot=!0),this.controller.getSettings().vastLoadTimeout&&(e.vastLoadTimeout=this.controller.getSettings().vastLoadTimeout),this.controller.getSettings().omidMode&&window.console.warn("The additional setting `omidMode` has been removed. Use `omidVendorAccess` instead."),this.controller.getSettings().omidVendorAccess){e.omidAccessModeRules={};var t=this.controller.getSettings().omidVendorAccess;
vendor: 16,384 bytes, line 45
45Object.keys(t).forEach(function(i){e.omidAccessModeRules[i]=t[i]})}e.linearAdSlotWidth=this.controller.getPlayerWidth(),e.linearAdSlotHeight=this.controller.getPlayerHeight(),e.nonLinearAdSlotWidth=this.controller.getSettings().nonLinearWidth||this.controller.getPlayerWidth(),e.nonLinearAdSlotHeight=this.controller.getSettings().nonLinearHeight||this.controller.getPlayerHeight(),e.setAdWillAutoPlay(this.controller.adsWillAutoplay()),e.setAdWillPlayMuted(this.controller.adsWillPlayMuted());var i=this.controller.getSettings().adsRequest;i&&"object"===ek(i)&&Object.keys(i).forEach(function(t){e[t]=i[t]}),this.adsLoader.requestAds(e),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-request",AdsRequest:e})},eP.prototype.onAdsManagerLoaded=function(e){this.createAdsRenderingSettings(),this.adsManager=e.getAdsManager(this.controller.getContentPlayheadTracker(),this.adsRenderingSettings),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdError.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this.onAdBreakReady.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this.onContentPauseRequested.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this.onContentResumeRequested.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this.onAllAdsCompleted.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this.onAdLoaded.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this.onAdStarted.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this.onAdComplete.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this.onAdComplete.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this.onAdLog.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this.onAdPaused.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this.onAdResumed.bind(this)),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-manager",adsManager:this.adsManager}),this.autoPlayAdBreaks||this.initAdsManager();var t=this.controller.getSettings().preventLateAdStart;t?t&&!this.isAdTimedOut&&this.controller.onAdsReady():this.controller.onAdsReady(),this.controller.getSettings().adsManagerLoadedCallback&&this.controller.getSettings().adsManagerLoadedCallback()},eP.prototype.onAdsLoaderError=function(e){window.console.warn("AdsLoader error: "+e.getError()),this.controller.onErrorLoadingAds(e),this.adsManager&&this.adsManager.destroy()},eP.prototype.initAdsManager=function(){try{var e=this.controller.getPlayerWidth(),t=this.controller.getPlayerHeight();this.adsManagerDimensions.width=e,this.adsManagerDimensions.height=t,this.adsManager.init(e,t),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.initializeAdDisplayContainer()}catch(e){this.onAdError(e)}},eP.prototype.createAdsRenderingSettings=function(){if(this.adsRenderingSettings=new google.ima.AdsRenderingSettings,this.adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete=!0,this.controller.getSettings().adsRenderingSettings)for(var e in this.controller.getSettings().adsRenderingSettings)""!==e&&(this.adsRenderingSettings[e]=this.controller.getSettings().adsRenderingSettings[e])},eP.prototype.onAdError=function(e){var t=void 0!==e.getError?e.getError():e.stack;window.console.warn("Ad error: "+t),this.adsManager.destroy(),this.controller.onAdError(e),this.adsActive=!1,this.adPlaying=!1},eP.prototype.onAdBreakReady=function(e){this.adBreakReadyListener(e)},eP.prototype.onContentPauseRequested=function(e){this.adsActive=!0,this.adPlaying=!0,this.controller.onAdBreakStart(e)},eP.prototype.onContentResumeRequested=function(e){this.adsActive=!1,this.adPlaying=!1,this.controller.onAdBreakEnd()},eP.prototype.onAllAdsCompleted=function(e){this.allAdsCompleted=!0,this.controller.onAllAdsCompleted()},eP.prototype.onAdLoaded=function(e){e.getAd().isLinear()||(this.controller.onNonLinearAdLoad(),this.controller.playContent())},eP.prototype.onAdStarted=function(e){this.currentAd=e.getAd(),this.currentAd.isLinear()?(this.adTrackingTimer=setInterval(this.onAdPlayheadTrackerInterval.bind(this),250),this.controller.onLinearAdStart()):this.controller.onNonLinearAdStart()},eP.prototype.onAdPaused=function(){this.controller.onAdsPaused()},eP.prototype.onAdResumed=function(e){this.controller.onAdsResumed()},eP.prototype.onAdComplete=function(){this.currentAd.isLinear()&&clearInterval(this.adTrackingTimer)},eP.prototype.onAdLog=function(e){this.controller.onAdLog(e)},eP.prototype.onAdPlayheadTrackerInterval=function(){if(null!==this.adsManager){var e,t=this.adsManager.getRemainingTime(),i=this.currentAd.getDuration(),r=i-t;r=r>0?r:0;var s=0;this.currentAd.getAdPodInfo()&&(e=this.currentAd.getAdPodInfo().getAdPosition(),s=this.currentAd.getAdPodInfo().getTotalAds()),this.controller.onAdPlayheadUpdated(r,t,i,e,s)}},eP.prototype.onContentComplete=function(){this.adsLoader&&(this.adsLoader.contentComplete(),this.contentCompleteCalled=!0),(this.adsManager&&this.adsManager.getCuePoints()&&!this.adsManager.getCuePoints().includes(-1)||!this.adsManager)&&this.controller.onNoPostroll(),this.allAdsCompleted&&this.controller.onContentAndAdsCompleted()},eP.prototype.onPlayerDisposed=function(){this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null)},eP.prototype.onPlayerReadyForPreroll=function(){if(this.autoPlayAdBreaks){this.initAdsManager();try{this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start()}catch(e){this.onAdError(e)}}},eP.prototype.onAdTimeout=function(){this.isAdTimedOut=!0},eP.prototype.onPlayerReady=function(){this.initAdObjects(),(this.controller.getSettings().adTagUrl||this.controller.getSettings().adsResponse)&&"onLoad"===this.controller.getSettings().requestMode&&this.requestAds()},eP.prototype.onPlayerEnterFullscreen=function(){this.adsManager&&this.adsManager.resize(window.screen.width,window.screen.height)},eP.prototype.onPlayerExitFullscreen=function(){this.adsManager&&this.adsManager.resize(this.controller.getPlayerWidth(),this.controller.getPlayerHeight())},eP.prototype.onPlayerVolumeChanged=function(e){this.adsManager&&this.adsManager.setVolume(e),0==e?this.adMuted=!0:this.adMuted=!1},eP.prototype.onPlayerResize=function(e,t){this.adsManager&&(this.adsManagerDimensions.width=e,this.adsManagerDimensions.height=t,this.adsManager.resize(e,t))},eP.prototype.getCurrentAd=function(){return this.currentAd},eP.prototype.setAdBreakReadyListener=function(e){this.adBreakReadyListener=e},eP.prototype.isAdPlaying=function(){return this.adPlaying},eP.prototype.isAdMuted=function(){return this.adMuted},eP.prototype.pauseAds=function(){this.adsManager.pause(),this.adPlaying=!1},eP.prototype.resumeAds=function(){this.adsManager.resume(),this.adPlaying=!0},eP.prototype.unmute=function(){this.adsManager.setVolume(1),this.adMuted=!1},eP.prototype.mute=function(){this.adsManager.setVolume(0),this.adMuted=!0},eP.prototype.setVolume=function(e){this.adsManager.setVolume(e),0==e?this.adMuted=!0:this.adMuted=!1},eP.prototype.initializeAdDisplayContainer=function(){this.adDisplayContainer&&!this.adDisplayContainerInitialized&&(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0)},eP.prototype.playAdBreak=function(){this.autoPlayAdBreaks||(this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start())},eP.prototype.addEventListener=function(e,t){this.adsManager&&this.adsManager.addEventListener(e,t)},eP.prototype.getAdsManager=function(){return this.adsManager},eP.prototype.reset=function(){this.adsActive=!1,this.adPlaying=!1,this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null),this.adsLoader&&!this.contentCompleteCalled&&this.adsLoader.contentComplete(),this.contentCompleteCalled=!1,this.allAdsCompleted=!1};var eL=function(e,t){this.settings={},this.contentAndAdsEndedListeners=[],this.isMobile=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i),this.isIos=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i),this.initWithSettings(t);var i=Object.assign({},{debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},t.contribAdsSettings||{});this.playerWrapper=new ex(e,i,this),this.adUi=new eI(this),this.sdkImpl=new eP(this)};eL.IMA_DEFAULTS={adLabel:"Advertisement",adLabelNofN:"of",debug:!1,disableAdControls:!1,prerollTimeout:1e3,preventLateAdStart:!1,requestMode:"onLoad",showControlsForJSAds:!0,timeout:5e3},eL.prototype.initWithSettings=function(e){this.settings=Object.assign({},eL.IMA_DEFAULTS,e||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,!1===this.settings.showCountdown&&(this.showCountdown=!1)},eL.prototype.warnAboutDeprecatedSettings=function(){var e=this;["adWillAutoplay","adsWillAutoplay","adWillPlayMuted","adsWillPlayMuted"].forEach(function(t){void 0!==e.settings[t]&&console.warn("WARNING: videojs.ima setting "+t+" is deprecated")})},eL.prototype.getSettings=function(){return this.settings},eL.prototype.getIsMobile=function(){return this.isMobile},eL.prototype.getIsIos=function(){return this.isIos},eL.prototype.injectAdContainerDiv=function(e){this.playerWrapper.injectAdContainerDiv(e)},eL.prototype.getAdContainerDiv=function(){return this.adUi.getAdContainerDiv()},eL.prototype.getContentPlayer=function(){return this.playerWrapper.getContentPlayer()},eL.prototype.getContentPlayheadTracker=function(){return this.playerWrapper.getContentPlayheadTracker()},eL.prototype.requestAds=function(){this.sdkImpl.requestAds()},eL.prototype.setSetting=function(e,t){this.settings[e]=t},eL.prototype.onErrorLoadingAds=function(e){this.adUi.onAdError(),this.playerWrapper.onAdError(e)},eL.prototype.onAdPlayPauseClick=function(){this.sdkImpl.isAdPlaying()?(this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()):(this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds())},eL.prototype.onAdMuteClick=function(){this.sdkImpl.isAdMuted()?(this.playerWrapper.unmute(),this.adUi.unmute(),this.sdkImpl.unmute()):(this.playerWrapper.mute(),this.adUi.mute(),this.sdkImpl.mute())},eL.prototype.setVolume=function(e){this.playerWrapper.setVolume(e),this.sdkImpl.setVolume(e)},eL.prototype.getPlayerVolume=function(){return this.playerWrapper.getVolume()},eL.prototype.toggleFullscreen=function(){this.playerWrapper.toggleFullscreen()},eL.prototype.onAdError=function(e){this.adUi.onAdError(),this.playerWrapper.onAdError(e)},eL.prototype.onAdBreakStart=function(e){this.playerWrapper.onAdBreakStart(),this.adUi.onAdBreakStart(e)},eL.prototype.showAdContainer=function(){this.adUi.showAdContainer()},eL.prototype.onAdBreakEnd=function(){this.playerWrapper.onAdBreakEnd(),this.adUi.onAdBreakEnd()},eL.prototype.onAllAdsCompleted=function(){this.adUi.onAllAdsCompleted(),this.playerWrapper.onAllAdsCompleted()},eL.prototype.onAdsPaused=function(){this.adUi.onAdsPaused()},eL.prototype.onAdsResumed=function(){this.adUi.onAdsResumed()},eL.prototype.onAdPlayheadUpdated=function(e,t,i,r,s){this.adUi.updateAdUi(e,t,i,r,s)},eL.prototype.onAdLog=function(e){this.playerWrapper.onAdLog(e)},eL.prototype.getCurrentAd=function(){return this.sdkImpl.getCurrentAd()},eL.prototype.playContent=function(){this.playerWrapper.play()},eL.prototype.onLinearAdStart=function(){this.adUi.onLinearAdStart(),this.playerWrapper.onAdStart()},eL.prototype.onNonLinearAdLoad=function(){this.adUi.onNonLinearAdLoad()},eL.prototype.onNonLinearAdStart=function(){this.adUi.onNonLinearAdLoad(),this.playerWrapper.onAdStart()},eL.prototype.getPlayerWidth=function(){return this.playerWrapper.getPlayerWidth()},eL.prototype.getPlayerHeight=function(){return this.playerWrapper.getPlayerHeight()},eL.prototype.onAdsReady=function(){this.playerWrapper.onAdsReady()},eL.prototype.onPlayerResize=function(e,t){this.sdkImpl.onPlayerResize(e,t)},eL.prototype.onContentComplete=function(){this.sdkImpl.onContentComplete()},eL.prototype.onNoPostroll=function(){this.playerWrapper.onNoPostroll()},eL.prototype.onContentAndAdsCompleted=function(){for(var e in this.contentAndAdsEndedListeners)"function"==typeof this.contentAndAdsEndedListeners[e]&&this.contentAndAdsEndedListeners[e]()},eL.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()},eL.prototype.onPlayerReadyForPreroll=function(){this.sdkImpl.onPlayerReadyForPreroll()},eL.prototype.onAdTimeout=function(){this.sdkImpl.onAdTimeout()},eL.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()},eL.prototype.onPlayerEnterFullscreen=function(){this.adUi.onPlayerEnterFullscreen(),this.sdkImpl.onPlayerEnterFullscreen()},eL.prototype.onPlayerExitFullscreen=function(){this.adUi.onPlayerExitFullscreen(),this.sdkImpl.onPlayerExitFullscreen()},eL.prototype.onPlayerVolumeChanged=function(e){this.adUi.onPlayerVolumeChanged(e),this.sdkImpl.onPlayerVolumeChanged(e)},eL.prototype.setContentWithAdTag=function(e,t){this.reset(),this.settings.adTagUrl=t||this.settings.adTagUrl,this.playerWrapper.changeSource(e)},eL.prototype.setContentWithAdsResponse=function(e,t){this.reset(),this.settings.adsResponse=t||this.settings.adsResponse,this.playerWrapper.changeSource(e)},eL.prototype.setContentWithAdsRequest=function(e,t){this.reset(),this.settings.adsRequest=t||this.settings.adsRequest,this.playerWrapper.changeSource(e)},eL.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset(),this.adUi.reset()},eL.prototype.addContentEndedListener=function(e){this.playerWrapper.addContentEndedListener(e)},eL.prototype.addContentAndAdsEndedListener=function(e){this.contentAndAdsEndedListeners.push(e)},eL.prototype.setAdBreakReadyListener=function(e){this.sdkImpl.setAdBreakReadyListener(e)},eL.prototype.setShowCountdown=function(e){this.adUi.setShowCountdown(e),this.showCountdown=e,this.adUi.countdownDiv.style.display=this.showCountdown?"block":"none"},eL.prototype.initializeAdDisplayContainer=function(){this.sdkImpl.initializeAdDisplayContainer()},eL.prototype.playAdBreak=function(){this.sdkImpl.playAdBreak()},eL.prototype.addEventListener=function(e,t){this.sdkImpl.addEventListener(e,t)},eL.prototype.getAdsManager=function(){return this.sdkImpl.getAdsManager()},eL.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()},eL.prototype.changeAdTag=function(e){this.reset(),this.settings.adTagUrl=e},eL.prototype.pauseAd=function(){this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()},eL.prototype.resumeAd=function(){this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds()},eL.prototype.togglePlayback=function(){this.playerWrapper.togglePlayback()},eL.prototype.adsWillAutoplay=function(){return void 0!==this.settings.adsWillAutoplay?this.settings.adsWillAutoplay:void 0!==this.settings.adWillAutoplay?this.settings.adWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay},eL.prototype.adsWillPlayMuted=function(){return void 0!==this.settings.adsWillPlayMuted?this.settings.adsWillPlayMuted:void 0!==this.settings.adWillPlayMuted?this.settings.adWillPlayMuted:void 0!==this.playerWrapper.getPlayerOptions().muted?this.playerWrapper.getPlayerOptions().muted:0==this.playerWrapper.getVolume()},eL.prototype.triggerPlayerEvent=function(e,t){this.playerWrapper.triggerPlayerEvent(e,t)};var eR=function(e,t,i){this.vjsPlayer=e,this.daiController=i,this.vjsControls=this.vjsPlayer.getChild("controlBar"),this.h5Player=null,this.vjsPlayer.on("dispose",this.playerDisposedListener.bind(this)),this.vjsPlayer.on("pause",this.onPause.bind(this)),this.vjsPlayer.on("play",this.onPlay.bind(this)),this.vjsPlayer.on("seeked",this.onSeekEnd.bind(this)),this.vjsPlayer.ready(this.onPlayerReady.bind(this)),this.vjsPlayer.ads||window.console.warn("You may be using a version of videojs-contrib-ads that is not compatible with your version of video.js."),this.vjsPlayer.ads(t)};eR.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.daiController.onPlayerDisposed()},eR.prototype.onPause=function(){this.daiController.isInAdBreak()&&this.vjsCon
vendor: 11,404 bytes, line 45
45trols.show()},eR.prototype.onPlay=function(){this.daiController.isInAdBreak()&&this.vjsControls.hide()},eR.prototype.onSeekEnd=function(){this.daiController.onSeekEnd(this.vjsPlayer.currentTime())},eR.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName("vjs-tech")[0],this.daiController.onPlayerReady()},eR.prototype.getStreamPlayer=function(){return this.h5Player},eR.prototype.getVjsPlayer=function(){return this.vjsPlayer},eR.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_},eR.prototype.getPlayerId=function(){return this.vjsPlayer.id()},eR.prototype.onAdError=function(e){this.vjsControls.show();var t=void 0!==e.getError?e.getError():e.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:t,AdErrorEvent:e}})},eR.prototype.onAdBreakStart=function(){this.vjsControls.hide()},eR.prototype.onAdBreakEnd=function(){this.vjsControls.show()},eR.prototype.reset=function(){this.vjsControls.show()};var eM=function(e){this.daiController=e,this.streamPlayer=null,this.vjsPlayer=null,this.streamManager=null,this.uiSettings=new google.ima.dai.api.UiSettings,this.isAdBreak=!1,this.isSnapback=!1,this.snapForwardTime=0,this.timedMetadata,this.metadataLoaded={},this.SOURCE_TYPES={hls:"application/x-mpegURL",dash:"application/dash+xml"}};eM.prototype.initImaDai=function(){var e=this;this.streamPlayer=this.daiController.getStreamPlayer(),this.vjsPlayer=this.daiController.getVjsPlayer(),this.createAdUiDiv(),this.daiController.getSettings().locale&&this.uiSettings.setLocale(this.daiController.getSettings().locale),this.streamManager=new google.ima.dai.api.StreamManager(this.streamPlayer,this.adUiDiv,this.uiSettings),this.streamPlayer.addEventListener("pause",this.onStreamPause),this.streamPlayer.addEventListener("play",this.onStreamPlay),[google.ima.dai.api.StreamEvent.Type.LOADED,google.ima.dai.api.StreamEvent.Type.ERROR,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED].forEach(function(t){e.streamManager.addEventListener(t,e.onStreamEvent.bind(e))}),this.vjsPlayer.textTracks().onaddtrack=this.onAddTrack.bind(this),this.vjsPlayer.trigger({type:"stream-manager",StreamManager:this.streamManager}),this.requestStream()},eM.prototype.onAddTrack=function(e){var t=this,i=e.track;"metadata"===i.kind&&(i.mode="hidden",i.addEventListener("cuechange",function(e){var r,s=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return eE(e,void 0);var i=({}).toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?eE(e,t):void 0}}(e))){i&&(e=i);var r=0,s=function(){};return{s:s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a=!0,o=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,n=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw n}}}}(i.activeCues);try{for(s.s();!(r=s.n()).done;){var n=r.value,a={};a[n.value.key]=n.value.data,t.streamManager.onTimedMetadata(a)}}catch(e){s.e(e)}finally{s.f()}}))},eM.prototype.createAdUiDiv=function(){var e=document.createElement("div");e.id="ad-ui",e.style.height="calc(100% - 3em)",this.streamPlayer.parentNode.appendChild(e),this.adUiDiv=e},eM.prototype.onStreamPause=function(){this.isAdBreak&&(this.adUiDiv.style.display="none")},eM.prototype.onStreamPlay=function(){this.isAdBreak&&(this.adUiDiv.style.display="block")},eM.prototype.onSeekEnd=function(e){if("live"!==this.daiController.getSettings().streamType){if(this.isSnapback){this.isSnapback=!1;return}var t=this.streamManager.previousCuePointForStreamTime(e);t&&!t.played&&(this.isSnapback=!0,this.snapForwardTime=e,this.vjsPlayer.currentTime(t.start))}},eM.prototype.onStreamEvent=function(e){switch(e.type){case google.ima.dai.api.StreamEvent.Type.LOADED:this.loadUrl(e.getStreamData().url);break;case google.ima.dai.api.StreamEvent.Type.ERROR:window.console.warn("Error loading stream, attempting to play backup stream. "+e.getStreamData().errorMessage),this.daiController.onErrorLoadingAds(e),this.daiController.getSettings().fallbackStreamUrl&&this.loadUrl(this.daiController.getSettings().fallbackStreamUrl);break;case google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED:this.isAdBreak=!0,this.adUiDiv.style.display="block",this.daiController.onAdBreakStart();break;case google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED:this.isAdBreak=!1,this.adUiDiv.style.display="none",this.daiController.onAdBreakEnd(),this.snapForwardTime&&this.snapForwardTime>this.vjsPlayer.currentTime()&&(this.vjsPlayer.currentTime(this.snapForwardTime),this.snapForwardTime=0)}},eM.prototype.loadUrl=function(e){this.vjsPlayer.ready((function(){var t=this.daiController.getSettings().streamFormat;this.vjsPlayer.src({src:e,type:this.SOURCE_TYPES[t]});var i=this.daiController.getSettings().bookmarkTime;if(i){var r=this.streamManager.streamTimeForContentTime(i);this.isSnapback=!0,this.vjsPlayer.currentTime(r)}}).bind(this))},eM.prototype.requestStream=function(){var e,t=this.daiController.getSettings().streamType;if("vod"===t?((e=new google.ima.dai.api.VODStreamRequest).contentSourceId=this.daiController.getSettings().cmsId,e.videoId=this.daiController.getSettings().videoId):"live"===t?(e=new google.ima.dai.api.LiveStreamRequest).assetKey=this.daiController.getSettings().assetKey:window.console.warn("No valid stream type selected"),e.format=this.daiController.getSettings().streamFormat,this.daiController.getSettings().apiKey&&(e.apiKey=this.daiController.getSettings().apiKey),this.daiController.getSettings().authToken&&(e.authToken=this.daiController.getSettings().authToken),this.daiController.getSettings().adTagParameters&&(e.adTagParameters=this.daiController.getSettings().adTagParameters),this.daiController.getSettings().streamActivityMonitorId&&(e.streamActivityMonitorId=this.daiController.getSettings().streamActivityMonitorId),this.daiController.getSettings().omidMode){e.omidAccessModeRules={};var i=this.daiController.getSettings().omidMode;i.FULL&&(e.omidAccessModeRules[google.ima.OmidAccessMode.FULL]=i.FULL),i.DOMAIN&&(e.omidAccessModeRules[google.ima.OmidAccessMode.DOMAIN]=i.DOMAIN),i.LIMITED&&(e.omidAccessModeRules[google.ima.OmidAccessMode.LIMITED]=i.LIMITED)}this.streamManager.requestStream(e),this.vjsPlayer.trigger({type:"stream-request",StreamRequest:e})},eM.prototype.onPlayerReady=function(){this.initImaDai()},eM.prototype.onPlayerDisposed=function(){this.streamManager&&this.streamManager.reset()},eM.prototype.addEventListener=function(e,t){this.streamManager&&this.streamManager.addEventListener(e,t)},eM.prototype.getStreamManager=function(){return this.streamManager},eM.prototype.reset=function(){this.streamManager&&this.streamManager.reset()};var eO=function(e,t){this.inAdBreak=!1,this.settings={},this.isMobile=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i),this.isIos=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i),this.initWithSettings(t);var i=Object.assign({},{debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},t.contribAdsSettings||{});this.playerWrapper=new eR(e,i,this),this.sdkImpl=new eM(this)};eO.IMA_DEFAULTS={adLabel:"Advertisement",adLabelNofN:"of",debug:!1,disableAdControls:!1,showControlsForJSAds:!0},eO.prototype.initWithSettings=function(e){this.settings=Object.assign({},eO.IMA_DEFAULTS,e||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,!1===this.settings.showCountdown&&(this.showCountdown=!1)},eO.prototype.warnAboutDeprecatedSettings=function(){var e=this;[].forEach(function(t){void 0!==e.settings[t]&&console.warn("WARNING: videojs.imaDai setting "+t+" is deprecated")})},eO.prototype.getSettings=function(){return this.settings},eO.prototype.getIsMobile=function(){return this.isMobile},eO.prototype.getIsIos=function(){return this.isIos},eO.prototype.getStreamPlayer=function(){return this.playerWrapper.getStreamPlayer()},eO.prototype.getVjsPlayer=function(){return this.playerWrapper.getVjsPlayer()},eO.prototype.requestStream=function(){this.sdkImpl.requestStream()},eO.prototype.setSetting=function(e,t){this.settings[e]=t},eO.prototype.onErrorLoadingAds=function(e){this.playerWrapper.onAdError(e)},eO.prototype.onAdError=function(e){this.playerWrapper.onAdError(e)},eO.prototype.onAdBreakStart=function(){this.inAdBreak=!0,this.playerWrapper.onAdBreakStart()},eO.prototype.onAdBreakEnd=function(){this.inAdBreak=!1,this.playerWrapper.onAdBreakEnd()},eO.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()},eO.prototype.isInAdBreak=function(){return this.inAdBreak},eO.prototype.onSeekEnd=function(e){this.sdkImpl.onSeekEnd(e)},eO.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()},eO.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset()},eO.prototype.addEventListener=function(e,t){this.sdkImpl.addEventListener(e,t)},eO.prototype.getStreamManager=function(){return this.sdkImpl.getStreamManager()},eO.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()},eO.prototype.streamWillAutoplay=function(){return void 0!==this.settings.streamWillAutoplay?this.settings.streamWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay},eO.prototype.triggerPlayerEvent=function(e,t){this.playerWrapper.triggerPlayerEvent(e,t)};var eN=function(e,t){this.controller=new eL(e,t),this.addContentAndAdsEndedListener=(function(e){this.controller.addContentAndAdsEndedListener(e)}).bind(this),this.addContentEndedListener=(function(e){this.controller.addContentEndedListener(e)}).bind(this),this.addEventListener=(function(e,t){this.controller.addEventListener(e,t)}).bind(this),this.changeAdTag=(function(e){this.controller.changeAdTag(e)}).bind(this),this.getAdsManager=(function(){return this.controller.getAdsManager()}).bind(this),this.initializeAdDisplayContainer=(function(){this.controller.initializeAdDisplayContainer()}).bind(this),this.pauseAd=(function(){this.controller.pauseAd()}).bind(this),this.playAdBreak=(function(){this.controller.playAdBreak()}).bind(this),this.requestAds=(function(){this.controller.requestAds()}).bind(this),this.resumeAd=(function(){this.controller.resumeAd()}).bind(this),this.setAdBreakReadyListener=(function(e){this.controller.setAdBreakReadyListener(e)}).bind(this),this.setContentWithAdTag=(function(e,t){this.controller.setContentWithAdTag(e,t)}).bind(this),this.setContentWithAdsResponse=(function(e,t){this.controller.setContentWithAdsResponse(e,t)}).bind(this),this.setContentWithAdsRequest=(function(e,t){this.controller.setContentWithAdsRequest(e,t)}).bind(this),this.setShowCountdown=(function(e){this.controller.setShowCountdown(e)}).bind(this)},ej=function(e,t){this.controller=new eO(e,t),this.streamEndedListener=(function(e){this.controller.addStreamEndedListener(e)}).bind(this),this.addEventListener=(function(e,t){this.controller.addEventListener(e,t)}
45).bind(this),this.getStreamManager=(function(){return this.controller.getStreamManager()}).bind(this)},eU=ew(function e(t,i){return(eC(this,e),"hls"!==(t=t.toLowerCase())&&"dash"!==t)?void window.console.error("VodStream error: incorrect streamFormat."):"dash"===t?void window.console.error("streamFormat error: DASH streams are notcurrently supported by this plugin."):"string"!=typeof i?void window.console.error("assetKey error: value must be string."):void(this.streamFormat=t,this.assetKey=i)}),eB=ew(function e(t,i,r){return(eC(this,e),"hls"!==(t=t.toLowerCase())&&"dash"!==t)?void window.console.error("VodStream error: incorrect streamFormat."):"dash"===t?void window.console.error("streamFormat error: DASH streams are notcurrently supported by this plugin."):"string"!=typeof i?void window.console.error("cmsId error: value must be string."):"string"!=typeof r?void window.console.error("videoId error: value must be string."):void(this.streamFormat=t,this.cmsId=i,this.videoId=r)}),eF=a.default.registerPlugin||a.default.plugin;eF("ima",function(e){this.ima=new eN(this,e)}),eF("imaDai",function(e,t){if(e instanceof eU)t.streamType="live",t.assetKey=e.assetKey;else{if(!(e instanceof eB))return void window.console.error("initDai() first parameter must be an instance of LiveStream or VodStream.");t.streamType="vod",t.cmsId=e.cmsId,t.videoId=e.videoId}t.streamFormat=e.streamFormat,this.imaDai=new ej(this,t)}),e.i(311726);var eq=e.i(3303),eV=e.i(207670),e$=e.i(558536),eH=e.i(21019),ez=e.i(398071),eW=e.i(583328);let eG=e=>` 46<div class="vjs-upnext-overlay"></div> 47<div class="vjs-upnext-container" data-vjs-upnext-container> 48 <div class="vjs-upnext-header-container"><span class="vjs-upnext-header-title">${e.headText}</span></div> 49 <div class="vjs-play-next-container" data-vjs-upnext-${e.hasNext()?"play":"replay"}> 50 <div class="vjs-play-next-banner-container"> 51 <div class="img"></div> 52 </div> 53 <div class="vjs-upnext-title">${e.getTitle()}</div> 54 <div class="vjs-upnext-progress-container"> 55 <svg viewBox="0 0 90 90" preserveAspectRatio="xMinYMin meet"> 56 <circle class="vjs-upnext-progress-circle-background" cx="40" cy="40" r="40"></circle> 57 <circle id="vjs-upnext-progress-circle" data-vjs-upnext-progress-circle class="vjs-upnext-progress-circle" cx="40" cy="40" r="40"></circle> 58 <svg viewBox="0 0 24 24" width="60" height="80"> 59 <path transform="rotate(90 12 12) translate(1,-4)" fill="#fff" d="M8 5v14l11-7z"></path> 60 </svg> 61 </svg> 62 </div> 63 </div> 64 <div class="vjs-upnext-cancel-button" data-vjs-upnext-cancel><a title="${e.cancelText}">x</a></div> 65</div> 66 `;class eX{videoJsPlayer;pluginOptions;controlSelectors={upnextContainer:"data-vjs-upnext-container",upnextCancel:"data-vjs-upnext-cancel",upnextPlayContainer:"data-vjs-upnext-play",upnextReplay:"data-vjs-upnext-replay",upnextProgressCircle:"data-vjs-upnext-progress-circle"};timeoutId;renderCleanup=null;currentUpnextContainer=null;constructor(e,t){this.videoJsPlayer=e,t&&"object"==typeof t&&"pluginOptions"in t?this.pluginOptions=t.pluginOptions:this.pluginOptions=t,this.videoJsPlayer.on("ended",this.handleVideoEnded)}toggleControls=e=>{this.videoJsPlayer.controls(e)};removeUpnextControl=e=>{if(this.renderCleanup){try{this.renderCleanup()}catch(e){}this.renderCleanup=null}e.remove(),this.toggleControls(!0),clearTimeout(this.timeoutId),this.currentUpnextContainer=null};dismissUpNext=()=>{this.currentUpnextContainer&&this.removeUpnextControl(this.currentUpnextContainer)};playNext=e=>{let{pluginOptions:t,removeUpnextControl:i}=this;t.playNext(),i(e)};replay=e=>{let{pluginOptions:t,removeUpnextControl:i}=this;t.replay(),i(e)};handleVideoEnded=()=>{let{videoJsPlayer:e,pluginOptions:t,toggleControls:i,removeUpnextControl:r,controlSelectors:s,playNext:n,replay:a}=this,o=document.createElement("div");if(o.className="vjs-upnext-root",e.el().appendChild(o),this.currentUpnextContainer=o,o.style.setProperty("--video-image-url",`url(${t.getVideoImageUrl()})`),t.render)try{let e=t.render(o,t);"function"==typeof e&&(this.renderCleanup=e)}catch(e){o.innerHTML=eG(t)}else o.innerHTML=eG(t);let l=()=>{if(t.interval>=0){let e=o.querySelector(`[${s.upnextProgressCircle}]`);e?(e.style.setProperty("--progress-animation-duration",`${t.interval}s`),this.timeoutId=setTimeout(()=>{n(o)},1e3*t.interval)):console.warn("---- No progress circle found",s.upnextProgressCircle)}i(!1);let e=o.querySelector(`[${s.upnextCancel}]`);e&&e.addEventListener("click",()=>{t.cancel(),r(o)});let l=o.querySelector(`[${s.upnextPlayContainer}]`);l&&l.addEventListener("click",()=>{n(o),r(o)});let d=o.querySelector(`[${s.upnextReplay}]`);d&&d.addEventListener("click",()=>{a(o),r(o)})};t.render?setTimeout(()=>l(),100):l()}}!function(){let e=a.default,r=e.Component,s=e.Plugin;if(!r&&e.getComponent&&(r=e.getComponent("Component")),!s&&e.getPlugin&&(s=e.getPlugin("plugin")),!r||!s)return console.error("video.js Component or Plugin not found",{hasComponent:!!r,hasPlugin:!!s,videojs:Object.keys(e).slice(0,10)});t=class extends r{constructor(e,t){super(e,t),Object.assign(this,new eX(e,t))}},i=class extends s{static VERSION="2.0.1";defaultOptions={interval:20,headText:"Up Next",cancelText:"Cancel",playText:"Play now",getTitle(){throw Error("Function not implemented.")},playNext(){throw Error("Function not implemented.")},cancel(){throw Error("Function not implemented.")},replay(){throw Error("Function not implemented.")},getVideoImageUrl(){throw Error("Function not implemented.")},hasNext(){throw Error("Function not implemented.")}};constructor(e,t){super(e);let i=a.default.mergeOptions(this.defaultOptions,t);e.ready(()=>this.onPlayerReady(e,i))}onPlayerReady=(e,i)=>{this.endCard=new t(e,{pluginOptions:i}),e.addChild(this.endCard),e.upnext=this};dismissUpNext=()=>{this.endCard?.dismissUpNext&&this.endCard.dismissUpNext()}};try{a.default.registerComponent("UpnextCard",t)}catch(e){console.error("Failed to register UpnextCard component:",e)}try{a.default.registerPlugin("upnext",i)}catch(e){console.error("Failed to register upnext plugin:",e)}}(),a.default.registerPlugin("bigToggleButton",function(){let e=this.bigPlayButton.handleClick;this.bigPlayButton.handleClick=t=>{this.hasClass("vjs-touch-enabled")?this.paused()?this.play():this.pause():e.call(this.bigPlayButton,t)};let t=()=>{this.hasClass("vjs-touch-enabled")&&(this.hasClass("vjs-user-active")?this.paused()?(this.bigPlayButton.show(),this.bigPauseButton.hide()):(this.bigPauseButton.show(),this.bigPlayButton.hide()):(this.bigPlayButton.hide(),this.bigPauseButton.hide()))};this.on("useractive",t),this.on("userinactive",t),this.on("play",t),this.on("pause",t)});let eY=a.default.getComponent("Button"),eK=a.default.getComponent("Component");class eQ extends eY{mouseused_;controlText_;constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("pause"),this.on("mousedown",e=>this.handleMouseDown(e))}buildCSSClass(){return"vjs-big-pause-button vjs-hidden"}handleClick(e){let t=this.player_.pause();if("tap"===e.type||this.mouseused_&&"clientX"in e){t&&"function"==typeof t.catch&&t.catch(()=>{}),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}let i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(!r)return void this.player_.tech(!0).focus();let s=()=>r.focus();t&&"function"==typeof t.then?t.then(s,()=>{}):this.setTimeout(s,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}eQ.prototype.controlText_="Pause Video",eK.registerComponent("BigPauseButton",eQ);var eZ=e.i(250194),eJ=e.i(88014);let e0=new ez.default("[VIDEO-PLAYER] videoPlayerIcons.ts"),e1={play:eZ.PlayIcon,pause:eZ.PauseIcon,"volume-mute":eZ.SpeakerSimpleXIcon,"volume-low":eZ.SpeakerSimpleNoneIcon,"volume-medium":eZ.SpeakerSimpleLowIcon,"volume-high":eZ.SpeakerSimpleHighIcon,"fullscreen-enter":eZ.ArrowsOutSimpleIcon,"fullscreen-exit":eZ.ArrowsInSimpleIcon,"picture-in-picture-enter":eZ.PictureInPictureIcon,"picture-in-picture-exit":eZ.RectangleDashedIcon},e2=a.default.getComponent("Component"),e4=e2.prototype.setIcon;e2.prototype.setIcon=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(!this.player_.options_.experimentalSvgIcons)return e4.call(this,e,t);let i=e1[e];if(!i)return e4.call(this,e,t);let r=document.createElement("span");
66r.className="custom-icon",r.setAttribute("aria-hidden","true");let s=(0,eJ.createRoot)(r),a=["play","pause"].includes(e)?"fill":"regular";s.render(n.default.createElement(i,{size:"md",weight:a}));let o=t.querySelector(".vjs-icon-placeholder")||t.querySelector(".custom-icon");if(this.iconIsSet_&&o)try{t.replaceChild(r,o)}catch(i){e0.error(`Error replacing icon "${e}": ${i}. Appending instead.`),t.appendChild(r)}else t.appendChild(r);return this.iconIsSet_=!0,r};var e5=e.i(641636);e.s(["DEFAULT_MIME_TYPE",()=>e8,"PLAYLIST_MAX_ITEMS",()=>e7,"UNPROCESSED_MIME_TYPE",()=>e3,"YOUTUBE_MIME_TYPE",()=>e6],365651);let e8="application/x-mpegURL",e3="application/mpx-id",e6="video/youtube",e7=5,e9=new ez.default("[VIDEO-ADS] IMA utils"),te=new ez.default("[VIDEO-ADS] IMA hooks"),tt=async(e,t)=>{e&&t&&t.sources[0]?.adTagUrl&&(e.ima.changeAdTag(t.sources[0].adTagUrl),te.info("IMA ad tag set to existing adTagUrl"),e.ima.requestAds())},ti=new ez.default("[VIDEO-ERRORS] Error config"),tr={RESTRICTED_ONDEMAND:{headline:"This video is only available at SBS OnDemand.",message:"Follow this link to OnDemand to watch it."},RESTRICTED_EXPIRED:{headline:"This video is no longer available."},RESTRICTED_NOT_YET_AVAILABLE:{headline:"This video is not yet available."}},ts=new ez.default("[VIDEO-ERRORS] Error hooks");e.s([],621121);let tn=new ez.default("[VIDEO-PLAYER] videoPlaylistUtils.ts"),ta=(e,t)=>{let i=e?.playlist.currentIndex?.()??-1;return i>=0?i:t.current||-1},to=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return e&&e.playlist().length>t+1?t+1:-1},tl=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(!e)return;let i=to(e,t);if(i>=0)return e.playlist()[i]};e.s(["decodeMPXParams",()=>t_,"fetchVideoData",()=>ty,"getMpxIdFromString",()=>tg],651335);var td=e.i(931752),tu=e.i(951705);let th=new ez.default("fetchWrapper");async function tc(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.method??"GET";try{t=await fetch(e,i)}catch(t){throw th.logByStatus(t,{method:r,path:e}),t}if(t.status===td.NOT_FOUND)return{data:null,response:t};if(t.ok)try{return{data:await t.json(),response:t}}catch(t){throw th.logByStatus(t,{method:r,path:e}),t}let s=new tu.CustomError(`ð¢ FetchWrapper failed: ${t.statusText} - ${e}`,t.status);throw th.logByStatus(s,{method:r,path:e}),s}let tp=new ez.default("[FETCH] fetchMpxData");async function tm(e){let{id:t,fosService:i}=e;if(!t)return tp.warn("Cannot proceed without video ID"),null;try{let e=`${i}/mpx/video/stream/${t}`,{data:r}=await tc(e,{method:"GET",headers:{"Content-Type":"application/json"}});return r}catch(e){return null}}let tf=new ez.default("[VIDEO-PLAYER] mpxService.ts"),tg=e=>e.split("/").pop()||void 0,ty=async(e,t)=>{let i=tg(e);try{return await tm({id:i,fosService:t})}catch(e){tf.error("fetchMpxData",e)}},t_=e=>Object.fromEntries(decodeURIComponent(new URL(e).searchParams.toString()).split("~").map(e=>e.split("="))),tv=new ez.default("[VIDEO-PLAYER] Middleware"),tb=e=>({setSource:(t,i)=>{let{src:r,type:s}=t,n=e.playlist(),a=e.playlist.currentIndex(),o=s===e3,l=!1;if(!o&&a>-1&&Array.isArray(n)){let t=e.playlist[a],i=t?.sources?.[0]?.expiry;i&&Date.now()>i-6e4&&(tv.info("Source isExpiring, fetching latest MPX data for src.",r),l=!0)}o||l?(o?tv.info("Detected unprocessed source: fetching latest MPX data for src.",r):tv.info("Detected expired source: fetching latest MPX data for src.",r),(async()=>{try{let s=await ty(r,e.fosService);if(tv.info("Fetched MPX data in middleware",s?.videoInfo?.mpxID),s?.videoPlayer?.src){let r=t_(s.videoPlayer.src),o=r.exp?Number(r.exp):void 0,l={...t,src:s.videoPlayer.src,type:e8,id:s.videoInfo.mpxID,expiry:o?1e3*o:void 0};if("ima"in e&&"object"==typeof e.ima){let t=function(e,t){let i=e;return t&&e?.includes("__AD_PREROLL_NAME__")&&(i=e.replace("__AD_PREROLL_NAME__",t)),i}(s.videoPlayer.dfp?.src??"",e.dfpAdPreRollName??"");l.adTagUrl=t,function(e,t){if(e.ima.setContentWithAdTag(null,t),"requestAds"in e.ima&&"function"==typeof e.ima.requestAds)try{e.ima?.requestAds()}catch(e){}}(e,t),tv.info("[VIDEO-ADS] IMA ad tag set with new tag")}a>-1&&Array.isArray(n)?(n[a]={...n[a],sources:[l]},tv.info("Restoring playlist with updated source",a,n),e.playlist(n,a)):tv.warn("No valid current index, skipping playlist restore",a),e.trigger("mpxdatafetched",{...s,aepAttributes:s.attribute}),i(null,l)}else tv.error("Failed to fetch valid MPX data, using original source",r),i(null,t)}catch(e){tv.error("Error fetching MPX data in middleware, using original source",{src:r,type:s,currentIndex:a},e),i(e,t)}})()):i(null,t)}});var tT=e.i(657688),tA=e.i(366718),tS=e.i(605146),tE=e.i(918824);let tC=new ez.default("[VIDEO-ENDCARD] Up next utils");var tw=e.i(161670);function tk(e){let{video:t}=e;return t?.title||t?.description?(0,s.jsxs)("div",{"data-testid":"video-info-panel","data-container-hover-toggle":!0,className:tw.default.headerOverlay,children:[t.title&&(0,s.jsx)("h3",{children:t.title}),t?.description&&(0,s.jsx)("p",{children:t.description})]}):null}let tx=new ez.default("[VIDEO-PLAYER] VideoPlayer");window.videojs=a.default;let tI={ads:!0,endcards:!0,errors:!0},tD=["html5"];function tP(e){var t,i;let{playerId:r,ref:o,video:l,events:d,playlist:u,currentIndex:h,features:c=tI,techOrder:p=tD,techOptions:m,variant:f="default",eventData:g}=e,{fosService:y,dfp:{dfpAdPreRollName:_=""}={}}=(0,eH.useConfigContext)()??{},v=(0,n.useRef)(null),b=(0,n.useRef)(d),T=(0,n.useRef)(g),[A,S]=(0,n.use
66State)(!1),[E,C]=(0,n.useState)(!1),[w,k]=(0,n.useState)(null),[x,I]=(0,n.useState)(null);(0,n.useEffect)(()=>{b.current=d},[d]),(0,n.useEffect)(()=>{T.current=g},[g]);let D=(0,n.useMemo)(()=>JSON.stringify({playlist:u,video:l,currentIndex:h}),[u,l,h]),P=(0,n.useRef)(-1),L=(0,n.useRef)(r||`fallback-${Math.random().toString(36).substring(2,9)}`),R=(0,n.useCallback)(e=>{k(e)},[]),M=(0,n.useCallback)((e,t)=>{b.current?.onBeforePlaylistItemChanged&&b.current.onBeforePlaylistItemChanged(t),C(!0),v?.current?.pause()},[]),O=(0,n.useCallback)(()=>{C(!1)},[]),N=(0,n.useCallback)((e,t)=>{if(!t||!w)return;let i=v.current?.playlist()?.[P.current],r=i?.eventData??T.current,s={...t,brightspotMetadata:r?.brightspotId||r?.taxonomies?{id:r.brightspotId,taxonomies:r.taxonomies}:void 0,playerLocation:r?.playerLocation};tx.info("Analytics: setting video listeners",s.videoInfo?.mpxID),e$.default.clearVideoListeners(),e$.default.setVideoListeners(w,s)},[w]),j=(0,n.useCallback)(()=>{c.endcards&&v.current?.upnext?.dismissUpNext?.()},[c.endcards]),U=(0,n.useCallback)(()=>{j()},[j]),B=(0,n.useCallback)(async(e,t)=>{if(b.current?.onPlaylistItemChanged&&b.current.onPlaylistItemChanged(t),c.ads&&await tt(v.current,t),t){let e=v.current;if(!e)return;let i=e&&t?e.playlist.indexOf(t):-1;i>=0&&(P.current=i,I(t))}},[b,c.ads]);return(0,n.useEffect)(()=>null==w?(tx.info("No video element to initialize player on"),()=>{}):(async function(){tx.info("Initializing video.js player"),a.default.use(e3,tb),v.current=(0,a.default)(w,{id:L.current,techOrder:p,...m,autoplay:!1,controls:!0,sources:[],playbackRates:[.5,1,1.5,2],experimentalSvgIcons:!0,controlBar:{subsCapsButton:!1},children:["bigPlayButton","bigPauseButton","controlBar","loadingSpinner","posterImage","resizeManager",...c.errors?["errorDisplay"]:[]]}),v.current.fosService=y,v.current.dfpAdPreRollName=_,v.current.bigToggleButton(),c.ads&&((e,t,i)=>{try{let r;if(!e)throw Error("Player not available");if(!(()=>{let e=window;return void 0!==e.google?.ima})())throw Error("Google IMA SDK not available on window");if(!e?.ads)throw Error("videojs-contrib-ads plugin not available on player");if("function"!=typeof e.ima)throw Error("IMA plugin not available on player");e9.info("All prerequisites met for IMA initialization");let s={adLabel:"Ad",adTagUrl:t??void 0,disableAdControls:!1,preventLateAdStart:!0,showCountdown:!0};e.ima({...s}),e9.info("IMA plugin initialized with config:",s),e9.info("Creating events handlers");let n=(r=i,{onAdEnd:()=>{r.current?.onAdEnd&&r.current.onAdEnd()},onAdStart:()=>{r.current?.onAdStart&&r.current.onAdStart()}});e.on("adend",n.onAdEnd),e.on("adstart",n.onAdStart)}catch(e){e9.error("Error initializing IMA plugin:",e)}})(v.current,null,b),c.endcards&&((e,t)=>{try{let i,r,n=(i=e,r=t,{interval:-1,headText:"Up next",cancelText:"Cancel",playText:"Play",getTitle:()=>{let e=ta(i,r),t=tl(i,e);return t&&t.title?t.title:void 0},getVideoImageUrl:()=>{let e=ta(i,r),t=tl(i,e);return t&&t.poster?t.poster:void 0},hasNext:()=>{let e=ta(i,r);return null!=tl(i,e)},playNext:()=>{let e=ta(i,r),t=to(i,e);t>=0&&(i.playlist.currentItem(t),r.current=t,i?.play())},cancel:()=>{},replay:()=>{i?.currentTime(0),i?.play()},render:(e,t)=>{let i=(0,eJ.createRoot)(e);return i.render(function(e){let{getTitle:t,getVideoImageUrl:i,headText:r,cancel:n,cancelText:a,playNext:o,playText:l,replay:d}=e,u=i?i():void 0,h=t?t():void 0,c=!!(h||u);return(0,s.jsx)("div",{className:(0,eV.default)("vjs-upnext-overlay",tE.default.overlay),children:(0,s.jsx)("div",{className:(0,eV.default)("vjs-upnext-container",tE.default.container),children:c?(0,s.jsxs)(s.Fragment,{children:[r&&(0,s.jsx)("p",{className:tE.default.headText,children:r}),(0,s.jsxs)("button",{className:tE.default.imageContainer,onClick:o,type:"button","aria-label":h?`Play ${h}`:"Play next video",children:[u&&(0,s.jsx)(tT.default,{loader:tA.default,src:u,width:320,height:180,alt:""}),t&&(0,s.jsx)("p",{className:tE.default.title,"aria-hidden":"true",children:t()})]}),(0,s.jsxs)("div",{className:tE.default.actions,children:[n&&(0,s.jsx)(tS.default,{"data-vjs-upnext-cancel":!0,variant:"outline",onClick:n,className:tE.default.buttonOutline,children:a||"Cancel"}),(0,s.jsx)(tS.default,{"data-vjs-upnext-play":!0,dark:!0,onClick:o,className:tE.default.buttonInvert,children:l||"Play now"})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:tE.default.noUpNext,children:(0,s.jsx)("button",{"data-vjs-upnext-replay":!0,onClick:d,type:"button","aria-label":"Replay video",children:(0,s.jsx)(eZ.ArrowsClockwiseIcon,{color:"#ffffff","aria-hidden":"true"})})}),(0,s.jsx)("div",{className:tE.default.actions,children:n&&(0,s.jsx)(tS.default,{"data-vjs-upnext-cancel":!0,variant:"outline",onClick:n,className:tE.default.buttonOutline,children:a||"Cancel"})})]})})})}(t)),()=>i.unmount()}});e?.upnext(n)}catch(e){tC.error("Error initializing UpNext plugin:",e)}})(v.current,P);let e=(e=>{let{video:t,playlist:i=[],currentIndex:r=-1}=e,s=-1;tn.log({playlist:i,video:t,currentIndex:r}),t&&i?.length>0?((s=((e,t)=>t?e.findIndex(e=>e.id===t):-1)(i,t?.id))<0&&(i.unshift(t),s=0),tn.log("playlist and video")):t?(s<0&&i.unshift(t),s=0,tn.log("video")):i?.length>0&&(s=0,tn.log("playlist")),tn.log({playlist:i,currentIndex:r,index:s});let n=new Set,a={playlist:i.filter(e=>!(!e.id||n.has(e.id))&&(n.add(e.id),!0)).slice(0,e7),currentIndex:r<0?s:r};return tn.log("result",a),a})({video:l,playlist:u,currentIndex:h});e.playlist.length>0&&(tx.log("Setting up playlist with",e),v.current.playlist(e.playlist,e.currentIndex),P.current=e.currentIndex,I(e.playlist[e.currentIndex])),v.current.on("mpxdatafetched",N),v.current?.ready(()=>{tx.info("Player ready event"),S(!0),b.current?.onPlayerReady&&b.current.onPlayerReady(v.current),v?.current?.on("play",U)})}(),()=>{tx.info("Disposing player");let e=v.current;if(e){e.off("play",U),e.off("beforeplaylistitem",M),e.off("playlistitem",B),e.off("loadstart",O),e.off("mpxdatafetched",N);try{e.playlist?.([])}catch(e){tx.warn("Error clearing playlist during dispose",e)}e.isDisposed()||e.dispose()}e$.default.clearVideoListeners(),v.current=null,P.current=-1,I(null),S(!1),C(!1),k(null)}),[h,c.ads,c.endcards,c.errors,M,O,N,U,B,u,D,m,p,l,w,_,y]),(0,n.useEffect)(()=>A&&v?.current?.playlist&&0!==v.current.playlist.length?(tx.info("UseEffect playlist: Triggering playlist ready event"),v?.current?.trigger("playlistready"),v?.current?.on("beforeplaylistitem",M),v?.current?.on("playlistitem",B),v?.current?.on("loadstart",O),()=>{v?.current?.off("beforeplaylistitem",M),v?.current?.off("playlistitem",B),v?.current?.off("loadstart",O)}):(tx.info("UseEffect playlist: No player or playlist available."),()=>{}),[A,v?.current?.playlist,O,M,B]),t=v.current,(0,n.useEffect)(()=>t?(((e,t)=>{try{if(!e)throw Error("Player not available");if("function"!=typeof e.errors)throw Error("videojs-errors plugin not available on player");if("function"!=typeof e.errors.extend)throw Error("videojs-errors extend not available on player");e.errors(),e.errors.extend({...tr,...t??{}}),ti.info("videojs-errors initialized with custom messages")}catch(e){ti.error("Failed to initialize videojs-errors plugin",e)}})(t,i),()=>{t?.errors?.dismiss&&t.errors.dismiss()}):(ts.warn("Cannot initialize videojs-errors without player"),()=>{}),[t,i]),(0,n.useImperativeHandle)(o,()=>({player:v.current,isPlayerReady:A}),[A]),(0,s.jsxs)("div",{"data-variant":f,className:e5.default.container,children:[(0,s.jsx)(eW.default,{"aria-label":"Video player loading","aria-busy":"true","aria-live":"polite",className:(0,eV.default)(e5.default.placeholder,A&&!E?e5.default.placeholderHidden:void 0)}),"header"===f&&(0,s.jsx)(tk,{video:x||l}),(0,s.jsxs)("div",{"data-vjs-player":!0,children:[(0,s.jsx)(eq.default,{src:"//imasdk.googleapis.com/js/sdkloader/ima3.js",strategy:"beforeInteractive"}),(0,s.jsx)("video",{className:(0,eV.default)("video-js","vjs-16-9",e5.default.video),controls:!0,playsInl
66ine:!0,ref:R})]})]})}},18723,e=>{e.v({dateTime:"VideoMetadata-module__zVJoca__dateTime",dateTimeSkel:"VideoMetadata-module__zVJoca__dateTimeSkel",description:"VideoMetadata-module__zVJoca__description",descriptionSkel:"VideoMetadata-module__zVJoca__descriptionSkel",metadata:"VideoMetadata-module__zVJoca__metadata",title:"VideoMetadata-module__zVJoca__title",titleSkel:"VideoMetadata-module__zVJoca__titleSkel"})},115491,e=>{"use strict";e.s(["default",()=>o]);var t=e.i(857727),i=e.i(271645),r=e.i(207670),s=e.i(134016),n=e.i(244456),a=e.i(18723);function o(e){let{playerHandle:o,video:l}=e,[d,u]=(0,i.useState)(l||null);return((0,i.useEffect)(()=>{if(!o?.player)return()=>{};let e=o.player,t=()=>(e=>{let t=e.playlist?.currentIndex(),i=e.playlist()?.[t];i&&u(i)})(e);return e.on("playlistitem",t),()=>{e.off("playlistitem",t)}},[o,o?.player]),d)?(0,t.jsxs)("div",{className:a.default.metadata,"data-testid":"VideoMetadata",children:[(d.title||d.publishDate)&&(0,t.jsxs)("div",{children:[d.title&&(0,t.jsx)("h3",{className:(0,r.default)("subheading1",a.default.title),"data-testid":"video-title",children:d.title}),d.publishDate&&(0,t.jsx)(s.default,{publishDate:d.publishDate,className:a.default.dateTime})]}),d.description&&(0,t.jsx)("p",{className:a.default.description,"data-testid":"video-abstract",children:d.description})]}):(0,t.jsxs)("div",{className:a.default.metadata,children:[(0,t.jsx)(n.default,{width:"60%",className:a.default.titleSkel,darkMode:!0}),(0,t.jsx)(n.default,{width:"20%",className:a.default.dateTimeSkel,darkMode:!0}),(0,t.jsx)(n.default,{width:"100%",className:a.default.descriptionSkel,darkMode:!0})]})}},571083,e=>{e.v({hasMoreLink:"VideoPlaylist-module__sEiedW__hasMoreLink",playlist:"VideoPlaylist-module__sEiedW__playlist",playlistContainer:"VideoPlaylist-module__sEiedW__playlistContainer",playlistSkeletonContainer:"VideoPlaylist-module__sEiedW__playlistSkeletonContainer",pulse:"VideoPlaylist-module__sEiedW__pulse",skeletonItem:"VideoPlaylist-module__sEiedW__skeletonItem"})},464566,e=>{e.v({iconText:"Signpost-module__uutKOq__iconText",pulsatingDot:"Signpost-module__uutKOq__pulsatingDot","pulse-dot":"Signpost-module__uutKOq__pulse-dot",signpost:"Signpost-module__uutKOq__signpost",signpostIconAndText:"Signpost-module__uutKOq__signpostIconAndText",signpostText:"Signpost-module__uutKOq__signpostText",signpostTextLink:"Signpost-module__uutKOq__signpostTextLink"})},315229,e=>{"use strict";e.s(["Signpost",()=>n,"default",()=>a]);var t=e.i(857727),i=e.i(207670),r=e.i(86132),s=e.i(464566);let n=Object.assign(function(e){let{children:i}=e;return(0,t.jsx)("div",{className:s.default.signpost,"data-testid":"lozenge",children:i})},{Icon:function(e){let{icon:r,children:n,className:a}=e;return(0,t.jsxs)("div",{className:(0,i.default)(s.default.signpostIconAndText,a),children:[r,n]})},IconText:function(e){let{text:r,className:n}=e;return(0,t.jsx)("p",{dir:"auto",className:(0,i.default)("subtitle2",s.default.iconText,n),"data-testid":"signpost-icon-text",children:r})},Text:function(e){let{text:n,link:a,clickEventData:o}=e,l=(0,t.jsx)("p",{dir:"auto",className:(0,i.default)("subtitle2",s.default.signpostText),"data-testid":"signpost-text",children:n});return a?(0,t.jsx)(r.default,{href:a,title:n,clickEventData:{...o,clickURL:a,elementText:n},className:s.default.signpostTextLink,children:l}):l},LiveIndicator:function(){return(0,t.jsx)("span",{className:s.default.pulsatingDot})}}),a=n},429291,e=>{e.v({active:"PlaylistItem-module__Xa-Dka__active",playlistItem:"PlaylistItem-module__Xa-Dka__playlistItem",playlistItemDuration:"PlaylistItem-module__Xa-Dka__playlistItemDuration",playlistItemIcon:"PlaylistItem-module__Xa-Dka__playlistItemIcon",playlistItemInfo:"PlaylistItem-module__Xa-Dka__playlistItemInfo",playlistItemThumbnail:"PlaylistItem-module__Xa-Dka__playlistItemThumbnail",playlistItemThumbnailBase:"PlaylistItem-module__Xa-Dka__playlistItemThumbnailBase",playlistItemThumbnailWrapper:"PlaylistItem-module__Xa-Dka__playlistItemThumbnailWrapper",playlistItemTitle:"PlaylistItem-module__Xa-Dka__playlistItemTitle",skeletonItem:"PlaylistItem-module__Xa-Dka__skeletonItem",skeletonTitle:"PlaylistItem-module__Xa-Dka__skeletonTitle"})},709496,e=>{"use strict";e.s(["default",()=>v],709496);var t=e.i(857727),i=e.i(271645),r=e.i(398071),s=e.i(207670),n=e.i(86132),a=e.i(236692),o=e.i(245685),l=e.i(571083);e.i(752623);var d=e.i(120764),u=e.i(605146),h=e.i(315229),c=e.i(250194),p=e.i(212313),m=e.i(429291);
66function f(e){let{enabled:i=!0,isActive:r,video:n,handleItemClick:a}=e;if(!n.sources||0===n.sources.length)return null;let o=n?.duration?(0,p.default)(Number(n.duration/1e3)):void 0;return(0,t.jsx)("li",{className:(0,s.clsx)(r&&m.default.active),"aria-current":r||void 0,children:(0,t.jsxs)(u.default,{disabled:!i,className:m.default.playlistItem,onClick:()=>a?.(n),type:"button",variant:"ghost","aria-label":n.title?`Play ${n.title}`:"Play video",children:[(0,t.jsx)(d.default,{wrapperClassName:m.default.playlistItemThumbnailWrapper,className:(0,s.clsx)(m.default.playlistItemThumbnail,m.default.playlistItemThumbnailBase),src:n.poster,alt:n.title||"Video thumbnail",width:160,height:90,dark:!0}),(0,t.jsxs)("div",{className:m.default.playlistItemInfo,children:[n.title&&(0,t.jsx)("p",{className:m.default.playlistItemTitle,children:n.title}),n.duration&&(0,t.jsx)(h.Signpost,{children:(0,t.jsx)(h.Signpost.Icon,{icon:(0,t.jsx)(c.PlayIcon,{size:"sm",weight:"fill"}),className:m.default.playlistItemIcon,children:o&&(0,t.jsx)(h.Signpost.IconText,{text:o,className:m.default.playlistItemDuration})})})]})]})})}var g=e.i(244456);function y(e){let{darkMode:i}=e;return(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:(0,s.default)(m.default.playlistItem,m.default.skeletonItem),children:[(0,t.jsx)(g.default,{className:m.default.playlistItemThumbnailBase,darkMode:i}),(0,t.jsxs)("div",{className:m.default.playlistItemInfo,children:[(0,t.jsxs)("div",{className:(0,s.default)(m.default.playlistItemTitle,m.default.skeletonTitle),children:[(0,t.jsx)(g.default,{height:"1.3em",width:"100%",darkMode:i}),(0,t.jsx)(g.default,{height:"1.3em",width:"90%",darkMode:i})]}),(0,t.jsx)(g.default,{className:m.default.playlistItemDuration,height:"1.2em",width:"40px",darkMode:i})]})]})})}let _=new r.default("[VIDEO-PLAYER] VideoPlaylist");function v(e){let{className:r,playerHandle:d,playOnSelect:u,hasMore:h,skelLength:c,enabled:p=!0}=e,[m,g]=(0,i.useState)(!1),[v,b]=(0,i.useState)(null),[T,A]=(0,i.useState)(-1),S=(0,o.default)(`(max-width: ${a.BREAKPOINT_MD}px)`),E=(0,i.useRef)(null),C=(0,i.useCallback)(e=>{let t=e.playlist();if(t&&t.length>0){let i=e.playlist.currentIndex();return b(t),A(i),g(!0),!0}return!1},[]),w=(0,i.useCallback)(e=>{let t=e.playlist.currentIndex();A(t),_.info("Current item changed event triggered",t)},[]);(0,i.useEffect)(()=>{if(!d?.player)return _.info("No player available",d),()=>{};let e=d.player,t=()=>w(e);return e.on("playlistitem",t),_.info("Event listeners set up"),C(e),()=>{e.off("playlistitem",t),E.current&&(E.current(),E.current=null)}},[d,d?.player,w,C]);let k=e=>{if(!e||!d?.player||!p)return;let t=d.player,i=v?.findIndex(t=>t===e);if(_.info("Item clicked",e.id,"at index",i),t.playlist.currentItem(i),void 0!==i&&i>-1&&A(i),S){let e=t.el();e&&e.scrollIntoView({behavior:"smooth",block:"start"})}u&&t.play().catch(e=>{_.warn("Autoplay failed after playlist item selection",e)})};return v&&0!==v.length||c?(0,t.jsxs)("aside",{className:(0,s.default)(l.default.playlistContainer,r),"data-testid":"VideoPlaylist","aria-label":"Video playlist",children:[m?(0,t.jsx)("ul",{className:l.default.playlist,children:v?.map((e,i)=>(0,t.jsx)(f,{enabled:p,video:e,handleItemClick:k,isActive:i===T},e.id||i))}):(0,t.jsx)("ul",{className:l.default.playlist,children:Array.from({length:c??0}).map((e,i)=>(0,t.jsx)(y,{darkMode:!0},`skeleton-${i+1}`))}),h&&(0,t.jsx)(n.default,{"aria-label":e?.title?`See more ${e?.title}`:"See more",href:e?.collectionLink??"",clickEventData:{...e?.clickEventData,clickURL:e?.collectionLink},className:(0,s.default)("body2",l.default.hasMoreLink),children:"See more"})]}):null}},958257,e=>{"use strict";e.s(["Video",()=>n],958257);var t=e.i(652458),i=e.i(115491),r=e.i(709496),s=e.i(857727);let n={Player:t.default,Metadata:i.default,Playlist:r.default,Wrapper:function(e){let{children:t,className:i}=e;return(0,s.jsx)("div",{className:i,"data-testid":"video-wrapper",children:t})}}},330451,e=>{e.v({caption:"EmbedMpxVideo-module__cgZQXW__caption",container:"EmbedMpxVideo-module__cgZQXW__container",skeletonCaption:"EmbedMpxVideo-module__cgZQXW__skeletonCaption "+e.i(359644).placeholder,skeletonVideo:"EmbedMpxVideo-module__cgZQXW__skeletonVideo "+e.i(359644).placeholder})},205033,e=>{"use strict";e.s(["default",()=>a]);var t=e.i(857727),i=e.i(45607),r=e.i(958257),s=e.i(365651),n=e.i(330451);function a(e){let{brightspotId:a,caption:o,mpxId:l,poster:d,isExpired:u=!1,isHeader:h=!1,taxonomies:c}=e,p=l.toString(),m={id:a,title:o,poster:d,sources:[{src:p,type:s.UNPROCESSED_MIME_TYPE,mpxId:p}]};return u?null:(0,t.jsx)(i.default,{placeholder:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:n.default.skeletonVideo}),o&&(0,t.jsx)("div",{className:n.default.skeletonCaption})]}),children:(0,t.jsxs)("div",{className:n.default.container,id:p,"data-layer-event-source-type":h?"header":"shortcode",children:[(0,t.jsx)(r.Video.Player,{variant:"header",playerId:`embed-${p}`,video:m,features:{ads:!1,endcards:!1,errors:!0},eventData:{brightspotId:a,taxonomies:c,playerLocation:"shortcode"}}),o&&(0,t.jsx)("p",{className:n.default.caption,children:o})]})})}},953755,e=>{e.v({container:"EmbedX-module__aP0yUq__container "+e.i(359644).container,placeholder:"EmbedX-module__aP0yUq__placeholder "+e.i(359644).placeholder})},258534,e=>{"use strict";e.s(["default",()=>a]);var t=e.i(857727),i=e.i(3303),r=e.i(45607),s=e.i(271645),n=e.i(953755);function a(e){let{url:a}=e,o=(0,s.useRef)(null),l=(0,s.useCallback)(e=>!!e.current&&"true"===getComputedStyle(e.current).getPropertyValue("--dark-mode").trim(),[]),d=(0,s.useCallback)(()=>{let e=o.current;e&&(l(o)?e.setAttribute("data-theme","dark"):e.removeAttribute("data-theme")),window.twttr?.widgets?.load?.()},[o,l]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.default,{src:"https://platform.twitter.com/widgets.js",strategy:"lazyOnload",onLoad:d}),(0,t.jsx)(r.default,{onLoad:d,placeholder:(0,t.jsx)("div",{className:n.default.placeholder}),children:(0,t.jsx)("div",{className:n.default.container,"data-testid":"embedded-tweet",children:(0,t.jsx)("blockquote",{ref:o,className:"twitter-tweet",children:(0,t.jsx)("a",{href:a})})})})]})}},554733,e=>{e.v({container:"EmbedInstagram-module__KH13lW__container "+e.i(359644).container,placeholder:"EmbedInstagram-module__KH13lW__placeholder "+e.i(359644).placeholder})},739084,e=>{"use strict";e.s(["default",()=>s]);var t=e.i(857727),i=e.i(45607),r=e.i(554733);function s(e){let{url:s}=e;return(0,t.jsx)(i.default,{onLoad:()=>{(window.instgrm?Promise.resolve():new Promise(e=>{let t=document.createElement("script");t.src="https://www.instagram.com/embed.js",t.async=!0,t.onload=()=>e(),document.body.appendChild(t)})).then(()=>{window.instgrm?.Embeds?.process?.()})},placeholder:(0,t.jsx)("div",{className:r.default.placeholder}),children:(0,t.jsx)("div",{className:r.default.container,"data-testid":"instagram-embed",children:(0,t.jsx)("blockquote",{className:"instagram-media","data-instgrm-captioned":!0,"data-instgrm-permalink":s,"data-instgrm-version":"14",children:(0,t.jsx)("div",{className:r.default.placeholder})})})})}},84239,e=>{e.v({container:"EmbedYoutube-module__hb9iOG__container "+e.i(359644).container})},314920,e=>{"use strict";e.s(["default",()=>n]);var t=e.i(857727),i=e.i(958257),r=e.i(365651),s=e.i(84239);function n(e){let{url:n}=e,a=new URL(n).searchParams.get("v")??n.replace(/[^a-zA-Z0-9-_]/g,"-"),o={id:`youtube-${a}`,sources:[{src:n,type:r.YOUTUBE_MIME_TYPE}]};return(0,t.jsx)("div",{className:s.default.container,"data-testid":"youtube-embed",children:(0,t.jsx)(i.Video.Player,{playerId:`embed-yt-${a}`,video:o,techOrder:["youtube","html5"],techOptions:{youtube:{ytControls:2}},features:{ads:!1,endcards:!1,errors:!0}})})}},488108,e=>{e.v({containerPost:"EmbedFacebook-module__1IvGmW__containerPost "+e.i(359644).container,containerVideo:"EmbedFacebook-module__1IvGmW__containerVideo "+e.i(359644).container,placeholderPost:"EmbedFacebook-module__1IvGmW__placeholderPost "+e.i(359644).placeholder,placeholderVideo:"EmbedFacebook-module__1IvGmW__placeholderVideo "+e.i(359644).placeholder})},802746,e=>{"use strict";e.s(["default",()=>n]);var t=e.i(857727),i=e.i(3303),r=e.i(45607),s=e.i(488108);function n(e){let{url:n}=e,a=!1;try{let{hostname:e,pathname:t}=new URL(n),i=t.split("/");a="fb.watch"===e||i.includes("watch")||i.includes("videos")}catch{}let o=()=>{window?.FB?.XFBML?.parse?.()},l=a?s.default.containerVideo:s.default.containerPost,d=a?s.default.placeholderVideo:s.default.placeholderPost;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.default,{src:"https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v11.0",strategy:"lazyOnload",onLoad:o}),(0,t.jsx)(r.default,{onLoad:o,placeholder:(0,t.jsx)("div",{className:d}),children:(0,t.jsx)("div",{className:l,children:a?(0,t.jsx)("div",{className:"fb-video","data-href":n,"data-show-text":!0,"data-lazy":!0,"data-testid":"embedded-facebook-video"}):(0,t.jsx)("div",{className:"fb-post","data-href":n,"data-lazy":!0,"data-testid":"embedded-facebook-post"})})})]})}},706211,e=>{e.v({container:"EmbedTikTok-module__tO2zqW__container "+e.i(359644).container,embedWrapper:"EmbedTikTok-module__tO2zqW__embedWrapper",placeholder:"EmbedTikTok-module__tO2zqW__placeholder "+e.i(359644).placeholder})},476,e=>{"use strict";e.s(["default",()=>l,"parseTikTokUrl",()=>o]);var t=e.i(857727),i=e.i(3303),r=e.i(45607),s=e.i(398071),n=e.i(706211);let a=new s.default("EmbedTikTok"),o=e=>{let t=e.match(/\/video\/(.*)/);return{cite:e,videoId:t?.[1]||""}};function l(e){let{url:s}=e,{cite:l,videoId:d}=o(s);l&&d||a.log("EmbedTikTok:","Malformed Embed Url","cite:",l," ","videoId:",d);let u=()=>{let e=Array.from(document.querySelectorAll("blockquote.tiktok-embed"));void 0!==window.tiktokEmbed&&e.length&&window.tiktokEmbed.lib.render(e)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.default,{src:"//www.tiktok.com/embed.js",strategy:"lazyOnload",onLoad:u}),(0,t.jsx)(r.default,{onLoad:u,placeholder:(0,t.jsx)("div",{className:n.default.placeholder}),children:(0,t.jsx)("div",{className:n.default.container,"data-testid":"tiktok-embed",children:(0,t.jsx)("div",{className:n.default.embedWrapper,children:(0,t.jsx)("blockquote",{className:"tiktok-embed",cite:l,"data-vi
66deo-id":d,children:(0,t.jsx)("div",{className:n.default.placeholder})})})})})]})}},275949,e=>{"use strict";e.s(["PictureSC",()=>t.default]);var t=e.i(202664)},412972,e=>{e.v({type:"PodcastEpisodeTypeText-module__Jf2dNW__type"})},19508,e=>{"use strict";e.s(["default",()=>t]);let t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!e||isNaN(e)||e<=0)return"0 B";let i=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**i).toFixed(t<0?0:t))} ${["B","KB","MB","GB","TB","PB","EB","ZB","YB"][i]}`}},575728,e=>{e.v({wrapper:"PlayButton-module__LjIALG__wrapper"})},994254,e=>{"use strict";e.s(["default",()=>a]);var t=e.i(857727),i=e.i(207670),r=e.i(250194);e.i(881673);var s=e.i(418446),n=e.i(575728);function a(e){let{isPlaying:a,onClick:o,className:l,subject:d="episode"}=e,u=a?(0,t.jsx)(r.WaveformIcon,{"data-testid":"state-icon",weight:"bold",size:"sm"}):(0,t.jsx)(r.PlayIcon,{"data-testid":"state-icon",weight:"fill",size:"sm"});return o?(0,t.jsx)(s.Button,{type:"button",className:(0,i.default)(n.default.wrapper,l),"data-testid":"play-button",onClick:o,"aria-pressed":a,"aria-label":`${a?"Pause":"Play"} ${d}`,children:u}):(0,t.jsx)("span",{className:(0,i.default)(n.default.wrapper,l),"data-testid":"play-button","aria-hidden":!0,children:u})}},996270,e=>{e.v({button:"Item-module__rAPCha__button",buttonInShelf:"Item-module__rAPCha__buttonInShelf",condensedButtonWrapper:"Item-module__rAPCha__condensedButtonWrapper",container:"Item-module__rAPCha__container",content:"Item-module__rAPCha__content",headline:"Item-module__rAPCha__headline",imageWrapper:"Item-module__rAPCha__imageWrapper",menuWrapper:"Item-module__rAPCha__menuWrapper","play-button-icon":"Item-module__rAPCha__play-button-icon",playButtonDesktop:"Item-module__rAPCha__playButtonDesktop",shelf:"Item-module__rAPCha__shelf",wrapper:"Item-module__rAPCha__wrapper"})},999601,e=>{e.v({actionButton:"SocialShareSection-module__qe0nXW__actionButton",actions:"SocialShareSection-module__qe0nXW__actions",fadeIn:"SocialShareSection-module__qe0nXW__fadeIn",fadeOut:"SocialShareSection-module__qe0nXW__fadeOut",shareSection:"SocialShareSection-module__qe0nXW__shareSection",slideDown:"SocialShareSection-module__qe0nXW__slideDown",slideUp:"SocialShareSection-module__qe0nXW__slideUp",title:"SocialShareSection-module__qe0nXW__title",toastClosing:"SocialShareSection-module__qe0nXW__toastClosing",toastDescription:"SocialShareSection-module__qe0nXW__toastDescription",toastIcon:"SocialShareSection-module__qe0nXW__toastIcon",toastRoot:"SocialShareSection-module__qe0nXW__toastRoot",toastViewport:"SocialShareSection-module__qe0nXW__toastViewport"})},646971,e=>{"use strict";e.s(["default",()=>d]);var t=e.i(857727),i=e.i(271645),r=e.i(250194),s=e.i(796008);e.i(530914);var n=e.i(918719),a=e.i(913208);e.i(881673);var o=e.i(418446),l=e.i(999601);function d(e){let{urlLink:d,onCopiedAction:u,className:h,size:c="sm",text:p="Copy link",ref:m,onClick:f,...g}=e,[y,_]=(0,s.default)({resetDelay:2500});return(0,i.useEffect)(()=>{y.copied&&u()},[y.copied,u]),(0,t.jsxs)(o.Button,{type:"button",className:h||l.default.actionButton,onClick:e=>{f?.(e),_(d)},"data-testid":"copy-button","data-clickevent":(0,n.createClickEventAttribute)({elementText:"Copy link",elementType:"button",clickType:a.ClickType.ClickSource,clickURL:d}),ref:m,...g,children:[(0,t.jsx)("span",{children:p}),(0,t.jsx)(r.LinkIcon,{size:c})]})}},85386,e=>{e.v({contentContainer:"ItemMenu-module__2uMh9a__contentContainer",copyButton:"ItemMenu-module__2uMh9a__copyButton",copyButtonActive:"ItemMenu-module__2uMh9a__copyButtonActive",desktopOnly:"ItemMenu-module__2uMh9a__desktopOnly",dropDownLink:"ItemMenu-module__2uMh9a__dropDownLink",menuButton:"ItemMenu-module__2uMh9a__menuButton",mobileOnly:"ItemMenu-module__2uMh9a__mobileOnly"})},476862,e=>{e.v({duration:"ItemMetadata-module__yMLxea__duration"})},531970,611319,996093,e=>{"use strict";e.s(["default",()=>F],531970);var t=e.i(857727),i=e.i(207670),r=e.i(585264),s=e.i(67405),n=e.i(392695),a=e.i(236692);e.i(752623);var o=e.i(275949);e.i(881673);var l=e.i(418446);e.s(["default",()=>c],611319);var d=e.i(738286),u=e.i(311182),h=e.i(412972);let c=e=>{let{episodeType:s,seasonNumber:n,episodeNumber:a}=e,{locale:o}=(0,u.useSiteContext)(),l=(0,r.useTranslations)(),c=s,p=l("season").toLocaleUpperCase(o),m=l("episode").toLocaleUpperCase(o),f=s.toLowerCase();if("full"===f){let e=n?`${p} ${n}`:"",t=a?`${m} ${a}`:"";c=`${e}${a&&n?" ":""}${t}`}else("bonus"===f||"trailer"===f)&&(c=l(f).toLocaleUpperCase(o));return(0,d.default)(c)?null:(0,t.jsx)("p",{className:(0,i.default)("body2",h.default.type),children:c})};var p=e.i(19508);let m={live:[],podcast:[{id:"view more",icon:"read more",name:"View More"},{id:"download",icon:"Download",name:"Download"}],catchup:[]};var f=e.i(994254),g=e.i(996270),y=e.i(271645),_=e.i(540666);e.i(387366);var v=e.i(257766),b=e.i(250194);e.i(843267);var T=e.i(110172),A=e.i(995483),S=e.i(397584),E=e.i(646971),C=e.i(962420),w=e.i(384595),k=e.i(85386);function x(e){let{options:i,clickEventData:r,showCopyButton:s,copyUrl:n}=e,a={options:i,clickEventData:r,showCopyButton:s&&!!n,copyUrl:n};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:k.default.mobileOnly,children:(0,t.jsx)(L,{...a})}),(0,t.jsx)("div",{className:k.default.desktopOnly,children:(0,t.jsx)(R,{...a})})]})}function I(e){let{onClick:i,ref:r,...s}=e;return(0,t.jsxs)(l.Button,{type:"button",variant:"ghost","data-testid":"moreVerticalButton",onClick:i,className:k.default.menuButton,ref:r,...s,children:[(0,t.jsx)("span",{className:"srOnly",children:"Open episode menu"}),(0,t.jsx)(b.MenuDotsIcon,{weight:"bold",size:"md"})]})}function D(e){return"download"===e?b.DownloadIcon:"view more"===e?b.ListPlusIcon:void 0}function P(){let[e,t]=(0,y.useState)(!1),i=(0,y.useRef)(void 0);return(0,y.useEffect)(()=>()=>clearTimeout(i.current),[]),{isCopied:e,onCopy:()=>{clearTimeout(i.current),t(!0),i.current=setTimeout(()=>{t(!1)},2500)}}}function L(e){let{options:r,clickEventData:s,showCopyButton:n,copyUrl:a}=e,[o,l]=(0,y.useState)(!1),{isCopied:d,onCopy:u}=P();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(I,{"data-testid":"moreVerticalButton-mobile",onClick:()=>l(!0)}),(0,t.jsx)(T.MobileDrawerDialog,{open:o,setOpen:l,isMobileScreenWidth:!0,"aria-label":"Episode menu",children:(0,t.jsxs)(A.MobileDrawerContentContainer,{children:[(0,t.jsx)(S.MobileDrawerCloseButton,{"aria-label":"Close episode menu dialog","data-testid":"close-episode-menu",onClick:()=>l(!1)}
66),(0,t.jsxs)(S.MobileDrawerListContainer,{children:[r.map(e=>{let{id:i,url:r}=e,n=D(i);return(0,t.jsx)("li",{children:(0,t.jsxs)(S.MobileDrawerLink,{href:r,"data-testid":i,clickEventData:s,onNavigate:()=>l(!1),target:"download"===i?"_blank":void 0,children:[n&&(0,t.jsx)(n,{}),e.name]})},i)}),n&&(0,t.jsx)("li",{children:(0,t.jsx)(E.default,{"data-copied":d,className:(0,i.default)(k.default.copyButton,d&&k.default.copyButtonActive,C.default.drawerLink),urlLink:(0,w.resolveUrl)(a),onCopiedAction:u,size:"md",text:d?"Copied!":"Copy link"})},"copy")]})]})})]})}function R(e){let{options:r,clickEventData:s,showCopyButton:n,copyUrl:a}=e,{isCopied:o,onCopy:l}=P();return(0,t.jsxs)(_.Root,{modal:!1,children:[(0,t.jsx)(_.Trigger,{asChild:!0,children:(0,t.jsx)(I,{"data-testid":"moreVerticalButton-desktop"})}),(0,t.jsx)(_.Portal,{children:(0,t.jsxs)(_.Content,{className:(0,i.default)("themeGamma",k.default.contentContainer),children:[r.map(e=>{let{id:i,url:r}=e,n=D(i),a="download"===i&&e.contentSize?`${e.name} (${e.contentSize})`:e.name;return(0,t.jsx)(_.Item,{asChild:!0,children:(0,t.jsxs)(v.Link,{href:r,"data-testid":i,clickEventData:s,target:"download"===i?"_blank":void 0,className:k.default.dropDownLink,children:[n&&(0,t.jsx)(n,{}),a]})},i)}),n&&(0,t.jsx)(_.Item,{asChild:!0,onSelect:e=>e.preventDefault(),children:(0,t.jsx)(E.default,{"data-copied":o,className:(0,i.default)(k.default.copyButton,o&&k.default.copyButtonActive,k.default.dropDownLink,C.default.drawerLink),urlLink:(0,w.resolveUrl)(a),onCopiedAction:l,size:"md",text:o?"Copied!":"Copy link"})},"copy")]})})]})}e.s(["default",()=>B],996093);var M=e.i(212313),O=e.i(149451),N=e.i(162433),j=e.i(476862);let U=e=>{let{text:i,screenReaderText:r,icon:s}=e;return(0,t.jsxs)(N.default,{variant:"transparent",children:[(0,t.jsx)(N.default.Icon,{icon:s,weight:"regular",size:"md"}),(0,t.jsx)("span",{className:"srOnly",children:r}),(0,t.jsx)(N.default.Text,{variant:"transparent",size:"small",text:i})]})},B=e=>{let{displayDateUnixEpochMilli:r,duration:s,hasTranscript:n=!1}=e;return(0,t.jsxs)("div",{className:(0,i.default)("body2",j.default.duration),"data-testid":"date-duration",children:[(0,t.jsx)("span",{className:"srOnly",children:"Published: "}),(0,t.jsx)("time",{dateTime:(0,O.getFormattedDate)(r,"YYYY-MM-DD"),children:(0,O.getFormattedDate)(r,"DD/MM/YYYY")}),(0,t.jsx)(U,{icon:b.WaveformIcon,text:(0,M.default)(s),screenReaderText:"Duration: "}),n&&(0,t.jsx)(U,{icon:b.ChatCenteredTextIcon,text:"Transcript",screenReaderText:"available"})]})},F=e=>{let{clickEventData:d,episode:u,audioType:h="podcast",isShelf:y=!1,hasTranscript:_=!1}=e,v=(0,r.useTranslations)(),[b]=(0,s.useMediaContextV2)(),{headline:T,leadImage:A,episodeType:S,seasonNumber:E,episodeNumber:C,displayDate:w,audio:k,route:I}=u,D=A?.attributes?.sizes?.[0]?.src??"",P=A?.attributes?.sizes?.[1]?.src??"",L=y?[{srcSet:P}]:[{media:`(min-width: ${a.BREAKPOINT_MD}px)`,srcSet:D},{srcSet:P}],R=k?.url||"",M=(0,s.useTogglePlay)(R),O=(0,n.mediaIsPlaying)(b.status,R,b.activeMediaUrl),N=v.has(`radio--${T}`)?v(`radio--${T}`):T;return(0,t.jsxs)("li",{className:(0,i.default)(g.default.container,"audio-item",y&&g.default.shelf),children:[(0,t.jsx)(l.Button,{type:"button",variant:"ghost",className:(0,i.default)(g.default.button,y&&g.default.buttonInShelf),"data-testid":"play-item-button","aria-pressed":O,onClick:M,children:(0,t.jsxs)("div",{className:g.default.wrapper,children:[(0,t.jsx)("div",{className:g.default.playButtonDesktop,children:(0,t.jsx)(f.default,{isPlaying:O})}),"catchup"!==h&&(0,t.jsx)("div",{className:g.default.imageWrapper,children:(0,t.jsx)(o.PictureSC,{dark:!0,sources:L,alt:A?.alt??"",fill:!0})}),(0,t.jsxs)("div",{className:g.default.content,"data-testid":"play-item-title",children:[S&&(0,t.jsx)(c,{episodeType:S,seasonNumber:E,episodeNumber:C}),T&&(0,t.jsx)("span",{className:(0,i.default)("subtitle2",g.default.headline),children:N}),(0,t.jsx)(B,{displayDateUnixEpochMilli:w?.unixEpochMilli,duration:k?.duration,hasTranscript:_})]})]})}),(0,t.jsxs)("div",{className:g.default.menuWrapper,children:["podcast"===h&&(0,t.jsx)(x,{clickEventData:d,options:((e,t)=>{let{route:i,audio:r}=t,{permalink:s}=i||{},{fileSize:n,url:a}=r||{};return e.map(e=>{let{id:t,icon:i,name:r}=e,o="Download"===r;return{id:t,icon:i,name:r,url:(o?a:s)||"",contentSize:o&&n?(0,p.default)(parseFloat(n),0):""}})})(m[h]??[],u),showCopyButton:!0,copyUrl:I?.permalink}),(0,t.jsx)("div",{className:g.default.condensedButtonWrapper,"data-testid":"play-button-small",children:(0,t.jsx)(f.default,{isPlaying:O,onClick:M})})]})]})}},859029,218467,e=>{"use strict";e.s(["default",()=>n],859029);var t=e.i(857727);e.i(704334);var i=e.i(836908),r=e.i(809243),s=e.i(250194);function n(e){let{guide:n}=e;if(!n)return null;let{formattedTimeRange:a,isLive:o,isSoon:l,isScheduled:d}=(0,r.getPlaylistDateDetails)(n),u="small",h=l&&"Soon"||o&&"Live"||d&&"Scheduled"||"",c=l&&"breaking"||o&&"live"||"badge";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(i.Lozenge,{radius:"sm",size:u,variant:c,insideCard:!1,"data-testid":"schedule-lozenge",children:[o&&(0,t.jsx)(i.Lozenge.Icon,{icon:s.CircleIcon}),(0,t.jsx)(i.Lozenge.Text,{text:h,variant:c,size:u})]}),(0,t.jsx)("span",{"data-testid":"schedule-time",className:"subtitle2",children:a})]})}e.s(["default",()=>d],218467);var a=e.i(738286);function o(e,t){return Number(t?.publishDate?.unixEpochMilli)-Number(e?.publishDate?.unixEpochMilli)}function l(e,t){return void 0!==t.seasonNumber&&void 0!==e.seasonNumber?t.seasonNumber-e.seasonNumber:0}let d=(e,t)=>{let i=e.toLowerCase();
66if("serial"!==i&&"episodic"!==i)return;let r={};"serial"===i?r=t.reduce((e,t)=>{let i,{seasonNumber:r,episodeType:s}=t;return e[i=(0,a.default)(r)?s?.toLowerCase()==="trailer"?"trailer":"extras":r]||(e[i]={groupType:Number(i)?"serial":i,episodes:[],...r&&{seasonNumber:Number(r)}}),e[i].episodes.push(t),e},r):"episodic"===i&&(r=t.reduce((e,t)=>{let{episodeType:i}=t,r=i?.toLowerCase()==="trailer"?"trailer":"episodic";return e[r]||(e[r]={groupType:r,episodes:[]}),e[r].episodes.push(t),e},r));let s=Object.values(r).map(e=>({...e,episodes:e.episodes.sort(o)}));return"serial"===i&&s.sort(l),s}},486773,e=>{e.v({list:"EpisodeList-module__OhcN2G__list",subtitle:"EpisodeList-module__OhcN2G__subtitle"})},552016,e=>{"use strict";e.s(["default",()=>n],552016);var t=e.i(857727),i=e.i(207670);e.i(442376);var r=e.i(531970),r=r,s=e.i(486773);let n=e=>{let{list:n,subTitle:a,clickEventData:o,audioType:l="podcast",isShelf:d=!1}=e;return(0,t.jsxs)("ul",{className:s.default.list,"data-testid":"episode-list",children:[a&&(0,t.jsx)("h3",{className:(0,i.default)("subtitle1",s.default.subtitle),children:a}),n?.map(e=>(0,t.jsx)(r.default,{clickEventData:o,episode:e,audioType:l,isShelf:d,hasTranscript:!!e?.transcript?.id},e.id??e.audio?.url))]})}},817891,e=>{e.v({container:"GroupedPodcastEpisodes-module__bgeB3a__container"})},779373,e=>{e.v({container:"Episodes-module__LxB_da__container",loadMore:"Episodes-module__LxB_da__loadMore"})},442376,822975,e=>{"use strict";e.s([],442376),e.i(859029),e.i(531970),e.i(996093),e.s(["default",()=>m],822975);var t=e.i(857727),i=e.i(585264);e.i(881673);var r=e.i(418446),s=e.i(883339),n=e.i(271645),a=e.i(738286),o=e.i(311182),l=e.i(481026),d=e.i(218467),u=e.i(552016),h=e.i(817891);let c=e=>{let{seriesType:r,list:s}=e,{locale:c}=(0,o.useSiteContext)(),p=(0,i.useTranslations)(),m=(0,n.useMemo)(()=>(0,d.default)(r??"",s),[s,r]),f="Serial"===r?p("Seasons"):p("Episodes");if((0,a.default)(m))return null;let g=m?.find(e=>"extras"===e.groupType),y=m?.find(e=>"trailer"===e.groupType),_=m?.filter(e=>e.groupType===r?.toLowerCase());return(0,t.jsxs)("div",{className:h.default.container,children:[(!(0,a.default)(_)||!(0,a.default)(y))&&(0,t.jsx)(l.ShelfTitle,{children:f}),_&&_.map(e=>{let{groupType:i,episodes:r,seasonNumber:s}=e;if(r.length<=0)return null;let n="serial"===i?`${p("season").toLocaleUpperCase(c)} ${s}`:void 0;return(0,t.jsx)(u.default,{subTitle:n,clickEventData:{elementType:"PodcastSeriesLink"},list:r},n??i)}),y&&!(0,a.default)(y.episodes)&&(0,t.jsx)(u.default,{subTitle:p("trailer").toLocaleUpperCase(c),clickEventData:{elementType:"PodcastSeriesLink"},list:y.episodes}),g&&!(0,a.default)(g.episodes)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.ShelfTitle,{children:p("Extras")}),(0,t.jsx)(u.default,{clickEventData:{elementType:"PodcastSeriesLink"},list:g.episodes})]})]})};var p=e.i(779373);let m=e=>{let{clickEventData:n,list:a=[],hasMore:o,fetchMore:l,loading:d,audioType:h="podcast",isShelf:m=!1,seriesType:f}=e,g=(0,i.useTranslations)();return(0,t.jsxs)("div",{className:p.default.container,children:[m||"podcast"!==h?(0,t.jsx)(u.default,{list:a,clickEventData:n,audioType:h,isShelf:m}):(0,t.jsx)(c,{seriesType:f,list:a}),o&&(0,t.jsx)(r.Button,{className:p.default.loadMore,onClick:()=>{l&&l()},variant:"outline","data-testid":"episodes-load-more-button",disabled:d,size:"lg",children:d?(0,t.jsx)(s.default,{}):g("Load more")})]})}},277e3,e=>{e.v({container:"PodcastSeriesItems-module__IzBn1q__container",desktopOnly:"PodcastSeriesItems-module__IzBn1q__desktopOnly",episodeLabel:"PodcastSeriesItems-module__IzBn1q__episodeLabel",imageWrapper:"PodcastSeriesItems-module__IzBn1q__imageWrapper",img:"PodcastSeriesItems-module__IzBn1q__img",itemContent:"PodcastSeriesItems-module__IzBn1q__itemContent",list:"PodcastSeriesItems-module__IzBn1q__list",listItem:"PodcastSeriesItems-module__IzBn1q__listItem",metaInfo:"PodcastSeriesItems-module__IzBn1q__metaInfo",mobileOnly:"PodcastSeriesItems-module__IzBn1q__mobileOnly",playButton:"PodcastSeriesItems-module__IzBn1q__playButton",scrollArea:"PodcastSeriesItems-module__IzBn1q__scrollArea",seeMoreLink:"PodcastSeriesItems-module__IzBn1q__seeMoreLink",title:"PodcastSeriesItems-module__IzBn1q__title",w
66aveformIcon:"PodcastSeriesItems-module__IzBn1q__waveformIcon"})},632895,e=>{"use strict";e.s(["PodcastSeriesItem",()=>c,"default",()=>h],632895);var t=e.i(857727),i=e.i(207670),r=e.i(86132);e.i(752623);var s=e.i(120764),n=e.i(250194),a=e.i(67405),o=e.i(392695),l=e.i(212313);e.i(442376);var d=e.i(996093),d=d,u=e.i(277e3);function h(e){let{clickEventData:s,items:n,siteName:a,seeMoreHref:o}=e;return(0,t.jsxs)("div",{className:u.default.scrollArea,children:[(0,t.jsx)("ul",{className:u.default.list,children:n.map(e=>(0,t.jsx)("li",{className:u.default.listItem,children:(0,t.jsx)(c,{item:e,allItems:n,siteName:a})},e.title))}),o&&(0,t.jsx)(r.default,{href:o,className:(0,i.default)("body2",u.default.seeMoreLink),clickEventData:{elementText:"View more",clickURL:o,...s},children:"View more"})]})}function c(e){let{item:r,allItems:h=[],siteName:c}=e,{title:p,desktopImage:m,mobileImage:f,seasonNumber:g,episodeNumber:y,displayDate:_,duration:v,media:b}=r,[T,A]=(0,a.useMediaContextV2)(),S=(0,o.mediaIsPlaying)(T.status,b.url,T.activeMediaUrl),E=[null!=g&&`Season ${g}`,null!=y&&`Episode ${y}`].filter(Boolean).join(" "),C=[S?"Pause":"Play",p,null!=v?(0,l.formatDurationSpeech)(v):null].filter(Boolean).join(", "),w=()=>{S?A({type:"PAUSE"}):(A({type:"APPEND_PLAYLIST",payload:{beforeAppend:"clear",playlist:h.map(e=>e.media)}}),A({type:"SET_ACTIVE_MEDIA_AND_PLAY",payload:{media:r.media}}))};return(0,t.jsxs)("div",{className:(0,i.default)(u.default.container,c),itemScope:!0,itemType:"https://schema.org/CreativeWork",role:"button","aria-label":C,tabIndex:0,onClick:w,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"===e.key||" "===e.key)&&w()},children:[(0,t.jsxs)("div",{className:u.default.imageWrapper,children:[f&&(0,t.jsx)(s.default,{src:f,alt:"",crop:"4x3",fill:!0,className:u.default.img,wrapperClassName:u.default.mobileOnly,itemProp:"thumbnailUrl"}),m&&(0,t.jsx)(s.default,{src:m,alt:"",crop:"16x9",fill:!0,className:u.default.img,wrapperClassName:u.default.desktopOnly})]}),(0,t.jsxs)("div",{className:u.default.itemContent,children:[E&&(0,t.jsx)("span",{className:(0,i.default)("body2",u.default.episodeLabel),children:E}),(0,t.jsx)("span",{className:(0,i.default)("subtitle2",u.default.title),itemProp:"headline",children:p}),(_||v)&&(0,t.jsx)(d.default,{displayDateUnixEpochMilli:_,duration:v})]}),(0,t.jsx)("button",{type:"button",className:u.default.playButton,"aria-hidden":"true",tabIndex:-1,"data-site":c,children:S?(0,t.jsx)(n.PauseIcon,{weight:"fill"}):(0,t.jsx)(n.PlayIcon,{weight:"fill"})})]})}},261165,e=>{"use strict";e.s(["default",()=>r]);var t=e.i(857727);let i=(0,e.i(770703).default)(()=>e.A(992211),{loadableGenerated:{modules:[648050]}}),r=e=>{let{embed:r}=e,{audio:s,thumbnail:n,description:a,label:o}=r?.value??{},{id:l,title:d,url:u,duration:h}=s??{},{src:c}=n?.size??{},p=l||r?.refId;return u&&p?(0,t.jsx)(i,{id:p,src:u,name:d||"Unknown",caption:a||d||"",listenTo:o,imagesrc:c,duration:h}):null}},675618,e=>{"use strict";e.s(["default",()=>o],675618);var t=e.i(857727),i=e.i(3303),r=e.i(541969);let s=e=>{let{href:i,lazy:r,width:s,showText:n,showCaptions:a,autoPlay:o,allowFullScreen:l,testId:d="embedded-facebook-video"}=e;return(0,t.jsx)("div",{className:"fb-video","data-href":i,"data-width":s,"data-show-text":n,"data-show-captions":a,"data-autoplay":o,"data-allowfullscreen":l,"data-lazy":r,"data-testid":d})},n=e=>{let{href:i,lazy:r,width:s,testId:n="embedded-facebook-post"}=e;return(0,t.jsx)("div",{className:"fb-post","data-href":i,"data-width":s,"data-lazy":r,"data-testid":n})};function a(e){let{url:a}=e,{hostname:o,pathname:l}=new URL(a),d=l.split("/"),u="fb.watch"===o||d.includes("watch")||d.includes("videos"),h={href:a,lazy:!0};return(0,t.jsxs)(r.default,{sx:{minHeight:u?{xs:"190px",sm:"386px",md:"437px",lg:"383px"}:"120px",".fb-post":{display:"block !important",span:{width:"100% !important",iframe:{width:"100% !important"}}}},children:[(0,t.jsx)(i.default,{src:"https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v11.0",strategy:"lazyOnload"}),u?(0,t.jsx)(s,{...h,showText:!0}):(0,t.jsx)(n,{...h})]})}let o=e=>{let{embed:{value:i}={}}=e;return(0,t.jsx)(a,{url:i?.URL||""})}},763731,757811,e=>{"use strict";e.s(["default",()=>c],763731);var t=e.i(857727),i=e.i(207670),r=e.i(585264),s=e.i(271645);e.s(["default",()=>a],757811);let n=new Set((e=>Array.isArray(e)?e.filter(e=>!e?.font).flatMap(e=>e.code):[])(e.i(134669).default)),a=e=>!!e&&n.has(e);var o=e.i(541969);let l=e=>{let{tag:n="h6",text:{html:l}={},id:d}=e,u=a((0,r.useLocale)());return(0,t.jsx)(o.default,{className:(0,i.default)("rich-text",{"override-heading-font":u}),children:s.default.createElement(n,{"data-testid":"embed-heading",dangerouslySetInnerHTML:{__html:l},id:d})})};l.displayName="EmbedHeading";var d=e.i(738286);e.i(828398);var u=e.i(644949);let h=e=>{let{headingTag:n,value:{target:l,href:d="",body:h},id:c}=e,p=a((0,r.useLocale)());return d?(0,t.jsx)(o.default,{className:(0,i.default)("rich-text",{"override-heading-font":p}),children:s.default.createElement(n,{"data-testid":"embed-hyperlinked-heading"},(0,t.jsx)(u.default,{href:d,target:l,id:c,children:h?.html}))}):(0,t.jsx)(o.default,{className:(0,i.default)("rich-text",{"override-heading-font":p}),children:s.default.createElement(n,{"data-testid":"embed-hyperlinked-heading",id:c},h?.html)})};h.displayName="EmbedHyperlinkedHeading";let c=e=>{let{embed:{value:i}={}}=e,r=i?.tag??"",s=/^h[1-6]$/.test(r)?r:"h6";return!(0,d.default)(i?.link)&&i?.link?(0,t.jsx)(h,{headingTag:s,value:i.link,id:i?.anchorId??""}):(0,t.jsx)(l,{tag:s,text:i?.text,id:i?.anchorId??""})}},261415,e=>{"use strict";e.s(["default",()=>a],261415);var t=e.i(857727),i=e.i(25687),r=e.i(261722);let s=(0,r.styled)("div")` 67 margin: 0; 68`,n=e=>{let{src:r,title:n,width:a,height:o}=e;return(0,t.jsxs)(s,{itemScope:!0,itemType:"https://schema.org/MediaObject",children:[(0,t.jsx)(i.default,{...e}),(0,t.jsx)("meta",{itemProp:"identifier",content:r}),(0,t.jsx)("meta",{itemProp:"url",content:r}),(0,t.jsx)("meta",{itemProp:"headline",content:n||r}),a&&(0,t.jsx)("meta",{itemProp:"width",content:a}),o&&(0,t.jsx)("meta",{itemProp:"height",content:o})]})},a=e=>{let{embed:{value:i}={}}=e,r={title:i?.name,src:i?.url,width:i?.width?.toString(),height:i?.he
68ight?.toString(),iframeJsLibrary:i?.iframeJsLibrary};return(0,t.jsx)(n,{...r})}},443905,716490,e=>{"use strict";e.s(["default",()=>f],443905);var t=e.i(857727),i=e.i(954512),r=e.i(419274),s=e.i(838456);function n(e){let t=e?.unixEpochMilli;if(!t)return!1;let i="string"==typeof t?Number(t):t;return!Number.isNaN(i)&&i<new Date().getTime()}e.s(["default",()=>n],716490);var a=e.i(551429),o=e.i(674107),l=e.i(541969),d=e.i(689820),u=e.i(261722);let h=(0,u.styled)(d.default)` 69 color: ${(0,r.getPalette)("neutral",600)}; 70 margin-top: ${e=>{let{enableMargin:t}=e;return t?"8px":0}}; 71`,c=e=>{let{variant:i="body2",component:r="p",caption:s="",source:n,credit:a="",enableMargin:o=!1,testId:l,...d}=e,u=n||a;return s||u?(0,t.jsxs)(h,{component:r,"data-testid":l?`${l}-caption`:"hero-image-caption",variant:i,enableMargin:o,...d,children:[s,u&&(0,t.jsxs)("span",{itemProp:"name","data-testid":l?`${l}-source`:"hero-image-source",children:[n?" Source: ":" Credit: ",n,n&&a&&" / ",a]})]}):null},p=e=>{let{msg:r}=e,n=(0,i.useTheme)();return(0,t.jsx)(s.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:10,color:n.palette.neutral[0]},children:(0,t.jsx)(d.default,{variant:"body1",children:r||"Image no longer available"})})},m=e=>{let{id:d,src:u,title:h,caption:m="",alt:f,source:g,credit:y="",width:_,height:v,imageExpiry:b}=e,T=_&&v,[A,S]=T?[_,v]:a.default["16x9"],E=(0,i.useTheme)(),C=n(b);return(0,t.jsx)(l.default,{children:(0,t.jsxs)("div",{itemScope:!0,itemType:"https://schema.org/ImageObject",id:d,"data-testid":"embedded-image",children:[(0,t.jsxs)(s.Box,{sx:{position:"relative",textAlign:"center",...!T?{"> span, > span > img":{position:"static !important"},"> span > img":{height:"auto !important",width:"auto !important"}}:{}},children:[C?(0,t.jsx)(p,{msg:"Image no longer available"}):null,(0,t.jsx)(o.default,{src:C?"":u,alt:(f||h)??"",width:A,height:S,sizes:`(min-width:${E.maxContainerWidth}) ${E.calcMaxWidth(8)}px, ${(0,r.getMediaCondition)(E)("up","md")} 83vw, 100vw`,loading:"lazy",dark:C,style:{width:"100%",height:"100%"}})]}),(0,t.jsx)(c,{component:"div",variant:"subtitle2",mb:1,caption:m,source:g,credit:y,textAlign:"ltr"===E.direction?"left":"center",enableMargin:!0,testId:"embedded-image"}),(0,t.jsx)("meta",{itemProp:"name",content:h}),_?(0,t.jsx)("meta",{itemProp:"width",content:`${_}`}):"",v?(0,t.jsx)("meta",{itemProp:"height",content:`${v}`}):"",(0,t.jsx)("meta",{itemProp:"identifier",content:d})]})})};m.displayName="EmbedImage";let f=m},769893,e=>{"use strict";e.s(["default",()=>d],769893);var t=e.i(857727),i=e.i(3303),r=e.i(261722),s=e.i(946347),n=e.i(45607),a=e.i(541969);let o=(0,r.styled)("div")` 72 position: relative; 73 iframe { 74 max-width: 540px; 75 width: 100%; 76 } 77`,l=e=>{let{url:r}=e;return(0,t.jsx)(n.default,{onLoad:()=>{window.instgrm?.Embeds?.process?.()},children:(0,t.jsxs)(a.default,{children:[(0,t.jsx)(i.default,{src:"//www.instagram.com/embed.js",strategy:"lazyOnload"}),(0,t.jsx)(o,{children:(0,t.jsx)("blockquote",{className:"instagram-media","data-instgrm-captioned":!0,"data-instgrm-permalink":r,"data-instgrm-version":"13",children:(0,t.jsx)(s.default,{variant:"rectangular",sx:{maxWidth:540},height:600})})})]})})},d=e=>{let{embed:{value:i}={}}=e;return(0,t.jsx)(l,{url:i?.URL||""})}},785053,e=>{"use strict";e.s(["default",()=>a],785053);var t=e.i(857727);e.i(828398);var i=e.i(644949);e.i(530914);var r=e.i(918719),s=e.i(913208);let n=e=>{let{html:n,href:a,clickEventData:o,fontSize:l,...d}=e;if(!a)return null;let u=a?.startsWith("#"),h=o?.elementType??"LinkEmbed";return u?(0,t.jsx)("a",{href:a,"data-testid":"anchor-link",style:{display:"inline",overflowWrap:"anywhere",...void 0!==l&&{fontSize:l}},"data-clickevent":(0,r.createClickEventAttribute)({...o,elementType:h,clickURL:a,clickType:s.ClickType.ClickSource}),children:n&&(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:n}})}):(0,t.jsx)(i.default,{display:"inline",my:5,href:a,sx:{overflowWrap:"anywhere",...void 0!==l&&{fontSize:l},textDecorationColor:"color-mix(in srgb, currentColor 40%, transparent)","&:hover":{textDecorationThickness:"3px"}},clickEventData:{...o,elementType:h,clickURL:a},...d,children:n&&(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:n}})})},a=e=>{let{embed:{value:i}={}}=e;return(0,t.jsx)(n,{href:i?.route?.permalink||i?.href,html:i?.body?.html,...i?.target&&{target:i.target}})}},402217,e=>{"use strict";e.s(["default",()=>a]);var t=e.i(857727),i=e.i(770703),r=e.i(149451),s=e.i(19508);let n=(0,i.default)(()=>e.A(992211),{loadableGenerated:{modules:[648050]}}),a=e=>{let{embed:i}=e,{podcastEpisode:a,thumbnail:o,description:l,label:d}=i?.value??{},{route:u,audio:h,publishDate:c,audioLanguage:p,podcastSeries:m=[],audioFileSize:f="0",headline:g}=a??{},{id:y,title:_,url:v,duration:b}=h??{},{brand:T,siteName:A,routePaths:S,permalink:E}=u??{},{src:C}=o?.size??{},w=y||i?.refId;if(!v||!w)return null;let k=[],x=T||A||"",I=x?.length>0,D=m?.[0]?.id,P=c?.utcDateTime||void 0,L=(0,r.default)(P).format("DD/MM/YYYY"),R=Array.isArray(S)&&S.length>0,M=S&&R?S[0]:null;R&&M&&k.push({id:"read-more",icon:"read more",name:"Read More",target:"_blank",url:M});let O=(0,s.default)(parseFloat(f));k.push({id:"download",icon:"Download",name:"Download",target:"_self",contentSize:O,url:v});let N={id:w,src:v,name:_||"Unknown",caption:l||g||_||"",listenTo:d,imagesrc:C,duration:b,page:E||"",language:p||"Unknown",belongsTo:I?`SBS ${x}`:"SBS",publishedDate:L,moreOptionsList:k,seriesId:D};return(0,t.jsx)(n,{clickEventData:{elementType:"PodcastEmbed"},...N})}},484782,e=>{"use strict";e.s(["default",()=>h],484782);var t=e.i(857727),i=e.i(541969),r=e.i(689820),s=e.i(261722),n=e.i(419274);let a=(0,s.styled)(r.default)` 78 display: inline-block; 79 font-style: normal; 80 margin-top: ${(0,n.getSpacing)(1)}; 81 82 ${e=>{let{theme:t}=e;return t.breakpoints.up("md")}} { 83 margin-top: ${(0,n.getSpacing)(2)}; 84 } 85`,o=(0,s.styled)("blockquote")` 86 border: 0; 87 border-color: ${(0,n.getPalette)("secondary","main")}; 88 border-style: solid; 89 border-${(0,n.getDirection)("left","right")}-width: 4px; 90 padding: 0; 91 padding-${(0,n.getDirection)("left","right")}: ${(0,n.getSpacing)(2)}; 92
93 ${(0,n.getBreakpoint)("up","md")} { 94 padding-${(0,n.getDirection)("left","right")}: ${(0,n.getSpacing)(3)}; 95 } 96`,l=(0,s.styled)(r.default)` 97 margin-top: 0; 98 margin-bottom: 0; 99 100 &:before { 101 content: ${e=>{let{theme:t}=e;return"ltr"===t.direction?'"â"':'"â"'}}; 102 } 103 104 &:after { 105 content: ${e=>{let{theme:t}=e;return"ltr"===t.direction?'"â"':'"â"'}}; 106 } 107`,d=e=>{let{quote:i,author:r}=e;return(0,t.jsxs)(o,{children:[(0,t.jsx)(l,{variant:"h4",component:"div",children:i}),r&&(0,t.jsx)(a,{variant:"subtitle2",component:"cite",children:r})]})},u=e=>{let{quote:r,attribution:s}=e;return(0,t.jsx)(i.default,{children:(0,t.jsx)(d,{author:s,quote:r})})};u.displayName="EmbedQuote";let h=e=>{let{embed:{value:i}={}}=e;return(0,t.jsx)(u,{quote:i?.quote||"",attribution:i?.attribution})}},574810,e=>{"use strict";e.s(["Wrapper",()=>b,"default",()=>T],574810);var t=e.i(857727),i=e.i(261722),r=e.i(954512),s=e.i(838456),n=e.i(782904),a=e.i(290765),o=e.i(419274);e.i(50019);var l=e.i(992036);e.i(828398);var d=e.i(644949),u=e.i(674107),h=e.i(585264);let c=(0,i.styled)(s.Box,{shouldForwardProp:e=>"$customVariant"!==e})` 108 background-color: ${(0,o.getPalette)("neutral",100)}; 109 110 ${(0,o.getBreakpoint)("up","xs")} { 111 padding-top: ${(0,o.getSpacing)(0)}; 112 } 113 114 ${e=>{let{$customVariant:t}=e;return(0,o.getCustomVariant)("StyledRelatedContent",t)}} 115`;function p(e){let{children:i,...n}=e,a="rtl"===(0,r.useTheme)().direction;return(0,t.jsx)(s.Box,{bgcolor:"neutral.200",minWidth:115,height:65,position:"relative",...a?{mr:0,ml:2}:{mr:2,ml:0},...n,children:i})}function m(e){let{children:i,...r}=e,{isHover:s,...a}=(0,l.useHover)();return(0,t.jsx)(n.Typography,{variant:"body1",color:e=>s?e.palette.link?.hover:"neutral.600",...a,...r,children:i})}function f(e){let{children:i,...r}=e;return(0,t.jsx)(n.Typography,{variant:"subtitle2",pt:{xs:2,md:3},color:"neutral.600",fontWeight:700,mb:2,...r,children:i})}let g=e=>{let{id:i,label:r,itemTitle:s,image:n,url:o,target:l}=e,g=(0,h.useTranslations)(),y=`Image for read more article '${r}'`;return(0,t.jsxs)(c,{itemScope:!0,itemType:"https://schema.org/CreativeWork",p:[2,3],"data-layer-event-source-placement":"body","data-layer-event-source-title":"read more","data-layer-event-source-type":"read more","data-testid":"body-read-more-card",children:[r&&(0,t.jsx)(f,{children:"READ MORE"===r?g("READ MORE"):r}),(0,t.jsx)(d.default,{underline:"none",href:o,"aria-label":s,linkTarget:l,clickEventData:{elementText:s,elementType:"RelatedContentEmbed",clickURL:o},children:(0,t.jsxs)(a.Stack,{direction:"row",children:[i&&(0,t.jsx)("meta",{content:i,itemProp:"identifier"}),(0,t.jsx)(p,{"data-testid":"embed-read-more-image-box",children:(0,t.jsx)(u.default,{title:y,src:n||"",alt:"",sizes:"115px",width:115,height:65,style:{objectFit:"cover"},itemProp:"thumbnailUrl"})}),(0,t.jsx)(m,{itemProp:"headline",variant:"body1",children:s})]})})]})};g.displayName="EmbedRelatedContent";var y=e.i(738286);e.i(591523);var _=e.i(837830);let v=["article","collection-page","podcast","podcast-episode","video","live-blog","creative",e.i(972640).CONTENT_TYPES.SBS_PAGE,"recipe"],b=(0,i.styled)("div",_.default)(e=>{let{theme:t}=e;return{margin:`${t.spacing(5)} 0`}}),T=e=>{let{embed:{value:i}={}}=e;if(!i?.items)return null;let r=i.items.filter(e=>e.linkUrl||e?.route&&v.includes(e.route.contentType));return(0,y.default)(r)?(0,t.jsx)("br",{}):(0,t.jsx)(b,{children:r.map((e,r)=>{let{image:s,route:n,linkUrl:a}=e;return(n?.permalink||a)&&(!n||v.includes(n.contentType))?(0,t.jsx)(g,{id:n?.UUID,label:0===r&&i.label||"",itemTitle:e.title,image:s,url:n?.permalink||a,target:e.linkTarget},e.title):null})})}},523173,e=>{"use strict";e.s(["default",()=>a],523173);var t=e.i(857727),i=e.i(3303),r=e.i(45607),s=e.i(541969);function n(e){let{url:n}=e;return(0,t.jsx)(r.default,{onLoad:()=>{window.twttr?.widgets?.load?.()},children:(0,t.jsxs)(s.default,{"data-testid":"embedded-tweet",children:[(0,t.jsx)(i.default,{src:"https://platform.twitter.com/widgets.js",strategy:"lazyOnload"}),(0,t.jsx)("blockquote",{className:"twitter-tweet",children:(0,t.jsx)("a",{href:n})})]})})}let a=e=>{let{embed:{value:i,type:r}={}}=e;return(0,t.jsx)(n,{url:"x"===r?i?.URL?.replace("x.com","twitter.com")||"":i?.U
115RL||""})}},935655,e=>{"use strict";e.s(["default",()=>r]);var t=e.i(857727);let i=(0,e.i(770703).default)(()=>e.A(372672),{loadableGenerated:{modules:[697133]}}),r=e=>{let{embed:{value:r}={}}=e;if(!r)return null;let s=r.caption?.text||r.thumbnailImage?.alt,n=r.videoProvider?.mpxId?.split("/").pop(),a=r?.taxonomies;return(0,t.jsx)(i,{caption:s,brightspotId:r?.id,mpxId:parseInt(n,10),light:!0,taxonomies:a})}},640858,e=>{"use strict";e.s(["default",()=>r]);var t=e.i(857727);let i=(0,e.i(770703).default)(()=>e.A(330597),{loadableGenerated:{modules:[305881]}}),r=e=>{let{embed:{value:r}={}}=e;return(0,t.jsx)(i,{url:r?.URL||""})}},616346,(e,t,i)=>{"use strict";let r;Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(s)};let s=new Uint8Array(16)},512285,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,i.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},317606,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e.r(512285));i.default=function(e){return"string"==typeof e&&r.default.test(e)}},955766,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,i.unsafeStringify=n;var r=function(e){return e&&e.__esModule?e:{default:e}}(e.r(317606));let s=[];for(let e=0;e<256;++e)s.push((e+256).toString(16).slice(1));function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase()}i.default=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=n(e,t);if(!(0,r.default)(i))throw TypeError("Stringified UUID is invalid");return i}},199103,(e,t,i)=>{"use strict";let r,s;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e.r(616346)),a=e.r(955766);let o=0,l=0;i.default=function(e,t,i){let d=t&&i||0,u=t||Array(16),h=(e=e||{}).node||r,c=void 0!==e.clockseq?e.clockseq:s;if(null==h||null==c){let t=e.random||(e.rng||n.default)();null==h&&(h=r=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==c&&(c=s=(t[6]<<8|t[7])&16383)}let p=void 0!==e.msecs?e.msecs:Date.now(),m=void 0!==e.nsecs?e.nsecs:l+1,f=p-o+(m-l)/1e4;if(f<0&&void 0===e.clockseq&&(c=c+1&16383),(f<0||p>o)&&void 0===e.nsecs&&(m=0),m>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");o=p,l=m,s=c;let g=((0xfffffff&(p+=122192928e5))*1e4+m)%0x100000000;u[d++]=g>>>24&255,u[d++]=g>>>16&255,u[d++]=g>>>8&255,u[d++]=255&g;let y=p/0x100000000*1e4&0xfffffff;u[d++]=y>>>8&255,u[d++]=255&y,u[d++]=y>>>24&15|16,u[d++]=y>>>16&255,u[d++]=c>>>8|128,u[d++]=255&c;for(let e=0;e<6;++e)u[d+e]=h[e];return t||(0,a.unsafeStringify)(u)}},902092,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e.r(317606));i.default=function(e){let t;if(!(0,r.default)(e))throw TypeError("Invalid UUID");let i=new Uint8Array(16);return i[0]=(t=parseInt(e.slice(0,8),16))>>>24,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i[4]=(t=parseInt(e.slice(9,13),16))>>>8,i[5]=255&t,i[6]=(t=parseInt(e.slice(14,18),16))>>>8,i[7]=255&t,i[8]=(t=parseInt(e.slice(19,23),16))>>>8,i[9]=255&t,i[10]=(t=parseInt(e.slice(24,36),16))/0x10000000000&255,i[11]=t/0x100000000&255,i[12]=t>>>24&255,i[13]=t>>>16&255,i[14]=t>>>8&255,i[15]=255&t,i}},619973,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.URL=i.DNS=void 0,i.default=function(e,t,i){function o(e,n,a,o){var l;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));let t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i));return t}(e)),"string"==typeof n&&(n=(0,s.default)(n)),(null==(l=n)?void 0:l.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let d=new Uint8Array(16+e.length);if(d.set(n),d.set(e,n.length),(d=i(d))[6]=15&d[6]|t,d[8]=63&d[8]|128,a){o=o||0;for(let e=0;e<16;++e)a[o+e]=d[e];return a}return(0,r.unsafeStringify)(d)}try{o.name=e}catch(e){}return o.DNS=n,o.URL=a,o};
115var r=e.r(955766),s=function(e){return e&&e.__esModule?e:{default:e}}(e.r(902092));let n="6ba7b810-9dad-11d1-80b4-00c04fd430c8";i.DNS=n;let a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";i.URL=a},631342,(e,t,i)=>{"use strict";function r(e){return(e+64>>>9<<4)+14+1}function s(e,t){let i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function n(e,t,i,r,n,a){var o;return s((o=s(s(t,e),s(r,a)))<<n|o>>>32-n,i)}function a(e,t,i,r,s,a,o){return n(t&i|~t&r,e,t,s,a,o)}function o(e,t,i,r,s,a,o){return n(t&r|i&~r,e,t,s,a,o)}function l(e,t,i,r,s,a,o){return n(t^i^r,e,t,s,a,o)}function d(e,t,i,r,s,a,o){return n(i^(t|~r),e,t,s,a,o)}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,i.default=function(e){if("string"==typeof e){let t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let i=0;i<t.length;++i)e[i]=t.charCodeAt(i)}return function(e){let t=[],i=32*e.length,r="0123456789abcdef";for(let s=0;s<i;s+=8){let i=e[s>>5]>>>s%32&255,n=parseInt(r.charAt(i>>>4&15)+r.charAt(15&i),16);t.push(n)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[r(t)-1]=t;let i=0x67452301,n=-0x10325477,u=-0x67452302,h=0x10325476;for(let t=0;t<e.length;t+=16){let r=i,c=n,p=u,m=h;i=a(i,n,u,h,e[t],7,-0x28955b88),h=a(h,i,n,u,e[t+1],12,-0x173848aa),u=a(u,h,i,n,e[t+2],17,0x242070db),n=a(n,u,h,i,e[t+3],22,-0x3e423112),i=a(i,n,u,h,e[t+4],7,-0xa83f051),h=a(h,i,n,u,e[t+5],12,0x4787c62a),u=a(u,h,i,n,e[t+6],17,-0x57cfb9ed),n=a(n,u,h,i,e[t+7],22,-0x2b96aff),i=a(i,n,u,h,e[t+8],7,0x698098d8),h=a(h,i,n,u,e[t+9],12,-0x74bb0851),u=a(u,h,i,n,e[t+10],17,-42063),n=a(n,u,h,i,e[t+11],22,-0x76a32842),i=a(i,n,u,h,e[t+12],7,0x6b901122),h=a(h,i,n,u,e[t+13],12,-0x2678e6d),u=a(u,h,i,n,e[t+14],17,-0x5986bc72),n=a(n,u,h,i,e[t+15],22,0x49b40821),i=o(i,n,u,h,e[t+1],5,-0x9e1da9e),h=o(h,i,n,u,e[t+6],9,-0x3fbf4cc0),u=o(u,h,i,n,e[t+11],14,0x265e5a51),n=o(n,u,h,i,e[t],20,-0x16493856),i=o(i,n,u,h,e[t+5],5,-0x29d0efa3),h=o(h,i,n,u,e[t+10],9,0x2441453),u=o(u,h,i,n,e[t+15],14,-0x275e197f),n=o(n,u,h,i,e[t+4],20,-0x182c0438),i=o(i,n,u,h,e[t+9],5,0x21e1cde6),h=o(h,i,n,u,e[t+14],9,-0x3cc8f82a),u=o(u,h,i,n,e[t+3],14,-0xb2af279),n=o(n,u,h,i,e[t+8],20,0x455a14ed),i=o(i,n,u,h,e[t+13],5,-0x561c16fb),h=o(h,i,n,u,e[t+2],9,-0x3105c08),u=o(u,h,i,n,e[t+7],14,0x676f02d9),n=o(n,u,h,i,e[t+12],20,-0x72d5b376),i=l(i,n,u,h,e[t+5],4,-378558),h=l(h,i,n,u,e[t+8],11,-0x788e097f),u=l(u,h,i,n,e[t+11],16,0x6d9d6122),n=l(n,u,h,i,e[t+14],23,-0x21ac7f4),i=l(i,n,u,h,e[t+1],4,-0x5b4115bc),h=l(h,i,n,u,e[t+4],11,0x4bdecfa9),u=l(u,h,i,n,e[t+7],16,-0x944b4a0),n=l(n,u,h,i,e[t+10],23,-0x41404390),i=l(i,n,u,h,e[t+13],4,0x289b7ec6),h=l(h,i,n,u,e[t],11,-0x155ed806),u=l(u,h,i,n,e[t+3],16,-0x2b10cf7b),n=l(n,u,h,i,e[t+6],23,0x4881d05),i=l(i,n,u,h,e[t+9],4,-0x262b2fc7),h=l(h,i,n,u,e[t+12],11,-0x1924661b),u=l(u,h,i,n,e[t+15],16,0x1fa27cf8),n=l(n,u,h,i,e[t+2],23,-0x3b53a99b),i=d(i,n,u,h,e[t],6,-0xbd6ddbc),h=d(h,i,n,u,e[t+7],10,0x432aff97),u=d(u,h,i,n,e[t+14],15,-0x546bdc59),n=d(n,u,h,i,e[t+5],21,-0x36c5fc7),i=d(i,n,u,h,e[t+12],6,0x655b59c3),h=d(h,i,n,u,e[t+3],10,-0x70f3336e),u=d(u,h,i,n,e[t+10],15,-1051523),n=d(n,u,h,i,e[t+1],21,-0x7a7ba22f),i=d(i,n,u,h,e[t+8],6,0x6fa87e4f),h=d(h,i,n,u,e[t+15],10,-0x1d31920),u=d(u,h,i,n,e[t+6],15,-0x5cfebcec),n=d(n,u,h,i,e[t+13],21,0x4e0811a1),i=d(i,n,u,h,e[t+4],6,-0x8ac817e),h=d(h,i,n,u,e[t+11],10,-0x42c50dcb),u=d(u,h,i,n,e[t+2],15,0x2ad7d2bb),n=d(n,u,h,i,e[t+9],21,-0x14792c6f),i=s(i,r),n=s(n,c),u=s(u,p),h=s(h,m)}return[i,n,u,h]}(function(e){if(0===e.length)return[];let t=8*e.length,i=new Uint32Array(r(t));for(let r=0;r<t;r+=8)i[r>>5]|=(255&e[r/8])<<r%32;return i}(e),8*e.length))}},109832,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var r=n(e.r(619973)),s=n(e.r(631342));function n(e){return e&&e.__esModule?e:{default:e}}i.default=(0,r.default)("v3",48,s.default)},587811,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,i.default={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)}},140883,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var r=a(e.r(587811)),s=a(e.r(616346)),n=e.r(955766);
115function a(e){return e&&e.__esModule?e:{default:e}}i.default=function(e,t,i){if(r.default.randomUUID&&!t&&!e)return r.default.randomUUID();let a=(e=e||{}).random||(e.rng||s.default)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=a[e];return t}return(0,n.unsafeStringify)(a)}},553508,(e,t,i)=>{"use strict";function r(e,t){return e<<t|e>>>32-t}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,i.default=function(e){let t=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6],i=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0];if("string"==typeof e){let t=unescape(encodeURIComponent(e));e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let s=Math.ceil((e.length/4+2)/16),n=Array(s);for(let t=0;t<s;++t){let i=new Uint32Array(16);for(let r=0;r<16;++r)i[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];n[t]=i}n[s-1][14]=(e.length-1)*8/0x100000000,n[s-1][14]=Math.floor(n[s-1][14]),n[s-1][15]=(e.length-1)*8|0;for(let e=0;e<s;++e){let s=new Uint32Array(80);for(let t=0;t<16;++t)s[t]=n[e][t];for(let e=16;e<80;++e)s[e]=r(s[e-3]^s[e-8]^s[e-14]^s[e-16],1);let a=i[0],o=i[1],l=i[2],d=i[3],u=i[4];for(let e=0;e<80;++e){let i=Math.floor(e/20),n=r(a,5)+function(e,t,i,r){switch(e){case 0:return t&i^~t&r;case 1:case 3:return t^i^r;case 2:return t&i^t&r^i&r}}(i,o,l,d)+u+t[i]+s[e]>>>0;u=d,d=l,l=r(o,30)>>>0,o=a,a=n}i[0]=i[0]+a>>>0,i[1]=i[1]+o>>>0,i[2]=i[2]+l>>>0,i[3]=i[3]+d>>>0,i[4]=i[4]+u>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},14915,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var r=n(e.r(619973)),s=n(e.r(553508));function n(e){return e&&e.__esModule?e:{default:e}}i.default=(0,r.default)("v5",80,s.default)},751266,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,i.default="00000000-0000-0000-0000-000000000000"},787796,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e.r(317606));i.default=function(e){if(!(0,r.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},894017,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"NIL",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(i,"parse",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(i,"stringify",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(i,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(i,"v3",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(i,"v4",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(i,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(i,"validate",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(i,"version",{enumerable:!0,get:function(){return l.default}});var r=c(e.r(199103)),s=c(e.r(109832)),n=c(e.r(140883)),a=c(e.r(14915)),o=c(e.r(751266)),l=c(e.r(787796)),d=c(e.r(317606)),u=c(e.r(955766)),h=c(e.r(902092));function c(e){return e&&e.__esModule?e:{default:e}}},275023,e=>{"use strict";e.s(["default",()=>w],275023);var t=e.i(857727),i=e.i(618566),r=e.i(770703),s=e.i(261722),n=e.i(738286);let a=(0,s.styled)("img")` 116 border: none !important; 117 box-shadow: none !important; 118 margin: 0 !important; 119 max-height: 1px !important; 120 max-width: 1px !important; 121 min-height: 1px !important; 122 min-width: 1px !important; 123 opacity: 0 !important; 124 outline: none !important; 125 padding: 0 !important; 126`;var o=e.i(571006),l=e.i(255957);e.i(828398);var d=e.i(644949),u=e.i(674107);let h=(0,l.default)(d.default)` 127 position: relative; 128 aspect-ratio: 1/1; 129`;var c=e.i(271645),p=e.i(797907);let m=e=>e.querySelector("iframe")||null,f=(0,s.styled)(o.default)(e=>{let{theme:t}=e;return` 130 min-height: 450px; 131 position: relative; 132 ${t.breakpoints.down("sm")} { 133 min-height: 300px; 134 } 135`});var g=e.i(25687),y=e.i(863665),_=e.i(946347),v=e.i(21019);let b=e.r(894017),T=(0,r.default)(()=>e.A(482842),{loadableGenerated:{modules:[751077]}}),A=(0,r.default)(()=>
135e.A(212423),{loadableGenerated:{modules:[819332]}}),S={SponsorBlock:e=>{let{sponsors:i=[]}=e;return 0===i.length?null:(0,t.jsx)(o.default,{display:"grid",gridTemplateColumns:{xs:"repeat(3, 1fr)",md:"repeat(4, 1fr)",lg:"repeat(6, 1fr)"},gap:{xs:2,md:3},children:i.map(e=>{let{name:i,url:r,img:s}=e;return(0,t.jsx)(h,{title:i,href:r,display:"block",isExternal:!0,linkTarget:"_blank",children:(0,t.jsx)(u.default,{alt:i,src:s,fill:!0,style:{objectFit:"contain"}})},r)})})},FlourishWidget:e=>{let{story:r}=e,[s,n]=(0,c.useState)(!1),a=(0,c.useRef)(null),{scriptLoaded:o}=((e,t)=>{let r=(0,i.usePathname)(),[s,n]=(0,c.useState)(!1),[a,o]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let i=()=>{let i=document.querySelectorAll(`script[src="${e}"]`);i.length>0&&(i.forEach(e=>{document.body.removeChild(e)}),t&&t.forEach(e=>{window[e]&&delete window[e]}))};return i(),(()=>{let t=document.createElement("script");t.src=e,t.async=!0,t.setAttribute("data-testid","useDynamicScript-script"),document.body.appendChild(t),t.onload=()=>{n(!0)},t.onerror=()=>o(!0)})(),()=>{i()}},[e,r]),{scriptLoaded:s,error:a}})("https://public.flourish.studio/resources/embed.js",["FlourishLoaded"]);(0,c.useEffect)(()=>{let e,t=()=>{n(!0)};return o&&a?.current?.children&&(e=m(a.current))&&e.addEventListener("load",t),()=>{e&&e.removeEventListener("load",t)}},[o]);let l=o&&s;return(0,t.jsx)(f,{width:"100%","data-src":`story/${r}`,"data-testid":"flourish-widget-container",className:"flourish-embed",ref:a,children:!l&&(0,t.jsx)(p.Skeleton,{variant:"rectangular","data-testid":"flourish-widget-skeleton",sx:{margin:"0 auto",minHeight:"100%",position:"absolute",width:"100%"}})})},TDF2023:e=>{let{embedUrl:i,height:r}=e,s=(0,v.useConfigContext)(),n=(0,c.useRef)(b.v4()),a=(e=>{let t=`${e}&uuid=${n.current}`;return(e=>{try{return new URL(e)}catch(e){return!1}})(e)?t:`${s?.tdf2023?.apiUrl}?${t}`})(i),[o,l]=(0,c.useState)(!1),d=(0,c.useRef)(null),u=(0,c.useRef)(!1);function h(){u.current=!0}return(0,c.useEffect)(()=>(window.addEventListener("focus",h),()=>{window.removeEventListener("focus",h)}),[]),(0,c.useEffect)(()=>{let e,t=()=>l(!0);return d?.current?.children&&(e=m(d.current))&&e.addEventListener("load",t),()=>{e&&e.removeEventListener("load",t)}},[d]),(0,t.jsx)(y.default,{ref:d,children:(0,t.jsxs)(y.default,{children:[!o&&(0,t.jsx)(_.default,{"data-testid":"tdf-2023-widget-skeleton",variant:"rectangular",height:r}),(0,t.jsx)(g.default,{title:"Tour De France Embed",iframeJsLibrary:"None",src:a.toString(),height:`${r}`})]})})},ConversationTrackingPixel:e=>{let{conversationArticleId:i}=e;if((0,n.default)(i))return null;let r=`https://counter.theconversation.com/content/${i}/count.gif?distributor=republish-lightbox-advanced`;return(0,t.jsx)(a,{src:r,alt:"The Conversation",width:"1",height:"1"})}},E=Object.keys(S),C=e=>{let r,{componentId:s,componentConfig:n}=e,a=(0,i.useSearchParams)(),o=a?.get("previewId");if(!E.includes(s))return o?(0,t.jsxs)(T,{"data-testid":"invalid-component-id",severity:"warning",children:[(0,t.jsx)(A,{children:"Custom Component"}),(0,t.jsxs)(A,{fontSize:"small",children:['The "Component ID" (',s,") is not in the AllowedComponentIds array, try one of:"," "]}),(0,t.jsx)("ul",{children:E.map(e=>(0,t.jsx)("li",{children:e},e))})]}):(0,t.jsx)(t.Fragment,{});try{r=n&&JSON.parse(n)}catch(e){return o?(0,t.jsxs)(T,{"data-testid":"invalid-component-config",severity:"warning",children:[(0,t.jsx)(A,{children:"Custom Component"}),(0,t.jsxs)(A,{fontSize:"small",children:['The format of the supplied "Component Config" is incorrect, please make sure you are supplying a valid JSON string.',(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),(0,t.jsx)("code",{dangerouslySetInnerHTML:{__html:e}}),(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),(0,t.jsx)("code",{"data-testid":"component-config",dangerouslySetInnerHTML:{__html:((e,t)=>{let i=(e=>{let t=e.match(/((?!position|column)(?!\s).)(\d+)/g);return t?e.match(/column/g)?(t[0]-1).toString():t[0]:null})(e);if(!i)return t;let r=Number(i),s=t.charAt(r),n=t;return s&&(n=`${t.substring(0,r)}<strong style="color:red">${t.substring(r,r+s.length)}</strong>${t.substring(r+s.length)}`),n})(e.toString(),n)}})]})]}):(0,t.jsx)(t.Fragment,{})}let l=S[s];return(0,t.jsx)(l,{...r})},w=e=>{let{embed:{value:i}={}}=e;return i?.componentId?(0,t.jsx)(C,{componentId:i.componentId,componentConfig:i.componentConfig}):null}},531282,e=>{"use strict";e.s(["default",()=>h],531282);var t=e.i(857727),i=e.i(3303),r=e.i(261722),s=e.i(946347),n=e.i(45607),a=e.i(398071),o=e.i(541969);let l=new a.default("EmbedTikTok"),d=(0,r.styled)("div")` 136 position: relative; 137 iframe { 138 max-width: 605px; 139 width: 100%; 140 } 141`,u=e=>{let{url:r}=e,{cite:a,videoId:u}=(e=>{let t=e.match(/\/video\/(.*)/);return{cite:e,videoId:t?.[1]||""}})(r);a&&u||l.log("EmbedTikTok:","Malformed Embed Url","cite:",a," ","videoId:",u);let h=()=>{let e=Array.from(document.querySelectorAll("blockquote.tiktok-embed"));void 0!==window.tiktokEmbed&&e.length&&window.tiktokEmbed.lib.render(e)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.default,{src:"//www.tiktok.com/embed.js",strategy:"lazyOnload",onLoad:h}),(0,t.jsx)(n.default,{onLoad:h,children:(0,t.jsx)(o.default,{children:(0,t.jsx)(d,{children:(0,t.jsx)("blockquote",{className:"tiktok-embed",cite:a,"data-vi
141deo-id":u,children:(0,t.jsx)(s.default,{variant:"rectangular",sx:{maxWidth:605},width:605,height:722})})})})})]})},h=e=>{let{embed:{value:i}={}}=e;return(0,t.jsx)(u,{url:i?.URL||""})}},499651,e=>{e.v({container:"ShareButtons-module__yCNwyW__container",linkShareButton:"ShareButtons-module__yCNwyW__linkShareButton",linkShareCopied:"ShareButtons-module__yCNwyW__linkShareCopied",shareButtonListItem:"ShareButtons-module__yCNwyW__shareButtonListItem",shareButtonsList:"ShareButtons-module__yCNwyW__shareButtonsList",shareIcon:"ShareButtons-module__yCNwyW__shareIcon",shareIconCopied:"ShareButtons-module__yCNwyW__shareIconCopied",shareIconMedium:"ShareButtons-module__yCNwyW__shareIconMedium",shareLabel:"ShareButtons-module__yCNwyW__shareLabel",shareLink:"ShareButtons-module__yCNwyW__shareLink"})},53495,e=>{"use strict";e.s(["default",()=>n]);var t=e.i(353389),i=e.i(371253),r=e.i(828749),s=e.i(164629);function n(e){let{platform:n,url:a,shareTitle:o,shareImageUrl:l,shareDescription:d}=e;switch(n){case"facebook":return{link:`https://www.facebook.com/sharer/sharer.php?u=${a}`,label:"Facebook",ariaLabel:"Share on Facebook",component:i.FacebookShareButton};case"twitter":return{link:`https://twitter.com/share?url=${a}&text=${encodeURIComponent(o||"")}`,label:"Twitter",ariaLabel:"Share on X (Twitter)",component:s.TwitterShareButton,componentOptions:{title:o}};case"email":return{link:`mailto:?subject=${encodeURIComponent(o||"")}&body=${a}`,label:"Email",ariaLabel:"Share by email",component:t.EmailShareButton,componentOptions:{subject:o}};case"pinterest":return{link:`https://www.pinterest.com/pin/create/button/?url=${a}&media=${encodeURIComponent(l||"")}&description=${encodeURIComponent(d||"")}`,label:"Pinterest",ariaLabel:"Share on Pinterest",component:r.PinterestShareButton,componentOptions:{media:l}};case"link":return{label:"Link Share",ariaLabel:"Copy link"};default:return{label:"Unknown Share",ariaLabel:"Unknown share option"}}}},189910,e=>{"use strict";e.s(["resolveIconVariant",()=>s,"resolveShareData",()=>r,"resolveShareVisibility",()=>i]);var t=e.i(171308);let i=e=>({...t.default,...e}),r=e=>({shareImageUrl:(e=>{let{openGraphMetaView:t,leadImage:i}=e;return t?.images?.[0]?.image?.src||i?.attributes?.size?.src||""})({openGraphMetaView:e?.openGraphMetaView,leadImage:e?.leadImage}),shareTitle:e?.openGraphMetaView?.title||e?.headline,shareDescription:e?.openGraphMetaView?.description}),s=(e,t)=>"outlined"===e?"border":t?"dark":"border"},377252,e=>{"use strict";e.s(["default",()=>c]);var t=e.i(857727),i=e.i(207670);e.i(50019);var r=e.i(799372),s=e.i(250194),n=e.i(849758),a=e.i(36473),o=e.i(913208);e.i(530914);var l=e.i(918719),d=e.i(499651),u=e.i(53495),h=e.i(189910);let c=e=>{let{url:c,clickEventData:p,shareData:m,size:f,variant:g,dark:y}=e,[{copied:_},v]=(0,r.useCopyToClipboard)({resetDelay:2500}),b=(0,u.default)({platform:"link",url:c,...m}),T=(0,h.resolveIconVariant)(g,y);return(0,t.jsxs)("div",{className:d.default.linkShareButton,children:[_&&(0,t.jsxs)("div",{className:d.default.linkShareCopied,children:[(0,t.jsx)(s.CheckIcon,{}),"Copied"]}),(0,t.jsx)(n.default,{onClick:()=>{v(c)},"data-testid":"share-link","aria-label":"Copy Link","data-clickevent":(0,l.createClickEventAttribute)({...p,clickType:o.ClickType.ClickSource,elementType:"button",elementText:b.label||"Copy Link",clickURL:b.link}),variant:T,className:d.default.shareLink,children:(0,t.jsx)(a.default,{name:"link",className:(0,i.default)(d.default.shareIcon,_&&d.default.shareIconCopied,"medium"===f&&d.default.shareIconMedium)})})]})}},29961,e=>{"use strict";e.s(["EmailShareButton",()=>u,"FacebookShareButton",()=>h,"PinterestShareButton",()=>p,"TwitterShareButton",()=>c,"default",()=>m]);var t=e.i(857727),i=e.i(207670),r=e.i(36473),s=e.i(195961);e.i(530914);var n=e.i(918719),a=e.i(913208),o=e.i(53495),l=e.i(499651),d=e.i(189910);let u=e=>(0,t.jsx)(m,{...e,platform:"email"}),h=e=>(0,t.jsx)(m,{...e,platform:"facebook"}),c=e=>(0,t.jsx)(m,{...e,platform:"twitter"}),p=e=>(0,t.jsx)(m,{...e,platform:"pinterest"});function m(e){let{platform:u,url:h,shareData:c,size:p,variant:m,dark:f,clickEventData:g={}}=e,{shareTitle:y,shareImageUrl:_,shareDescription:v}=c,b=(0,o.default)({platform:u,url:h,shareTitle:y,shareImageUrl:_,shareDescription:v}),T=b?.component;if(!T)return null;let A=(0,d.resolveIconVariant)(m,f);return(0,t.jsx)(T,{"aria-label":b.ariaLabel,url:h,"data-clickevent":(0,n.createClickEventAttribute)({elementType:"button",...g,clickType:a.ClickType.ClickSource,elementText:b.label,clickURL:b.link}),resetButtonStyle:!1,className:(0,i.default)(s.default.roundedIconElement,l.default.shareLink),"data-variant":A,"data-testid":`share-${"twitter"===u?"x":u}`,...b.componentOptions||{},children:(0,t.jsx)(r.default,{name:u,className:(0,i.default)(l.default.shareIcon,{[l.default.shareIconMedium]:"medium"===p})})})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.