1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[199,46085,10194,89113,61850,75272,90942,7925],{64961:function(e,t,i){"use strict";function a(e){return null!=e}i.d(t,{D:function(){return a}})},45983:function(e,t,i){"use strict";i.d(t,{C:function(){return r},t:function(){return s}});var a=i(78822),n=i(21465);async function s(e){var t;let i=null!==(t=e.ads_tags)&&void 0!==t?t:"";return(0,a.qu)("tag","getTagLineages_fromContent",{tagLineages:i,content:e}),i}async function r(e){let t=[];return e.made_for_kids&&t.push("kids"),e.ads_tags&&t.push(...(0,n.K)(e.ads_tags.split(","))),(0,a.qu)("tag","getStag_fromContent result",{made_for_kids:e.made_for_kids,stags:t,content:e}),Array.from(new Set(t)).join("|")}},21465:function(e,t,i){"use strict";i.d(t,{K:function(){return s}});var a=i(64961);let n={"tag_zh-TW_cat14":"kids","tag_en-US_cat14":"kids"};function s(e){let t=e.map(e=>(function(e){let t=e.map(e=>n[e]);return t})(e.split("|"))).flat().filter(a.D);return t}},78483:function(e,t,i){"use strict";var a=i(85893),n=i(67294),s=i(67421),r=i(23114),o=i(94330),l=i(278),d=i(73198),c=i(14664),u=i(1622),v=i(79668),h=i(79149),p=i(11877),m=i(44321),f=i(85707),g=i(42527),y=i(97706);let b=e=>{let{channel:t,content:i,subscribedBtnClass:b="text-s13 b588:text-s14 whitespace-nowrap",btnClass:w="text-s13 b588:text-s14 whitespace-nowrap",textClass:A="b588:min-w-[65px] whitespace-nowrap",startIcon:P,endIcon:x,loading:k,disabled:S,customSubscribeBtnText:E,customSubscribedBtnText:T,isHideIfSubscribed:_,isUseButtonV2:j,customSubscribedBtnOnClick:C,dataTestid:I}=e,{t:L}=(0,s.$G)(),N=(0,o.JR)(),{locale:D}=(0,l.ZP)(),M=(0,o.xJ)(),{watchPremiumContent:R}=(0,o.Qe)(),V=(0,c.s)(e=>e.system.isCSR),Z=(0,c.s)(e=>!!Object.keys(e.dialogProvider.dialogs).length),U=(0,n.useRef)(!1),{channelPlans:F,hasChannelSubscription:O,isLoaded:B}=(0,v.Z)(t),{isChannelOwner:q}=(0,h.H)(null==t?void 0:t.id),G=(0,f.Kp)("ContinueSubscribeChannel".concat(null==i?void 0:i.id)),{isSVOD:H,isActiveSubscription:W,isChannelMembership:z}=(0,n.useMemo)(()=>{var e,i;let a=null===(e=t.permission)||void 0===e?void 0:e.svod,n=null===(i=t.permission)||void 0===i?void 0:i.subscription,s=Boolean(O);return{isSVOD:a,isActiveSubscription:s,isChannelMembership:n}},[null==t?void 0:t.id,null==t?void 0:t.permission,O]),{individualPlanOffer:X,promoPlan:$}=(0,p.N)(H,"GJW_INDIVIDUAL_STREAM"),Q=(0,n.useCallback)(async()=>(0,y.L)({userId:M.user_id,content:i,channel:t,channelPlans:F,isSVOD:H,individualPlanOffer:X,promoPlan:$,unmountedRef:U}),[M.user_id,H,t.id,null==i?void 0:i.id,F.length,$,X]);if((0,n.useEffect)(()=>(U.current=!1,()=>{U.current=!0}),[]),(0,n.useEffect)(()=>{M.user_id&&G&&!Z&&B&&(null==F?void 0:F.length)&&!O&&((0,g.UP)("ContinueSubscribeChannel".concat(null==i?void 0:i.id)),Q())},[M.user_id,Z,B,F,O]),(0,n.useEffect)(()=>{(0,u.az)(t,W)},[t.id,W]),!V||!N.subscriptionFeature||!B||q||!H&&!(null==F?void 0:F.length))return null;let K=H&&z?R:W,J=K?T||L("channelSubscription.text.subscribed"):E||L("channelSubscription.text.subscribe"),Y=I||"channel-subscribe-btn",ee=H?"svod":"member",et=K?"subscribed":"unsubscribed";return j?K&&_?null:(0,a.jsx)("span",{className:"contents","data-subscribe-variant":ee,"data-subscribe-state":et,children:(0,a.jsx)(m.Z,{id:"subscribe_btn",theme:"blue",shape:"rounded",isLoading:k,disabled:S,startIcon:P,endIcon:x,onClick:Q,text:J,dataTestid:Y})}):(0,a.jsx)("span",{className:"contents","data-subscribe-variant":ee,"data-subscribe-state":et,children:(0,a.jsx)(d.Z,{id:"subscribe_btn",btnClass:(0,r.Z)("subscribeBtn",w,K&&["subscribed",b]),textClass:(0,r.Z)(A,(e=>{switch(e){case"zh-CN":case"zh-TW":return"text-s13 b588:text-s14";case"ru-RU":return"text-[9.5px] text-s10 b375:text-s14";default:return"text-s16"}})(D)),theme:"gold",loading:k,disabled:S,variant:"contained",startIcon:P,endIcon:x,onClick:K?C:Q,text:J,dataTestid:Y})})};t.Z=(0,n.memo)(b)},97706:function(e,t,i){"use strict";i.d(t,{L:function(){return m}});var a=i(36409),n=i(42527),s=i(53864),r=i(27844),o=i(90229),l=i(17747),d=i(78764),c=i(83636),u=i(19960),v=i(45645),h=i(5152),p=i.n(h);let m=(0,a.Z)(async e=>{var t,i;let{userId:a,content:h,channel:p,channelPlans:m,isSVOD:g,individualPlanOffer:y,promoPlan:b,promoCode:w,unmountedRef:A}=e;if(c.dialogHandler.hasDialog()||a&&(0,l.SQ)())return;let{isAllowedCountry:P}=await (0,o.cO)();if(A.current)return;if(!P){if((0,l.T1)())return;c.dialogHandler.showCustomDialog({Component:v.Z,props:{channel:p,channelPlans:m}});return}let x=await (0,s.wT)();if(null==x.errorMsg&&(null===(t=x.data)||void 0===t?void 0:null===(i=t.list)||void 0===i?void 0:i.length)>0){let k=x.data.list.filter(e=>{var t;return(null==e?void 0:null===(t=e.plan)||void 0===t?void 0:t.name)==p.id&&"PAST_DUE"==e.subs_status});if((null==k?void 0:k.length)>0){c.dialogHandler.showCustomDialog({Component:f,props:{plan:k[0]}});return}}if(g){(0,r.t6)(y,b,d.SUBSCRIPTION_CONTEXT.SVODChannel,!1,w);return}if((0,l.T1)()){(0,n.Z4)("ContinueSubscribeChannel".concat(null==h?void 0:h.id),!0);return}c.dialogHandler.showCustomDialog({Component:u.default,props:{channel:p,content:h,channelPlans:m}})},300),f=p()(async()=>{let e=await i.e(85067).then(i.bind(i,85067));return e.default}
1,{loadableGenerated:{webpack:()=>[85067]},ssr:!1})},79668:function(e,t,i){"use strict";i.d(t,{Z:function(){return v}});var a=i(26042),n=i(69396),s=i(2141),r=i(53864),o=i(94330),l=i(59820),d=i(85707),c=i(42527);let u={isChannelOwner:!1,isChannelManager:!1,channelPlans:[]};function v(e){let t=(0,o.xJ)(),i=(0,o.jY)(),v=(0,d.Kp)("checkEntitlement-".concat(t.user_id,"-").concat(null==e?void 0:e.id));(0,l.ZP)(t.user_id?"UserPurchasedPlans-".concat(t.user_id):null,()=>(0,r.wT)());let{data:h}=(0,l.ZP)((null==e?void 0:e.permission)?"SubscribeChannelButton-".concat(t.user_id,"-").concat(i.id,"-").concat(e.id):null,async()=>{var a,n,o;if(!(null==e?void 0:e.id))return u;let l=i.id===e.id&&"owner"===i.role,d=i.id===e.id&&"manager"===i.role,v=[];if(null===(a=e.permission)||void 0===a?void 0:a.subscription){let h=await (0,r.MY)(e.id);if(v=(null==h?void 0:h.data)||[],t.user_id&&v.length){let p=await (0,s.hK)(e.id,t.user_id),m=Boolean(null===(o=null===(n=p.data)||void 0===n?void 0:n.filter(e=>(null==e?void 0:e.status)=="ACTIVE"))||void 0===o?void 0:o.length);(0,c.Z4)("checkEntitlement-".concat(t.user_id,"-").concat(e.id),m)}}return{isChannelOwner:l,isChannelManager:d,channelPlans:v}},{revalidateIfStale:!1});return h?(0,n.Z)((0,a.Z)({},h),{hasChannelSubscription:v,isLoaded:!0}):(0,n.Z)((0,a.Z)({},u),{hasChannelSubscription:v,isLoaded:!1})}},89779:function(e,t,i){"use strict";var a=i(26042),n=i(69396),s=i(278),r=i(94330),o=i(86967),l=i(59820),d=i(28134),c=i(53864),u=i(29154),v=i(89820),h=i(2141),p=i(42527),m=i(67294),f=i(11591);let g=e=>{let{content:t,seasons:i}=e,{locale:g}=(0,s.ZP)(),y=(0,r.dO)(),{seasonIndex:b=0}=(0,d.up)(t),w=t.tvseries?"".concat(t.id,"_").concat(b):t.id,A=(0,o.e7)(w),P=(0,m.useRef)({}),{episodeList:x}=(0,f.Z)({content:t,seasons:i,seasonIndex:b}),k="TVEpisodesTabs-".concat(t.id,"-").concat(g,"-").concat(A,"-").concat(b,"-").concat(y,"-").concat(!!(null==x?void 0:x.length)),{data:S,isLoading:E}=(0,l.ZP)(k,async()=>{if(!x)return null;let e=new URL(window.location.href),t=e.searchParams.get("orderId"),i="cancel"===e.searchParams.get("act"),s="";if(t&&!i){var r,o;let{data:l}=await (0,c.v1)(t);s=(null==l?void 0:null===(r=l.items)||void 0===r?void 0:null===(o=r[0])||void 0===o?void 0:o.productId)||""}let d=await Promise.all(x.map(async e=>{if(A===u.rI.Free)return(0,n.Z)((0,a.Z)({},e),{no_access_right:!1});if(s&&e.id===s){var t;let i=await (0,v.E0)(()=>(0,h.hK)(e.id,y),2e3,10,t=>{var i,a;return(null===(a=null===(i=t.data)||void 0===i?void 0:i.find(t=>t.ent===e.id))||void 0===a?void 0:a.status)==="ACTIVE"}),r=i.data;return(0,n.Z)((0,a.Z)({},e),{no_access_right:(null===(t=null==r?void 0:r.find(t=>t.ent===e.id))||void 0===t?void 0:t.status)!=="ACTIVE"})}return e}))||[],m=(0,p.N7)(d);return P.current[w]=m,m},u.yL);return E&&!S?P.current[w]:S};t.Z=g},11591:function(e,t,i){"use strict";var a=i(59820),n=i(278),s=i(29154),r=i(42527),o=i(94330),l=i(81739);let d={episodeIds:[],episodeList:[]};t.Z=function(e){var t,i;let{content:c,seasons:u=[],seasonIndex:v,disabled:h}=e,{locale:p}=(0,n.ZP)(),m="TVSeries"===c.type,f=(0,o.xJ)(),g=(0,l.z2)(),{data:y=d}=(0,a.ZP)(!h&&m?{locale:p,id:c.id,name:"useGetMovieOrEpisodes",userId:f.user_id,activeEnt:null==g?void 0:g.ent,seasonIndex:v,seasons:u.map(e=>e.number),episodes:null===(t=u[v])||void 0===t?void 0:null===(i=t.episodes)||void 0===i?void 0:i.length}:null,async e=>{let{seasonIndex:t}=e,i=u[t],a=(null==i?void 0:i.episodes)||[];if(0===a.length)return d;let{contentIds:n,contentList:s}=await (0,r._d)(a,{query:"basic,full,description,movie,translations,watch"});return{episodeIds:n,episodeList:s}},s.yL);return y||d}},23844:function(e,t,i){"use strict";i.d(t,{Z:function(){return Y}});var a=i(26042),n=i(85893),s=i(67294),r=i(34375),o=i(23114),l=i(35131),d=i(67421),c=i(40722),u=i.n(c),v=i(75844),h=i(37929),p=(0,s.memo)(function(e){let{videoEl:t}=e,{t:i}=(0,d.$G)(),a=(0,r.nP)(e=>e.isAdMuted),s=()=>{t&&(t.muted=!1,(0,v.W7)({muted:!1}),r.nP.setState({isAdMuted:!1,mutedDefault:!1}))};return(0,n.jsxs)("div",{className:(0,o.Z)(u().unMuteBtn,a&&u().active),onClick:s,"data-testid":"ad-unmute-btn",children:[(0,n.jsx)(h.default,{name:"UnmuteBannerIcon",className:"w-[15px] h-[15px]"}),(0,n.jsx)("span",{children:i("videojs.tapToUnmute")})]})}),m=i(36409),f=i(111),g=i(8483),y=i(6250),b=i(85518),w=i(18643),A=i(14
1664),P=i(89820);function x(e){let{videoEl:t,className:i,containerEl:a}=e,l=(0,A.s)(e=>e.system.isRealMobile),d=(0,r.nP)(e=>!(e.isEmbed&&e.nativeFullscreen))&&!(0,P.gn)();return(0,s.useEffect)(()=>{if(!a)return;let e,i=(0,m.Z)(()=>{clearTimeout(e),null==a||a.classList.remove("hideControls"),e=setTimeout(n,3e3)},200),n=(0,m.Z)(()=>{null!=t&&t.paused||(null==a||a.classList.add("hideControls"),clearTimeout(e))},200),s=(0,m.Z)(e=>{var t;let s=(null===(t=e.target.nodeName)||void 0===t?void 0:t.toLowerCase())==="button",r=null==a?void 0:a.classList.contains("hideControls");s||r?i():n()},200);return l?a.addEventListener("pointerup",s):(a.addEventListener("mouseover",i),a.addEventListener("mouseleave",n)),()=>{a&&(a.removeEventListener("click",s),a.removeEventListener("mouseenter",i),a.removeEventListener("mouseleave",n))}},[l]),(0,n.jsxs)("div",{className:(0,o.Z)("ad-controls-bar",i),"data-testid":"ad-control-bar",children:[(0,n.jsxs)("div",{className:"control-btns",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(S,{videoEl:t}),(0,n.jsx)(T,{videoEl:t}),(0,n.jsx)("div",{className:(0,o.Z)("adLabel",!!t.duration&&"dotAfter"),"data-testid":"ad-label",children:"Ads"}),!!t.duration&&(0,n.jsx)(k,{videoEl:t})]}),(0,n.jsx)("span",{className:"flex-1"}),d&&(0,n.jsx)("div",{"data-testid":"ad-fullscreen-btn",className:"contents",children:(0,n.jsx)(g.iT,{iconClassName:"w-10 h-8 p-[6.5px]"})})]}),(0,n.jsx)(E,{videoEl:t})]})}let k=e=>{let{videoEl:t}=e,{0:i,1:a}=(0,s.useState)("");return(0,s.useEffect)(()=>{let e=()=>{if(!t)return;let e=t.currentTime,i=t.duration,n=function(e){let t=e=>e<10?"0".concat(e):e,i=Math.floor(e),a=Number(t(Math.floor(i/3600))),n=t(Math.floor(i%3600/60)),s=t(i%60),r="";return a>0&&(r+="".concat(+a,":")),r+="".concat(a>0?n:+n,":").concat(s)}(i-e);a(n)};return t.addEventListener("timeupdate",e),()=>{t.removeEventListener("timeupdate",e)}},[t,t.duration]),(0,n.jsx)("div",{"data-testid":"ad-remaining-time",children:i})},S=e=>{let{videoEl:t}=e,{t:i}=(0,d.$G)(),a=(0,r.nP)(e=>e.isEmbed),{0:o,1:l}=(0,s.useState)(!t.paused),c=(0,s.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),t.paused?(window.player&&(window.player.userRecentAction="play",(0,v.W7)({isPaused:!1})),t.play(),l(!0)):(window.player&&(window.player.userRecentAction="pause",(0,v.W7)({isPaused:!0})),t.pause(),l(!1))},[t]);return((0,s.useEffect)(()=>{let e=()=>{let e=!t.paused;l(e),setTimeout(()=>{if(e)return;let i=t.closest(".adPlayer");null==i||i.classList.remove("hideControls")},0)};return t.addEventListener("pause",e),t.addEventListener("playing",e),()=>{t.removeEventListener("pause",e),t.removeEventListener("pause",e)}},[]),b.tq)?(0,n.jsx)("button",{className:"vds-button play-button",onClick:c,"data-testid":"ad-play-button",children:o?(0,n.jsx)(y.Z.Pause,{}):(0,n.jsx)(y.Z.Play,{})}):(0,n.jsx)(w.Z,{vertical:"top",horizontal:"left",content:"".concat(i(o?"videojs.pause":"videojs.play")," ").concat(!a&&"(k, Space)"),className:"cursor-pointer",children:(0,n.jsx)("button",{className:"vds-button play-button",onClick:c,"data-testid":"ad-play-button",children:o?(0,n.jsx)(y.Z.Pause,{}):(0,n.jsx)(y.Z.Play,{})})})},E=e=>{let{videoEl:t}=e,i=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!i.current)return;i.current.style.transition="width 0.3s linear",i.current.style.willChange="width";let e=(0,f.Z)(()=>{if(!i.current)return;let e=t.currentTime/t.duration*100;i.current.style.width="".concat(e.toFixed(3),"%")},100);return t.addEventListener("timeupdate",e),()=>{t.removeEventListener("timeupdate",e)}},[]),(0,n.jsx)("div",{className:"w-full h-1 flex items-center bg-white/40",children:(0,n.jsx)("div",{ref:i,className:"h-1 bg-[#eebb3b]"})})},T=e=>{let{videoEl:t}=e,{t:i}=(0,d.$G)(),{0:a,1:c}
1=(0,s.useState)(0),{0:h,1:p}=(0,s.useState)(!1),{0:m,1:f}=(0,s.useState)(t.volume),g=(0,r.nP)(e=>e.isEmbed),A=(0,r.nP)(e=>e.isAdMuted),P=(0,r.nP)(e=>e.adState===l.H9.showing);(0,s.useEffect)(()=>{if(!t)return;let e=()=>{f(t.volume),r.nP.setState({isAdMuted:t.muted})};return t.addEventListener("volumechange",e),()=>{t.removeEventListener("volumechange",e)}},[t]),(0,s.useEffect)(()=>{(A||m)&&!P||(t.volume=(0,v.At)({key:"volume",defaultVal:1}),f(t.volume))},[P,A]);let x=(0,s.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),t.muted?(0===t.volume&&(t.volume=1,f(1)),t.muted=!1):t.muted=!0,(0,v.W7)({muted:t.muted}),r.nP.setState({isAdMuted:t.muted}),c(Date.now())},[]),k=(0,s.useCallback)(()=>{p(!0)},[]),S=(0,s.useCallback)(()=>{p(!1)},[]);return(0,n.jsx)("div",{className:"flex items-center",onMouseOverCapture:k,onMouseLeave:S,children:b.tq?(0,n.jsx)("button",{id:"adMuteBtn",className:(0,o.Z)("vds-button",u().floatMuteBtn),onClick:x,"data-testid":"ad-mute-button",children:A||!m?(0,n.jsx)(y.Z.Mute,{className:"py-[5px]"}):m<.25?(0,n.jsx)(y.Z.VolumeLow,{className:"py-[5.5px]"}):m<.7?(0,n.jsx)(y.Z.VolumeHigh,{className:"py-[5.5px]"}):(0,n.jsx)(y.Z.VolumeMax,{className:"py-[5.5px]"})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w.Z,{vertical:"top",horizontal:"left",content:"".concat(i(A?"videojs.unmute":"videojs.mute")).concat(g?"":" (m)"),className:"cursor-pointer",children:(0,n.jsx)("button",{id:"adMuteBtn",className:(0,o.Z)("vds-button",u().floatMuteBtn),onClick:x,"data-testid":"ad-mute-button",children:A||!m?(0,n.jsx)(y.Z.Mute,{className:"py-[5px]"}):m<.25?(0,n.jsx)(y.Z.VolumeLow,{className:"py-[5.5px]"}):m<.7?(0,n.jsx)(y.Z.VolumeHigh,{className:"py-[5.5px]"}):(0,n.jsx)(y.Z.VolumeMax,{className:"py-[5.5px]"})})}),(0,n.jsx)(_,{videoEl:t,volume:m,setVolume:f,className:(0,o.Z)("vds-volume-slider vds-slider",(!h||t.muted)&&"hidden")})]})})},_=e=>{let{volume:t,videoEl:i,className:a}=e,s=e=>{let t=Number(parseFloat(e.target.value).toFixed(2));t>1&&(t=1);let a=0===t;(0,v.W7)({muted:a,volume:t}),r.nP.setState({isAdMuted:a}),i.muted=a,i.volume=t};return(0,n.jsx)("div",{className:"flex items-center",children:(0,n.jsx)("input",{type:"range",min:"0",max:"1",step:"0.01",value:t,onChange:s,className:(0,o.Z)("ad-volume-slider",a),"data-testid":"ad-volume-slider"})})};var j=i(59820),C=i(66754),I=i(29154);function L(){let{t:e}=(0,d.$G)(),t=(0,A.s)(e=>e.system.isRealMobile||e.system.browserWidth<I.h1),i=t&&P.gx,a=(0,s.useCallback)(()=>{let e=document.querySelector(".visit_advertiser");if(e){e.click();return}let t=document.querySelector(".vast-blocker");t&&t.click()},[]);return(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)("div",{className:"visitAdBtn-shadow"}),(0,n.jsxs)("div",{"data-testid":"ad-learn-more",className:(0,o.Z)("visitAdBtn",t&&"mobile",i&&"moveDown"),onClick:a,children:[!t&&(0,n.jsx)(h.default,{name:"DoubleArrowIcon",className:"w-3 h-4"}),(0,n.jsx)("span",{children:e("common.learnMore")})]})]})}var N=i(93041),D=i(42054),M={SKIP_TEXT:"Skip Ads in %%TIME%%",SKIP_BUTTON_TEXT:"Skip Ads",WILL_PLAY_AFTER_AD:"Video will play after ad",DEFAULT_SKIP_TIME:7,DEFAULT_AD_TEXT:"Visit Advertiser",REMAINING_TEXT:"Skip Ads in"},R=i(85479),V=i(77690),Z=i(13290);function U(e){var t;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(F(i))return l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] Google IMA wrapper detected: hiding visit advertiser"),!0;let a=(null===(t=(0,Z.safeLocalStorage)())||void 0===t?void 0:t.getItem("gjw_hide_visit_ad_for_all_vpaid"))==="true";if(a&&O(e))return l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] Feature flag enabled: hiding visit advertiser for JS/VPAID"),!0;let n=B(e);return n&&l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] VPAIDIMA3 fallback: hiding visit advertiser"),n}function F(e){if(!e)return!1;try{let t=new URL(e),i=t.hostname;if(i.endsWith("googlesyndication.com")&&t.pathname.includes("ima3vpaid"))return!0;let a=t.searchParams.get("adtagurl");if(a){let n=decodeURIComponent(a);try{let s=new URL(n);if(s.hostname.endsWith("doubleclick.net"))return!0}catch(r){if(n.includes("doubleclick.net"))return!0}}return!1}catch(o){return e.includes("googlesyndication.com")&&e.includes("ima3vpaid")}}function O(e){var t,i;let a=null===(t=e.creatives)||void 0===t?void 0:t.find(e=>"linear"===e.type);if(!a)return!1;let n=null===(i=a.mediaFiles)||void 0===i?void 0:i[0];return!!n&&(n.mimeType===V.dV.JS||"VPAID"===n.apiFramework)}function B(e){var t,i;let a=null==e?void 0:e.system,n="string"==typeof a?a:"object"==typeof a&&a?null!==(i=null!==(t=a.value)&&void 0!==t?t:a.name)&&void 0!==i?i:a.system:void 0;return"VPAIDIMA3"===n}class q{get onClickVisitAdvertiser(){return this._visitAdvertiserClickHandler}set onClickVisitAdvertiser(e){this._visitAdvertiserClickHandler=e,this.visitAdBtn&&(this.visitAdBtn.onclick=null,this.visitAdBtn.onclick=e)}createAdElements(e,t){var i;if(!this.adPlayer.el)return;this.adContainer||(this.adContainer=this.adPlayer.el.querySelector(".adContainer")),this.adContainer||(this.adContainer=document.createElement("div"),this.adContainer.className="adContainer",this.adPlayer.el.appendChild(this.adContainer));let a=t.extensions||[],n=a.findIndex(e=>"domain"===e.attributes.extensionType);this.adTitle=n>-1?a[n].value.toString():"";let s=e.creatives[0];this.adDuration=s.duration||this.adPlayer.videoEl.duration,this.clickThroughUri=(null===(i=s.videoClickThroughURLTemplate)||void 0===i?void 0:i.url)||"",this.skipAfter=-1;let r=a.findIndex(e=>"skip"===e.attributes.extensionType);if(-1!==r){let o=parseInt(a[r].value.toString(),10);this.skipAfter=Number.isFinite(o)?o:-1}else(null==s?void 0:s.skipDelay)&&(this.skipAfter=s.skipDelay);l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] createAdElements() | Data:",{adBreak:t,adTitle:this.adTitle,duration:this.adDuration,skipAfter:this.skipAfter,clickThroughUri:this.clickThroughUri});let d=this.adPlayer.ad.vmapRequestUrl||"";this.linkWrapper=this.createAdLinkWrapper();let c=U(e,d);c?this.visitAdBtn=void 0:(this.visitAdBtn=this.createVisitAdvertiser(),this.linkWrapper.appendChild(this.visitAdBtn));let u=function(e){var t;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(F(i))return l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] Google IMA wrapper detected: hiding skip button"),!0;let a=(null===(t=(0,Z.safeLocalStorage)())||void 0===t?void 0:t.getItem("gjw_hide_skip_for_all_vpaid"))==="true";if(a&&O(e))return l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] Feature flag enabled: hiding skip for JS/VPAID creative"),!0;let n=B(e);return n&&l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] VPAIDIMA3 fallback: hiding skip button"),n}(e,d);u?this.skipBtn=void 0:(this.skipBtn=this.createVastSkipBtn(),this.linkWrapper.appendChild(this.skipBtn)),this.adContainer.appendChild(this.linkWrapper)}showAdElements(){if(this.skipBtnInterval&&clearInterval(this.skipBtnInterval),l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] showAdElements()",{linkWrapper:this.linkWrapper,skipBtn:this.skipBtn}),!this.linkWrapper){l.j5.ads&&console.error("[".concat((0,C.hf)(),"]"),"[AD] Error: linkWrapper not initialized");return}if(!this.skipBtn){l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] No skip button (IMA/VPAID handles own UI)");return}this.skipBtn.style.visibility="visible";let e=0;this.skipBtnInterval=setInterval(()=>{let t=r.nP.getState().adState;if(t===l.H9.showing){if(!this.adPlayer.state.isPlaying){this.updateSkipBtnTextClass();return}if(e++,this.adDuration&&this.adDuration-e<.5){this.adPlayer.ad.endAdVideo(),clearInterval(this.skipBtnInterval);return}this.skipAfter>0?(this.skipAfter--,this.updateSkipBtnTextClass()):clearInterval(this.skipBtnInterval)}},1e3)}removeAdElements(){this.adContainer&&(l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] remove all Ad Elements"),this.skipBtnInterval&&clearInterval(this.skipBtnInterval),this.skipBtnInterval=void 0,this.adContainer.setAttribute("style",""),this.adContainer.innerHTML="",this.linkWrapper=void 0,this.skipBtn=void 0,this.visitAdBtn=void 0)}dispose(){this.skipBtnInterval&&clearInterval(this.skipBtnInterval),this.skipBtnInterval=void 0,this.removeAdElements()}updateSkipBtnTextClass(){let e=this.skipAfter<0?this.t("videojs.willPlayAfterAd"):0===this.skipAfter?this.t("videojs.skipButtonText"):this.skipAfter.toString();return this.skipBtnTextEl||(this.skipBtnTextEl=document.createElement("span"),this.skipBtnTextEl.className="vast-skip-button-text",this.skipBtnTextEl.setAttribute("data-testid","ad-skip-button-text")),this.skipBtnTextEl.innerHTML=e,this.skipBtnTextEl.classList.remove("longTxt","shortTxt","vLongTxt"),e.length<12?this.skipBtnTextEl.classList.add("shortTxt"):e.length>40?this.skipBtnTextEl.classList.add("vLongTxt"):e.length>30&&this.skipBtnTextEl.classList.add("longTxt"),this.skipBtnTextEl}createAdLinkWrapper(){this.adContainer.innerHTML="",this.adContainer.setAttribute("style","");let e=document.createElement("div");return e.onclick=e=>{e.stopPropagation(),e.preventDefault(),this.adPlayer.state.isPlaying?(window.player&&(window.player.userRecentAction="pause"),this.adPlayer.pause(),(0,v.W7)({isPaused:!0})):(window.player&&(window.player.userRecentAction="play"),this.adPlayer.play(),(0,v.W7)({isPaused:!1}))}
1,e.id="vmap-wrapper",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0",e.style.position="absolute",e}createVisitAdvertiser(){let e=document.createElement("div");return e.className="visit_advertiser",e.innerHTML='<span style="margin-left: 3px"><svg width="12px" height="12px" viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>external link</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Artboard" transform="translate(-886.000000, -95.000000)" fill-rule="nonzero" fill="#FFFFFF">\n <path d="M897.397841,95 C897.704317,95 897.952696,95.2483788 897.952696,95.5548548 L897.952696,99.3770099 C897.952696,99.6834858 897.704317,99.9318646 897.397841,99.9318646 C897.091365,99.9318646 896.842987,99.6834858 896.842987,99.3770099 L896.842987,96.9558497 L891.459403,102.339566 C891.35107,102.447899 891.209025,102.502132 891.067114,102.502132 C890.925202,102.502132 890.783157,102.447899 890.674825,102.339566 C890.458026,102.122901 890.458026,101.77152 890.674825,101.554855 L896.11997,96.1097095 L893.575553,96.1097095 C893.269077,96.1097095 893.020698,95.8613307 893.020698,95.5548548 C893.020698,95.2483788 893.269077,95 893.575553,95 L897.397841,95 Z M895.478636,100.58799 C895.785111,100.58799 896.03349,100.836502 896.03349,101.142844 L896.03349,105.520387 C896.03349,106.33628 895.36977,107 894.553878,107 L887.479613,107 C886.66372,107 886,106.33628 886,105.520387 L886,98.4461224 C886,97.6302301 886.66372,96.9665097 887.479613,96.9665097 L891.872613,96.9665097 C892.179089,96.9665097 892.427467,97.2148885 892.427467,97.5213645 C892.427467,97.8278405 892.179089,98.0762192 891.872613,98.0762192 L887.479613,98.0762192 C887.279071,98.0762192 887.10971,98.2455805 887.10971,98.4461224 L887.10971,105.520387 C887.10971,105.720929 887.279071,105.89029 887.479613,105.89029 L894.553878,105.89029 C894.754419,105.89029 894.923781,105.720929 894.923781,105.520387 L894.923781,101.142844 C894.923781,100.836368 895.17216,100.58799 895.478636,100.58799 Z" id="external-link"></path>\n </g>\n </g>\n </svg></span><span style="margin-left:4px;">'.concat(this.adTitle?this.adTitle:M.DEFAULT_AD_TEXT,"</span>"),e.style.display="none",e.onclick=this.onClickVisitAdvertiser,e}createVastSkipBtn(){var e;let t=document.createElement("div");t.style.display="flex",t.setAttribute("data-testid","ad-skip-button");let i=this.updateSkipBtnTextClass();t.appendChild(i),t.className=(0,o.Z)("vast-skip-button",this.skipAfter>-1&&"skippable"),t.style.visibility="hidden";let a=null===(e=this.adPlayer.ad.video)||void 0===e?void 0:e.poster_url;if(a){let n=document.createElement("div");n.className="vast-skip-thumb",n.setAttribute("data-testid","ad-skip-thumb");let s=document.createElement("img");s.src=(0,R.ab)(a,"thumb",R.fs.SMALL),n.appendChild(s),t.appendChild(n)}let r=this;return t.onclick=e=>{e.stopPropagation(),window.adPlayer&&window.player&&-1!==r.skipAfter&&!(r.skipAfter>0)&&(window.player.userRecentAction="play",(0,v.W7)({isPaused:!1}),window.adPlayer.ad.endAdVideo(!0,!0,"user-skip"),window.adPlayer.ui.removeAdElements())},t}constructor(e,t){this.skipAfter=-1,this.adTitle="",this.adDuration=0,this.clickThroughUri="",this._visitAdvertiserClickHandler=e=>{var t,i,a;if((null===(t=window.adPlayer)||void 0===t?void 0:null===(i=t.ad)||void 0===i?void 0:i.clickThroughUri)&&window.player){e.stopPropagation(),e.preventDefault();try{window.open(window.adPlayer.ad.clickThroughUri,"_blank"),window.player.userRecentAction="pause",window.adPlayer.pause(),null===(a=window.adPlayer.ad.vastTracker)||void 0===a||a.click(),window.adPlayer.event.trigger("vpaid.AdClickThru")}catch(n){}}},this.t=t,this.adPlayer=e,this.adContainer=e.el.querySelector(".adContainer")}}class G{get src(){var e;return null===(e=this.videoEl)||void 0===e?void 0:e.src}get currentTime(){var e;return(null===(e=this.videoEl)||void 0===e?void 0:e.currentTime)||0}get duration(){var e;return(null===(e=this.videoEl)||void 0===e?void 0:e.duration)||0}get getVolume(){var e;return null===(e=this.videoEl)||void 0===e?void 0:e.volume}get isMuted(){var e;return null===(e=this.videoEl)||void 0===e?void 0:e.muted}get isPlaying(){var e;return!(null===(e=this.videoEl)||void 0===e?void 0:e.paused)}constructor(e){this.videoEl=e}}class H{on(e,t){if("function"!=typeof t)throw TypeError("The handler argument must be of type Function. Received type ".concat(typeof t));
1if(!e)throw TypeError("The event argument must be of type String. Received type ".concat(typeof e));return this._handlers.push({event:e,handler:t}),this}once(e,t){return this.on(e,function(e,t,i){let a={fired:!1,wrapFn:void 0};function n(){for(var n=arguments.length,s=Array(n),r=0;r<n;r++)s[r]=arguments[r];a.fired||(e.off(t,a.wrapFn),a.fired=!0,i.bind(e)(...s))}return a.wrapFn=n,n}(this,e,t))}off(e,t){return this._handlers=this._handlers.filter(i=>i.event!==e||i.handler!==t),this}offAll(e){return this._handlers=this._handlers.filter(t=>t.event!==e),this}emit(e){for(var t=arguments.length,i=Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];let n=!1;return this._handlers.forEach(t=>{"*"===t.event&&(n=!0,t.handler(e,...i)),t.event===e&&(n=!0,t.handler(...i))}),n}removeAllListeners(e){return e?(this._handlers=this._handlers.filter(t=>t.event!==e),this):(this._handlers=[],this)}listenerCount(e){return this._handlers.filter(t=>t.event===e).length}listeners(e){return this._handlers.reduce((t,i)=>(i.event===e&&t.push(i.handler),t),[])}eventNames(){return this._handlers.map(e=>e.event)}constructor(){this._handlers=[]}}class W extends H{addMainVideoListeners(){var e;if(!(null===(e=window.player)||void 0===e?void 0:e.el))return;this.removeMainVideoListeners();let t=window.player.el.querySelector("video");if(!t)return;let i=e=>{this.emit("play",e)},a=e=>{this.emit("loadedmetadata",e)},n=(0,f.Z)(e=>{var t;this.emit("timeupdate",e),null===(t=window.adPlayer)||void 0===t||t.ad.onVideoTimeUpdate()},1e3),s=e=>{this.emit("canplay",e)},r=e=>{this.emit("seeked",e)},o=e=>{this.emit("ended",e)};t.addEventListener("play",i),t.addEventListener("loadedmetadata",a),t.addEventListener("timeupdate",n),t.addEventListener("canplay",s),t.addEventListener("seeked",r),t.addEventListener("ended",o),this._listeners.push(()=>{n.cancel(),t.removeEventListener("play",i),t.removeEventListener("loadedmetadata",a),t.removeEventListener("timeupdate",n),t.removeEventListener("canplay",s),t.removeEventListener("seeked",r),t.removeEventListener("ended",o)})}addAdVideoListeners(){if(!this.adPlayer.el)return;this.removeAdVideoListeners();let e=this.adPlayer.videoEl||this.adPlayer.el.querySelector("video");if(!e)return;let t=e=>{var t;if(!(null===(t=window.adPlayer)||void 0===t?void 0:t.el)||!window.player)return;let{adState:i,isPreRoll:a}=r.nP.getState(),n=window.adPlayer,s=window.player;if(l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] onAdPlay | adState:",(0,P.$O)(i,l.H9)," | isMuted",n.state.isMuted," | isPreRoll",a),[l.H9.hidden,l.H9.countDown].includes(i)||i===l.H9.showing&&"pause"===s.userRecentAction){n.pause();return}this.emit("play",e)},i=e=>{if(!window.adPlayer||!window.player)return;let{adState:t,isPreRoll:i}=r.nP.getState(),a=window.adPlayer;if(a.videoEl.duration&&a.videoEl.duration-a.videoEl.currentTime<.5){a.ad.endAdVideo();return}l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] onAdPaused | adState:",(0,P.$O)(t,l.H9)," | isMuted",a.state.isMuted," | isPreRoll",i),t===l.H9.showing&&r.nP.setState({playerStatus:l.GZ.Paused}),this.emit("pause",e)},n=(0,m.Z)(()=>{var e;if(!(null===(e=window.adPlayer)||void 0===e?void 0:e.el))return;let{adState:t,isPreRoll:i}=r.nP.getState();l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] onAdCanPlay | adState:",(0,P.$O)(t,l.H9)," | isMuted",window.adPlayer.state.isMuted," | isPreRoll",i),[l.H9.hidden,l.H9.countDown].includes(t)?window.adPlayer.pause():t===l.H9.fetching?r.nP.setState({adState:l.H9.canShow}):t===l.H9.showing&&window.adPlayer.autoplay()},100),s=e=>{let t=window.adPlayer,i=window.player;if(!(null==t?void 0:t.el)||!(null==i?void 0:i.el))return;let{video:n,adState:s,isPreRoll:o,isEmbed:d,nativeFullscreen:c,isFullScreen:u}=r.nP.getState();if("pause"===i.userRecentAction){t.pause(),l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] onAdPlaying | userRecentAction = pause => Pause video");return}if(u&&c){t.ad.endAdVideo(!1,!0,"navigation");return}let v=[l.H9.ready,l.H9.showing].includes(s);if(o||v){if(l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] onAdPlaying"," | adState:",(0,P.$O)(s,l.H9)," | isMuted",t.state.isMuted," | isPreRoll",o),i.adPlaying=!0,i.state.playing&&(i.el.classList.remove("loadingNext"),i.remoteControl.pause()),this.emit
1("playing",e),r.nP.setState(e=>{var i;return e.isLoading=!1,e.isAdMuted=null==t?void 0:null===(i=t.state)||void 0===i?void 0:i.isMuted,e.adState=l.H9.showing,e.playerStatus=l.GZ.Playing,(0,a.Z)({},e)}),!d){let h=!(null==n?void 0:n.made_for_kids)&&(null==n?void 0:n.protected_type)==="login"&&A.s.getState().account.forceLogin;if(h){t.pause();return}}}else s===l.H9.hidden?(l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] onAdPlaying | Ad is closed"," | adState:",(0,P.$O)(s,l.H9)," | isMuted",t.state.isMuted," | isPreRoll",o),t.pause(),i.remoteControl.play()):s===l.H9.canShow&&(l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] onAdPlaying | adState:",(0,P.$O)(s,l.H9)," | isMuted",t.state.isMuted," | Ad is ready to play => Countdown begins"),t.pause(),i.remoteControl.play(),r.nP.setState({adState:l.H9.countDown}))},o=e=>{this.emit("timeupdate",e)},d=e=>{var t;(null===(t=window.adPlayer)||void 0===t?void 0:t.el)&&(l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] onAdEnded"),this.emit("ended",e),window.adPlayer.ad.endAdVideo())},c=e=>{var t;(null===(t=window.adPlayer)||void 0===t?void 0:t.el)&&(l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] onAdError | Data:",e),this.emit("error",e),window.adPlayer.ad.endAdVideo(!1,!0,"error"))},u=e=>{var t;if(!(null===(t=window.adPlayer)||void 0===t?void 0:t.el))return;l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] onAdAbort | Data:",e),this.emit("abort",e);let{adState:i}=r.nP.getState();i!==l.H9.hidden&&window.adPlayer.autoplay()},v=()=>{var t;l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] onVolumeChange | Muted:",e.muted," | Volume:",e.volume),r.nP.setState({isAdMuted:e.muted}),(null===(t=window.player)||void 0===t?void 0:t.adPlaying)&&(window.player.remoteControl.changeVolume(e.volume),e.muted?window.player.remoteControl.mute():window.player.remoteControl.unmute())};e.addEventListener("canplay",n),e.addEventListener("play",t),e.addEventListener("pause",i),e.addEventListener("abort",u),e.addEventListener("playing",s),e.addEventListener("error",c),e.addEventListener("ended",d),e.addEventListener("timeupdate",o),e.addEventListener("volumechange",v),this._adListeners.push(()=>{n.cancel(),e.removeEventListener("canplay",n),e.removeEventListener("play",t),e.removeEventListener("pause",i),e.removeEventListener("abort",u),e.removeEventListener("playing",s),e.removeEventListener("error",c),e.removeEventListener("ended",d),e.removeEventListener("timeupdate",o),e.removeEventListener("volumechange",v)})}removeMainVideoListeners(){var e;if(null===(e=this._listeners)||void 0===e?void 0:e.length){for(let t of this._listeners)t&&t();this._listeners=[]}}removeAdVideoListeners(){var e;if(null===(e=this._adListeners)||void 0===e?void 0:e.length){for(let t of this._adListeners)t&&t();this._adListeners=[]}}addEventListeners(){this.addMainVideoListeners(),this.addAdVideoListeners()}removeEventListeners(){this.removeMainVideoListeners(),this.removeAdVideoListeners()}trigger(e){for(var t=arguments.length,i=Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];this.emit(e,i)}one(e,t){return this.once(e,t)}constructor(e){super(),this._listeners=[],this._adListeners=[],this.adPlayer=e,this.addAdVideoListeners=this.addAdVideoListeners.bind(this),this.addMainVideoListeners=this.addMainVideoListeners.bind(this),this.removeAdVideoListeners=this.removeAdVideoListeners.bind(this),this.removeMainVideoListeners=this.removeMainVideoListeners.bind(this)}}var z=i(36823),X=i(4432),$=i(95418);class Q{async autoplay(e,t){var i;if(this.state.isPlaying||(null===(i=window.player)||void 0===i?void 0:i.userRecentAction)==="pause")return;let a=this.videoEl;this.pendingMutedAutoplayListener&&(a.removeEventListener("volumechange",this.pendingMutedAutoplayListener),this.pendingMutedAutoplayListener=void 0),l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] autoplay | mute:",e," | isRetry:",t," | current mute status:",a.muted);let n=a.muted;if(e){let s=async()=>{a.play();let e=a.currentTime.toFixed(3);if(this.hls){await (0,P.gw)(500);let t=a.currentTime.toFixed(3),i=!a.paused;
1l.j5.basic&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] autoplay | check play error",{curTime1:e,curTime2:t,isPlaying:i}),i||e!==t||this.hls.recoverMediaError()}};n?s():(this.pendingMutedAutoplayListener=s,a.addEventListener("volumechange",s,{once:!0}),a.muted=!0);return}t||(this.restoreMuteState(!0),await (0,P.gw)(300)),a.play().catch(t=>{let i=r.nP.getState().adState===l.H9.hidden;i||(l.j5.ads&&console.warn("[".concat((0,C.hf)(),"]"),"[AD] Autoplay failed (Code: ".concat(t.code," | Name: ").concat(t.name,")"),"\n=> mute AdPlayer and play again | current muted state:",a.muted),void 0===t.code?this.autoplay(e,!0):0===t.code&&this.autoplay(!0,!0))})}src(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(this.hls&&(this.hls.destroy(),this.hls=void 0),!(null===(e=window.adPlayer)||void 0===e?void 0:e.videoEl)||!t)return;let i=this.videoEl.querySelector("source");i&&i.remove(),this.videoEl.src=t,r.nP.setState({adSrc:t}),l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] Update AdPlayer source:",t);let a=new URL(t),n=a.pathname.endsWith(".m3u8")||a.pathname.endsWith(".ts");if(n&&!b.G6&&N.ZP.isSupported()){l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] Browser support HLS.js => use it to play AD video"),this.hls=new N.ZP((0,X.HB)());try{this.hls.loadSource(t)}catch(s){return window.adPlayer.ad.onRestore("HLS Cannot Load AD Source: ".concat(t)),!1}this.hls.on(N.ZP.Events.MANIFEST_PARSED,function(e,t){var i;(null===(i=window.adPlayer)||void 0===i?void 0:i.hls)&&(0,$.bu)(t.levels)}),this.hls.on(N.ZP.Events.ERROR,function(e,i){var a,n;if(!(null===(a=window.adPlayer)||void 0===a?void 0:a.hls)||!i.fatal)return;let s=i.type,r=i.fatal,o=i.details;switch(l.j5.event&&console.error("[".concat((0,C.hf)(),"]"),"[AD][Error] onHlsError | Error Type:",s," | Details:",o," | Fatal:",r," | Error Msg:",null===(n=i.error)||void 0===n?void 0:n.message),i.type){case N.ZP.ErrorTypes.MEDIA_ERROR:l.j5.event&&console.error("[".concat((0,C.hf)(),"]"),"[AD] Fatal media error encountered, try to recover"),window.adPlayer.hls.recoverMediaError();break;case N.ZP.ErrorTypes.NETWORK_ERROR:l.j5.event&&console.error("[".concat((0,C.hf)(),"]"),"[AD] Fatal network error encountered | hl
1s.startLoad()");break;default:window.adPlayer.hls.destroy()}window.adPlayer.ad.onRestore("HLS Error - Cannot play Ad video: ".concat(t))}),this.hls.once(N.ZP.Events.MEDIA_ATTACHED,function(){window.adPlayer&&window.adPlayer.autoplay()}),this.hls.attachMedia(this.videoEl);return}l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] Not HLS Video OR Browser doesn't support HLS.js => use native lib to play video"),this.event.one("canplay",()=>{var e;let{adState:t}=r.nP.getState();t!==l.H9.hidden&&(null===(e=window.adPlayer)||void 0===e||e.autoplay())})}load(){var e;null===(e=this.videoEl)||void 0===e||e.load()}play(){var e;null===(e=this.videoEl)||void 0===e||e.play().catch(D.Z)}pause(){var e;null===(e=this.videoEl)||void 0===e||e.pause()}mute(){this.videoEl.muted=!0}unmute(){this.videoEl.muted=!1}playbackRate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.videoEl.playbackRate=e}currentTime(e){this.videoEl.currentTime=e}changeVolume(e){this.videoEl.volume=e}addClass(e,t){t?t.classList.add(e):this.el.classList.add(e)}removeClass(e,t){t?t.classList.remove(e):this.el.classList.remove(e)}dispose(){var e;l.j5.basic&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] dispose Ad Player"),this.state.isPlaying&&this.pause(),this.pendingMutedAutoplayListener&&(this.videoEl.removeEventListener("volumechange",this.pendingMutedAutoplayListener),this.pendingMutedAutoplayListener=void 0),this.ad.onDispose(),this.ui.dispose(),null===(e=this.hls)||void 0===e||e.destroy(),this.event.removeEventListeners(),this.event.removeAllListeners(),window.adPlayer=void 0}constructor(e,t,i){this.restoreMuteState=(e,t)=>{if(!this.videoEl)return!0;let i=this.videoEl.muted,a=(0,v.At)({key:"muted",defaultVal:!!t,isPreview:t});return l.j5.basic&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] restoreAdPlayerMuteState | user mute video:",a,"is player muted:",i,a?"=> mute Ad Player":" => unmute Ad Player"),!a&&e&&(this.videoEl.volume=(0,v.At)({key:"volume",defaultVal:1})),r.nP.setState({isAdMuted:a}),i!==a&&(this.videoEl.muted=a),a},this.el=e,this.videoEl=t,this.ui=new q(this,i),this.ad=new z.Z(this),this.event=new W(this),this.state=new G(this.videoEl),l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] AdPlayer constructor")}}var K=i(365),J=i(61310),Y=(0,s.memo)(function(e){var t,i;let{video:c,isEmbed:v}=e,{t:h}=(0,d.$G)(),m=(0,s.useRef)(null),f=(0,s.useRef)(null),g=(0,s.useRef)(!1),y=(0,r.nP)(e=>e.videoSrcObj),b=(0,r.nP)(e=>e.adState===l.H9.showing),w=(0,r.nP)(e=>e.isLiveStreaming),P=A.s.getState().system.hasInteracted;(0,K.Z)(()=>(g.current=!1,()=>{var e;null===(e=window.adPlayer)||void 0===e||e.dispose(),g.current=!0}),[]);let k=(0,s.useRef)(""),S="vmap_data_".concat(y.videoId,"_").concat(w,"_").concat(y.src),{mutate:E}=(0,j.ZP)(S,async()=>{var e,t,i,n,s;if(!window.adPlayer||g.current||!y.src||y.videoId!==c.id)return!1;let[o,d]=k.current.split("|");if(o===y.src&&d===y.videoId){let{isLoading:u,isPreRoll:h,adState:p}=r.nP.getState();return l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] usrSWR | videoSrcRef.current === videoSrc",{isLoading:u,isPreRoll:h,adState:p}),(u||h&&p<l.H9.showing)&&r.nP.setState(e=>(e.isLoading=!1,e.isPreRoll=!1,e.adState=l.H9.hidden,(0,a.Z)({},e))),(null===(i=window.player)||void 0===i?void 0:i.userRecentAction)!=="pause"&&setTimeout(()=>(0,J.zr)(),500),!1}if(k.current="".concat(y.src,"|").concat(c.id),(null===(e=window.adPlayer)||void 0===e?void 0:e.state.isPlaying)&&(l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] usrSWR pause previous ad video"),window.adPlayer.pause()),!y.src)return l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] usrSWR Fetching Vmap Data | No videoSrc => return | video:",c.title),r.nP.setState({showingWall:!0,adState:l.H9.hidden,isPreRoll:!1,vmap:void 0,adSrc:""}),null===(n=window.adPlayer)||void 0===n||n.ad.resetAdData(),!1;let m=(null===(t=(0,Z.safeLocalStorage)())||void 0===t?void 0:t.getItem("gjw_ad_config"))==="always";return!m&&window.adPlayer.ad.adCoolingDown?(l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] usrSWR Fetching Vmap Data","is adCoolingDown:",window.adPlayer.ad.adCoolingDown),r.nP.setState({isLoading:!1,adState:l.H9.hidden,isPreRoll:!1,vmap:void 0,adSrc:""}),setTimeout(()=>{let e=window.player;(null==e?void 0:e.el)&&(e.el.classList.remove("loadingNext","vds-hideControls"),e.adPlaying=!1,e.el.style.display="",e.remoteControl.play())}
1,0),null===(s=window.adPlayer)||void 0===s||s.ad.resetAdData(),!1):(l.j5.ads&&console.debug("[".concat((0,C.hf)(),"]"),"[AD] usrSWR Fetching Vmap Data | video:",c.title," \nvideoSrc:",y.src),window.adPlayer.ad.loadPlayAd(c,v,w).catch(console.error),!0)},{revalidateOnMount:!0,dedupingInterval:0});(0,s.useEffect)(()=>{if(f.current&&m.current)return window.adPlayer=new Q(f.current,m.current,h),r.nP.setState({adPlayer:window.adPlayer}),E(),()=>{var e;null===(e=window.adPlayer)||void 0===e||e.dispose()}},[]);let T=null===(i=null===(t=window.adPlayer)||void 0===t?void 0:t.ad.vastTracker)||void 0===i||!i.ad||!U(window.adPlayer.ad.vastTracker.ad,window.adPlayer.ad.vmapRequestUrl||"");return(0,n.jsxs)("div",{ref:f,id:"video1","data-testid":"ad-player",className:(0,o.Z)(u().adPlayer,"adPlayer",b&&"adShowing"),children:[(0,n.jsx)("video",{ref:m,className:"w-full h-full",playsInline:!0,controls:!1,muted:!P}),!!m.current&&(0,n.jsxs)(n.Fragment,{children:[T&&(0,n.jsx)(L,{}),(0,n.jsx)(p,{videoEl:m.current}),(0,n.jsx)(x,{videoEl:m.current,containerEl:f.current,className:"absolute left-0 right-0 bottom-0 w-full z-10"}),(0,n.jsx)("div",{className:"adContainer absolute top-0 left-0 w-full h-full"})]})]})})},36823:function(e,t,i){"use strict";i.d(t,{E:function(){return e9},Z:function(){return e2}});var a,n,s,r,o,l=i(26042),d=i(69396),c=i(87066),u=i(82280),v=i(86619);let h=["ganjingworld.com","ganjingworld.dev","ganjing.dev","localhost:3000"];var p=i(37253),m=i(89820),f=i(13290),g=i(29154),y=i(6270),b=i(16314),w=i(92971),A=i(6703),P=i(89402),x=i(98347),k=i(35131),S=i(66754),E=i(14664),T=i(8872),_=i(90229),j=i(45983),C=i(3043),I=i(94330);let L=!1;async function N(){L||(p.p.adSettings.startLoading(),await (0,x.R)("".concat(g.ns.apibe.adsJsBase,"/freqCaps.js"),"freqCaps"),L=!0)}function D(e,t){return e?"z_VIDEO_AVOD":t?"VIDEO_EMBED":"VIDEO_ZONE"}async function M(e){try{var t,i;let a=window.pbjs,n=null!==(i=null==a?void 0:a.getEvents())&&void 0!==i?i:[],s=await (null===(t=window._getPbjsVideoImp)||void 0===t?void 0:t.call(window,n,{requestData:e,isProd:g.ns.isGgInProd,hbStatReq:{reqId:e.req_id,eventName:"pbEvents_afterRender"}}));return s}catch(r){console.error("Unexpected Error during _getPbjsVideoImp",r),F({requestData:e,hbStatReq:{eventName:"preError",errorMsg:"getPrebidVideoImpUrl_Failed|".concat(r.message),adUnitCodes:["VIDEO_ZONE"],extraData:r.stack},flush:!0})}}async function R(e,t,i,a){var n;let s=null===(n=(0,f.safeLocalStorage)())||void 0===n?void 0:n.getItem("gjw_prebid_video"),r=function(e,t){let i=["always","mock"].includes(e||"");return i&&F({requestData:null!=t?t:{},hbStatReq:{eventName:"preCheck",allowPrebid:!0,adUnitCodes:["VIDEO_ZONE"],extraData:"enforcePrebid"}}),i}(s,t);if(r)return!0;if(e&&"mockForSkip"!==e.no_ad_reason){let o=function(e,t){if(k.j5.ads){var i;let a=(null===(i=(0,f.safeLocalStorage)())||void 0===i?void 0:i.getItem("gjw_ad_config"))==="always";console.debug("[".concat((0,S.hf)(),"]"),"shouldLoadPrebidVideoAds()",{is_gd_ad:e.is_gd_ad,skipping_ads:e.skipping_ads,alwaysShowAds:a,isEmbed:t})}
1let n=e.rate_limit||e.skipping_ads,s=!e.no_prebid&&(e.is_404||!e.is_gd_ad);return!n&&s}(e,i);if(!o)return!1}else{let l=await V(a);if(!l)return!1}let d=await Z(s,i,t);return d}async function V(e){var t,i,a,n,s,r,o;let l=(0,T.X)(navigator.userAgent);if(l)return!1;let d=(0,I.RX)().countryCode||(null===(t=(await (0,_.FV)()).data)||void 0===t?void 0:t.countryCode),c=null!==(o=null!==(r=null===(i=e.allowedCountryCodesByType)||void 0===i?void 0:i.Video)&&void 0!==r?r:e.allowedCountryCodes)&&void 0!==o?o:null===(a=E.s.getState().webConfig)||void 0===a?void 0:null===(n=a.webConfig)||void 0===n?void 0:null===(s=n.reviveAds)||void 0===s?void 0:s.allowedCountryCodes;if((0,m.qu)("AdModerator","checkCountryCode",{countryCode:d,allowedCountryCodes:c,extAdSiteSettings:e}),d&&c){let u=c.includes(d);if(!u)return!1}return!0}async function Z(e,t,i){let a=function(){let e=h.some(e=>window.location.host.includes(e));return e}(),n=(0,m.jU)()&&"never"!==e&&!t&&a;if(F({requestData:null!=i?i:{},hbStatReq:{eventName:"preCheck",allowPrebid:n,adUnitCodes:["VIDEO_ZONE"]}}),!n)return!1;let s=await (0,w.U)();return n&&(n=!s),F({requestData:null!=i?i:{},hbStatReq:{eventName:"cmpResult",isCmpLoaded:E.s.getState().account.cmpLoaded,allowPrebid:n,adUnitCodes:["VIDEO_ZONE"]}}),(0,m.qu)("AdModerator",{isPrivacyAdsOptOut:s}),!s}async function U(e){let{countryCode:t,vastReqTimeout:i,requestData:a}=e,n="",s="";try{var r,o,l,d,c;let[u]=await Promise.all([p.p.adSettings.getAsset(),(0,x.R)("".concat(g.ns.apibe.adsJsBase,"/pbjsUtils.js"),"pbjsUtils"),(0,x.R)("/pbjs_v".concat(C.y,".js"),"pbjs_js")]),v=window.pbjs;if(!v||(v.adUnits=[],v.que=v.que||[],"object"!=typeof v||!("setBidderConfig"in v)))return{tagUrl:n};let h=null==u?void 0:null===(r=u.VIDEO_ZONE)||void 0===r?void 0:null===(o=r.prebid)||void 0===o?void 0:o.adUnit,f=null!==(c=(0,y.my)(h))&&void 0!==c?c:null===(l=O().prebid)||void 0===l?void 0:l.adUnit;if(!(null===(d=null==f?void 0:f.mediaTypes.video)||void 0===d?void 0:d.playerSize.length))return{tagUrl:n};let b={bidders:["appnexus"],config:{schain:{validation:"relaxed",config:{ver:"1.0",complete:1,nodes:[{asi:"152media.info",sid:"152M461",hp:1}]}}}};try{"_getPbjsVideoBidderConfig"in window&&(b=window._getPbjsVideoBidderConfig({}))}catch(w){console.error("Unexpected Error during _getPbjsVideoBidderConfig",w)}v.setBidderConfig(b);try{if("_getPbjsVideoBidderSettings"in window){let A=window._getPbjsVideoBidderSettings({countryCode:t});v.bidderSettings=null!=A?A:{}}}catch(P){console.error("Unexpected Error during _getPbjsVideoBidderSettings",P)}let k=await new Promise(e=>{let s=setTimeout(()=>{F({requestData:a,hbStatReq:{eventName:"reqError",errorMsg:"Timeout",adUnitCodes:[f.code]}}),e({tagUrl:n})},i);v.que.push(function(){v.adUnits=[],v.addAdUnits(f);let r=function(e){var t,i;let a=null!==(i=e,t=i?"AT"==i||"BE"==i||"BG"==i||"HR"==i||"CY"==i||"CZ"==i||"DK"==i||"EE"==i||"FI"==i||"FR"==i||"DE"==i||"GR"==i||"HU"==i||"IE"==i||"IT"==i||"LV"==i||"LT"==i||"LU"==i||"MT"==i||"NL"==i||"AN"==i||"PL"==i||"PT"==i||"RO"==i||"SK"==i||"SI"==i||"ES"==i||"SE"==i||"GB"==i:null)&&void 0!==t&&t;return{debug:!1,userSync:{filterSettings:{image:{bidders:["appnexus"],filter:"include"},iframe:{bidders:["appnexus"],filter:"include"}},auctionDelay:100,syncsPerBidder:5,syncDelay:3e3},cache:{url:"https://prebid.adnxs.com/pbc/v1/cache"},consentManagement:{usp:{cmpApi:"iab",timeout:100},gdpr:{cmpApi:"iab",timeout:8e3,defaultGdprScope:a,rules:[{purpose:"storage",enforcePurpose:a,enforceVendor:a},{purpose:"basicAds",enforcePurpose:a,enforceVendor:a},{purpose:"measurement",enforcePurpose:a,enforceVendor:a}]}},currency:{adServerCurrency:"USD",conversionRateFile:"https://cdn.jsdelivr.net/gh/prebid/currency-file@1/latest.json",defaultRates:{USD:{EUR:.92}}}}}(t);try{"_getPbjsVideoConfig"in window&&(r=window._getPbjsVideoConfig({countryCode:t}))}catch(o){console.error("Unexpected Error during _getPbjsVideoConfig",o)}v.setConfig(r),F({requestData:a,hbStatReq:{eventName:"jsLoaded",isJsLoaded:!0,adUnitCodes:[f.code]}}),v.requestBids({bidsBackHandler:function(){var t;let{tagUrl:i,tagXml:r}=null!==(t=function(e){var t;let i=null===(t=e.getHighestCpmBids())||void 0===t?void 0:t[0];if(!i){console.error("No highest bid.");return}return i.vastXml&&i.vastUrl?{tagUrl:i.vastUrl,tagXml:i.vastXml}:i.vastUrl?{tagUrl:i.vastUrl}:void console.error("Missing vastUrl from pbjs.getHighestCpmBids()?.[0]")}(v))&&void 0!==t?t:{};(0,m.qu)("AdModerator","pbjs.requestBids bidsBackHandler response videoUrl: ",i),F({requestData:a,hbStatReq:{eventName:"reqCallback",adUnitCodes:[f.code],extraData:JSON.stringify({pbjsTagUrl:i,pbjsTagXml:r})}}),clearTimeout(s),e({tagUrl:i||n,tagXml:r||""})},timeout:i})})});n=null==k?void 0:k.tagUrl,(null==k?void 0:k.tagXml)&&(s=null==k?void 0:k.tagXml)}catch(S){console.error("Failed to getVideoPrebidAds",S),F({requestData:a,hbStatReq:{eventName:"reqError",errorMsg:S.message,extraData:S.stack},flush:!0})}finally{F({requestData:a,hbStatReq:{eventName:"pbEvents_beforeRender"}})}return{tagUrl:n,tagXml:s}}async function F(e){var t,i,a,n,s,r;let o=null===(t=window._pbjsUtils)||void 0===t?void 0:t.enableReport;if(!o)return;let c=await (0,y.xp)();if(!(null===(i=c.units.VIDEO_ZONE)||void 0===i?void 0:null===(a=i.prebid)||void 0===a?void 0:a.report))return;let{requestData:u,hbStatReq:v,flush:h=!1}=e;v.reqId=u.req_id;let p=[];switch(v.eventName){case"preCheck":case"cmpResult":case"jsLoaded":case"preError":case"earlyUnload":case"logError":break;default:let f=window.pbjs;if(!f)return;p=null!==(n=null==f?void 0:f.getEvents())&&void 0!==n?n:[]}try{null===(s=window._reportPbjsVideo)||void 0===s||s.call(window,p,{requestData:u,isProd:g.ns.isGgInProd,hbStatReq:v,flush:h}).then(e=>e),(0,m.qu)("VideoPlayer","_reportPbjsVideo success",{type:v.eventName,isProd:g.ns.isGgInProd})}catch(b){null===(r=window._reportPbjsVideo)||void 0===r||r.call(window,[],{requestData:{},isProd:g.ns.isGgInProd,zoneIdsToReport:[],hbStatReq:(0,d.Z)((0,l.Z)({},v),{eventName:"logError",errorMsg:"_reportPbjsVideo failed|".concat(b.message),extraData:"".concat(b.stack)}),flush:!0}),console.error("Exception while executing ".concat(v.eventName," _reportPbjsVideo"),{e:b,reportPbjsVideo:window._reportPbjsVideo,isProd:g.ns.isGgInProd})}}function O(){var e;return{gjw:{network_id:"",publisher_id:"R_O6HYes4C_1689728735106",hierarchy:"video_preroll",is_dynamic:!1,code:"VIDEO_ZONE",sizes:[{width:0,height:0}]},prebid:{report:!0,adUnit:{code:"video1",mediaTypes:{video:{context:"instream",placement:1,plcmt:1,playerSize:[640,360],mimes:["video/mp4","video/ogg","video/webm","video/mpeg","application/javascript"],protocols:[2,3,5,6],playbackmethod:[1,2],api:[1,2],skip:1,startdelay:0,maxduration:60,minduration:5,w:640,h:360,linearity:1}},bids:[{bidder:"appnexus",params:{placementId:null!==(e=(0,f.getPlacementID)())&&void 0!==e?e:g.ns.isGgInProd?28877055:13232361}}]}}}}var B=i(70138),q=i(7580),G=i(11163),H=i(85518),W=i(61310),z=i(34375);let X;var $,Q,K,J,Y,ee=i(95418),et=i(77690);($=a||(a={})).linear="linear",$.nonlinear="nonlinear",$.display="display",(Q=n||(n={})).breakStart="breakStart",Q.breakEnd="breakEnd",Q.error="error",(K=s||(s={}
1)).VAST3="vast3",K.custom="custom",K.adTagURI="adTagURL",(J=r||(r={})).vast1="vast1",J.vast2="vast2",J.proprietary="proprietary",(Y=o||(o={})).vast1="vast1",Y.vast2="vast2",Y.vast3="vast3",Y.proprietary="proprietary";class ei{play(){k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] Play image ad"),this.imageWrapper=this.getImageWrapperElement(),this.div.appendChild(this.imageWrapper)}stop(){this.imageWrapper.remove(),this.div.style.position="",this.div.style.top="",this.div.style.bottom="",this.div.style.left="",this.div.style.right="",this.div.style.zIndex=""}getImageWrapperElement(){let e=document.createElement("div"),t=document.createElement("img");return t.src=this.src,t.style.width="100%",t.style.height="100%",e.appendChild(t),this.div.style.position="absolute",this.div.style.top="0px",this.div.style.bottom="0px",this.div.style.left="0px",this.div.style.right="0px",this.div.style.zIndex="100",e.id="vmap-image-wrapper",e.style.position="absolute",e.style.top="0px",e.style.bottom="0px",e.style.left="0px",e.style.right="0px",e.style.backgroundColor="#000",e}constructor(e,t){this.div=e,this.src=t}}function ea(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i]}function en(e,t){return e?null:Error(t)}let es={};function er(e){let t=es[e];t&&(clearTimeout(t),delete es[e])}var eo=["handshakeVersion","initAd","startAd","stopAd","skipAd","resizeAd","pauseAd","resumeAd","expandAd","collapseAd","subscribe","unsubscribe"];function el(e,t,i){}el.prototype.handshakeVersion=function(e,t){},el.prototype.initAd=function(e,t,i,a,n,s,r){},el.prototype.startAd=function(e){},el.prototype.stopAd=function(e){},el.prototype.skipAd=function(e){},el.prototype.resizeAd=function(e,t,i,a){},el.prototype.pauseAd=function(e){},el.prototype.resumeAd=function(e){},el.prototype.expandAd=function(e){},el.prototype.collapseAd=function(e){},el.prototype.subscribe=function(e,t,i){},el.prototype.unsubscribe=function(e,t){},el.prototype.getAdLinear=function(e){},el.prototype.getAdWidth=function(e){},el.prototype.getAdHeight=function(e){},el.prototype.getAdExpanded=function(e){},el.prototype.getAdSkippableState=function(e){},el.prototype.getAdRemainingTime=function(e){},el.prototype.getAdDuration=function(e){},el.prototype.getAdVolume=function(e){},el.prototype.getAdCompanions=function(e){},el.prototype.getAdIcons=function(e){},el.prototype.setAdVolume=function(e,t){},ed=el,ec="METHODS",eu=eo,ed[ec]=eu,eh="GETTERS",ep=["getAdLinear","getAdWidth","getAdHeight","getAdExpanded","getAdSkippableState","getAdRemainingTime","getAdDuration","getAdVolume","getAdCompanions","getAdIcons"],(ev=el)[eh]=ep,ef="SETTERS",eg=["setAdVolume"],(em=el)[ef]=eg,eb="EVENTS",ew=["AdLoaded","AdStarted","AdStopped","AdSkipped","AdSkippableStateChange","AdSizeChange","AdLinearChange","AdDurationChange","AdExpandedChange","AdRemainingTimeChange","AdVolumeChange","AdImpression","AdVideoStart","AdVideoFirstQuartile","AdVideoMidpoint","AdVideoThirdQuartile","AdVideoComplete","AdClickThru","AdInteraction","AdUserAcceptInvitation","AdUserMinimize","AdUserClose","AdPaused","AdPlaying","AdLog","AdError"],(ey=el)[eb]=ew;var ed,ec,eu,ev,eh,ep,em,ef,eg,ey,eb,ew,eA,eP,ex,ek=eo.filter(function(e){return -1===["skipAd"].indexOf(e)});function eS(){this._subscribers={}}eA=el,eP="checkVPAIDInterface",ex=function(e){return ek.every(function(t){return"function"==typeof e[t]})},eA[eP]=ex,eS.prototype.subscribe=function(e,t,i){this.isHandlerAttached(e,t)||this.get(t).push({handler:e,context:i,eventName:t})},eS.prototype.unsubscribe=function(e,t){this._subscribers[t]=this.get(t).filter(function(t){return e!==t.handler})},eS.prototype.unsubscribeAll=function(){this._subscribers={}},eS.prototype.trigger=function(e,t){var i=this;
1this.get(e).concat(this.get("*")).forEach(function(e){setTimeout(function(){i.isHandlerAttached(e.handler,e.eventName)&&e.handler.call(e.context,t)},0)})},eS.prototype.triggerSync=function(e,t){this.get(e).concat(this.get("*")).forEach(function(e){e.handler.call(e.context,t)})},eS.prototype.get=function(e){return this._subscribers[e]||(this._subscribers[e]=[]),this._subscribers[e]},eS.prototype.isHandlerAttached=function(e,t){return this.get(t).some(function(t){return e===t.handler})};let eE=el.checkVPAIDInterface;el.METHODS;var eT="AdClickThru",e_=el.EVENTS.filter(function(e){return e!=eT});function ej(e,t,i,a){this._isValid=eE(e),this._isValid&&(this._creative=e,this._el=t,this._videoEl=i,this._iframe=a,this._subscribers=new eS,eC.call(this))}function eC(){if(e_.forEach((function(e){this._creative.subscribe(eL.bind(this,e),e)}).bind(this)),this._creative.subscribe(eI.bind(this),eT),this._videoEl){var e=this._iframe.contentDocument.documentElement,t=this._videoEl;e.addEventListener("click",function(i){i.target===e&&t.click()})}}function eI(e,t,i){this._subscribers.triggerSync(eT,{url:e,id:t,playerHandles:i})}function eL(e){for(var t=arguments.length,i=Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];this._subscribers.trigger(e,i),this._onEvent&&this._onEvent(e,i)}function eN(e,t,i,a){e?e(i,a):i&&t.trigger("AdError",i)}ej.prototype=Object.create(el.prototype),ej.prototype.isValidVPAIDAd=function(){return this._isValid},el.METHODS.forEach(function(e){-1===["subscribe","unsubscribe","initAd"].indexOf(e)&&(ej.prototype[e]=function(){var t=el.prototype[e].length,i=Array.prototype.slice.call(arguments),a=t===i.length?i.pop():void 0;setTimeout((function(){var t,n=null;try{t=this._creative[e].apply(this._creative,i)}catch(s){n=s}eN(a,this._subscribers,n,t)}).bind(this),0)})}),ej.prototype.handshakeVersion=function(e,t){},ej.prototype.initAd=function(e,t,i,a,n,s,r){var o,l;n=n||{},o={slot:this._el,videoSlot:this._videoEl},Object.keys(l=s||{}).forEach(function(e){o[e]=l[e]}),s=o,setTimeout((function(){var o;try{this._creative.initAd(e,t,i,a,n,s)}catch(l){o=l}eN(r,this._subscribers,o)}).bind(this),0)},ej.prototype.startAd=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];this._creative.startAd(t)},ej.prototype.subscribe=function(e,t,i){this._subscribers.subscribe(t,e,i)},ej.prototype.unsubscribe=function(e,t){this._subscribers.unsubscribe(t,e)},ej.prototype.on=ej.prototype.subscribe,ej.prototype.off=ej.prototype.unsubscribe,ej.prototype.setOnEvent=function(e){this._onEvent=e},el.GETTERS.forEach(function(e){ej.prototype[e]=function(t){setTimeout((function(){var i,a=null;try{i=this._creative[e]()}catch(n){a=n}eN(t,this._subscribers,a,i)}).bind(this),0)}}),ej.prototype.setAdVolume=function(e,t){setTimeout((function(){var i,a=null;try{this._creative.setAdVolume(e),i=this._creative.getAdVolume()}catch(n){a=n}a||(a=en(i===e,"failed to apply volume: "+e)),eN(t,this._subscribers,a,i)}).bind(this),0)},ej.prototype._destroy=function(){this.stopAd(),this._subscribers.unsubscribeAll()};var eD=i(68919);let eM="VPAID";class eR{play(){this.stop(),k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] Play JS ad"),this.loadAdUnit(()=>this.playAdUnit())}stop(){this.unloadAdUnit(),this.adContainer.setAttribute("style",""),this.contentURL&&URL.revokeObjectURL(this.contentURL),this._onLoad&&(window.removeEventListener("message",this._onLoad),er(this._onLoad)),this._frame&&this._frame.remove()}isDestroyed(){return this._destroyed}destroy(){this._destroyed||(this._destroyed=!0,eU.call(this))}get adUnit(){return this._adUnit}getFrameID(){if(!this._frameID){var e;let t;this._frameID=(t=-1,function(){return"vmap-js-wrapper"+"_"+ ++t})()}return this._frameID}getVideoEl(){var e,t;return null===(e=this.adPlayer)||void 0===e?void 0:null===(t=e.el)||void 0===t?void 0:t.querySelector("video")}getWrapperElement(){let e=this.createIframe();return e.id=this.getFrameID(),e.style.position="absolute",e.style.top="0px",e.style.bottom="0px",e.style.left="0px",e.style.right="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex="1",e}playAdUnit(){let e=this.getVideoEl(),t=this._adUnit;if(!t||!e)return;this.addEventListeners();let i=this.ad.creatives[0].adParameters;t.initAd(e.offsetWidth,e.offsetHeight,"normal",-1,{AdParameters:(null==i?void 0:i.value)||""},void 0,()=>{}),(0,m.qu)(eM,"Called adUnit.initAd()",{adUnit:t,adParameters:i})}addEventListeners(){let e=this._adUnit;e&&(e.on("AdLoaded",()=>{e.startAd(),(0,m.qu)(eM,"AdUnit loaded. Called adUnit.startAd()")}),e.on("AdStarted",()=>{(0,m.qu)(eM,"AdStarted"),this.adPlayer.event.trigger("vast.adStart");let e=()=>{this.adPlayer.event.trigger("vpaid.adEnd")};this.adPlayer.event.on("vast.adsCancel",e),this.adPlayer.event.one("vpaid.adEnd",function(){var t;null===(t=window.adPlayer)||void 0===t||t.event.off("vast.adsCancel",e),eU.call(this)}),setTimeout(()=>{var e,t;let i=this._frame;if(!i)return;let a=null===(e=i.contentWindow)||void 0===e?void 0:e.document.querySelector("body"),n=null===(t=i.contentWindow)||void 0===t?void 0:t.document.querySelector(".ad-element");a&&n&&(a.style.height="100vh",a.style.width="100%",n.style.height="100%",
1n.style.width="100%",this.adPlayer.ad.clickThroughUri||(this.adPlayer.ui.onClickVisitAdvertiser=()=>{n.click()}))},0)}),e.on("AdStopped",()=>{this.adPlayer.event.trigger("vpaid.AdStopped"),this.onStop&&this.onStop()}),e.on("AdSkipped",()=>{this.adPlayer.event.trigger("vpaid.AdSkipped"),this.onSkip&&this.onSkip()}),e.setOnEvent((e,t)=>{this.onEvent&&this.onEvent(e,t)}))}loadAdUnit(){var e,t,i,a;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ea;(0,m.qu)(eM,"Initialization"),this._frame=this.getWrapperElement(),this.adContainer.style.position="absolute",this.adContainer.style.top="0px",this.adContainer.style.bottom="0px",this.adContainer.style.left="0px",this.adContainer.style.right="0px",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.adContainer.style.zIndex="3",this.adContainer.appendChild(this._frame);let s=this;this._onLoad=(e=(function(e){if((0,m.qu)(eM,"iframe.onLoad"),e.origin!==function e(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}())return;let t="string"==typeof e.data?JSON.parse(e.data):e.data;if(t.id!==s.getFrameID()||!s._frame)return;let i,a,r;if(!(a=s._frame.contentWindow?en("function"==typeof(r=s._frame.contentWindow.getVPAIDAd),"the ad didn't return a function to create an ad"):"the iframe is not anymore in the DOM tree")){var o;let l=s.getVideoEl(),d=null===(o=s._frame.contentWindow)||void 0===o?void 0:o.document.querySelector(".ad-element");d&&l&&((i=new ej(r(),d,l,s._frame)).subscribe("AdStopped",eZ.bind(s)),a=en(i.isValidVPAIDAd(),"the add is not fully complaint with VPAID specification"),(0,m.qu)(eM,"VPAIDAdUnit created",{adUnit:i}))}return s._adUnit=i,eO.call(s),n(a,a?null:i),!0}).bind(this),t=(function(){n("timeout",null)}).bind(this),a=setTimeout(function(){e=ea,delete a[i],t()},1e4),es[i=function(){e.apply(this,arguments)&&er(i)}]=a,i),window.addEventListener("message",this._onLoad);let r=this.ad.creatives[0].mediaFiles[0].fileURL||"";this._frame.src="/api/jsplayer?iframeURL_JS=".concat(encodeURIComponent(r),"&iframeID=").concat(encodeURIComponent(this.getFrameID()))}unloadAdUnit(){eU.call(this)}createIframe(e){let t=document.createElement("iframe");return t.width="100%",t.height="100%",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.margin="0px",t.style.padding="0px",t.style.border="none",t.style.overflow="hidden",e&&(t.style.zIndex=e),t.setAttribute("sandbox","allow-popups allow-same-origin allow-scripts allow-top-navigation-by-user-activation"),t.setAttribute("SCROLLING","NO"),t}constructor(e){this._destroyed=!1;let{adPlayer:t,ad:i,onSkip:a,onStop:n,onEvent:s}=e;this.ad=i,this.adPlayer=t,this.adContainer=t.ui.adContainer,this.onSkip=a,this.onStop=n,this.onEvent=s}}function eV(e){let t=this[e];t&&(t.remove(),delete this[e])}function eZ(){eF.call(this),delete this._adUnit}function eU(){eF.call(this),eB.call(this)}function eF(){eV.call(this,"_frame"),eO.call(this)}function eO(){this._onLoad&&(window.removeEventListener("message",this._onLoad),er(this._onLoad),delete this._onLoad)}function eB(){this._adUnit&&(this._adUnit.stopAd(),delete this._adUnit)}var eq=i(30248),eG=class{get id(){return this._id}get allowMultipleAds(){return this._allowMultipleAds}get followRedirects(){return this._followRedirects}get vastAdData(){return this._vastAdData}set vastAdData(e){this._vastAdData=e}get adTagURI(){return this._adTagURI}set adTagURI(e){this._adTagURI=e}get customData(){return this._customData}constructor(e){this._id=e.getAttribute("id"),this._allowMultipleAds=e.getAttribute("allowMultipleAds"),this._followRedirects=e.getAttribute("followRedirects"),this._vastAdData=null,this._adTagURI=null,this._customData=null;for(let t=0;t<e.children.length;t++){let i=e.children[t];switch(i.localName){case"AdTagURI":this._adTagURI={templateType:i.getAttribute("templateType"),uri:(i.textContent||"").trim()};break;case"VASTAdData":this._vastAdData=i.firstElementChild;break;case"CustomAdData":this._customData=i}}}};function eH(e,t){let i=[];for(let a in e.childNodes){let n=e.childNodes[a];(n.nodeName===t||t==="vmap:".concat(n.nodeName)||n.nodeName==="vmap:".concat(t))&&i.push(n)}return i}function eW(e){let t={attributes:{},children:{},value:{}};t.value=function(e){if(!e||!e.childNodes)return{};let t=e.childNodes,i=[];for(let a in t){let n=t[a];"#cdata-section"===n.nodeName&&i.push(n)}if(i&&i.length>0)try{return JSON.parse(i[0].data)}catch(s){}let r="";for(let o in t){let l=t[o];
1switch(l.nodeName){case"#text":var d;r+=(null===(d=l.textContent)||void 0===d?void 0:d.trim())||"";break;case"#cdata-section":r+=l.data}}return r}(e);let i=e.attributes;if(i)for(let a in i){let n=i[a];n.nodeName&&void 0!==n.nodeValue&&null!==n.nodeValue&&(t.attributes[n.nodeName]=n.nodeValue)}let s=e.childNodes;if(s)for(let r in s){let o=s[r];o.nodeName&&"#"!==o.nodeName.substring(0,1)&&(t.children[o.nodeName]=eW(o))}return t}var ez=class{get trackingEvents(){return this._trackingEvents}get timeOffset(){return this._timeOffset}set timeOffset(e){this._timeOffset=e}get breakType(){return this._breakType}get breakId(){return this._breakId}get repeatAfter(){return this._repeatAfter}get adSource(){return this._adSource}get ad(){return this._ad}set ad(e){this._ad=e}get adChain(){return this._adChain}get extensions(){return this._extensions}track(e,t){for(let i in this.trackingEvents){let a=this.trackingEvents[i];if(a.event===e){let{uri:n}=a;"error"===a.event&&(n=n.replace("[ERRORCODE]",t)),this.tracker(n)}}}tracker(e){if(null!==window){let t=new Image;t.src=e}}constructor(e){this._adChain=[],this._timeOffset=e.getAttribute("timeOffset")||"",this._breakType=e.getAttribute("breakType"),this._breakId=e.getAttribute("breakId"),this._repeatAfter=e.getAttribute("repeatAfter"),this._adSource=null,this._trackingEvents=[],this._extensions=[];for(let t=0;t<e.children.length;t++){let i=e.children[t];switch(i.localName){case"AdSource":this._adSource=new eG(i);break;case"TrackingEvents":for(let a in i.childNodes){let n=i.childNodes[a];"Tracking"===n.localName&&this._trackingEvents.push({event:n.getAttribute("event"),uri:(n.textContent||"").trim()})}break;case"Extensions":this._extensions=eH(i,"Extension").map(e=>eW(e))}}}};class eX{get version(){return this._version}get adBreaks(){return this._adBreaks}get extensions(){return this._extensions}static parseFromString(e){let t=new DOMParser,i=t.parseFromString(e,"application/xml");return new eX(i)}constructor(e){var t;let i=null==e?void 0:null===(t=e.documentElement)||void 0===t?void 0:t.localName;if("VAST"!==i&&"VMAP"!==i)throw Error("Not a VMAP/VAST document");if("VAST"===i){let a=e.children[0],n='\n <vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n <vmap:AdBreak breakType="linear" timeOffset="start">\n <vmap:AdSource allowMultipleAds="true" followRedirects="true" id="-1675117733">\n <vmap:VASTAdData>\n '.concat(a.outerHTML,"\n </vmap:VASTAdData>\n </vmap:AdSource>\n </vmap:AdBreak>\n </vmap:VMAP>\n ");e=new window.DOMParser().parseFromString(n,"text/xml")}for(let s in this._version=e.documentElement.getAttribute("version"),this._adBreaks=[],this._extensions=[],e.documentElement.childNodes){let r=e.documentElement.childNodes[s];switch(r.localName){case"AdBreak":this._adBreaks.push(new ez(r));break;case"Extensions":this._extensions=eH(r,"Extension").map(e=>eW(e))}}}}let e$={isArray:e=>"[object Array]"===Object.prototype.toString.call(e),isValidTimeValue:e=>Number.isFinite(e)&&e>=-2,filterValidUrlTemplates:e=>e.filter(e=>{let t="string"!=typeof e?e.url:e;return e$.isValidUrl(t)}),isValidUrl:e=>/^(https?:\/\/|\/\/)/.test(e),addLeadingZeros(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.toString().padStart(t,"0")},parseTimeOffset(e){let t=(e=e.toString()).split(":"),i=1==t.length?parseInt(t[0]):2==t.length?60*parseInt(t[0])+parseInt(t[1]):3==t.length?3600*parseInt(t[0])+60*parseInt(t[1])+parseInt(t[2]):0;return i},convertToTimecode(e){if(!e$.isValidTimeValue(e))return"";let t=1e3*e;return"".concat(e$.addLeadingZeros(Math.floor(t/36e5),2),":").concat(e$.addLeadingZeros(Math.floor(t/6e4%60),2),":").concat(e$.addLeadingZeros(Math.floor(t/1e3%60),2),".").concat(e$.addLeadingZeros(Math.floor(t%1e3),3))},extractURLsFromTemplates:e=>e.map(e=>e&&"string"!=typeof e?e.url:e),resolveURLTemplates(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=[],n=e$.extractURLsFromTemplates(e);for(let s in!t.ERRORCODE||i.isCustomCode||/^[0-9]{3}$/.test(t.ERRORCODE)||(t.ERRORCODE=900),t.CACHEBUSTING=e$.addLeadingZeros(Math.round(1e8*Math.random())),t.TIMESTAMP=new Date().toISOString(),t.RANDOM=t.random=t.CACHEBUSTING,t)t[s]=e$.encodeURIComponentRFC3986(t[s]);if("string"==typeof n)a.push(n);else for(let r of n){let o=r;"string"==typeof o&&a.push(e$.replaceUrlMacros(o,t))}return a},replaceUrlMacros(e,t){e=e$.replaceMacrosValues(e,t);let i=e.match(/[^[\]]+(?=])/g);if(!i)return e;let a=i.filter(e=>eQ.indexOf(e)>-1);if(0===a.length)return e;let n=a.reduce((e,t)=>
1(e[t]=-1,e),{});return e$.replaceMacrosValues(e,n)},replaceMacrosValues(e,t){let i=e;for(let a in t){let n=t[a];i=i.replace(RegExp("(?:\\[|%%)(".concat(a,")(?:\\]|%%)"),"g"),n)}return i},track(e,t,i){let a=e$.resolveURLTemplates(e,t,i);a.forEach(e=>{null!==window&&fetch(e,{method:"GET",mode:"no-cors"})})},encodeURIComponentRFC3986:e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%".concat(e.charCodeAt(0).toString(16)))},eQ=["ADCATEGORIES","ADCOUNT","ADPLAYHEAD","ADSERVINGID","ADTYPE","APIFRAMEWORKS","APPBUNDLE","ASSETURI","BLOCKEDADCATEGORIES","BREAKMAXADLENGTH","BREAKMAXADS","BREAKMAXDURATION","BREAKMINADLENGTH","BREAKMINDURATION","BREAKPOSITION","CLICKPOS","CLICKTYPE","CLIENTUA","CONTENTID","CONTENTPLAYHEAD","CONTENTURI","DEVICEIP","DEVICEUA","DOMAIN","EXTENSIONS","GDPRCONSENT","IFA","IFATYPE","INVENTORYSTATE","LATLONG","LIMITADTRACKING","MEDIAMIME","MEDIAPLAYHEAD","OMIDPARTNER","PAGEURL","PLACEMENTTYPE","PLAYERCAPABILITIES","PLAYERSIZE","PLAYERSTATE","PODSEQUENCE","REGULATIONS","SERVERSIDE","SERVERUA","TRANSACTIONID","UNIVERSALADID","VASTVERSIONS","VERIFICATIONVENDORS"];var eK=i(17187),eJ=i.n(eK);let eY="VastTracker";class e0 extends eJ(){_initLinearTracking(){var e;this.linear=!0;let t=this.creative;this.skipDelay=null!==(e=t.skipDelay)&&void 0!==e?e:-1,this.setDuration(t.duration),this.clickThroughURLTemplate=t.videoClickThroughURLTemplate?t.videoClickThroughURLTemplate:void 0,this.clickTrackingURLTemplates=t.videoClickTrackingURLTemplates}_initVariationTracking(){var e,t;if(this.linear=!1,this.skipDelay=-1,this.variation){for(let i in this.variation.trackingEvents){let a=this.variation.trackingEvents[i];this.trackingEvents[i]?this.trackingEvents[i]=this.trackingEvents[i].concat(a.slice(0)):this.trackingEvents[i]=a.slice(0)}"nonLinearAd"===(e=this.variation).adType?(this.clickThroughURLTemplate=this.variation.nonlinearClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.nonlinearClickTrackingURLTemplates,this.setDuration(this.variation.minSuggestedDuration)):"companionAd"===(t=this.variation).adType&&(this.clickThroughURLTemplate=this.variation.companionClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.companionClickTrackingURLTemplates)}}setDuration(e){e$.isValidTimeValue(e)&&(this.assetDuration=e,this.quartiles={firstQuartile:Math.round(25*this.assetDuration)/100,midpoint:Math.round(50*this.assetDuration)/100,thirdQuartile:Math.round(75*this.assetDuration)/100})}setProgress(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e$.isValidTimeValue(e)||"object"!=typeof t)return;let i=this.skipDelay||-1;if(-1===i||this.skippable||(i>e?this.emit("skip-countdown",i-e):(this.skippable=!0,this.emit("skip-countdown",0))),this.assetDuration>0){let a=Math.round(e/this.assetDuration*100),n=[];if(e>0){this.adsViewedTime>0&&this.isAdsViewedReached(this.adsViewedTime,e)&&(n.push("progress-".concat(this.adsViewedTime)),this._alreadyTriggeredAdsViewed=!0);for(let s=this.lastPercentage;s<a;s++)n.push("progress-".concat(s+1,"%"));for(let r in this.quartiles)this.isQuartileReached(r,this.quartiles[r],e)&&(n.push(r),this._alreadyTriggeredQuartiles[r]=!0);this.lastPercentage=a}n.forEach(e=>{this.track(e,{macros:t,once:!0})}),e<this.progress&&this.track("rewind",{macros:t})}this.progress=e,this.parentTracker&&this.parentTracker.setProgress(e,t={})}isAdsViewedReached(e,t){let i=!1;return e<=t&&!this._alreadyTriggeredAdsViewed&&(i=!0),i}isQuartileReached(e,t,i){let a=!1;return t<=i&&!this._alreadyTriggeredQuartiles[e]&&(a=!0),a}setMuted(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&"object"==typeof t&&(this.muted!==e&&this.track(e?"mute":"unmute",{macros:t}),this.muted=e)}setPaused(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&"object"==typeof t&&(this.paused!==e&&this.track(e?"pause":"resume",{macros:t}),this.paused=e)}setFullscreen(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&"object"==typeof t&&(this.fullscreen!==e&&this.track(e?"fullscreen":"exitFullscreen",{macros:t}),this.fullscreen=e)}setExpand(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&"object"==typeof t&&(this.expanded!==e&&(this.track(e?"expand":"collapse",{macros:t}),this.track(e?"playerExpand":"playerCollapse",{macros:t})),this.expanded=e)}setSkipDelay(e){e$.isValidTimeValue(e)&&(this.skipDelay=e)}trackImpression(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof e&&((0,m.qu)(eY,"track impression",{ad:this.ad}),this.impressed||(this.impressed=!0,this.trackURLs(this.ad.impressionURLTemplates,e),this.track("creativeView",{macros:e})),this.parentTracker&&this.parentTracker.trackImpression())}trackViewableImpression(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof e&&((0,m.qu)(eY,"track viewableImpression",{ad:this.ad}),this.ad.viewableImpression.forEach(t=>{this.trackURLs(t.viewable,e)}))}trackNotViewableImpression(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof e&&((0,m.qu)(eY,"track notViewableImpression",{ad:this.ad}),this.ad.viewableImpression.forEach(t=>{this.trackURLs(t.notViewable,e)}))}trackUndeterminedImpression(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof e&&this.ad.viewableImpression.forEach(t=>{this.trackURLs(t.viewUndetermined,e)})}error(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"object"==typeof e&&"boolean"==typeof t&&((0,m.qu)(eY,"track error",{ad:this.ad,macros:e,isCustomCode:t}),this.trackURLs(this.ad.errorURLTemplates,e,{isCustomCode:t}))}errorWithCode(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"string"==typeof e&&"boolean"==typeof t&&(this.error({ERRORCODE:e},t),console.log("The method errorWithCode is deprecated, please use vast tracker error method instead"))}complete(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof t&&(this.track("complete",{macros:t}),null===(e=this.parentTracker)||void 0===e||e.complete(t))}notUsed(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof e&&(this.track("notUsed",{macros:e}),this.trackingEvents=[])}otherAdInteraction(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof e&&this.track("otherAdInteraction",{macros:e})}acceptInvitation(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof e&&this.track("acceptInvitation",{macros:e})}adExpand(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof e&&this.track("adExpand",{macros:e})}adCollapse(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof e&&this.track("adCollapse",{macros:e})}minimize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof e&&this.track("minimize",{macros:e})}verificationNotExecuted(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e||"object"!=typeof t)return;if(!this.ad||!this.ad.adVerifications||!this.ad.adVerifications.length)throw Error("No adVerifications provided");
1if(!e)throw Error("No vendor provided, unable to find associated verificationNotExecuted");let i=this.ad.adVerifications.find(t=>t.vendor===e);if(!i)throw Error("No associated verification element found for vendor: ".concat(e));let a=i.trackingEvents;if(a&&a.verificationNotExecuted){let n=a.verificationNotExecuted;this.trackURLs(n,t),this.emit("verificationNotExecuted",{trackingURLTemplates:n})}}overlayViewDuration(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof e&&"object"==typeof t&&(t.ADPLAYHEAD=e,this.track("overlayViewDuration",{macros:t}))}close(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof t&&(this.track(this.linear?"closeLinear":"close",{macros:t}),null===(e=this.parentTracker)||void 0===e||e.close(t))}skip(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"==typeof t){if(!this.impressed){(0,m.qu)(eY,"skip suppressed: no impression was tracked for this ad",{ad:this.ad});return}this.track("skip",{macros:t}),null===(e=this.parentTracker)||void 0===e||e.skip(t)}}load(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"object"==typeof e&&this.track("loaded",{macros:e})}click(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!==t&&"string"!=typeof t||"object"!=typeof i)return;(0,m.qu)(eY,"track click",{ad:this.ad,fallbackClickThroughURL:t,macros:i,clickTrackingURLTemplates:this.clickTrackingURLTemplates,clickThroughURLTemplate:this.clickThroughURLTemplate}),this.clickTrackingURLTemplates&&this.clickTrackingURLTemplates.length&&this.trackURLs(this.clickTrackingURLTemplates,i);let a=this.clickThroughURLTemplate||t,n=(0,l.Z)({},i);if(a){this.progress&&(n.ADPLAYHEAD=this.progressFormatted());let s=e$.resolveURLTemplates([a],n)[0];this.emit("clickthrough",s)}null===(e=this.parentTracker)||void 0===e||e.click(t,i)}track(e){let{macros:t={},once:i=!1,trackParent:a=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={macros:t,once:i,trackParent:a},s=this.memcache_1s;s.getAsync(s.buildCacheKey(e,n),async()=>{this._trackInternal(e,n)})}_trackInternal(e){let{macros:t={},once:i=!1,trackParent:a=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof t)return;"closeLinear"===e&&!this.trackingEvents[e]&&this.trackingEvents.close&&(e="close");let n=this.trackingEvents[e],s=this.emitAlwaysEvents.indexOf(e)>-1;n?(this.emit(e,{trackingURLTemplates:n}),this.trackURLs(n,t)):s&&this.emit(e,null),i&&(delete this.trackingEvents[e],s&&this.emitAlwaysEvents.splice(this.emitAlwaysEvents.indexOf(e),1)),(0,m.qu)(eY,"track ".concat(e),{ad:this.ad,trackingURLTemplates:n,isAlwaysEmitEvent:s,once:i,macros:t}),a&&this.parentTracker&&this.parentTracker.track(e,{macros:t,once:i,trackParent:a})}trackURLs(e){var t,i;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this.creative,r=e$.filterValidUrlTemplates(e),o=(0,l.Z)({},a);this.linear&&((null===(i=s.mediaFiles[0])||void 0===i?void 0:i.fileURL)&&(o.ASSETURI=s.mediaFiles[0].fileURL),this.progress&&(o.ADPLAYHEAD=this.progressFormatted())),(null==s?void 0:null===(t=s.universalAdIds)||void 0===t?void 0:t.length)&&(o.UNIVERSALADID=s.universalAdIds.map(e=>e.idRegistry.concat(" ",e.value)).join(",")),this.ad&&(this.ad.sequence&&(o.PODSEQUENCE=this.ad.sequence),this.ad.adType&&(o.ADTYPE=this.ad.adType),this.ad.adServingId&&(o.ADSERVINGID=this.ad.adServingId),this.ad.categories&&this.ad.categories.length&&(o.ADCATEGORIES=this.ad.categories.map(e=>e.value).join(",")),this.ad.blockedAdCategories&&this.ad.blockedAdCategories.length&&(o.BLOCKEDADCATEGORIES=this.ad.blockedAdCategories)),e$.track(r,o,n)}convertToTimecode(e){if(!e$.isValidTimeValue(e))return"";let t=1e3*e;return"".concat(e$.addLeadingZeros(Math.floor(t/36e5),2),":").concat(e$.addLeadingZeros(Math.floor(t/6e4%60),2),":").concat(e$.addLeadingZeros(Math.floor(t/1e3%60),2),".").concat(e$.addLeadingZeros(Math.floor(t%1e3),3))}
1progressFormatted(){return this.convertToTimecode(this.progress)}trackFirstQuartile(){var e;this.track("firstQuartile"),this._alreadyTriggeredQuartiles.firstQuartile=!0,null===(e=this.parentTracker)||void 0===e||e.trackFirstQuartile()}trackMidpoint(){var e;this.track("midpoint"),this._alreadyTriggeredQuartiles.midpoint=!0,null===(e=this.parentTracker)||void 0===e||e.trackMidpoint()}trackThirdQuartile(){var e;this.track("thirdQuartile"),this._alreadyTriggeredQuartiles.thirdQuartile=!0,null===(e=this.parentTracker)||void 0===e||e.trackThirdQuartile()}constructor(e,t,i){var a;super(),this.memcache_1s=new A.Xq(1e3,1e3),this.emitAlwaysEvents=[];let{variation:n=null,muted:s=!1,parentTracker:r}=i||{};for(let o in this.parentTracker=r,this.ad=e,this.creative=t,this.variation=n,this.muted=s,this.impressed=!1,this.skippable=!1,this.trackingEvents={},this.skipDelay=-1,this.assetDuration=0,this.progress=0,this.adsViewedTime=0,this._alreadyTriggeredAdsViewed=!1,this.emitAlwaysEvents=["creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","resume","pause","rewind","skip","closeLinear","close"],this.clickTrackingURLTemplates=[],this.lastPercentage=0,this._alreadyTriggeredQuartiles={},this.creative.trackingEvents){o.includes("progress-")&&(this.adsViewedTime=Number(o.substring(o.indexOf("-")+1)));let l=this.creative.trackingEvents[o];this.trackingEvents[o]=l.slice(0)}"linear"===(a=this.creative).type?this._initLinearTracking():this._initVariationTracking()}}let e1="AdPlugin",e9="gjwads_is_ad_cooldown",e5="gjwads_cooldown_time";class e2{get adMetadata(){var e,t,i,a;if(!(null===(e=this.vmap)||void 0===e?void 0:e.requestUrl)&&!(null===(t=this.vmap)||void 0===t?void 0:t.requestXml))return null===(i=this.vmap)||void 0===i?void 0:null===(a=i.resp)||void 0===a?void 0:a.ads}get vmapRequestUrl(){var e;return null===(e=this.vmap)||void 0===e?void 0:e.requestUrl}get adCoolingDown(){var e;return this._adCoolingDown=null!==(e=(0,f.storageGet)(e9))&&void 0!==e&&e,this._adCoolingDown}set adCoolingDown(e){(0,f.storageSet)(e9,e,this._coolDownTime),this._adCoolingDown=e}get coolDownTime(){var e;return this._coolDownTime=null!==(e=(0,f.storageGet)(e5))&&void 0!==e?e:0,this._coolDownTime}set coolDownTime(e){(0,f.storageSet)(e5,e,30),this._coolDownTime=e}async adErrorListener(e){if(this.vastTracker&&this.adBreak){var t,i,a,n;let s=this.adBreak.adChain.length?this.adBreak.adChain[this.adBreak.adChain.length-1]:void 0;if(!s)return;let r={ASSETURI:null===(t=null==s?void 0:s.creatives[0].mediaFiles[0])||void 0===t?void 0:t.fileURL,ADTYPE:"video"};(null===(i=e.error)||void 0===i?void 0:i.message)&&(r.ERRORMESSAGE=e.error.message),r.ERRORCODE=null!==(n=null===(a=e.error)||void 0===a?void 0:a.code)&&void 0!==n?n:901,this.trackError(s,r,e.isCustomCode)}}async _getVastData(e){if(!e.ad){var t;let i=(null===(t=e.adSource)||void 0===t?void 0:t.vastAdData)?await this._parseInlineVastData(e.adSource.vastAdData):void 0;e.ad=null==i?void 0:i.ads[0]}return e.ad}trackError(e,t){var i;let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.vastTracker&&"object"==typeof t&&"boolean"==typeof a&&(null===(i=e.errorURLTemplates)||void 0===i?void 0:i.length)&&this.vastTracker.trackURLs(e.errorURLTemplates,t,{isCustomCode:a})}resetAdData(){this.invalidateShowAdFlow(),this.vmap=void 0,this.video=void 0,this.adBreak=void 0,this.adBreaks=[],this.adsForFirstTime=[],this.checkForFirstTime=!0}async loadPlayAd(e,t,i){(0,m.qu)(e1,"Init AdPlugin"),k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] loadPlayAd() | Fetch/Parse VMAP data and start playing Ad Video"),this.adPlayer.event.removeEventListeners(),this.resetAdData(),this.video=e,this.isMovie=(0,m.o1)(e);let a=await this.fetchVMAP(e,t,i),n=z.nP.getState().videoSrcObj,s=!n||!(null==a?void 0:a.resp)||a.resp.is_404&&!a.requestXml&&!a.requestUrl;if(s){this.onRestore("loadPlayAd() | Message: ".concat(n?"VMAP Empty":"VideoSrc Empty"));return}if(await this.parseVMAP(),!this.adBreaks.length){this.onRestore("loadPlayAd() | Message: VMAP Empty");return}this.onFirstPlay()}async fetchVMAP(e,t,i){var a,n,s,r,o,c,v,h,p,f,g,b,w,P,x,E,T;if(!this.adPlayer||this.fetchingId===e.id)return;this.fetchingId=e.id;let _,j,C="",L=D((0,m.o1)(e),t),N=(0,m.BH)();try{let M=(0,I.$h)();if(null==M?void 0:M.adFree)return;
1let V=A.mZ.buildCacheKey("getVmapData_reqId",[N,e.id,t,i]),[Z,U]=await Promise.all([A.mZ.getAsync(V,async()=>(0,m.Fs)()),(0,y.xp)()]);C=Z;let B=null!==(o=null===(r=U.units)||void 0===r?void 0:r.VIDEO_ZONE)&&void 0!==o?o:O(),q=U.site.extAd,W=function(e){var t,i,a;let n=null!==(i=e.gjw.adServingOrder)&&void 0!==i?i:["directSale","prebid","inHouse"],s=null!==(a=null===(t=localStorage.getItem("videoAd_serving_order"))||void 0===t?void 0:t.split("|").filter(Boolean))&&void 0!==a?a:[];return s.length>0&&(n=s),n}(B);({logAdsReq_beforeRouterChange:_,logAdsReq_beforeUnload:j}=function(e,t){let i=()=>{F({requestData:{req_id:e},hbStatReq:{eventName:"earlyUnload",errorMsg:"beforeunload|Video ads early unload",adUnitCodes:[t]},flush:!0})},a=()=>{F({requestData:{req_id:e},hbStatReq:{eventName:"earlyUnload",errorMsg:"routeChangeStart|Video ads early unload",adUnitCodes:[t]},flush:!0}),G.Router.events.off("routeChangeStart",a)};return window.addEventListener("beforeunload",i,{once:!0}),G.Router.events.on("routeChangeStart",a),{logAdsReq_beforeRouterChange:a,logAdsReq_beforeUnload:i}}(C,L)),z.nP.setState({adState:k.H9.fetching});let X={vmap:this.vmap,apiError:void 0},$,Q;"VIDEO_ZONE"!=L&&(W=["directSale","inHouse"]);let K=[...W];switch(H.G6&&!function(){let e="true"===localStorage.getItem("allowAdxVideoAds");return e}()&&function(e){e.forEach((t,i)=>{if("adX"===t){let a=e.findIndex(e=>"prebid"===e);a>=0?e[i]="inHouse":(e[i]="prebid",e.push("inHouse"))}})}(W),(0,m.qu)("AdModerator","start moderating ads",{adServingOrder:W,oriAdServingOrder:K,isSafari:H.G6}),W[0]){case"directSale":if(this.vmap=await te(X,{video:e,locale:N,isEmbed:t,isLiveStreaming:i,req_id:C,zoneId:L}),(0,m.qu)("AdModerator","directSale ads",(0,d.Z)((0,l.Z)({},X),{adServingOrder:W})),!(null===(c=this.vmap)||void 0===c?void 0:c.resp)){tt(this.vmap,C,X.apiError,e.id,N,L);break}if((0,m.Au)("VAST")){!function(e){var t;if(!e)return;let i=localStorage.getItem("VAST_XML_OVERRIDE"),a=null!==(t=localStorage.getItem("VAST_URL_OVERRIDE"))&&void 0!==t?t:void 0;e.pbImpUrl="testUrl",i?(e.requestXml=i,e.requestUrl=void 0):a&&(e.requestUrl=a,e.requestXml=void 0)}(this.vmap);break}switch(W[1]){case"adX":if($=await R(this.vmap.resp,this.vmap.req,t,q),(0,m.qu)("AdModerator","adX ads",{shouldLoadExtAds:$,adServingOrder:W}),!$)break;await ta(this.vmap,B);break;case"prebid":if($=await R(this.vmap.resp,this.vmap.req,t,q),(0,m.qu)("AdModerator","prebid ads",{shouldLoadExtAds:$,adServingOrder:W}),!$)break;switch(await ts(this.vmap),W[2]){case"adX":if(Q=!(null===(v=this.vmap)||void 0===v?void 0:v.requestUrl)&&!(null===(h=this.vmap)||void 0===h?void 0:h.requestXml),(0,m.qu)("AdModerator","adX ads",{hasNoPrebidAd:Q,shouldLoadExtAds:$,adServingOrder:W}),!Q)break;await ta(this.vmap,B)}}break;case"adX":if(this.vmap||(this.vmap=await ti(C)),$=await R(null===(p=this.vmap)||void 0===p?void 0:p.resp,null===(f=this.vmap)||void 0===f?void 0:f.req,t,q),(0,m.qu)("AdModerator","adX ads",{shouldLoadExtAds:$,adServingOrder:W}),!$)break;await ta(this.vmap,B);break;case"prebid":if(this.vmap||(this.vmap=await ti(C)),$=await R(null===(g=this.vmap)||void 0===g?void 0:g.resp,null===(b=this.vmap)||void 0===b?void 0:b.req,t,q),(0,m.qu)("AdModerator","prebid ads",{shouldLoadExtAds:$,adServingOrder:W}),!$)break;if(await ts(this.vmap),Q=!(null===(w=this.vmap)||void 0===w?void 0:w.requestUrl)&&!(null===(P=this.vmap)||void 0===P?void 0:P.requestXml))switch(W[1]){case"adX":(0,m.qu)("AdModerator","adX ads",{hasNoPrebidAd:Q,adServingOrder:W}),await ta(this.vmap,B);break;case"directSale":this.vmap=await te(X,{video:e,locale:N,isEmbed:t,isLiveStreaming:i,req_id:C,zoneId:L}),(0,m.qu)("AdModerator","directSale ads",(0,d.Z)((0,l.Z)({},X),{hasNoPrebidAd:Q,adServingOrder:W})),(null===(x=this.vmap)||void 0===x?void 0:x.resp)||tt(this.vmap,C,X.apiError,e.id,N,L)}}}catch(J){F({requestData:null!==(T=null===(E=this.vmap)||void 0===E?void 0:E.req)&&void 0!==T?T:{req_id:C},hbStatReq:{eventName:"preError",errorMsg:"AHP233 Unknown error|".concat(J.message),adUnitCodes:[L],extraData:"".concat(J.stack,"}")},flush:!0}),k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] fetchVMAP() | Cannot get Prebid Ad Data",J)}finally{_&&G.Router.events.off("routeChangeStart",_),j&&window.removeEventListener("beforeunload",j),this.fetchingId=""}return this.video=e,this.vmap||(this.vmap=await ti(C)),this.vmap.videoId=e.id,this.coolDownTime=(null===(a=this.vmap)||void 0===a?void 0:null===(n=a.resp)||void 0===n?void 0:n.cooldown)||0,z.nP.setState({vmap:this.vmap}),k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] fetchVMAP() | Output:",this.vmap),null===(s=this.adMetadata)||void 0===s||s.forEac
1h(e=>(0,u.ZV)(e.freq_cap)),this.vmap}async parseVMAP(){var e,t,i;(0,m.qu)(e1,"Parse and process VMAP data");let a=this.vmap,n;if(a.requestXml?n=a.requestXml:a.requestUrl?n=await e8(a.requestUrl):a&&(n=(null===(e=a.resp)||void 0===e?void 0:e.xml)?(0,eD.NV)(a.resp.xml):void 0),!n){z.nP.setState({adBreaks:[]});return}let s=new DOMParser,r=s.parseFromString(n,"application/xml");try{let o=new eX(r);k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] parseVMAP | VMAP Data:",o.adBreaks);let l=(null===(t=window.player)||void 0===t?void 0:t.state.duration)||(null===(i=this.video)||void 0===i?void 0:i.duration);l&&o.adBreaks.forEach(e=>{e6(e,l)}),this.adBreaks=[...o.adBreaks],z.nP.setState({adBreaks:this.adBreaks})}catch(d){console.error(d)}}async onFirstPlay(){if(!window.player||!this.checkForFirstTime||!this.video)return;this.checkForFirstTime=!1,this.currentTime=await (0,W.F$)(this.video)||0;let e=window.player.state.duration||this.video.duration;if(this.adsForFirstTime=function(e,t,i){let{isMovie:a,duration:n}=i,s=e7(0,e,n),r=a?e4(t,e,n):[];for(let o of r)-1===s.indexOf(o)&&s.push(o);return s}(this.adBreaks,this.currentTime,{duration:e,isMovie:(0,m.o1)(this.video)}),k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] onFirstPlay() | Ads:",this.adsForFirstTime,"currentTime",this.currentTime),!this.adsForFirstTime.length){this.onRestore("onFirstPlay | No Ad Data");return}this.playingAdsForFirstTime=!0,this.currentAdNo=0,this.adBreak=this.adsForFirstTime.splice(0,1)[0],(0,m.qu)(e1,"[FirstPlay] showAd",this.adBreak),this.showAd(this.adBreak,{force:!0})}markAdAsViewed(){var e,t,i;let{adid:a,freq_cap:n}=null!==(i=null===(e=this.adMetadata)||void 0===e?void 0:e[this.currentAdNo])&&void 0!==i?i:{};null===(t=this.vastTracker)||void 0===t||t.trackImpression(),n&&(0,u.kn)(n),a&&(0,B.uL)(a),this.currentAdNo+=1}showVideoPlayer(e,t){let i=z.nP.getState().adState;i!==k.H9.hidden&&(k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] showVideoPlayer | Ad data:",e," | adBreak:",t),(0,m.qu)(e1,"[showVideoPlayer] start",{adBreak:t,ad:e}),this.vastTracker&&this.vastTracker.load(),this.adPlayer.event.once("playing",()=>{this.markAdAsViewed()}),this.playAd({src:e.creatives[0].mediaFiles[0].fileURL||"",onAdStarted:()=>{(0,m.qu)(e1,"[showVideoPlayer] ad showing",{adBreak:t,ad:e});let i=z.nP.getState().adState;i!==k.H9.hidden&&(this.adPlayer.ui.createAdElements(e,t),this.adPlayer.event.on("timeupdate",this.onAdTimeUpdate),this.adPlayer.ui.showAdElements())},onAdError:this.onAdError}))}onVideoAdPlaying(){var e;null===(e=this.vastTracker)||void 0===e||e.track("resume")}onVideoAdPaused(){var e;null===(e=this.vastTracker)||void 0===e||e.track("pause")}showImagePlayer(e,t){var i;let a=z.nP.getState().adState;a!==k.H9.hidden&&(k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] showImagePlayer | Ad data:",e,t),this.imagePlayer=new ei(this.adPlayer.el,e.creatives[0].mediaFiles[0].fileURL||""),this.adPlayer.ui.createAdElements(e,t),null===(i=window.player)||void 0===i||i.pause(),this.imagePlayer.play(),this.adPlayer.ui.showAdElements())}showJSPlayer(e,t){let i=z.nP.getState().adState;i!==k.H9.hidden&&(k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] showJSPlayer | Ad data:",e,t),(0,m.qu)(e1,"[showJSPlayer] initialization",{ad:e,adBreak:t}),this.adPlayer.ui.createAdElements(e,t),this.jsPlayer=new eR({ad:e,adPlayer:this.adPlayer,onStop:()=>this.endAdVideo(!0,!0,"vpaid-stop"),onEvent:(e,t)=>{var i,a,n,s,r,o,l,d,c,u,v,h,p;switch(k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] VPAID.onEvent",e,t),(0,m.qu)(e1,"VPAID.onEvent",e,t),e){case"AdSkipped":null===(i=this.vastTracker)||void 0===i||i.skip();break;case"AdImpression":null===(a=this.vastTracker)||void 0===a||a.trackImpression();break;case"AdStarted":break;case"AdVideoStart":null===(n=this.vastTracker)||void 0===n||n.track("start",{once:!0,trackParent:!0});break;case"AdPlaying":null===(s=this.vastTracker)||void 0===s||s.track("resume",{trackParent:!0});break;case"AdPaused":null===(r=this.vastTracker)||void 0===r||r.track("pause",{trackParent:!0});break;case"AdVideoFirstQuartile":null===(o=this.vastTracker)||void 0===o||o.trackFirstQuartile();break;case"AdVideoMidpoint":null===(l=this.vastTracker)||void 0===l||l.trackMidpoint();break;case"AdVideoThirdQuartile":null===(d=this.vastTracker)||void 0===d||d.trackThirdQuartile();break;case"AdClickThru":null===(c=this.vastTracker)||void 0===c||c.click();break;case"AdUserAcceptInvitation":null===(u=this.vastTracker)||void 0===u||u.acceptInvitation();break;
1case"AdUserClose":null===(v=this.vastTracker)||void 0===v||v.close();break;case"AdUserMinimize":null===(h=this.vastTracker)||void 0===h||h.minimize();break;case"AdVideoComplete":null===(p=this.vastTracker)||void 0===p||p.complete();break;case"AdError":case"error":ee.bK.error.next({error:{message:null==t?void 0:t[0],code:null==t?void 0:t[1]}}),this.endAdVideo(!1,!0,"error")}}}),this.jsPlayer.play(),this.adPlayer.event.on("timeupdate",this.onAdTimeUpdate),this.adPlayer.ui.showAdElements())}endAdVideo(){var e,t,i;let a=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],s=arguments.length>2?arguments[2]:void 0;if(s=null!=s?s:a?"user-skip":"completed",(0,m.qu)(e1,"[endAdVideo] start",{skipped:a,canPlay:n,reason:s}),this.invalidateShowAdFlow(),this.timerLock=0,this.adPlayer.event.off("playing",this.onVideoAdPlaying),this.adPlayer.event.off("pause",this.onVideoAdPaused),this.adPlayer.event.off("timeupdate",this.onAdTimeUpdate),this.adPlayer.pause(),this.adPlaying){a?(this.markNearbyUpcomingAdsAsUsed(),this.coolDownTime||(this.coolDownTime=20),this.adCoolingDown=!0,"user-skip"===s&&(null===(e=this.vastTracker)||void 0===e||e.skip())):"completed"===s&&(null===(t=this.vastTracker)||void 0===t||t.complete(),this.adPlayer.event.trigger("vast",{eventType:"complete"}));let r=a&&this.coolDownTime>0&&this.adCoolingDown;if(k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] endAdVideo | adPlaying:",this.adPlaying,"isCoolingDown:",r," | playingAdsForFirstTime",this.playingAdsForFirstTime," | adsForFirstTime",this.adsForFirstTime,"\nAd Breaks:",this.adBreaks.map(e=>({breakId:e.breakId,timeOffset:e.timeOffset,used:e.used}))),this.playingAdsForFirstTime){if(!r&&this.adsForFirstTime.length>0){this.adBreak=void 0;let o=this.adsForFirstTime.splice(0,1)[0];(0,m.qu)(e1,"[FirstPlay] showAd",o),this.showAd(o,{force:!0});return}this.playingAdsForFirstTime=!1,this.adsForFirstTime=[]}else{let l=this.currentTime,d=e3(this.adBreaks,l,this.duration),c=d===l,u=r||!c?[]:this.isMovie?e4(l,this.adBreaks,this.duration):e7(l,this.adBreaks,this.duration);if(k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] endAdVideo nextMissingAds",u," isCoolingDown",r," nextAdIsBackToBack",c),u.length){this.adBreak=void 0;let v=u[0];(0,m.qu)(e1,"[endAdVideo] show next ad",{adBreak:v,nextMissingAds:u}),this.showAd(v,{force:!0});return}}}else k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] endAdVideo | adPlaying:",this.adPlaying," | playingAdsForFirstTime",this.playingAdsForFirstTime," | adsForFirstTime",this.adsForFirstTime,"\nAd Breaks:",this.adBreaks.map(e=>({breakId:e.breakId,timeOffset:e.timeOffset,used:e.used})));this.adBreak&&(this.adVideoPlayer?this.adVideoPlayer.skip():this.imagePlayer?this.imagePlayer.stop():this.jsPlayer&&this.jsPlayer.stop(),this.adBreak=void 0),a&&this.adPlayer.event.trigger("vast.adsCancel"),this.adPlayer.event.trigger("vast",{eventType:"vast.adEnd"}),this.adPlaying=!1,this.adsForFirstTime=[],this.playingAdsForFirstTime=!1,(0,m.qu)(e1,"[endAdVideo] onRestore: close adPlayer and play main video",{skipped:a,canPlay:n}),this.onRestore(a?"User skip ad":"Video Ad is ended",n);let{video:h}=z.nP.getState();h&&(0,q.pU)({en:"ads_end",cnt_id:h.id,cnt_type:h.type,source:h.source,channel_id:(null===(i=h.channel)||void 0===i?void 0:i.id)||""})}onRestore(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];this.invalidateShowAdFlow();let{player:i,adPlayer:a,videoSrcObj:n}=z.nP.getState();if(e&&k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] onRestore | From:",e," => Show/Play Main Video | canPlay:",t),t&&(t=Boolean(n)),z.nP.setState({isPreRoll:!1,isLoading:!1,showingWall:!t,adState:k.H9.hidden}),(null==a?void 0:a.videoEl)&&(a.event.removeAdVideoListeners(),a.currentTime(0),a.pause(),a.src("")),(null==i?void 0:i.el)&&(i.el.classList.remove("loadingNext","vds-hideControls"),i.adPlaying=!1,i.el.style.display="",t)){let s=(0,W.Kt)(i,!0);setTimeout(()=>(0,W.zr)(i,s),500)}}playAd(e){if(!window.player)return;let{src:t,onAdStarted:i,onAdError:a}=e;this.adPlayer.event.one("timeupdate",i),this.adPlayer.event.one("error",a),this.adPlayer.playbackRate(1),this.adPlayer.currentTime(0),sessionStorage.getItem("ads_play_sample_video_always")?this.adPlayer.src(sessionStorage.getItem("ads_play_sample_video_url")||"https://vcdn.adnxs-simple.com/p/creative-video/c7/84/47/f8/c78447f8-84f7-400b-aacf-39a87d9e1fb7/c78447f8-84f7-400b-aacf-39a87d9e1fb7_768_432_1100k.mp4"):this.adPlayer.src(t),this.adPlayer.load(),this.adPlayer.autoplay()}onVideoTimeUpdate(){if(!window.player||this.adPlaying)return;let e=z.nP.getState().audioMode;if(e)return;let t=window.player.state.duration,i=window.player.state.currentTime,a=Date.now()/1e3;a-this._lastTimeUpdateValue>=1&&(this._lastTimeUpdateValue=a),k.j5.ads&&this.coolDownTime&&(this.coolDownTime=30),this.lastNormalUpdateTime&&i<this.lastNormalUpdateTime&&(this.lastNormalUpdateTime=Math.min(this.lastNormalUpdateTime,e3(this.adBreaks,i,t)));let n=this.canShowAds(i);if(n&&!this.adCoolingDown&&(void 0===this.lastNormalUpdateTime||this.lastNormalUpdateTime<=i)){var s,r;let o=this.duration||(null===(s=this.adVideoPlayer)||void 0===s?void 0:null===(r=s.snapshot)||void 0===r?void 0:r.duration),l=this.isMovie?e4(i,this.adBreaks,o):e7(i,this.adBreaks,o);l.length>0&&this.showAd(l[0]),this.lastNormalUpdateTime=i}}async onShowAd(e){var t;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0;this.adPlaying=!0,this.currentTime=(null===(t=window.player)||void 0===t?void 0:t.state.currentTime)||0,this.adCoolingDown=!0,this.adPlayer.event.trigger("vast",{eventType:"creativeView"}),this.adPlayer.event.trigger("vast.adStart"),z.nP.setState(t=>{var n,s,r,o;let d=e.timeOffset||0,c=this.playingAdsForFirstTime&&(a||0===d||"start"===d||(null===(n=e.breakId)||void 0===n?void 0:n.startsWith("preroll"))||(null===(s=e.adSource)||void 0===s?void 0:s.id)==="preroll-ads");t.adLink=i,t.adState=c||a?k.H9.ready:k.H9.canShow,t.isPreRoll=c,k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] onShowAd | adState:",(0,m.$O)(t.adState,k.H9),"isPreRoll",c,"force",a,"currentTime",this.currentTime,"\nclickThroughUri:",this.clickThroughUri),c?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e3;clearTimeout(X),X=setTimeout(async()=>{var i;let{video:a,adState:n,isPreRoll:s,isEmbed:r}=z.nP.getState();if(s&&n!==k.H9.showing){if(!r){let o=E.s.getState().account.forceLogin,l=!(null==a?void 0:a.made_for_kids)&&(null==a?void 0:a.protected_type)==="login"&&E.s.getState().account.forceLogin;if(l)for(;E.s.getState().account.forceLogin;)await new Promise(e=>setTimeout(e,500))}k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] Cannot Play Ads after ".concat(t," ms =>
1 close Ad Player | From:"),e),null===(i=window.adPlayer)||void 0===i||i.ad.endAdVideo(!0,!0,"auto-close")}},t)}("onShowAd",6e3):null===(r=window.player)||void 0===r||r.addEventListener("pause",e=>{var t;return null===(t=window.player)||void 0===t?void 0:t.remoteControl.play(e)},{once:!0});let{video:u}=z.nP.getState();return u&&(0,q.pU)({en:"ads_start",cnt_id:u.id,cnt_type:u.type,source:u.source,channel_id:(null===(o=u.channel)||void 0===o?void 0:o.id)||""}),(0,l.Z)({},t)})}onAdError(e){(0,m.qu)(e1,"[onAdError]",{error:e}),k.j5.ads&&e&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] onAdError | error:",e),ee.bK.error.next({error:e}),this.adPlayer.event.trigger("vast",{eventType:"vast.adError"}),this.endAdVideo(!1,!0,"error")}onDispose(){var e,t;this.invalidateShowAdFlow(),null===(e=this.vastTracker)||void 0===e||e.close(),null===(t=this.adErrorSubscription)||void 0===t||t.unsubscribe()}nextShowAdFlowId(){return this.activeShowAdFlowId+=1,this.activeShowAdFlowId}invalidateShowAdFlow(){this.activeShowAdFlowId+=1}isShowAdFlowActive(e){return this.activeShowAdFlowId===e}async showAd(e,t){var i,n,s,r,o,l,d,c,u;let v=null!==(d=null==t?void 0:t.flowId)&&void 0!==d?d:this.nextShowAdFlowId(),{audioMode:h,nativeFullscreen:p,isFullScreen:f}=z.nP.getState();if(h||f&&p){this.onRestore("showAd() | Audio mode is enabled or player is in iOS native fullscreen");return}if(e.used)return;let g,y;if(null===(i=e.adSource)||void 0===i?void 0:i.vastAdData)try{y=null==(g=await this._getVastData(e))?void 0:g.creatives.filter(e=>"linear"===e.type)[0]}catch(b){console.error("[showAd] this._getVastData error",b)}if((0,m.qu)(e1,"[showAd] load Ad data",{adBreak:e,ad:g,options:t}),!g||!y){(0,m.qu)(e1,"[showAd] Error: Empty VAST response",{adBreak:e,options:t}),this.isShowAdFlowActive(v)&&this.onAdError({message:"Empty VAST Response",code:303});return}let w=[...null!==(c=null==t?void 0:t.adChain)&&void 0!==c?c:e.adChain,g];(null==t?void 0:null===(n=t.parentTracker)||void 0===n?void 0:n.ad)===g&&(t.parentTracker=void 0),(null==t?void 0:null===(s=t.parentTracker)||void 0===s?void 0:s.ad)===g?this.vastTracker=null==t?void 0:t.parentTracker:this.vastTracker=new e0(g,y,{parentTracker:null==t?void 0:t.parentTracker});let A=g.VASTAdTagURI;if(A){if(w.length>=5){(0,m.qu)(e1,"[showAd] Error: adBreak.adChain >= WRAPPER_LIMIT",{adBreak:e,ad:g,options:t,WRAPPER_LIMIT:5}),this.isShowAdFlowActive(v)&&this.onAdError({message:"Wrapper limit reached",code:302});return}let P=new URL(A);P.searchParams.set("p",window.location.href),P.searchParams.set("r",document.referrer),(0,m.qu)(e1,"[showAd] Wrapper: Fetching vast data",{adBreak:e,ad:g,options:t});let x,E=new AbortController,T=setTimeout(()=>E.abort(),2500);try{let _=await fetch(P,{signal:E.signal});x=await _.text()}catch(j){(0,m.qu)(e1,"[showAd] Wrapper: Fetching vast data failed",{error:j,adBreak:e,ad:g,options:t}),this.isShowAdFlowActive(v)&&this.onAdError({message:j.message,code:301});return}finally{clearTimeout(T)}if(!this.isShowAdFlowActive(v))return;if(x){let C=new DOMParser,I=C.parseFromString(x,"application/xml");return e.adSource&&(e.adSource.vastAdData=I.documentElement),e.ad=void 0,(0,m.qu)(e1,"[showAd] Wrapper data is valid. Now call showAd()",{adBreak:e,ad:g,options:t,parentTracker:this.vastTracker}),await this.showAd(e,{parentTracker:this.vastTracker,force:null==t?void 0:t.force,flowId:v,adChain:w})}return(0,m.qu)(e1,"[showAd] Error: Wrapper data is invalid",{adBreak:e,ad:g,options:t}),void(this.isShowAdFlowActive(v)&&this.onAdError({message:"Invalid Wrapper XML data",code:300}))}if(this.isShowAdFlowActive(v)){if((null===(r=this.vmap)||void 0===r?void 0:r.pbImpUrl)&&(g.impressionURLTemplates=g.impressionURLTemplates.concat({url:this.vmap.pbImpUrl,id:"pbImpUrl"})),k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"[AD] showAd() | adBreak:",e,"player currentTime:",null===(u=window.player)||void 0===u?void 0:u.state.currentTime),this.adPlayer.event.addEventListeners(),e.used=!0,e.adChain.splice(0,e.adChain.length,...w),e.ad=g,this.adBreak=e,this.clickThroughUri=(null===(o=g.creatives[0])||void 0===o?void 0:null===(l=o.videoClickThroughURLTemplate)||void 0===l?void 0:l.url)||"",await this.onShowAd(e,this.clickThroughUri,null==t?void 0:t.force),e.breakType===a.linear){let L=g.creatives[0].mediaFiles[0];switch(L.mimeType){case et.dV.IMAGE_GIF:case et.dV.IMAGE_JPEG:case et.dV.IMAGE_JPG
1:case et.dV.IMAGE_PNG:this.showImagePlayer(g,e);break;case et.dV.JS:this.showJSPlayer(g,e);break;case et.dV.VIDEO_MP4:case et.dV.HLS:case et.dV.VIDEO_MPEG:case et.dV.VIDEO_OGG:case et.dV.VIDEO_WEBM:this.showVideoPlayer(g,e);break;default:throw Error('Media file type "'.concat(L.mimeType,'" is not support.'))}}else throw Error('AdBreak type "'.concat(this.adBreaks[0].breakType,'" is not support.'))}}onAdTimeUpdate(){var e;let t=this.adPlayer.state.currentTime,i=this.adPlayer.state.duration;i&&this.timerLock!==t-i&&(this.timerLock=t-i,null===(e=this.vastTracker)||void 0===e||e.setProgress(t),i-t<1?this.adPlayer.ad.endAdVideo():this.adPlayer.ui.updateSkipBtnTextClass())}canShowAds(e){return void 0!==e}markNearbyUpcomingAdsAsUsed(){var e,t;let i=this.adBreak;if(!i)return;let a=this.duration||(null===(e=window.player)||void 0===e?void 0:e.state.duration)||(null===(t=this.video)||void 0===t?void 0:t.duration),n=e6(i,a);for(let s of this.adBreaks){if(s===i||s.used||"end"===s.timeOffset)continue;let r=e6(s,a);r>=n&&r-n<=10&&(s.used=!0)}this.adsForFirstTime=this.adsForFirstTime.filter(e=>!e.used)}_parseInlineVastData(e){let t=new window.DOMParser().parseFromString(e.outerHTML,"text/xml"),i=new eq.OF;return i.parseVAST(t)}constructor(e){var t,i;this.duration=0,this.currentTime=0,this.adPlaying=!1,this._adCoolingDown=!1,this._coolDownTime=0,this.isMovie=!1,this.fetchingId="",this.timerLock=0,this._lastTimeUpdateValue=0,this.activeShowAdFlowId=0,this.adBreaks=[],this.clickThroughUri="",this.adsForFirstTime=[],this.checkForFirstTime=!0,this.playingAdsForFirstTime=!1,this.adPlayer=e,this.onRestore=this.onRestore.bind(this),this.fetchVMAP=this.fetchVMAP.bind(this),this.onAdError=this.onAdError.bind(this),this.onFirstPlay=this.onFirstPlay.bind(this),this.onAdTimeUpdate=this.onAdTimeUpdate.bind(this),this.onVideoTimeUpdate=this.onVideoTimeUpdate.bind(this),this.adErrorListener=this.adErrorListener.bind(this),this.onVideoAdPlaying=this.onVideoAdPlaying.bind(this),this.onVideoAdPaused=this.onVideoAdPaused.bind(this),this.currentAdNo=0,this._adCoolingDown=null!==(t=(0,f.storageGet)(e9))&&void 0!==t&&t,this._coolDownTime=null!==(i=(0,f.storageGet)(e5))&&void 0!==i?i:0,this.adErrorSubscription=ee.bK.error.subscribe(this.adErrorListener,!0)}}async function e8(e){k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"Try to load VMAP Data from:",e);let t="".concat(e).concat(-1===e.indexOf("?")?"?":"&","&p=").concat(window.location.href,"&r=").concat(document.referrer);try{let i=await c.Z.get(t);return i.data}catch(a){console.error("Failed to load VMAP/VAST from ".concat(t),a)}}function e3(e,t,i){let a=t;for(let n of e){let s=e6(n,i);s>=t&&s<a&&(a=s)}return a}function e7(e,t,i){let a=[];for(let n=0;n<t.length;n++){let s=t[n];if(s.used||"end"===s.timeOffset)continue;if("start"===s.timeOffset){a.push(s);continue}let r=e6(s,i);if(r<=e){a.push(s);for(let o=n+1;o<t.length;o++){let l=t[o];if(!l.used){if(l.timeOffset===s.timeOffset)a.push(l);else{let d=e6(l,i);5>Math.abs(d-r)&&a.push(l)}}}break}}return a}function e4(e,t,i){let a=[];for(let n=t.length-1;n>=0;n--){let s=t[n];if("end"===s.timeOffset)continue;let r=e6(s,i);if(r<=e){s.used||a.push(s);for(let o=n-1;o>=0;o--){let l=t[o];if(!l.used){if(l.timeOffset===s.timeOffset)a.push(l);else{let d=e6(l,i);5>Math.abs(d-r)&&a.push(l)}}}break}}return a}function e6(e,t){if("number"==typeof e.timeOffset)return e.timeOffset;if("start"===e.timeOffset||"end"===e.timeOffset)"start"===e.timeOffset?e.timeOffset=0:t&&(e.timeOffset=Math.max(0,t-2-5));else{let i=function(e){let t=(e=e.toString()).split(":");return 1==t.length?parseInt(t[0]):2==t.length?60*parseInt(t[0])+parseInt(t[1]):3==t.length?3600*parseInt(t[0])+60*parseInt(t[1])+parseInt(t[2]):0}(e.timeOffset||"0");i>=0&&(e.timeOffset=i)}return e.timeOffset}async function te(e,t){let{video:a,locale:n,isEmbed:s,isLiveStreaming:r,req_id:o,zoneId:c}=t,h;try{h=await function(e){let{locale:t,video:a,isEmbed:n,isLiveStreaming:s,reqId:r}=e,o=s||"Live"===a.type&&"LIVE"===a.status,c=r||A.mZ.buildCacheKey("getVmapData",[t,a.id,n,o]);return A.mZ.getAsync(c,async()=>{var e,s,c,h,p,g;await N();let y=a.id,w=r||(0,m.Fs)(),[A="",x,k,S]=await Promise.all([(0,f.getMaskedDSID)(),(0,b.j)(),(0,j.t)(a),(0,j.C)(a)]),E=null!==(h=null===(e=a.hashtags)||void 0===e?void 0:e.map(e=>P.hashtagUtil.name(e,!0)))&&void 0!==h?h:[],T=(0,u.yF)(),_=(0,m.o1)(a),C=D(_,n
1),I=(0,d.Z)((0,l.Z)({lang:t,cid:A,req_id:w,cnt_id:y,cnt_type:o?"LiveNow":a.type,chl:null===(s=a.channel)||void 0===s?void 0:s.id,cat:a.category_id,tag:k,htag:E.join("|"),stag:S,zoneid:C},x),{freq_capped_grpid:T.filter(e=>"Group"===e.level).map(e=>e.id).join("|"),freq_capped_cmpnid:T.filter(e=>"Campaign"===e.level).map(e=>e.id).join("|"),freq_capped_crtvid:T.filter(e=>"Creative"===e.level).map(e=>e.id).join("|")});a.duration&&a.duration>0&&(I.start=0,I.cd=a.duration),o&&(I.cd=0);let L;try{L=await (0,v.li)(I)}catch(M){F({requestData:I,hbStatReq:{eventName:"preError",errorMsg:"getAdsXML_API_Failed|".concat(M.message),adUnitCodes:[C],extraData:M.stack},flush:!0})}let R={resp:null==L?void 0:L.data,req:I,requestUrl:"",rawRespStr:JSON.stringify(L)},V=(null===(c=(0,f.safeLocalStorage)())||void 0===c?void 0:c.getItem("gjw_ad_mockup"))==="1";if(V||!(null==L?void 0:L.data)||L.data.rate_limit||L.data.is_404){let Z=(null===(p=(0,f.safeLocalStorage)())||void 0===p?void 0:p.getItem("gjw_ad_config"))==="always",U=null===(g=(0,f.safeLocalStorage)())||void 0===g?void 0:g.getItem("gjw_prebid_video");if(Z){let{getVMAPMovieOutput:O,getVMAPDataOutput:B}=await i.e(21451).then(i.bind(i,21451)),q=(0,m.o1)(a);R.resp=q?O:B}else if(U&&"never"!==U){let{noServerAd_butCanLoadPrebid:G}=await i.e(21451).then(i.bind(i,21451));R.resp=G}}return R})}({video:a,locale:n,isEmbed:s,isLiveStreaming:r,reqId:o})}catch(g){var p;F({requestData:null!==(p=null==h?void 0:h.req)&&void 0!==p?p:{req_id:o},hbStatReq:{eventName:"preError",errorMsg:"getVmapData_Failed|".concat(g.message),adUnitCodes:[c],extraData:"".concat(g.stack,"}")},flush:!0}),e.apiError=g}return e.vmap=h,h}function tt(e,t,i,a,n,s){var r,o;try{k.j5.ads&&console.debug("[".concat((0,S.hf)(),"]"),"fetchVMAP() | Doesn't have Vmap Response Data. Pls check the `getone` API and adBlock plugin"),F({requestData:null!==(r=null==e?void 0:e.req)&&void 0!==r?r:{req_id:t},hbStatReq:{eventName:"preError",errorMsg:"Missing Vmap resp|".concat(null==i?void 0:i.message),adUnitCodes:[s],extraData:"fetchVMAP|".concat(a,"|").concat(n,")}}|_|").concat(null==e?void 0:e.rawRespStr)}}),z.nP.setState({vmap:void 0})}catch(l){throw F({requestData:null!==(o=null==e?void 0:e.req)&&void 0!==o?o:{req_id:t},hbStatReq:{eventName:"preError",errorMsg:"AHP208 Unknown error|".concat(l.message),adUnitCodes:[s],extraData:"".concat(l.stack,"}")},flush:!0}),l}}async function ti(e){let t=(0,I.RX)().countryCode;return{req:{req_id:e},resp:{rate_limit:!1,country_iso_code:null!=t?t:"US",skipping_ads:!1,is_404:!0,no_prebid:!1,no_ad_reason:"mockForSkip"}}}async function ta(e,t){var i,a,n,s,r,o,l,d,c;if(!e)return;let u=(null===(i=e.resp)||void 0===i?void 0:i.country_iso_code)||(0,I.RX)().countryCode||(null===(a=(await (0,_.FV)()).data)||void 0===a?void 0:a.countryCode),v=u?null!==(c=tn(null===(n=t.wrapper)||void 0===n?void 0:null===(s=n[u])||void 0===s?void 0:s.url))&&void 0!==c?c:tn(null===(r=t.wrapper)||void 0===r?void 0:null===(o=r.default)||void 0===o?void 0:o.url):tn(null===(l=t.wrapper)||void 0===l?void 0:null===(d=l.default)||void 0===d?void 0:d.url);if(!v)return;let h=await M(e.req);h&&(e.pbImpUrl=h),e.requestUrl=v}function tn(e){var t;if(e)return null!==(t=e[H.tq?"mobile":"desktop"])&&void 0!==t?t:e.default}async function ts(e){var t,a,n,s;if(!e)return;let{tagUrl:r,tagXml:o}=await U({countryCode:(null===(t=e.resp)||void 0===t?void 0:t.country_iso_code)||(0,I.RX)().countryCode||(null===(a=(await (0,_.FV)()).data)||void 0===a?void 0:a.countryCode),vastReqTimeout:null!==(s=(0,f.getVastRequestTimeoutMilliseconds)())&&void 0!==s?s:6e3,requestData:e.req}),l=await M(e.req);l&&(e.pbImpUrl=l),e.requestUrl=r,e.requestXml=o;let d=null===(n=(0,f.safeLocalStorage)())||void 0===n?void 0:n.getItem("gjw_prebid_video");if(!r&&!o&&d&&"mock"===d){let c=await i.e(21451).then(i.bind(i,21451));e.requestXml=c[d]||c.JsAdMedia}}},95418:function(e,t,i){"use strict";i.d(t,{bK:function(){return l},bu:function(){return d}});var a=i(35131),n=i(34375),s=i(11914),r=i(66754),o=i(78097);let l={error:new s.Z(null)},d=e=>{var t;if(!(null===(t=window.adPlayer)||void 0===t?void 0:t.hls))return;let{isMobiPlayer:i}=n.nP.getState();if(!i){let s=window.navigator,l=0,d=localStorage.getItem(o.v);d&&(l=1e3*parseFloat(d),a.j5.event&&console.debug("[".concat((0,r.hf)(),"]"),"[AD] Using stored downlink:",l,"kbps")),(null==s?void 0:s.connection)&&(a.j5.event&&console.debug("[".concat((0,r.hf)(),"]"),"[AD] connection",1e3*s.connection.downlink,"kbps"),l=1e3*s.connection.downlink);let c=0;for(let u=e.length;u>0;u--){let v=e[u-1].bitrate/1e3;if(a.j5.event&&console.debug("[".concat((0,r.hf)(),"]"),"[AD] stream",u,"bitrate",v,"kbps"),l>v){c=u-1;break}}a.j5.event&&console.debug("[".concat((0,r.hf)(),"]"),"[AD] target hls stream",e[c]),window.adPlayer.hls.currentLevel=c,window.adPlayer.hls.startLevel=c}}},77690:function(e,t,i){"use strict";var a,n,s,r,o,l,d,c,u,v,h,p;i.d(t,{dV:function(){return o}}),(d=a||(a={})).inline="inline",d.wrapper="wrapper",(c=n||(n={})).cpc="cpc",c.cpm="cpm",c.cpe="cpe",c.cpv="cpv",(u=s||(s={})).linear="linear",(v=r||(r={})).creativeView="creativeView",v.start="start",v.firstQuartile="firstQuartile",v.midpoint="midpoint",v.thirdQuartile="thirdQuartile",v.complete="complete",v.mute="mute",v.unmute="unmute",v.pause="pause",v.rewind="rewind",v.resume="resume",v.fullscreen="fullscreen",v.exitFullscreen="exitFullscreen",v.expand="expand",v.collapse="collapse",v.acceptInvitation="acceptInvitation",v.close="close",v.skip="skip",v.progress="progress",(h=o||(o={})).IMAGE_GIF="image/gif",h.IMAGE_PNG="image/png",h.IMAGE_JPEG="image/jpeg",h.IMAGE_JPG="image/jpg",h.VIDEO_MP4="video/mp4",h.VIDEO_MPEG="video/mpeg",h.VIDEO_OGG="video/ogg",h.VIDEO_WEBM="video/webm",h.HLS="application/x-mpegURL",h.JS="application/javascript",(p=l||(l={}))[p.streaming=1]="streaming",p[p.progressive=2]="progressive"},24494:function(e,t,i){"use strict";i.d(t,{Z:function(){return ir}});var a=i(26042),n=i(85893),s=i(23114),r=i(67294),o=i(39708),l=i(28222),d=i(40722),c=i.n(d),u=i(34375),v=i(69396),h=i(96235),p=i(93041),m=i(35131),f=i(61310),g=i(89820),y=i(7580),b=i(63345),w=i(14664),A=i(32385),P=i(66754),x=i(85518),k=i(84536),S=i(4432),E=i(75844),T=i(36409),_=i(111),j=i(9835),C=i(1536),I=i(96712),L=i(25231),N=i(78097),D=i(78764),M=i(9752
10),R=i(13290),V=i(83636),Z=i(62528),U=i(47524);let F=[],O=(e,t)=>{if(e&&(0,h.mo)(e)){let i=u.nP.getState().hlsConfig||(0,S.jB)();e.library=p.ZP,e.config=i}},B=e=>{el();let{video:t,player:i,adState:a,isMobiPlayer:n}=u.nP.getState();(null==i?void 0:i.el)&&t&&(e.duration&&e.duration!==1/0&&i.state.duration!==e.duration&&i.remoteControl.changeDuration(e.duration),m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onCanPlay | detail:",e," | adState:",(0,g.$O)(a,m.H9)),q&&n&&i.el.classList.add("vds-hideControls"),i.adPlaying||u.nP.setState({playerStatus:m.GZ.CanPlay}))},q=!1,G=()=>{let{player:e,adState:t}=u.nP.getState();e&&(m.j5.event||m.j5.ads)&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onAbort"," | adState:",(0,g.$O)(t,m.H9))},H=async()=>{var e,t,i;let{player:a,playerStatus:n,video:s,isLiveStreaming:r,isTrailer:o,hlsConfig:l}=u.nP.getState(),d=(null===(e=(0,R.safeSessionStorage)())||void 0===e?void 0:e.getItem(M.t))==="1";if(u.nP.setState({isAutoPlay:d}),(null==a?void 0:a.el)&&s&&(n===m.GZ.NotReady&&u.nP.setState({playerStatus:m.GZ.StartLoad}),m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onLoadStart | video:",null==s?void 0:s.title),(0,f.XE)(a,l),(0,f.aO)(a,s),a.watchTime=0,s)){let c=await (0,D.checkPremiumWatch)(s),v=(null==a?void 0:a.state.playbackRate)||1,h=r||o?v:(0,E.At)({key:"rate",defaultVal:v});(0,y.pU)({en:d?M.O.AutoStart:M.O.VideoStart,cnt_id:s.id,cnt_type:s.type,source:s.source,play_speed:h,channel_id:(null===(t=s.channel)||void 0===t?void 0:t.id)||"",extra:o?"trailer":void 0,is_premium:c}),(0,A.nh)(s.id).isStartEventTracked=!0,null===(i=(0,R.safeSessionStorage)())||void 0===i||i.removeItem(M.t)}},W=()=>{el();let{player:e,adState:t,liveStatus:i,video:a,loop:n,playerStatus:s,isFullScreen:r,nativeFullscreen:o}=u.nP.getState();if(!(null==e?void 0:e.el)||!(null==a?void 0:a.duration))return;if(("pause"===e.userRecentAction||e.adPlaying)&&!(o&&r)){e.el.classList.remove("loadingNext","vds-hideControls"),e.remoteControl.pause();return}if([m.H9.showing,m.H9.ready].includes(t)){e.remoteControl.pause();return}let l=n||e.state.loop;if(!l){let d="LIVE"!==i&&(e.state.ended||e.state.duration-e.state.currentTime<.2);if(d){e.remoteControl.pause();return}}(m.j5.event||m.j5.ads)&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onPlay | adState:",(0,g.$O)(t,m.H9)," | video:",null==a?void 0:a.title);let c=e.state.currentTime;$&&clearTimeout($),$=setTimeout(()=>(0,f.Ls)(e,c),4e3),s===m.GZ.Paused&&t!==m.H9.showing&&t!==m.H9.ready&&(0,D.checkPremiumWatch)(a).then(t=>{var i;return(0,D.sendBDPTrackingEvent)({en:"progress_resume",addData:{cnt_id:a.id,cnt_type:a.type,source:a.source,channel_id:(null===(i=a.channel)||void 0===i?void 0:i.id)||"",is_premium:t},extra:{time:e.state.currentTime,pct:Math.round(((null==a?void 0:a.duration)?e.state.currentTime/a.duration:0)*100)}})}),(0,A.s5)(a.id),(0,A.tE)()},z=()=>{let{player:e,video:t,loop:i,isLiveStreaming:a,playerStatus:n,disableHistory:s,adState:r,isPreRoll:o}=u.nP.getState();if(!(null==e?void 0:e.el)||!(null==t?void 0:t.id))return;$&&clearTimeout($);let l=e.state.duration||1,d=e.state.currentTime||0,c=!a&&(e.state.ended||n===m.GZ.Ended);if(a||c||!e.state.started||e.state.duration===1/0||(c=l-d<1),(m.j5.event||m.j5.ads)&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onPause | isPreRoll:",o,"canAutoplay",q,"adState",(0,g.$O)(r,m.H9),"isEnded",c),!a&&!c&&e.state.started&&e.state.duration!==1/0){let v=e.state.duration||1,h=e.state.currentTime||0;c=v-h<1}if(!a&&c){let p=i||e.state.loop;p?(e.remoteControl.seek(0),e.remoteControl.play()):X();return}e.el.classList.remove("vds-hideControls"),u.nP.setState({showingWall:!1,playerStatus:m.GZ.Paused}),t.duration&&(s||(0,b.N)({video:t,currentTime:d,duration:l}),(0,D.checkPremiumWatch)(t).then(i=>{var a;return(0,D.sendBDPTrackingEvent)({en:"progress_pause",addData:{cnt_id:t.id,cnt_type:t.type,source:t.source,channel_id:(null===(a=t.channel)||void 0===a?void 0:a.id)||"",is_premium:i},extra:{time:e.state.currentTime,pct:Math.round((t.duration?e.state.currentTime/t.duration:0)*100)}})}))},X=(0,T.Z)(()=>{let{player:e,video:t,loop:i,isTrailer:n,isLiveStreaming:s,disableHistory:r,tvSeries:o,isAutoPlay:l}=u.nP.getState();if(!(null==e?void 0:e.state.currentTime)||!t||s&&["Live","Movie"].includes(t.type))return;let d=e.state.currentTime,c=e.state.duration;if(!(c-d<1))return;let h=i||e.state.loop;m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onEnded | video:",null==t?void 0:t.t
1itle,"\ncurrentTime:",null==e?void 0:e.state.currentTime," | duration:",null==e?void 0:e.state.duration," | isLoop:",h);let p=null==o?void 0:o.id,g=!!w.s.getState().following.followedChannels[t.channel.id],x=n?"trailer":g?"chan_follow":void 0;if(100!==(0,A.nh)(t.id).prevProgressValue&&(0,D.checkPremiumWatch)(t).then(i=>(0,y.pU)((0,v.Z)((0,a.Z)({en:l?M.O.AutoProgress:M.O.VideoProgress,cnt_id:t.id,cnt_type:t.type},t.source&&{source:t.source}),{play_speed:e.state.playbackRate,view_time:e.watchTime||0,view_pct:100,channel_id:t.channel.id,extra:x,is_premium:i}))),$&&clearTimeout($),r||(0,b.N)({video:t,currentTime:0,duration:e.state.duration}),h)e.remoteControl.seek(0),setTimeout(()=>e.remoteControl.play(),500);else if(p&&!n){var k;null===(k=(0,R.safeSessionStorage)())||void 0===k||k.setItem(M.t,"1"),(0,f.tu)("next");return}else setTimeout(()=>{e.state.paused&&u.nP.setState({playerStatus:m.GZ.Ended})},500)},200),$,Q=(0,_.Z)(e=>{let{player:t,video:i,isLiveStreaming:a,loop:n}=u.nP.getState();if(!i||!t||a||t.adPlaying)return;let s=t.state.duration,r=e.currentTime;if($&&clearTimeout($),$=setTimeout(()=>(0,f.Ls)(t,r),3e3),s>0){let o=i.end_screen,l=t.state.currentTime;if(o){let d=Z.Z.getState().publish,c=l>=o.start&&l<=o.end;d("Show_Custom_EndScreen",c?o:{})}(0,A.OY)({curTime:l,duration:s}),(0,A.b_)({curTime:l,duration:s}),(0,f.Dl)({video:i,curTime:l,player:t});let v=n||t.state.loop;l>=s&&(v?(t.remoteControl.seek(0),t.remoteControl.play()):(t.remoteControl.pause(),u.nP.setState({playerStatus:m.GZ.Ended})))}},500),K="",J,Y=()=>{let{isLiveStreaming:e,isLivePlayer:t,video:i,player:n,adState:s,isPreRoll:r,isMobiPlayer:o,isEmbed:l,nativeFullscreen:d,isFullScreen:c,shouldSkipAd:v}=u.nP.getState();if(!(null==n?void 0:n.el)||!i)return;if(ee=5,(0,L.C)(),"pause"===n.userRecentAction&&!(d&&c)){n.remoteControl.pause(),m.j5.ads&&console.debug("[".concat((0,P.hf)(),"]"),"[AD] onPlaying | userRecentAction = pause => Pause video");return}if($&&clearTimeout($),!l){let h=!(null==i?void 0:i.made_for_kids)&&(null==i?void 0:i.protected_type)==="login"&&w.s.getState().account.forceLogin;if(h){n.remoteControl.pause();return}}if(!e&&(null==n?void 0:n.state.duration)&&n.state.duration-n.state.currentTime<.5){n.remoteControl.pause();let p=new Event("ended");n.dispatchEvent(p);return}K=Number(n.state.currentTime).toFixed(3),n.el.classList.remove("loadingNext");let y=s<m.H9.showing&&s!==m.H9.hidden,b=s===m.H9.showing;if((m.j5.event||m.j5.ads)&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onPlaying | playingAtTime",K," | adState:",(0,g.$O)(s,m.H9)," | canAutoplay",q," | isPreRoll",r),q&&(q=!1),!t&&o&&(0,f.J0)(!1),setTimeout(()=>{var e,t;null==n||null===(e=n.el)||void 0===e||null===(t=e.classList)||void 0===t||t.remove("vds-hideControls"),(0,E.l3)("muted","remove")},500),!v&&(r&&y||b)){n.remoteControl.pause();return}if(null===V.dialogHandler||void 0===V.dialogHandler?void 0:V.dialogHandler.hasPausingDialog()){let A=!!n.el.closest(".dialog_paper");if(!A){V.dialogHandler.setPausedVideoByPopup(!0),n.remoteControl.pause();return}}n.timer||(n.timer=setInterval(function(){if(!(null==n?void 0:n.el)){clearInterval(n.timer);return}n.adPlaying||(n.watchTime||(n.watchTime=0),n.adPlaying||n.lastPlayerTime==n.state.currentTime||(n.watchTime+=1),n.lastPlayerTime=n.state.currentTime)},1e3));let k=(null==i?void 0:i.type)==="Live"&&e;if((x.gn||k)&&(clearTimeout(J),J=setTimeout(()=>{if(!(null==n?void 0:n.el))return;let e=Number(n.state.currentTime).toFixed(3);m.j5.basic&&console.debug("[".concat((0,P.hf)(),"]"),"Check play error interval | currentTime",e,"playingAtTime",K,"isPlaying",n.state.playing,"\n Video Src:",JSON.stringify(n.state.currentSrc)),n.state.playing&&K===e&&(m.j5.basic&&console.error("[".concat((0,P.hf)(),"]"),"[Video] Has ERROR - cannot load & play video | playingAtTime",K,"currentTime",e,"isPlaying",n.state.playing),(0,f.qf)(n))},2e3)),e&&((0,E.l3)("rate"),n.remoteControl.changePlaybackRate(1)),null==F?void 0:F.length){let{video:S}=u.nP.getState(),T=F[F.length-1];if((null==S?void 0:S.duration)&&S.id===T.videoId){let _=Math.round(F[0].fromTime),j=Math.round(T.toTime),C=Math.round(_/S.duration*100),I=Math.round(j/S.duration*100);(0,D.checkPremiumWatch)(S).then(e=>{var t;return(0,D.sendBDPTrackingEvent)({en:"progress_shift",addData:{cnt_id:S.id,cnt_type:S.type,source:S.source,channel_id:(null===(t=S.channel)||void 0===t?void 0:t.id)||"",is_premium:e},extra:{from_time:_,to_time:j,from_pct:C,to_pct:I}})})}F=[]}u.nP.setState(e=>(e.isLoading=!1,e.showingWall=!1,e.isMuted=n.state.muted,e.playerStatus=m.GZ.Playing,e.shouldSkipAd&&(e.isPreRoll=!1,e.adState=m.H9.hidden),(0,a.Z)({},e)))},ee=5,et=e=>{let{player:t,adState:i}=u.nP.getState();if(!(null==t?void 0:t.el))return;if($&&clearTimeout($),m.j5.event&&console.error("[".concat((0,P.hf)(),"]"),"[Video][Error] onError | detail",e),i===m.H9.hidden&&t.el.classList.remove("loadingNext","vds-hideControls"),0===ee){u.nP.setState({isLoading:!1,playerStatus:m.GZ.Error});return}ee-=1;let a=t.el.querySelector("video");a&&a.paused!==t.state.paused&&(m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onError | The pause state between the video element and the player is out of sync.",{videoElPaused:a.paused,playerPaused:t.state.paused}),a.pause()),"pause"!==t.userRecentAction&&setTimeout(()=>t.remoteControl.play(),300),u.nP.setState({isLoading:!1})},ei=(0,_.Z)((e,t)=>{var i,a,n,s,r,o,l;let{player:d,video:c,disableHistory:v,isLiveStreaming:h}=u.nP.getState();if(!(null==d?void 0:d.el)||!c)return;let p=d.el.querySelector("video"),f=e.type,g=e.fatal,y=e.details;if(m.j5.event&&console.error("[".concat((0,P.hf)(),"]"),"[Video][Error] onHlsError:"," Error Type:",f," | Details:",y," | Fatal:",g," | Error Msg:",null===(r=e.error)||void 0===r?void 0:r.message," | Video Error:",(null==p?void 0:p.error)?"[".concat(null===(o=p.error)||void 0===o?void 0:o.code,"] ").concat(null===(l=p.error)||void 0===l?void 0:l.message):null),x.G6&&"bufferStalledError"===y){(0,U.V)(d);return}if(!g)return;(0,L.Z)({player:d,videoId:c.id,level:"error",request_data:"Playback Fail",errorType:f,errorFatal:g,errorMsg:"".concat(e.details," | ").concat(null===(i=e.error)||void 0===i?void 0:i.message).concat((null===(a=p.error)||void 0===a?void 0:a.code)?" | Video Error: [".concat(null===(n=p.error)||void 0===n?void 0:n.code,"] ").concat(null===(s=p.error)||void 0===s?void 0:s.message):"")}),d.el.classList.remove("loadingNext","vds-hideControls"),$&&clearTimeout($);let b="Live"===c.sub_type&&h;if(!b&&d.state.duration&&d.state.duration-d.state.currentTime<.5){d.remoteControl.pause(t);return}
1(0,U.k)({player:d,errType:f,errDetail:y,video:c,disableHistory:v})},1e3),ea=e=>{let{video:t,player:i,isMobiPlayer:a}=u.nP.getState();if(a||(null==t?void 0:t.id)==="1ggfupbkr4c5yGSuz6Hj919Wj1gl1c")return;let n=window.navigator,s=0,r=localStorage.getItem(N.v);r&&(s=1e3*parseFloat(r),m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] Using stored downlink:",s,"kbps")),(null==n?void 0:n.connection)&&(m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] connection",1e3*n.connection.downlink,"kbps"),s=1e3*n.connection.downlink);let o=0;for(let l=e.levels.length;l>0;l--){let d=e.levels[l-1].bitrate/1e3;if(m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] stream",l,"bitrate",d,"kbps"),s>d){o=l-1;break}}m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] target hls stream",e.levels[o]),(0,f.aK)(i,{startLevel:o,currentLevel:o},!0)},en=(e,t)=>{m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"onFullscreenChange | isFullscreen",e,"nativeEvent",t),e?((0,k.Xz)("playerFullScreen",!0),document.body.classList.add("vjs-full-window"),u.nP.setState({isFullScreen:!0})):((0,k.Xz)("playerFullScreen",!1),document.body.classList.remove("vjs-full-window"),u.nP.setState({isFullScreen:!1}),setTimeout(()=>{let e=u.nP.getState().player;e.el&&e.remoteControl.pause()},500))},es=e=>{let{player:t}=u.nP.getState();if(null==t?void 0:t.el){if(m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onVolumeChange | Detail:",e),x.G6){let i=t.el.querySelector("video");i&&(i.muted=e.muted,i.volume=e.volume)}u.nP.setState({isMuted:e.muted})}},er=e=>{let{video:t,player:i,playerStatus:a}=u.nP.getState(),n=a===m.GZ.Playing;if(m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onQualityChange | quality:",e),!i||!t||!n||!e)return;let s=i.state.currentTime;setTimeout(()=>{if(!i.el)return;let e=i.state.currentTime;e-s>=.2||i.remoteControl.seek(e-.5)},500)},eo,el=()=>{eo&&clearInterval(eo);let e=Date.now(),t=()=>{let t=window.__videoPlayerReady;if(t){window.dispatchEvent(new CustomEvent("videoPlayerReady")),clearInterval(eo);return}let i=Date.now()-e;i>=1e4&&(window.dispatchEvent(new CustomEvent("videoPlayerReady")),clearInterval(eo))};eo=setInterval(t,200)},ed="",ec=(e,t)=>{let i=t.isTrusted||t.isOriginTrusted;if(i){let{video:a,player:n}=u.nP.getState();if(!(null==n?void 0:n.el)||!a)return;let s=n.el.querySelector("video"),r=function(e,t){let i=e.buffered;for(let a=0;a<i.length;a++){let n=i.start(a),s=i.end(a);if(t>=n&&t<=s)return!0}return!1}(s,e);r||ed===a.id||(ed=a.id)}},eu=(0,T.Z)(e=>{let{video:t,player:i,captions:a,currentCaption:n}=u.nP.getState();if((null==e?void 0:e.length)&&t&&i){if(m.j5.caption&&console.debug("[".concat((0,P.hf)(),"]"),"[Caption] onTextTracksChange | tracks",e,"captions",a,"currentCaption",n),e.length>0&&!(null==a?void 0:a.length)){(0,C.f_)(i);return}null!=a&&a.length&&a.length!==e.length||e.forEach(e=>{if("subtitles"===e.kind&&e.id.includes(t.id)&&(!e.label||!e.src||!e.language)){i.textTracks.remove(e);return}})}},300),ev=e=>{var t;if(!(null===(t=e.tracks)||void 0===t?void 0:t.length))return;let i=e.tracks,{player:n,captions:s=[],video:r}=u.nP.getState();if(!(null==n?void 0:n.el)||!r)return;let o=[];i.forEach((e,t)=>{let i=e.subtitleTrack;if(i){let a=(0,j.Mk)(r.lang||I.A1),n=s.some(e=>e.lang===a);if(!n){let l={id:"hls-subtitles-".concat(t),src:i.url,kind:"subtitles",type:"vtt",lang:a,captionLocale:r.lang||I.A1,label:i.name,videoId:r.id};o.push(l)}}}),m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Caption] onHlsNonNativeTextTracksFound | tracks:",i," | Captions:",o),u.nP.setState(e=>(e.captions?e.captions=[...o,...e.captions]:e.captions=o,(0,a.Z)({},e)))},eh=e=>{let{player:t,video:i}=u.nP.getState();if(i&&t&&i.duration){let a=Math.round(t.state.currentTime),n=Math.round(e),s=Math.round(a/i.duration*100),r=Math.round(n/i.duration*100);if(t.state.playing)(0,D.checkPremiumWatch)(i).then(e=>{var t;return(0,D.sendBDPTrackingEvent)({en:"progress_shift",addData:{cnt_id:i.id,cnt_type:i.type,source:i.source,channel_id:(null===(t=i.channel)||void 0===t?void 0:t.id)||"",is_premium:e},extra:{from_time:a,to_time:n,from_pct:s,to_pct:r}}
1)});else{let o=Math.round(n-a);(5==Math.abs(o)||10==Math.abs(o))&&(F.length&&F[F.length-1].toTime!==a?F=[]:F.push({fromTime:a,toTime:n,videoId:i.id}))}}};var ep=i(278),em=i(6250),ef=i(93180),eg=i(67421),ey=i(365);let eb={play:(0,n.jsx)(em.Z.Pause,{}),pause:(0,n.jsx)(em.Z.Play,{}),mute:(0,n.jsx)(em.Z.Mute,{className:"py-[7px]"}),volLow:(0,n.jsx)(em.Z.VolumeLow,{className:"py-[7px]"}),volHigh:(0,n.jsx)(em.Z.VolumeHigh,{className:"py-[7px]"}),volMax:(0,n.jsx)(em.Z.VolumeMax,{className:"py-[7px]"}),unmute:(0,n.jsx)(em.Z.VolumeMax,{className:"py-[7px]"})},ew=(e,t,i)=>{if(!t||!i)return{icon:i||"",text:""};if(i.includes("playbackRate-"))return{text:"".concat(e("videojs.dialogSpeed"),": ").concat(1===t.state.playbackRate?e("videojs.normalSpeed"):t.state.playbackRate)};if(i.includes("volume-")){let a=Math.round(100*t.state.volume);return{icon:0==a?"mute":a<25?"volLow":a<70?"volHigh":"volMax",text:"".concat(a,"%")}}switch(i){case"unmute":let n=t.state.volume;return{icon:0==n?"mute":n<.25?"volLow":n<.7?"volHigh":"volMax"};case"captionOff":return{text:"".concat(e("videojs.dialogCaptions"),": ").concat(e("videojs.off"))};case"captionOn":var s;return{text:"".concat(e("videojs.dialogCaptions"),": ").concat(e("videojs.on")," (").concat(null===(s=t.state.textTrack)||void 0===s?void 0:s.label,")")}}return{icon:i}};var eA=(0,r.memo)(function(){let{t:e}=(0,eg.$G)(),t=(0,ef.uY)(),i=(0,r.useRef)(),{0:a,1:o}=(0,r.useState)(""),{0:l,1:d}=(0,r.useState)(""),v=(0,r.useRef)(""),h=(0,u.nP)(e=>e.playerAction),p=(0,u.nP)(e=>e.isMobiPlayer);return(0,ey.Z)(()=>{if(t&&!p&&h&&v.current!==h)return v.current=h,setTimeout(()=>{let{icon:i,text:a}=ew(e,t,h);o(i||""),d(a||"")},100),i.current=setTimeout(()=>{o(""),d("")},1200),()=>{clearTimeout(i.current),o(""),d("")}},[h]),(0,n.jsxs)("div",{className:(0,s.Z)(c().actionNotif,Boolean(a||l)&&c().show),children:[(0,n.jsx)("div",{className:c().actNoti,children:(0,n.jsx)("div",{className:c().actText,children:l})}),!!a&&(0,n.jsx)("div",{className:c().actBezel,role:"status","aria-label":a,children:(0,n.jsx)("div",{className:c().actIcon,children:eb[a]})})]})}),eP=i(72297),ex=i(38933);let ek,eS={PlayerShortKeys:{keys:["k","Space","j","f","l","m","c","Shift+P","Shift+N","<",">",",",".","Shift+?","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],onKeyDown(e){let{event:t}=e;t.preventDefault(),t.stopImmediatePropagation()},onKeyUp(e){var t,i;let{event:n,player:s,remote:r}=e,{adPlayer:o,nextVideo:l,isLiveStreaming:d,isFastPlayer:c,prevVideo:v,tvSeries:h,videoSrcObj:p,disableControls:g,isEmbed:y}=u.nP.getState();if(!(null==p?void 0:p.src)||g||y)return;n.preventDefault(),n.stopImmediatePropagation(),m.j5.basic&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] PlayerShortKeys code",n.code);let b=null==h?void 0:h.id;switch(n.code){case"Space":case"KeyK":u.nP.setState(e=>{if(s.adPlaying&&e.adPlayer){let t=e.adPlayer.state.isPlaying;e.playerAction=t?"pause":"play",t?(s.userRecentAction="pause",e.adPlayer.pause(),(0,E.W7)({isPaused:!0})):(s.userRecentAction="play",e.adPlayer.play(),(0,E.W7)({isPaused:!1}))}else s.state.playing?(e.playerAction="pause",s.userRecentAction="pause",s.remoteControl.pause(),(0,E.W7)({isPaused:!0})):(e.playerAction="play",s.userRecentAction="play",s.remoteControl.play(),(0,E.W7)({isPaused:!1}));return(0,a.Z)({},e)});break;case"KeyF":let{isFullScreen:w,disableFullscreen:A}=u.nP.getState();if(A)return;let x=null===(t=s.el)||void 0===t?void 0:t.parentElement;if(!x)return;(0,eP.V9)(x,{isFullscreen:!w});break;case"KeyM":u.nP.setState(e=>{if(s.adPlaying&&o){let t=o.state.isMuted;e.playerAction=t?"unmute":"mute",t?o.unmute():o.mute()}else e.playerAction=s.state.muted?"unmute":"mute",r.toggleMuted(n);return(0,a.Z)({},e)});break;case"KeyN":if(c)break;if(s.adPlaying)return;if(b)(0,f.tu)("next");else{if(!(null==l?void 0:l.id))return;(0,f.mk)(l.id)}break;case"KeyP":if(c)break;if(s.adPlaying)return;if(b)(0,f.tu)("prev");else{if(!(null==v?void 0:v.id))return;(0,f.mk)(v.id)}break;case"KeyC":if(s.adPlaying)return;if(!(null===(i=s.state.textTracks)||void 0===i?void 0:i.length)){r.disableCaptions(n);return}let k=s.state.textTrack;k?(r.disableCaptions(n),u.nP.setState({playerAction:"captionOff"})):(r.toggleCaptions(n),u.nP.setState({playerAction:"captionOn"}));break;case"Period":if(c)break;if(s.adPlaying||d||s.state.playbackRate>1.75)return;let S=s.state.playbackRate+.25;r.changePlaybackRate(S),u.nP.setState({playerAction:"playbackRate-"+S});return;case"Comma":if(c)break;if(s.adPlaying||d||s.state.playbackRate<.5)return;let T=s.state.playbackRate-.25;r.changePlaybackRate(T),u.nP.setState({playerAction:"playbackRate-"+T});break;case"ArrowLeft":if(c)break;if(s.adPlaying)return;let _=s.state.currentTime-10;_<0&&(_=0),r.seek(_);break;case"ArrowRight":if(c)break;if(s.adPlaying||d&&s.state.duration<20)return;let j=d?s.state.duration-10:s.state.duration,C=s.state.currentTime+10;C>j&&(C=j),r.seek(C);break;case"ArrowUp":let I=Number(s.state.volume.toFixed(2));if(1===I)return;(I=s.state.volume+.05)>1&&(I=1),s.state.muted&&r.unmute(),r.changeVolume(I),u.nP.setState({playerAction:"volume-"+I});break;case"ArrowDown":let L=Number(s.state.volume.toFixed(2));if(0===L)return;(L=s.state.volume-.05)<=0&&(L=0,r.mute()),r.changeVolume(L),u.nP.setState({playerAction:"volume-"+L});break;case"Slash":if(c)break;if(s.adPlaying||ek||!n.shiftKey)return;ek=V.dialogHandler.showCustomDialog({Component:ex.g,props:{onClosed:()=>ek=void 0},dialogSettings:{disableBackdropClick:!0}})}}}};var eE=i(71192),eT=i(16481),e_=i(61671),ej=i(69940),eC=i(98940);let eI=e=>{let{video:t,player:i,locale:n}=e,s=(0,u.nP)(e=>e.isMoviePlayer),o=(0,u.nP)(e=>e.disableHistory),l=(0,u.nP)(e=>e.isLiveStreaming),d=(0,u.nP)(e=>{var i;return null!==(i=e.playlistData)&&void 0!==i&&!!i.contentIds.length&&-1!==e.playlistData.contentIds.findIndex(e=>e===t.id)}),c=(0,r.useRef)(!1),h=(0,r.useRef)([]),p=(0,r.useRef)(),g=t.live_redirect_id||"";return(0,r.useEffect)(()=>
1{if(o)return;let e=()=>{let{player:e,video:t,isLiveStreaming:i}=u.nP.getState();(null==e?void 0:e.el)&&t&&(!i||"Live"!==t.sub_type)&&(document.hidden||(0,E.W7)({isPaused:!1}),(0,b.N)({video:t,currentTime:e.state.currentTime,duration:e.state.duration}))};window.addEventListener("beforeunload",e),window.addEventListener("pagehide",e);let t=()=>{let{player:t}=u.nP.getState();document.hidden?(x.tq&&(null==t?void 0:t.state.playing)&&(c.current=!0,t.remoteControl.pause()),e()):x.tq&&c.current&&(null==t||t.remoteControl.play())};return document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("beforeunload",e),window.removeEventListener("pagehide",e),document.removeEventListener("visibilitychange",t)}},[t.id,n,o]),(0,r.useEffect)(()=>{var e,t;(null==i?void 0:i.el)&&(d?null===(e=i.el.querySelector(".autoNextBtn"))||void 0===e||e.classList.add("!hidden"):null===(t=i.el.querySelector(".autoNextBtn"))||void 0===t||t.classList.remove("!hidden"))},[d]),(0,r.useEffect)(()=>{if(!t||!["Video","Live","Movie","Episode","TVSeries"].includes(t.type))return;let e=(0,T.Z)(()=>{var e,i;let r=p.current,o=h.current;if(l&&!(null==r?void 0:null===(e=r.contentIds)||void 0===e?void 0:e.length)){u.nP.setState({liveRedirectId:Boolean(t.live_redirect_id)?t.live_redirect_id:""});return}if(!t.live_redirect_id&&!(null==r?void 0:null===(i=r.contentIds)||void 0===i?void 0:i.length)&&!(null==o?void 0:o.length)){let d,c=(0,m._r)();if(c.watched[t.id]=!0,c.data[t.id]){let y=c.list.findIndex(e=>e===t.id);if(y>0){let b=c.list[y-1],w=c.data[b];w&&(d=w.video)}}u.nP.setState({prevVideo:d,nextVideo:void 0});return}(0,f.QA)({video:t,locale:n,playlistData:r,relatedVideos:o,isMoviePlayer:s,callback(e,i,n){m.j5.basic&&console.debug("[".concat((0,P.hf)(),"]"),"Get prev & next video | ","\n[PrevVideo]:",null==e?void 0:e.title,"\n[CurrVideo]:",t.title,"\n[NextVideo]:",null==i?void 0:i.title),ej.S.prevNextVideoChanged.next({prevVideo:e,nextVideo:i}),eC.j.setState(e=>
1(o.forEach(t=>{e.data[t.id]=(0,v.Z)((0,a.Z)({},e.data[t.id],t),{ts:Date.now()})}),(0,a.Z)({},e))),u.nP.setState({nextVideo:i,prevVideo:e,relatedVideos:o,isLastVideoInPlaylist:n,liveRedirectId:Boolean(t.status!==e_.zZ.FINISHED&&g!==u.IJ&&t.live_redirect_id&&(null==i?void 0:i.id))?t.live_redirect_id:""})}})},300),i=ej.S.relatedContentChanged.subscribe(t=>{let{videos:i}=t;h.current=i,e()},!0),r=ej.S.playlistContentChanged.subscribe(t=>{p.current=t,e(),u.nP.setState({playlistData:t})},!0);return()=>{i.unsubscribe(),r.unsubscribe()}},[null==t?void 0:t.id,n,l]),null};var eL=(0,r.memo)(eI),eN=i(476),eD=i(32040),eM=i(14487),eR=i(85479),eV=i(73423),eZ=i(46129),eU=i(65771),eF=i(38771),eO=i(92150),eB=i(26276);let eq=(0,r.forwardRef)(function(e,t){var i;let{setHide:o,nextVideoId:l,inView:d,setIsThumbnailEndScreen:h}=e,{t:p}=(0,eg.$G)(),y=(0,r.useRef)(0),b=(0,r.useRef)(!1),A=(0,r.useRef)(null),P=(0,r.useRef)(null),x=(0,u.nP)(e=>e.video),S=(0,u.nP)(e=>e.isLivePlayer),E=(0,w.s)(e=>e.system.browserWidth<762),T=(0,w.s)(e=>e.system.topicEditPostInProcess),{0:j,1:C}=(0,r.useState)(0),{0:I,1:L}=(0,r.useState)(""),{0:N,1:D}=(0,r.useState)({stop:!1,count:1}),M=(0,r.useCallback)(e=>{(0,f.mk)(l,e),setTimeout(()=>o(!0),1e3)},[l]),R=()=>{A.current&&clearTimeout(A.current),D({stop:!0,count:1})};(0,r.useEffect)(()=>{l&&!N.stop&&(N.count>0?A.current=setTimeout(()=>{(null===V.dialogHandler||void 0===V.dialogHandler?void 0:V.dialogHandler.hasDialog())?C(j+1):D((0,v.Z)((0,a.Z)({},N),{count:N.count-1}))},1e3):M(!0))},[N,j]),(0,r.useEffect)(()=>{if((0,eO.gt)(null==x?void 0:x.id),d)N.stop&&!N.stopByClickOutSide&&D({stop:!1,count:1});else{if(N.stop)return;clearTimeout(A.current),D({stop:!0,count:1})}},[d]),(0,r.useEffect)(()=>{if(!P.current)return;let e=e=>{var t;if(null===(t=P.current)||void 0===t?void 0:t.contains(e.target)){if(!N.stop)return;D({count:1,stop:!1,stopByClickOutSide:!1})}else{if(N.stop&&N.stopByClickOutSide)return;clearTimeout(A.current),D({count:1,stop:!0,stopByClickOutSide:!0})}},t;return E&&(t=(0,_.Z)(()=>{let e=(0,k.c6)();if(N.stop){if(e>0)return;D({stop:!1,count:0===N.count?0:1})}e>y.current&&(clearTimeout(A.current),D({stop:!0,count:0===N.count?0:1})),y.current=e},100),document.addEventListener("scroll",t)),()=>{document.removeEventListener("click",e),document.removeEventListener("scroll",t)}},[E,N.stop,N.count]),(0,r.useEffect)(()=>{N.stop&&N.stopByClickOutSide||(T?setTimeout(()=>{clearTimeout(A.current),D({stop:!0,count:1}),b.current=!0},500):b.current&&setTimeout(()=>{D({stop:!1,count:N.count}),b.current=!1},500))},[T]);let Z=(0,r.useMemo)(()=>{var e,t,i,a,n;if(!l)return;let s=(0,m._r)(),r=null===(e=s.data[l])||void 0===e?void 0:e.video;if(!r)return;if(null==x?void 0:x.id){let o=null===(n=s.data[x.id])||void 0===n?void 0:n.video;o&&o.live_redirect_id===l&&L(p("livePage.liveRedirectTxt",{val0:o.channel.name}).toString())}let d=(0,g.XM)(r),c=(null===(t=r.channel)||void 0===t?void 0:t.id)===eF.n&&d,u=(0,eR.ab)(r.poster_url||(null===(i=r.channel)||void 0===i?void 0:i.default_thumbnail)||(0,eB._6)(null===(a=r.channel)||void 0===a?void 0:a.name),"thumb",eR.fs.GRID);return{video:r,thumbnail:u,isSYCChannel:c,channel:r.channel,channelUrl:(0,eU.Jj)(r.channel),target:c?"_blank":"_self",link:(0,g.dz)({isSYCChannel:c,video:r})}},[l,null==x?void 0:x.id,p,d]);if(!Z)return null;let U=()=>{R(),o(!0)};return(0,n.jsx)("div",{ref:P,className:(0,s.Z)(c().wrapper,c()["is-subscriber"]),children:(0,n.jsxs)("div",{className:(0,s.Z)(c().container),children:[(0,n.jsx)("div",{ref:t,className:c().countDown,"data-testid":"player-end-screen-countdown",dangerouslySetInnerHTML:{__html:N.stop?p("videojs.countDownText"):p("videojs.countDownText1",{val0:"<strong>".concat(N.count,"</strong>")})}}),Boolean(null==I?void 0:I.length)&&(0,n.jsx)("div",{className:"mb-1.5",children:I}),(0,n.jsxs)("div",{className:c().info,"data-testid":"player-end-screen-next-video-info",children:[(0,n.jsx)("div",{className:c().thumbnail,children:(0,n.jsxs)(eV.Z,{trackingContent:Z.video,href:Z.link,target:Z.target,children:[(0,n.jsx)(eZ.Z,{src:Z.thumbnail,alt:Z.video.title,layout:"fill",objectFit:"cover"}),Z.video.duration&&(0,n.jsx)("div",{className:"absolute inline-flex items-center justify-center bg-[rgba(0,0,0, 0.5)] !top-auto !h-3.75 right-3 bottom-2 p-1.5 text-s11 text-white w-auto left-auto rounded-full",children:(0,g.DZ)(Z.video.duration)})]})}),(0,n.jsxs)("div",{className:c().text,children:[(0,n.jsx)(eV.Z,{href:Z.link,target:Z.target,className:(0,s.Z)(c().title,"mb-1 b868:text-[16
1px] line-clamp-2 b868:mb-2"),children:Z.video.title}),(0,n.jsx)(eV.Z,{className:c().channel,href:Z.channelUrl,children:null===(i=Z.channel)||void 0===i?void 0:i.name})]}),(0,n.jsxs)("div",{className:c().btns,children:[(0,n.jsx)("button",{type:"button",className:"text-white mr-6 rounded-full py-1 text-s10 px-1 b429:px-2 b588:px-5 b688:py-2 b868:px-8 b868:text-s13 b1366:text-s16 font-medium hover:bg-gjw-p-dark transition ease-in-out","data-testid":"player-end-screen-cancel-btn",onClick(){U(),h&&h(!0),S&&u.nP.setState({liveRedirectId:u.IJ})},children:p("videojs.cancel")}),(0,n.jsx)("button",{type:"button",className:(0,s.Z)(c()["btn-light"],"text-white rounded-full py-1 text-s10 px-1 b429:px-2 b588:px-5 b688:py-2 b868:px-8 b868:text-s13 b1366:text-s16 font-medium hover:bg-gjw-p-dark transition ease-in-out"),"data-testid":"player-end-screen-play-now-btn",onClick(){U(),M()},children:p("videojs.playNow")})]})]})]})})});var eG=(0,r.memo)(eq),eH=i(73198),eW=i(70131),ez=i(3988);let eX=e=>{let{isInPlaylist:t,canAutoNext:i,nextVideoId:a,className:o,setIsThumbnailEndScreen:l}=e,{ref:d,inView:v,entry:h}=(0,eW.YD)(),{0:p,1:m}=(0,r.useState)(!0),{0:g,1:y}=(0,r.useState)(!0),b=(0,u.nP)(e=>e.isLivePlayer),w=(0,u.nP)(e=>e.enterPageTime);(0,r.useEffect)(()=>{if(2===t&&!i){m(!0);return}1===t?(m(!0),(0,f.mk)(a,!0)):m(!1);let e=()=>y(document.hidden);return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[a,i,t]),(0,r.useEffect)(()=>{h&&y(v)},[v]);let A=e=>{b&&u.nP.setState({liveRedirectId:""}),m(!0),l&&l(!0),e.stopPropagation()};return p||!a||w&&Date.now()-w>144e5?null:(0,n.jsxs)("div",{className:(0,s.Z)(c().ctaBanner,o),"data-testid":"player-end-screen-cta-banner",children:[(0,n.jsx)(eH.Z,{onClick:A,btnClass:"absolute right-6 top-5 cursor-pointer block p-2",dataTestid:"player-end-screen-close-btn",startIcon:(0,n.jsx)(ez.default,{className:"w-5 h-5 fill-white"})}),(0,n.jsx)(eG,{ref:d,setHide:m,inView:g,nextVideoId:a,setIsThumbnailEndScreen:l})]})};var e$=i(89414),eQ=i(6770),eK=i.n(eQ),eJ=i(85707);let eY=e=>{let{videoId:t}=e,{t:i}=(0,eg.$G)(),a=(0,eJ.RB)(t),o=(0,u.nP)(e=>e.isEmbed),l=(0,r.useMemo)(()=>{var e;if(!a)return;let t=(0,g.XM)(a),i=(null==a?void 0:null===(e=a.channel)||void 0===e?void 0:e.id)===eF.n&&t,n=(0,eR.ab)(a.poster_url||a.channel.default_thumbnail||(0,eB._6)(a.channel.name),"thumb",eR.fs.SMALL);
1return{thumbnail:n,isSYCChannel:i,channel:a.channel,target:i||o?"_blank":"_self",link:(0,g.dz)({isSYCChannel:i,video:a})}},[a,i]),d=(0,r.useCallback)(()=>{a&&(0,eO.gt)(a.id)},[null==a?void 0:a.id]);return a&&l?(0,n.jsx)("div",{onMouseEnter:d,className:(0,s.Z)(eK().videoCard),"data-testid":"player-end-screen-video-thumb",children:(0,n.jsxs)(eV.Z,{trackingContent:a,href:l.link,target:l.target,children:[(0,n.jsxs)("div",{className:eK().thumbnail,children:[(0,n.jsx)(eZ.Z,{src:l.thumbnail,className:eK().img,alt:a.title,layout:"fill",objectFit:"cover"}),Boolean(a.duration)&&(0,n.jsx)("div",{className:eK().duration,"data-testid":"player-end-screen-video-duration",children:(0,g.DZ)(a.duration)})]}),(0,n.jsxs)("div",{className:eK().info,children:[(0,n.jsxs)("div",{className:eK().title,children:[" ",a.title]}),(0,n.jsxs)("div",{className:eK().channel,children:[" ",l.channel.name]})]})]})}):null};var e0=(0,r.memo)(eY);let e1=e=>{let{video:t,nextVideoId:i}=e,a=(0,ef.uY)(),o=(0,u.nP)(e=>e.isEmbed),l=(0,u.nP)(e=>e.canAutoNext),d=(0,u.nP)(e=>e.isFullScreen),v=(0,u.nP)(e=>e.isMobiPlayer),h=(0,u.nP)(e=>e.relatedVideos),p=(0,w.s)(e=>e.system.isMobileLandscape),m=(0,u.nP)(e=>{var i;if(!(null===(i=e.playlistData)||void 0===i?void 0:i.contentIds.length))return 0;let{contentIds:a,config:n}=e.playlistData,s=a.findIndex(e=>e===t.id);if(-1===s)return 0;if(n.loop)return 1;let r=s===a.length-1;return r?2:1}),[f,{width:g,height:y}]=(0,e$.Z)(),{0:b,1:A}=(0,r.useState)(),{0:P,1:k}=(0,r.useState)(!1);(0,r.useEffect)(()=>()=>{var e,t;null===(e=window.player)||void 0===e||null===(t=e.el)||void 0===t||t.classList.remove("vds-endScreen")},[]),(0,r.useEffect)(()=>{var e,t;(null==a?void 0:a.el)&&(m?null===(e=a.el.querySelector(".autoNextBtn"))||void 0===e||e.classList.add("!hidden"):null===(t=a.el.querySelector(".autoNextBtn"))||void 0===t||t.classList.remove("!hidden"))},[m]),(0,r.useEffect)(()=>{k(!1),A(!1)},[l]);let S=Boolean((null==h?void 0:h.length)&&(o||(!l||l&&P)&&(!m||2===m))),E=Boolean(!o&&!P&&i&&!t.fromPost&&(l||m)),T=["Video","Live","Movie","Episode"],_=(0,eJ.H1)((null==h?void 0:h.filter(e=>e.id!==t.id&&T.includes(e.type)).map(e=>e.id))||[]).slice(0,3).map(e=>e.id)||[],{rows:j}=(0,r.useMemo)(()=>{let e=y>0&&y<130?0:y<230?1:y<372?2:y<500?3:4,i=g<440?1:g<660?2:3;if(!S||!e)return{relatedIds:[],divClass:"",rows:e,cols:i,gridWidth:"100%",gridHeight:"100%"};let a="grid-cols-".concat(i," grid-rows-").concat(e),n=220*i,s=124*e,r=1;if(d){let o=window.innerWidth/n,l=(window.innerHeight-150)/s;r=Math.min(o,l)}let c=(null==h?void 0:h.filter(e=>e.id!==t.id&&T.includes(e.type)).map(e=>e.id))||[];return{relatedIds:c=c.slice(0,1===e?12:e*i),gridClass:a,rows:e,cols:i,scale:r,gridWidth:n+"px",gridHeight:s+"px"}},[S,y,g,h,d]),C=Boolean(!E&&S&&!b&&(o||d||!x.UA||p));return((0,r.useEffect)(()=>{var e;(null===(e=window.player)||void 0===e?void 0:e.el)&&(C&&j>0?window.player.el.classList.add("vds-endScreen"):window.player.el.classList.remove("vds-endScreen"))},[C,j]),E)?(0,n.jsx)(eX,{nextVideoId:i,canAutoNext:l,isInPlaylist:m,setIsThumbnailEndScreen:k}):C?(0,n.jsx)("div",{className:(0,s.Z)("video-end-screen",c().endScreen,j>0&&c().active,o&&c().embed,v&&c().mobi),"data-testid":"player-end-screen",children:(0,n.jsx)("div",{ref:f,className:c().innerWrap,children:j>0&&(0,n.jsx)("div",{className:(0,s.Z)(c().videoGrid),"data-testid":"player-end-screen-grid",children:_.map((e,t)=>(0,n.jsx)(e0,{videoId:e},"".concat(e,"-").concat(t)))})})}):null};var e9=(0,r.memo)(e1),e5=i(29154),e2=i(11163),e8=i(83884),e3=i(11366),e7=i.n(e3);let e4=e=>{let{type:t,videoId:i,onHoverChange:a}=e,{t:o}=(0,eg.$G)(),l=(0,e8.Z)(i),d=(0,u.nP)(e=>e.isEmbed),c=(0,r.useMemo)(()=>{var e;if(!l)return;let t=(0,g.XM)(l),i=(null==l?void 0:null===(e=l.channel)||void 0===e?void 0:e.id)===eF.n&&t,a=(0,eR.ab)(l.poster_url||l.channel.default_thumbnail||(0,eB._6)(l.channel.name),"thumb",eR.fs.SMALL);return{thumbnail:a,link:(0,g.dz)({isSYCChannel:i,video:l}),target:i||d?"_blank":"_self"}},[l,o]),v=(0,r.useCallback)(()=>{l&&(0,eO.gt)(l.id),null==a||a(!0)},[null==l?void 0:l.id,a]),h=(0,r.useCallback)(()=>{null==a||a(!1)},[a]);return l&&c?(0,n.jsx)("div",{"data-testid":"video2"===t?"channel-end-screen-video-2":"channel-end-screen-video",onMouseEnter:v,onMouseLeave:h,className:(0,s.Z)(e7()[t],e7().hover),children:(0,n.jsxs)(eV.Z,{trackingContent:l,href:c.link,target:c.target,children:[(0,n.jsx)("div",{className:e7().thumbnail,children:(0,n.jsx)(eZ.Z,{layout:"fill",objectFit:"cover",alt:l.title,className:e7().img,src:c.thumbnail})}),(0,n.jsxs)("div",{className:(0,s.Z)(e7().info),children:[(0,n.jsx)("div",{className:(0,s.Z)(e7().title,e7()["max-lines-2"]),children:l.title}),(0,n.jsx)("div",{className:e7().meta,children:(null==l?void 0:l.duration)&&(0,n.jsx)("div",{className:e7().duration,children:(0,g.DZ)(l.duration)})})]})]})}):null};var e6=(0,r.memo)(e4),te=i(99534),tt=i(15043),ti=i(80695);let ta=e=>{var{playlistId:t}=e,i=(0,te.Z)(e,["playlistId"]);let{t:o}=(0,eg.$G)(),{playlist:l}=(0,tt.Z)(t,{checkEntStatus:!0}),d=(0,r.useMemo)(()=>{var e,t;if(!l)return;let i=l.stats,a=null!==(t=null==l?void 0:null===(e=l.data)||void 0===e?void 0:e.v1)&&void 0!==t?t:[],n=a.length||(null==i?void 0:i.contents)||0,s=(null==i?void 0:i.first_public_content)||a[0],r=(null==i?void 0:i.first_public_content_type)||"video",o=(0,eR.ab)(l.thumbnail,"thumb",eR.fs.SMALL),d="/".concat(r.toLowerCase(),"/").concat(s,"?playlist_id=").concat(l.id);return{link:d,thumbnail:o,numOfContent:n,target:"_self"}},[l,o]);return l&&d?(0,n.jsx)("div",(0,v.Z)((0,a.Z)({},i),{"data-testid":"channel-end-screen-playlist",className:(0,s.Z)(e7().playlist,e7().hover),children:(0,n.jsxs)(eV.Z,{trackingContent:l,href:d.link,target:d.target,children:[(0,n.jsx)("div",{className:e7().thumbnail,children:(0,n.jsx)(eZ.Z,{layout:"fill",objectFit:"cover",alt:l.name,className:e7().img,src:d.thumbnail})}),(0,n.jsxs)("div",{className:(0,s.Z)(e7().info),children:[(0,n.jsx)("div",{className:(0,s.Z)(e7().title,e7()["max-lines-2"]),children:l.name}),(0,n.jsxs)("div",{className:e7().number_indicator,children:[(0,n.jsx)(ti.default,{className:"w-[24px] h-[21px]"}),(0,n.jsx)("div",{children:d.numOfContent}),(0,n.jsx)("div",{className:"ml-[2px]",children:o(d.numOfContent>1?"channel.playlist.videos":"channel.playlist.video")})]})]})]})})):null};var tn=(0,r.memo)(ta),ts=i(29596),tr=i(78483),to=i(95482),tl=i(94330);let td=e=>{let{video:t,isActive:i,channelId:a}=e,{t:o}=(0,eg.$G)(),l=(0,ts.E)(a),d=(0,r.useRef)(null),{0:c,1:u}=(0,r.useState)(!1),{0:v,1:h}=(0,r.useState)(!1),p=(0,r.useMemo)(()=>
1{if(!l)return;let e=(0,eR.ab)(l.icon,"thumb",eR.fs.MEDIUM_672),t=(null==l?void 0:l.handle)?"/".concat(l.handle):"/channel/".concat(l.id);return{link:t,thumbnail:e}},[l,o]),m=()=>{(null==p?void 0:p.link)&&v&&window.open(p.link,"_blank","noopener,noreferrer")},f=()=>{u(!0),setTimeout(()=>{h(!0)},1e3)},g=()=>{u(!1),h(!1)};return((0,r.useEffect)(()=>{let e=e=>{d.current&&!d.current.contains(e.target)&&g()};return window.matchMedia("(hover: none)").matches&&document.addEventListener("touchstart",e),()=>{document.removeEventListener("touchstart",e)}},[]),l&&p&&t)?(0,n.jsx)("div",{"data-testid":"channel-end-screen-follow",className:(0,s.Z)(e7().follow,c&&e7().hoverFollow),children:(0,n.jsx)("div",{ref:d,className:e7()["avatar-overlay"],onMouseLeave:g,children:(0,n.jsxs)("div",{className:e7()["overlay-content"],"data-testid":"channel-end-screen-overlay",children:[(0,n.jsxs)("div",{className:e7()["overlay-info"],children:[(0,n.jsx)(tu,{channel:l}),(0,n.jsx)("div",{className:e7().divider}),(0,n.jsx)(tv,{video:t,channel:l,isActive:i})]}),(0,n.jsx)("div",{"data-testid":"channel-end-screen-avatar",className:e7().avatar,onClick:m,onMouseEnter:f,onTouchStart:f,style:{backgroundImage:'url("'.concat(null==p?void 0:p.thumbnail,'")')}})]})})}):null};var tc=(0,r.memo)(td);let tu=e=>{let{channel:t}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,s.Z)(e7()["overlay-name"],e7()["max-lines-2"]),children:t.name}),(0,n.jsx)("div",{className:(0,s.Z)(e7()["overlay-desc"],e7()["max-lines-3"]),children:t.desc})]})},tv=e=>{let{video:t,channel:i,isActive:a}=e,s=(0,w.s)(e=>!!e.following.followedChannels[(null==i?void 0:i.id)||""]),r=(0,tl.xJ)();return(0,n.jsxs)("div",{className:e7()["overlay-actions"],children:[(0,n.jsx)(to.o,{isNoti:!0,content:t,channel:i,channelId:i.id,isFollowed:Boolean((null==i?void 0:i.is_follow)||s),activeStyles:a?e7().activeUp:e7().activeDown}),(0,n.jsx)(tr.Z,{channel:i,disabled:!r.user_id&&t.made_for_kids})]})},th=new Map([[1,{id:1,align:"flex-end",frames:{video:"video",follower:"follower"}}],[2,{id:2,align:"center",frames:{video:"video",follower:"follower"}}],[3,{id:3,align:"flex-start",frames:{video:"video",follower:"follower"}}],[4,{id:4,align:"center",frames:{video:"video",video2:"video2"}}],[5,{id:5,align:"center",frames:{video:"video",playlist:"playlist",follower:"follower"}}]]),tp=()=>{let e=e=>th.get(e),t=Array.from(th.values());return{layouts:t,getLayout:e}},tm=e=>{let{video:t,endScreen:i}=e,{getLayout:a}=tp(),r=a(i.layout),o=null==r?void 0:r.frames,l=null==i?void 0:i.content_id,d=null==i?void 0:i.content_id2,c=null==i?void 0:i.channel_id,u=null==i?void 0:i.playlist_id,v=(null==r?void 0:r.align)?({"flex-end":"bottom",center:"middle","flex-start":"top"})[r.align]:void 0;return(0,n.jsxs)("div",{"data-testid":"channel-end-screen","data-layout":i.layout,"data-position":v,className:(0,s.Z)(e7().endScreenLayout,e7().container,e7()["layout-".concat(i.layout)]),children:[(null==o?void 0:o.video)&&l&&(0,n.jsx)(e6,{videoId:l,type:"video"}),(null==o?void 0:o.video2)&&d&&(0,n.jsx)(e6,{videoId:d,type:"video2"}),(null==o?void 0:o.follower)&&c&&(0,n.jsx)(tc,{video:t,channelId:c,isActive:3!==i.layout}),(null==o?void 0:o.playlist)&&u&&(0,n.jsx)(tn,{playlistId:u})]})};var tf=(0,r.memo)(tm);let tg=e=>{var t,i,a;let{loop:s,video:o,isEmbed:l,liveStats:d,videoSrcData:c,isMoviePlayer:v,isLiveStreaming:h}=e,p=(0,e2.useRouter)(),f=(0,Z.Z)(e=>e.subscribe),{0:g,1:y}=(0,r.useState)(!1),b=(0,u.nP)(e=>{var t;return null===(t=e.nextVideo)||void 0===t?void 0:t.id}),A=(0,w.s)(e=>e.system.browserWidth>=e5.re),P=(0,u.nP)(e=>Boolean(c.src&&!h&&!s&&e.playerStatus===m.GZ.Ended)),x=(null===(t=o.channel)||void 0===t?void 0:t.id)&&e5.cR.includes(null===(i=o.channel)||void 0===i?void 0:i.id),k=Boolean(v||!P||(null===(a=p.query
1)||void 0===a?void 0:a.rel)=="0"||l&&x||"Live"===o.type&&(null==d?void 0:d.status)!=="FINISHED"&&!o.live_redirect_id);return((0,r.useEffect)(()=>{let e=f("Show_Custom_EndScreen",e=>{y(!!(null==e?void 0:e.layout))});return()=>{e()}},[g,o.end_screen]),A&&k&&g&&(null==o?void 0:o.end_screen))?(0,n.jsx)(tf,{endScreen:o.end_screen,video:o}):k?null:(0,n.jsx)(e9,{video:o,nextVideoId:b})};var ty=(0,r.memo)(tg),tb=i(78893),tw=i(8483),tA=i(57546),tP=i(86143),tx=i(95902),tk=i(94587);let tS=e=>{let{disableCaption:t,TimeSliderComp:i,SettingMenuComp:a}=e,r=(0,u.nP)(e=>e.video),o=(0,u.nP)(e=>e.nativeFullscreen),l=(0,u.nP)(e=>e.disableFullscreen);return(0,n.jsxs)(tb.ai.Root,{className:"".concat(c().controls," vds-controls"),children:[(0,n.jsx)(tP.Z,{}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),i,(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,c().controlToolbar,"vds-controls-group vds-controls-group-bar"),children:[(0,n.jsx)(tw.sh,{}),(0,n.jsx)(tw.g7,{}),(0,n.jsx)(tw.vk,{}),(0,n.jsx)(tb.j$,{className:"vds-chapter-title"}),(0,n.jsx)("div",{className:"vds-controls-spacer hidden"}),!t&&(0,n.jsx)(tx.Z,{videoId:null==r?void 0:r.id,placement:"top end",disableTooltip:x.tq}),a,!l&&(o?(0,n.jsx)(tw.$c,{}):(0,n.jsx)(tw.iT,{}))]})]})},tE=e=>{let{TimeSliderComp:t,SettingMenuComp:i}=e,a=(0,u.nP)(e=>e.nativeFullscreen),r=(0,u.nP)(e=>e.disableFullscreen);return(0,n.jsxs)(tb.ai.Root,{className:(0,s.Z)(c().controls,"vds-controls"),children:[(0,n.jsx)(tP.Z,{}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),t,(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,"vds-controls-group"),children:[(0,n.jsx)(tw.sh,{}),(0,n.jsx)(tw.g7,{}),(0,n.jsx)(tw.vk,{}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),i,!r&&(a?(0,n.jsx)(tw.$c,{}):(0,n.jsx)(tw.iT,{}))]})]})};var tT=(0,r.memo)(function(e){let{videoSrcObj:t}=e,i=(0,u.nP)(e=>e.isMobiPlayer),a=(0,u.nP)(e=>e.disableCaption),o=(0,u.nP)(e=>e.adState===m.H9.countDown),{ControlComponents:l,SettingMenuComp:d}=(0,r.useMemo)(()=>({ControlComponents:i?tE:tS,SettingMenuComp:void 0}),[t.src,i]),v=(0,r.useMemo)(()=>(0,n.jsx)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,c().timeControls,"vds-controls-group"),"data-testid":"player-bar",children:(0,n.jsx)(tA.q,{videoSrc:t.src})}),[t.src]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tk.m,{}),(0,n.jsx)(tw.x2,{isShown:o}),(0,n.jsx)(l,{TimeSliderComp:v,SettingMenuComp:d,disableCaption:a})]})}),t_=i(85288),tj=i(15904);let tC=(0,r.memo)(function(e){var t,i;let{className:a="vds-chapter-title",defaultText:s=""}=e,o=(0,u.nP)(e=>{var t;return null===(t=e.video)||void 0===t?void 0:t.chapters}),l=(0,u.nP)(e=>{var t;return null===(t=e.video)||void 0===t?void 0:t.duration}),d=(0,r.useMemo)(()=>o&&l?(0,tj.Qn)(o,l):[],[o,l]),c=(0,h.j9)("currentTime"),v=Number.isFinite(c)?c:0,p=null!==(i=null===(t=d.find(e=>v>=e.startTime&&v<e.endTime))||void 0===t?void 0:t.title)&&void 0!==i?i:"";return(0,n.jsx)("span",{className:a,children:p||s})});var tI=i(16066);let tL=()=>{let e=(0,u.nP)(e=>e.video),t=(0,o.Dn)();if(!(null==e?void 0:e.id))return null;let i=i=>{var a;i.stopPropagation();let n=(0,tI.Qw)(e),s=null===(a=null==t?void 0:t.getPlayer())||void 0===a?void 0:a.currentTime;s&&(n+="?t=".concat(s)),window.open(n,"_blank")};return(0,n.jsx)("button",{className:c().gjwLogoBanner,type:"button","aria-disabled":"false",onClick:i,children:(0,n.jsx)("span",{className:"vjs-icon-placeholder","aria-hidden":"true"})})};var tN=(0,r.memo)(tL),tD=i(46085),tM=i(61094),tR=(0,r.memo)(function(){let{t:e}=(0,eg.$G)();return(0,n.jsxs)("div",{className:c().audioMode,"data-testid":"audio-mode-screen",children:[(0,n.jsx)(tD.default,{className:c().ico1}),(0,n.jsx)("h1",{className:c().txt1,"data-testid":"audio-mode-title",children:e("videojs.playingAudioOnly")}),(0,n.jsxs)("div",{className:c().txt2,"data-testid":"audio-mode-guide",children:[e("videojs.turnOnVideo"),(0,n.jsx)(tM.default,{className:c().ico2})," >",(0,n.jsx)("span",{className:"ml-3",children:e("videojs.audioOff")})]})]})}),tV=i(71378),tZ=i(36524),tU=i(53156);let tF=e=>{let{disableAutoNext:t,disableLoop:i,disableCaption:a,isEmbed:o,hidebrand:l,TimeSliderComp:d,SettingMenuComp:v}=e,{0:h,1:p}=(0,r.useState)(!1),f=(0,u.nP)(e=>e.isMobiPlayer),g=(0,u.nP)(e=>e.video),y=(0,u.nP)(e=>e.hideGJWBanner),b=(0,u.nP)(e=>e.nativeFullscreen),w=(0,u.nP)(e=>e.disableFullscreen),A=(0,u.nP)(e=>e.isFullScreen||e.nativeFullscreen);return(0,n.jsxs)(tb.ai.Root,{className:"".concat(c().controls," vds-controls"),children:[(0,n.jsx)(tP.Z,{}),!!g&&o&&A&&(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)("vds-controls-group",c().controlsGroup,c().topControl
1s),children:[(0,n.jsx)(tV.Z,{video:g,hidebrand:l,setShowEmbedShare:p}),!l&&h&&(0,n.jsx)(tZ.Z,{video:g,setShowEmbedShare:p})]}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),d,(0,n.jsx)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,c().controlToolbar,"vds-controls-group vds-controls-group-bar"),children:o?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tw.sh,{}),(0,n.jsx)(tw.g7,{}),(0,n.jsx)(tw.Qq,{}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),(!l||y)&&(0,n.jsx)(tN,{}),a!==m.mN.Disable&&(f?(0,n.jsx)(tU.Z,{videoId:null==g?void 0:g.id}):(0,n.jsx)(tx.Z,{videoId:null==g?void 0:g.id,placement:"top end",disableTooltip:f||x.tq})),v,!w&&(b?(0,n.jsx)(tw.$c,{}):(0,n.jsx)(tw.iT,{}))]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tw.Zc,{}),(0,n.jsx)(tw.sh,{}),(0,n.jsx)(tw.$5,{}),(0,n.jsx)(tw.g7,{}),(0,n.jsx)(tw.Qq,{}),(0,n.jsx)(tC,{className:"vds-chapter-title"}),(0,n.jsx)("div",{className:"vds-controls-spacer hidden"}),!i&&(0,n.jsx)(tw.rN,{}),!t&&(0,n.jsx)(tw.$4,{}),a!==m.mN.Disable&&(f?(0,n.jsx)(tU.Z,{videoId:null==g?void 0:g.id}):(0,n.jsx)(tx.Z,{videoId:null==g?void 0:g.id,placement:"top end",disableTooltip:f||x.tq})),v,!w&&(b?(0,n.jsx)(tw.$c,{}):(0,n.jsx)(tw.iT,{}))]})})]})},tO=e=>{let{disableAutoNext:t,disablePrevNext:i,TimeSliderComp:a,SettingMenuComp:r}=e,o=(0,u.nP)(e=>!e.isLiveStreaming&&!e.loop&&e.playerStatus===m.GZ.Ended),l=(0,u.nP)(e=>e.isLoading),d=(0,w.s)(e=>e.system.isMobileLandscape),v=(0,u.nP)(e=>e.nativeFullscreen),h=(0,u.nP)(e=>e.disableFullscreen),p=(0,u.nP)(e=>e.video),f=(0,u.nP)(e=>e.disableCaption),g=(0,u.nP)(e=>e.isMobiPlayer);return(0,n.jsxs)(tb.ai.Root,{className:"".concat(c().controls," vds-controls"),children:[(0,n.jsx)(tP.Z,{}),(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)("vds-controls-group",c().controlsGroup,c().topControls),children:[(0,n.jsx)("div",{className:"vds-controls-spacer"}),!t&&(0,n.jsx)(tw.$4,{}),f!==m.mN.Disable&&(g?(0,n.jsx)(tU.Z,{videoId:null==p?void 0:p.id}):(0,n.jsx)(tx.Z,{videoId:null==p?void 0:p.id,placement:"top end",disableTooltip:g||x.tq})),r]}),!l&&(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,c().floatBns,"vds-controls-group"),children:[!i&&(0,n.jsx)(tw.Zc,{alwaysShow:!0}),(0,n.jsx)(tw.sh,{alwaysShow:!0}),!i&&(0,n.jsx)(tw.$5,{alwaysShow:!0})]}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,"vds-controls-group"),children:[o&&d&&(0,n.jsx)(tw.sh,{}),(0,n.jsx)(tw.Qq,{}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),!h&&(v?(0,n.jsx)(tw.$c,{}):(0,n.jsx)(tw.iT,{}))]}),a]})};var tB=(0,r.memo)(function(e){var t,i;let{video:a,videoSrcObj:o}=e,l=(0,e2.useRouter)(),d=(0,u.nP)(e=>e.isEmbed),v=(0,u.nP)(e=>e.isMobiPlayer),h=(0,u.nP)(e=>{var t;return e.audioMode&&!!(null===(t=e.video)||void 0===t?void 0:t.audio_url)}),p=(0,u.nP)(e=>e.disableCaption),f=(0,u.nP)(e=>e.disableAutoNext),g=(0,u.nP)(e=>e.disableLoop),y=(0,u.nP)(e=>e.disableSettings),b=(0,u.nP)(e=>e.disablePrevNext),w=(0,u.nP)(e=>e.adState===m.H9.countDown),{ControlComponents:A,SettingMenuComp:P}=(0,r.useMemo)(()=>{let e=y?null:(0,n.jsx)(t_.Z,{videoId:a.id,placement:v?"bottom end":"top end",disableTooltip:v||x.tq});return{ControlComponents:d||!v?tF:tO,SettingMenuComp:e}},[o.src,d,v,y]),k=(0,r.useMemo)(()=>(0,n.jsx)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,c().timeControls,"vds-controls-group"),"data-testid":"player-bar",children:(0,n.jsx)(tA.q,{videoSrc:o.src})}),[o.src]),S=e5.cR.includes(null==a?void 0:null===(t=a.channel)||void 0===t?void 0:t.id)||(null===(i=l.query)||void 0===i?void 0:i.hidebrand)==="1";return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tk.m,{}),h&&(0,n.jsx)(tR,{}),(0,n.jsx)(tw.x2,{isShown:w}),(0,n.jsx)(A,{isEmbed:d,hidebrand:S,TimeSliderComp:k,SettingMenuComp:P,disableCaption:p,disableAutoNext:f,disableLoop:g,disablePrevNext:b})]})});let tq=e=>{let{isPremiere:t,isStreaming:i,disableAutoNext:a,disableCaption:o,isEmbed:l,hidebrand:d,TimeSliderComp:v,SettingMenuComp:h}=e,{0:p,1:f}=(0,r.useState)(!1),g=(0,u.nP)(e=>e.video),y=(0,u.nP)(e=>{var t,i;return Boolean(g&&(null===(t=e.playlistData)||void 0===t?void 0:null===(i=t.contentIds)||void 0===i?void 0:i.find(e=>
1e===g.id)))}),b=(0,u.nP)(e=>e.nativeFullscreen),w=(0,u.nP)(e=>e.isFullScreen||e.nativeFullscreen);return(0,n.jsxs)(tb.ai.Root,{className:(0,s.Z)(c().controls,"vds-controls"),children:[(0,n.jsx)(tP.Z,{}),!!g&&l&&w&&(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)("vds-controls-group",c().controlsGroup,c().topControls),children:[(0,n.jsx)(tV.Z,{video:g,hidebrand:d,setShowEmbedShare:f}),!d&&p&&(0,n.jsx)(tZ.Z,{video:g,setShowEmbedShare:f})]}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),v,(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,"vds-controls-group"),children:[i?(0,n.jsxs)(n.Fragment,{children:[y&&(0,n.jsx)(tw.Zc,{}),(0,n.jsx)(tw.sh,{}),y&&(0,n.jsx)(tw.$5,{}),(0,n.jsx)(tw.g7,{}),t?(0,n.jsx)(tw.zD,{}):(0,n.jsx)(tw.vk,{})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tw.Zc,{}),(0,n.jsx)(tw.sh,{}),(0,n.jsx)(tw.$5,{}),(0,n.jsx)(tw.g7,{}),(0,n.jsx)(tw.Qq,{})]}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),!l&&!a&&!i&&(0,n.jsx)(tw.$4,{}),o!==m.mN.Disable&&(0,n.jsx)(tx.Z,{videoId:null==g?void 0:g.id,placement:"top end",disableTooltip:x.tq}),h,b?(0,n.jsx)(tw.$c,{}):(0,n.jsx)(tw.iT,{})]})]})},tG=e=>{let{isPremiere:t,isStreaming:i,disableAutoNext:a,TimeSliderComp:r,SettingMenuComp:o}=e,l=(0,u.nP)(e=>e.nativeFullscreen);return(0,n.jsxs)(tb.ai.Root,{className:(0,s.Z)(c().controls,"vds-controls"),children:[(0,n.jsx)(tP.Z,{}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),r,(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,"vds-controls-group"),children:[i?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tw.sh,{}),(0,n.jsx)(tw.g7,{}),t?(0,n.jsx)(tw.zD,{}):(0,n.jsx)(tw.vk,{})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tw.Zc,{}),(0,n.jsx)(tw.sh,{}),(0,n.jsx)(tw.$5,{}),(0,n.jsx)(tw.g7,{}),(0,n.jsx)(tw.Qq,{})]}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),!a&&!i&&(0,n.jsx)(tw.$4,{}),o,l?(0,n.jsx)(tw.$c,{}):(0,n.jsx)(tw.iT,{})]})]})};var tH=(0,r.memo)(function(e){let{live:t,videoSrcObj:i,liveStats:a,isLiveStreaming:o,disableAutoNext:l}=e,d=(0,ef.uY)(),v=(0,u.nP)(e=>e.isPremiere),h=(0,u.nP)(e=>e.isEmbed),p=(0,u.nP)(e=>e.isMobiPlayer),f=(0,u.nP)(e=>e.adState===m.H9.countDown);(0,r.useEffect)(()=>()=>{(0,b.N)({video:t,currentTime:0,duration:0}),null==d||d.remoteControl.seek(0)},[]);let{ControlComponents:g,SettingMenuComp:y}=(0,r.useMemo)(()=>{let e=(0,n.jsx)(t_.Z,{videoId:t.id,placement:p?"bottom end":"top end",disableTooltip:p||x.tq});return{ControlComponents:h||!p?tq:tG,SettingMenuComp:e}},[t.id,i,h,p]),w=(0,r.useMemo)(()=>(0,n.jsx)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,c().timeControls,"vds-controls-group"),children:(0,n.jsx)(tA.q,{videoSrc:i.src})}),[i.src]),A=o||(null==a?void 0:a.status)==="LIVE";return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tk.m,{}),(0,n.jsx)(tw.x2,{isShown:f}),(0,n.jsx)(g,{isEmbed:h,isPremiere:v,isStreaming:A,TimeSliderComp:w,SettingMenuComp:y,disableAutoNext:l})]})}),tW=i(90942),tz=i(81739),tX=i(61081),t$=i(73019),tQ=i(27844),tK=i(11877);let tJ=e=>{let{className:t,small:i,t:a,episode:s,contentMonetization:o}=e,{individualPlanOffer:l,promoPlan:d}=(0,tK.N)(),c=w.s.getState().system.browserWidth<e5.NN,v=(0,r.useMemo)(()=>(0,g.FG)({content:s,purchaseType:"buy"}),[s]);return(0,n.jsxs)("div",{className:(0,g.vX)("flex",t),children:[(null==o?void 0:o.canUsePremiumPlan)&&(0,n.jsx)(eH.Z,{theme:"black",variant:"contained",className:(0,g.vX)("!bg-white !text-black !border-white text-sm mr-3",i?"px-2 py-1 font-semibold text-xs rounded":"px-4 py-2 font-bold text-sm rounded-md","hover:brightness-75"),onClick(){(0,tQ.vh)(s),(0,tQ.t6)(l,d)},children:a("movies:watchWithPremium")}),(null==o?void 0:o.canBuyRent)&&(0,n.jsx)(eH.Z,{theme:"black",variant:"contained",className:(0,g.vX)("!bg-white !text-black !border-white text-sm",i?"px-2 py-1 font-semibold text-xs rounded":"px-4 py-2 font-bold text-sm rounded-md","hover:brightness-75"),async onClick(){let{player:e,isFullScreen:t}=u.nP.getState();(null==e?void 0:e.el)&&t&&((0,f.rn)(),await (0,g.gw)(500)),(0,tQ.Zh)({content:s,buyPrice:v,isFromGJWplus:!0,fullScreen:c})},children:a("movies:buyEpisode",{res:"",price:" $".concat(v)})})]})};var tY=(0,r.memo)(tJ),t0=i(27503),t1=i(89779),t9=(0,r.memo)(function(e){let{tvSeries:t}=e,i=(0,r.useRef)(null),a=(0,u.nP)(e=>e.player),o=(0,u.nP)(e=>e.isMobiPlayer),l=(0,w.s)(e=>e.system.isMobileLandscape),d=(0,u.nP)(e=>e.isMobiPlayer&&!e.isFullScreen&&!e.isMoviePlayer);(0,r.useEffect)(()=>{var e;a&&(null===(e=i.current)||void 0===e||e.close(),a.pausedByPopup&&(a.pausedByPopup=!1,a.remoteControl.play()))},[l]);let{seasons:v=[],seasonIndex:h=0}=(0,tQ.ne)(t.id),p=(0,t1.Z)({content:t,seasons:v}),m=(0,r.useCallback)(()=>
1{if(null==a?void 0:a.remoteControl){if(!d){let e=document.querySelector(".closePopupBtn");e&&(e.style.display="none");return}a.state.playing&&(a.pausedByPopup=!0,a.remoteControl.pause())}},[a]),f=(0,r.useCallback)(()=>{if(!(null==a?void 0:a.remoteControl))return;let e=document.querySelector(".closePopupBtn");e&&(e.style.display=""),a.pausedByPopup&&(a.pausedByPopup=!1,a.remoteControl.play())},[a]);return(null==p?void 0:p.length)?(0,n.jsxs)(ef.GI.Root,{ref:i,className:"vds-menu",onOpen:m,onClose:f,children:[(0,n.jsx)(ef.GI.Button,{disabled:!1,className:(0,s.Z)("vds-menu-button vds-button",c().episodeBtn),"data-testid":"player-episodes",children:(0,n.jsx)(tW.default,{className:"vds-icon customIcon fill-none !py-[3px]"})}),d?(0,n.jsx)(ef.GI.Portal,{children:(0,n.jsx)(ef.GI.Content,{className:(0,s.Z)("vds-menu-items",c().playerMenu,c().episodeMenu,o&&c().mobiMenus),"data-testid":"episode-list-menu",placement:"bottom end",children:(0,n.jsx)(t5,{menuRef:i,tvSeries:t,episodeIds:p,seasonIndex:h})})}):(0,n.jsx)(ef.GI.Content,{className:(0,s.Z)("vds-menu-items",c().playerMenu,c().episodeMenu,o&&c().mobiMenus),"data-testid":"episode-list-menu",placement:"bottom end",children:(0,n.jsx)(t5,{menuRef:i,tvSeries:t,episodeIds:p,seasonIndex:h})})]}):null});let t5=e=>{let{tvSeries:t,seasonIndex:i,episodeIds:a,menuRef:s}=e,r=(0,t$.v)(t);return(0,n.jsxs)("div",{className:c().epList,"data-testid":"episode-list",children:[(0,n.jsx)(eH.Z,{btnClass:c().closeBtn,onClick:()=>s.current.close(),startIcon:(0,n.jsx)(ez.default,{className:"w-6 h-6"})}),(0,n.jsxs)("div",{className:c().tvseries,children:[(0,n.jsx)("div",{className:c().title,children:t.title}),(0,n.jsxs)("div",{className:c().seasonNum,children:["Season: ",i+1]})]}),a.map(e=>(0,n.jsx)(t2,{episodeId:e,menuRef:s,tvSeries:t,tvSeriesMonetization:r},"EpisodeMenuItem-".concat(e)))]})},t2=e=>{var t;let{episodeId:i,menuRef:a,tvSeriesMonetization:r}=e,{t:o}=(0,eg.$G)(),l=(0,eJ.RB)(i),d=(0,tl.xJ)(),v=(0,tz.s$)(),h=(0,u.nP)(e=>e.video);if(!(null==l?void 0:l.movie)||!h)return null;let p=null==r?void 0:r.allow,m=null==l?void 0:l.isPurchased,f=!m&&!v&&(null==l?void 0:null===(t=l.vod_monetization)||void 0===t?void 0:t.includes("avod"))&&0===l.gjw_premium,y=l&&!l.no_access_right||f,b=()=>{var e;if(l&&y&&(null==h?void 0:h.id)!==l.id){if((null===(e=l.movie)||void 0===e?void 0:e.rating)!=="G"&&!d.user_id
1){(0,t0.jm)();return}tX.Z.playMovieRequired.next({content:l,play:!0}),a.current.close()}};return(0,n.jsxs)("div",{className:(0,s.Z)(c().epItem,h.id===l.id&&c().active),"data-testid":"episode-item-".concat(l.id),onClick:b,children:[(0,n.jsx)("div",{className:c().epThumb,children:(0,n.jsx)(eT.Z,{loading:"lazy",alt:l.title,src:(0,eR.ab)(l.poster_url,"thumb",eR.fs.ALBUM_GRID),className:(0,g.vX)("object-cover object-center rounded-lg")})}),(0,n.jsxs)("div",{className:c().epInfo,children:[(0,n.jsx)("span",{className:(0,s.Z)("line-clamp-2",c().epTitle),children:l.title}),p&&!y&&(0,n.jsx)(tY,{t:o,small:!0,className:"mt-2",episode:l,contentMonetization:r})]})]})};var t8=i(751);let t3=e=>{let{disableCaption:t,TimeSliderComp:i,SettingMenuComp:a}=e,r=(0,u.nP)(e=>e.video),o=(0,u.nP)(e=>e.isEmbed),l=(0,u.nP)(e=>e.tvSeries),d=(0,u.nP)(e=>e.isTrailer),v=(0,u.nP)(e=>e.seasonIndex),h=(0,w.s)(e=>e.system.isRealMobile),p=(0,u.nP)(e=>e.isFullScreen||e.nativeFullscreen),f=(0,u.nP)(e=>e.nativeFullscreen),g=(0,u.nP)(e=>{var t,i;return!!(null===(t=e.playlistData)||void 0===t?void 0:null===(i=t.contentIds)||void 0===i?void 0:i.length)}),y=(0,tQ.Kd)(null==r?void 0:r.id,"isHideChat"),b=(0,u.nP)(e=>e.liveStatus);return(0,n.jsxs)(tb.ai.Root,{className:(0,s.Z)(c().controls,"vds-controls"),children:[(0,n.jsx)(tP.Z,{}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),i,(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,c().floatBns,"vds-controls-group"),children:[(0,n.jsx)(tw.OE,{}),(0,n.jsx)(tw.sh,{tooltipClassName:"invisible",buttonClassName:h?"":"invisible"}),(0,n.jsx)(tw.LR,{})]}),(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,c().controlToolbar,"vds-controls-group"),children:[!d&&g&&(0,n.jsx)(tw.Zc,{tvSeriesId:null==l?void 0:l.id,alwaysShow:!1}),(0,n.jsx)(tw.sh,{}),!d&&g&&(0,n.jsx)(tw.$5,{tvSeriesId:null==l?void 0:l.id}),(0,n.jsx)(tw.g7,{}),!d&&"LIVE"===b&&(0,n.jsx)(tw.vk,{liveIcon:(0,n.jsx)(t8.default,{}),className:c().movieLiveBtn}),(0,n.jsx)(tw.Qq,{className:d||"LIVE"!==b?void 0:"!hidden"}),o?(0,n.jsx)("div",{className:"flex-1"}):(0,n.jsx)(tb.j$,{className:"vds-chapter-title",defaultText:(null==r?void 0:r.title)||""}),!o&&!(null==r?void 0:r.made_for_kids)&&!p&&!!b&&(0,n.jsx)(tw.wf,{isHideChat:y,onToggleChat:e=>(0,tQ.KJ)(r.id,{isHideChat:e})}),t!==m.mN.Disable&&(0,n.jsx)(tx.Z,{videoId:null==r?void 0:r.id,placement:"top end",disableTooltip:x.tq}),p&&l&&void 0!==v&&(0,n.jsx)(t9,{tvSeries:l,seasonIndex:v}),a,f?(0,n.jsx)(tw.$c,{}):(0,n.jsx)(tw.iT,{})]})]})},t7=e=>{let{TimeSliderComp:t,SettingMenuComp:i}=e,a=(0,u.nP)(e=>e.video),r=(0,u.nP)(e=>e.tvSeries),o=(0,u.nP)(e=>e.liveStatus),l=(0,u.nP)(e=>e.seasonIndex),d=(0,u.nP)(e=>e.isMobiPlayer),v=(0,u.nP)(e=>e.disableCaption),h=(0,u.nP)(e=>e.isTrailer),p=(0,u.nP)(e=>e.isFullScreen||e.nativeFullscreen),f=(0,u.nP)(e=>e.nativeFullscreen),g=(0,u.nP)(e=>{var t,i;return!!(null===(t=e.playlistData)||void 0===t?void 0:null===(i=t.contentIds)||void 0===i?void 0:i.length)}),y=(0,u.nP)(e=>!e.isLiveStreaming&&!e.loop&&e.playerStatus===m.GZ.Ended),b=!h&&g;return(0,n.jsxs)(tb.ai.Root,{className:"".concat(c().controls," vds-controls"),children:[(0,n.jsx)(tP.Z,{}),(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)("vds-controls-group top-controls",c().controlsGroup,c().topControls),children:[(0,n.jsx)("div",{className:"vds-controls-spacer"}),p&&r&&void 0!==l&&(0,n.jsx)(t9,{tvSeries:r,seasonIndex:l}),v!==m.mN.Disable&&(d?(0,n.jsx)(tU.Z,{videoId:null==a?void 0:a.id}):(0,n.jsx)(tx.Z,{videoId:null==a?void 0:a.id,placement:"top end",disableTooltip:d||x.tq})),i]}),(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,c().floatBns,"vds-controls-group"),children:[b?(0,n.jsx)(tw.Zc,{tvSeriesId:null==r?void 0:r.id,alwaysShow:!1}):(0,n.jsx)(tw.OE,{}),(0,n.jsx)(tw.sh,{alwaysShow:!0,buttonClassName:d?"":"invisible"}),b?(0,n.jsx)(tw.$5,{tvSeriesId:null==r?void 0:r.id}):(0,n.jsx)(tw.LR,{})]}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),(0,n.jsxs)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,"vds-controls-group"),children:[y&&(0,n.jsx)(tw.sh,{}),(0,n.jsx)(tw.Qq,{}),(0,n.jsx)("div",{className:"vds-controls-spacer"}),!h&&"LIVE"===o&&(0,n.jsx)(tw.vk,{liveIcon:(0,n.jsx)(t8.default,{}),className:c().movieLiveBtn}),f?(0,n.jsx)(tw.$c,{}):(0,n.jsx)(tw.iT,{})]}),t]})};var t4=(0,r.memo)(function(e){let{movie:t}=e,i=(0,u.nP)(e=>e.isEmbed),a=(0,u.nP)(e=>e.videoSrcObj),o=(0,u.nP)(e=>e.isMobiPlayer),l=(0,u.nP)(e=>e.disableCaption),d=(0,u.nP)(e=>e.disableAutoNext),v=(0,u.nP)(e=>e.adState===m.H9.countDown),{ControlComponents:h,SettingMenuComp:p}=(0,r.useMemo)(()=>{let e=(0,n.jsx)(t_.Z,{videoId:t.id,placement:o?"bottom end":"top end",disableTooltip:o||x.tq});return{ControlComponents:i||!o?t3:t7,SettingMenuComp:e}},[i,o,t.id]),f=(0,r.useMemo)(()=>(0,n.jsx)(tb.ai.Group,{className:(0,s.Z)(c().controlsGroup,c().timeControls,"vds-controls-group"),children:(0,n.jsx)(tA.q,{videoSrc:a.src})}),[a.src]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tk.m,{}),(0,n.jsx)(tw.x2,{isShown:v}),(0,n.jsx)(h,{disableAutoNext:d,disableCaption:l,TimeSliderComp:f,SettingMenuComp:p})]})}),t6=i(14242);let ie={masterManifestLoadMs:null,mediaPlaylistLoadMs:null,firstSegmentTTFBMs:null,firstSegmentDownloadMs:null,timeToFirstFrameMs:null,initialBitrate:null,initialResolution:null,firstSegmentBytes:null,firstSegmentThroughputKbps:null,firstSegmentDnsMs:null,firstSegmentTcpMs:null,firstSegmentTlsMs:null};var it=i(48786);let ii=e=>{let{src:t}=e,i=(0,ef.uY)(),{flags:n}=(0,it.g)(),s=!!(null==n?void 0:n.vp_stt),o=(0,r.useRef)(function(){let e=(0,a.Z)({},ie),t="",i=null,n=!1,s=null,r=[];function o(e){return/\.(ts|m4s|mp4)(\?|$)/.test(e)&&!e.includes("init")}function l(t){let i=t.requestStart>0;i&&(e.firstSegmentDnsMs=Math.round(t.domainLookupEnd-t.domainLookupStart),e.firstSegmentTcpMs=Math.round(t.connectEnd-t.connectStart),e.firstSegmentTlsMs=t.secureConnectionStart>0?Math.round(t.connectEnd-t.secureConnectionStart):0,e.firstSegmentTTFBMs=Math.round(t.responseStart-t.requestStart)),e.firstSegmentDownloadMs=Math.round(t.duration),e.firstSegmentBytes=t.transferSize||t.encodedBodySize;let a=(t.responseEnd-t.responseStart)/1e3;a>0&&e.firstSegmentBytes&&(e.firstSegmentThroughputKbps=Math.round(8*e.firstSegmentBytes/a/1e3))}return{metrics:e,start:function(){"undefined"!=typeof PerformanceObserver&&(s=new PerformanceObserver(t=>{for(let i of t.getEntries()){let a=i,s=a.name;s.includes(".m3u8")&&!s.includes("/playlist")&&null===e.masterManifestLoadMs&&(e.masterManifestLoadMs=Math.round(a.duration)),s.includes("/playlist")&&s.includes(".m3u8")&&null===e.mediaPlaylistLoadMs&&(e.mediaPlaylistLoadMs=Math.round(a.duration)),!n&&o(s)&&(n=!0,l(a))}})).observe({type:"resource",buffered:!0})},attachPlayerListeners:function(a,n){var s;
1t=n;let o=null===(s=a.el)||void 0===s?void 0:s.querySelector("video");if(!o)return;let l=()=>{i=performance.now()},d=n=>{var s;let r=n.target,o=r.videoWidth,l=r.videoHeight;e.initialResolution="".concat(o,"x").concat(l);let d=r.duration,c=null===(s=a.provider)||void 0===s?void 0:s.instance;if(c){let u=-1===c.currentLevel?c.loadLevel:c.currentLevel,v=c.levels[u];e.initialBitrate=v.bitrate,e.initialResolution="".concat(v.width,"x").concat(v.height)}else{let h=r.webkitVideoDecodedByteCount||0;d>0&&h>0?e.initialBitrate=Math.round(8*h/d):e.initialBitrate=null}null===e.timeToFirstFrameMs&&i&&(e.timeToFirstFrameMs=Math.round(performance.now()-i),function(){let i={level:"info",request_data:"Video Perf",request_url:t,exception_detail:JSON.stringify(e)};(0,t6.t)(i)}())};o.addEventListener("play",l),o.addEventListener("playing",d),r=[()=>o.removeEventListener("play",l),()=>o.removeEventListener("playing",d)]},cleanup:function(){e=(0,a.Z)({},ie),r.forEach(e=>null==e?void 0:e()),r=[],null==s||s.disconnect()}}}());return(0,r.useEffect)(()=>{if(!t||!s)return;let e=o.current;if(e.start(),!i)return;let a=a=>{var n,s;let r=(null===(n=a.detail)||void 0===n?void 0:n.provider)||(null===(s=a.target)||void 0===s?void 0:s.provider);r&&(0,h.mo)(r)&&e.attachPlayerListeners(i,t)};return i.addEventListener("load-start",a),()=>{i.removeEventListener("load-start",a),e.cleanup()}},[t,i,s]),null};var ia=(0,r.memo)(ii);let is=e=>{var t;let{video:i,isEmbed:d,isTrailer:v,isLivePlayer:h,isLiveStreaming:p,drmToken:y,mutedDefault:b,autoplay:A,liveStats:x,isMoviePlayer:k,disableCaption:T,isFastPlayer:_}=e,{locale:j}=(0,ep.ZP)(),C=(0,r.useRef)(null),I=(0,o.Dn)(C.current),L=(0,u.nP)(e=>!v&&e.loop),N=(0,u.nP)(e=>{var t;return(null===(t=e.hlsConfig)||void 0===t?void 0:t.drmToken)||y}),D=(0,u.nP)(e=>e.audioMode),M=(0,u.nP)(e=>e.isPremiere),R=(0,u.nP)(e=>e.isMobiPlayer),V=(0,w.s)(e=>e.system.isRealMobile||e.system.isTouchDevice),Z=(0,u.nP)(e=>e.disableControls),U=(0,r.useRef)(!!D),F=(0,r.useRef)({videoId:"",currentTime:0,canSeek:!1});(0,r.useEffect)(()=>{var e;if(!(null===(e=C.current)||void 0===e?void 0:e.el))return;let t=()=>{var e;let t=null===(e=C.current)||void 0===e?void 0:e.el;if(!t)return;let i=t.querySelector("[data-media-provider]");i&&"1"!==i.style.opacity&&i.style.setProperty("opacity","1","important");let a=t.querySelector("video");(null==a?void 0:a.getAttribute("aria-hidden"))==="true"&&a.removeAttribute("aria-hidden")};t();let i=new MutationObserver(t);return i.observe(C.current.el,{childList:!0,subtree:!0}),()=>i.disconnect()},[C.current]);let $=(0,u.nP)(e=>e.videoSrcObj),K=(0,r.useMemo)(()=>{if(!$.src||(m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] Get Video source | VideoSrc:",$.src,"\naudioMode:",D," | audioModeRef.current",U.current),k))return $;if(D!==U.current&&C.current){U.current=!!D;let e=C.current.duration,t=C.current.currentTime||0;F.current={canSeek:!0,videoId:i.id,currentTime:e-t<1?0:t>1?t-1:t}}return D&&i.audio_url?{videoId:i.id,src:i.audio_url,type:(0,eN.e)(i.audio_url)}:$},[$.src,$.videoId,D,k]);(0,r.useEffect)(()=>{if(!C.current)return;let e=C.current;e.setSrc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u.nP.setState(t=>{var i;return t.videoSrcObj=(0,f.EY)(null===(i=t.video)||void 0===i?void 0:i.id,e),(0,a.Z)({},t)})};let t=(0,E.At)({key:"isPaused"});e.userRecentAction=t?"pause":"play",window.player=e,u.nP.setState({player:e})},[C.current,I,k,p]);let J=async e=>{var t,a,n,s;if(!(null===(t=C.current)||void 0===t?void 0:t.el)||!i)return;m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onLoadedMetadata | Title",null==i?void 0:i.title),(0,E.l3)("muted","manual");let r=0,o=C.current,l=null===(a=o.el)||void 0===a?void 0:a.querySelector("video");l.muted!==o.state.muted&&(m.j5.basic&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] Volume and Muted state are not synchronized between Player and Video element",{playerMuted:o.state.muted,videoMuted:l.muted}),l.muted=o.state.muted);let d=u.nP.getState().mutedDefault&&b;d&&!o.state.muted&&o.remoteControl.mute(e);let c=p&&"Live"===i.type&&"Live"===i.sub_type;if(!c&&!v){let h=i.duration||(null===(n=i.meta)||void 0===n?void 0:n.duration)||o.state.duration,y=h&&h!==1/0&&!isNaN(h);if(y){if(p){if(M&&(null==x?void 0:null===(s=x.metrics)||void 0===s?void 0:s.started_at)){let w=Math.max(0,(Date.now()-x.metrics.started_at)/1e3);r=Math.max(0,Math.min(h,w)-2)}else r=h-2}else F.current.canSeek&&F.current.videoId===i.id?(r=F.current.currentTime,F.current.canSeek=!1):r=await (0,f.F$)(i);r>3&&h-r>=3?I.seek(r):I.seek(0)}else setTimeout(()=>I.seek(0),400)}m.j5.event&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onLoadedMetadata | start auto-play video"),A?function(){let{player:e,video:t,adState:i,isPreRoll:a,isMobiPlayer:n,mutedDefault:s}=u.nP.getState();if(e){if(q=!0,e.video=t,n){var r;null==e||null===(r=e.el)||void 0===r||r.classList.add("vds-hideControls")}(m.j5.event||m.j5.ads)&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] onAutoPlay | adState:",(0,g.$O)(i,m.H9)," | isPreRoll:",a),a&&i===m.H9.fetching&&((0,E.l3)("muted"),e.remoteControl.mute()),(0,f.zr)(e,s)}}():o.remoteControl.pause()},ee=(0,r.useRef)();(0,r.useEffect)(()=>{var e;let t=null==x?void 0:null===(e=x.metrics)||void 0===e?void 0:e.started_at;
1if(!v&&p&&M&&t)return m.j5.basic&&console.debug("[".concat((0,P.hf)(),"]"),"[Video] Premiere | Status",null==x?void 0:x.status,"liveStartAt",t,"isLiveStreaming",p),ee.current=setInterval(()=>{var e,a;if(!t||v||!p||!(null===(e=C.current)||void 0===e?void 0:null===(a=e.state)||void 0===a?void 0:a.started))return;let n=new Date().getTime(),s=(n-t)/1e3+.1,r=i.duration;r&&s>r?(I.changeDuration(r),clearInterval(ee.current)):I.changeDuration(s)},1e3),()=>{clearInterval(ee.current)}},[i.id,p,v,M,null==x?void 0:null===(t=x.metrics)||void 0===t?void 0:t.started_at]);let eo=(0,r.useMemo)(()=>new eD.g,[]),el="drm"===i.encrypt_method,ed=(0,eR.ab)(i.poster_url,"thumb",eR.fs.ARTICLE);return(0,n.jsxs)(l.Syo,{crossOrigin:!0,playsInline:!0,storage:v?void 0:eo,src:N?K.src:K,ref:C,title:i.title,loop:L,preload:"auto",viewType:"video",poster:ed,controlsDelay:V||R?1e5:3e3,logLevel:m.j5.mainPlayer,hideControlsOnMouseLeave:!0,fullscreenOrientation:"landscape",onError:et,onHlsError:ei,onHlsManifestParsed:ea,onHlsNonNativeTextTracksFound:ev,onPlay:W,onPause:z,onAbort:G,onEnded:X,onCanPlay:B,onPlaying:Y,onSeeking:ec,onTimeUpdate:Q,onVolumeChange:es,onQualityChange:er,onLoadedMetadata:J,onLoadStart:H,onProviderSetup:O,onProviderChange:O,onFullscreenChange:en,onTextTracksChange:eu,onMediaSeekRequest:eh,streamType:!M&&p?"live:dvr":"on-demand",keyTarget:"document",keyDisabled:!$.src||Z||d,keyShortcuts:eS,className:(0,s.Z)("media-player",c().player,el&&c().drmVideo,h&&"live-player",_&&"fast-player",d&&"vds-embed",R&&"vds-mobi",k&&"vds-movie",Boolean(D&&i.audio_url)&&c().audioOnly,Z&&c().noControl,"Shorts"===i.type?"Shorts":i.type),preferNativeHLS:(0,S.S9)(el),children:[(0,n.jsx)(ia,{video:i,src:$.src}),(0,n.jsx)(eL,{video:i,locale:j,player:C.current}),(0,n.jsx)(ty,{loop:L,video:i,isEmbed:d,liveStats:x,videoSrcData:K,isMoviePlayer:k,isLiveStreaming:p}),(0,n.jsx)(io,{video:i,poster:ed,drmToken:N,isMoviePlayer:k}),!V&&(0,n.jsx)(eA,{}),(0,n.jsx)(eE.Z,{video:i}),(0,n.jsx)(eM.Z,{videoId:i.id,active:T!==m.mN.Disable}),k?(0,n.jsx)(t4,{movie:i}):h?(0,n.jsx)(tH,{live:i,liveStats:x,videoSrcObj:K,isLiveStreaming:p}):_?(0,n.jsx)(tT,{videoSrcObj:K}):(0,n.jsx)(tB,{video:i,videoSrcObj:K})]})};var ir=(0,r.memo)(is);let io=(0,r.memo)(e=>{let{video:t,isMoviePlayer:i,drmToken:a,poster:o}=e,d=(0,w.s)(e=>e.system.isPageRendered),u=(0,r.useMemo)(()=>i&&a&&!x.gn&&!x.G6?{"--media-border-radius":0}:void 0,[i,a]);return(0,n.jsx)(l.ZNi,{style:u,children:!!o&&(0,n.jsx)(eT.Z,{src:o,alt:t.title||"",className:(0,s.Z)(c().poster,"vds-poster",d&&"hidden")})})});io.displayName="MediaProviderWrapper"},53156:function(e,t,i){"use strict";i.d(t,{w:function(){return g}});var a=i(85893),n=i(93180),s=i(23114),r=i(40722),o=i.n(r),l=i(34375),d=i(67294),c=i(67421),u=i(31973),v=i(10194),h=i(89113),p=i(35131),m=i(22996);function f(e){let{videoId:t,isPreviewPlayer:i}=e,n=(0,l.nP)(e=>i?e.preview.captions:e.captions),s=(0,l.nP)(e=>i?e.preview.disableCaption:e.disableCaption),r=(0,l.nP)(e=>i?e.preview.currentCaption:e.currentCaption),o=(0,d.useCallback)(e=>{e&&(0,u.Q)({lang:e.lang,captionLocale:e.id},i),i?(0,m.updatePreviewPlayerData)({currentCaption:e}):l.nP.setState({currentCaption:e})},[i]);return t&&s!==p.mN.Disable&&(null==n?void 0:n.length)&&n[0].videoId===t?(0,a.jsx)(g,{videoId:t,captions:n,currentCaption:r,disableCaption:s,onCaptionChanged:o}):null}function g(e){let{videoId:t,captions:i,currentCaption:r,disableCaption:m,onCaptionChanged:f}=e,{t:g}=(0,c.$G)(),y=(0,n.uY)(),b=(0,d.useRef)(null),w=(e,t)=>{var i;if(e.stopPropagation(),!y)return;if(!t){(0,u.Q)(),y.remoteControl.disableCaptions(e),f(void 0),l.nP.setState({currentCaption:void 0});return}let a=y.textTracks.toArray();if(!(null==a?void 0:a.length))return;let n=a.findIndex(e=>e.label===t.label);-1!==n&&(f(t),y.remoteControl.changeTextTrackMode(n,"showing",e),null===(i=b.current)||void 0===i||i.close())},A=e=>{if(!i)return;e.stopPropagation();let t=e.target.selectedIndex;w(e,i[t-1])},P=()=>{if(!y)return;let e=y.el;e.setAttribute("data-onselect","")},x=()=>{if(!y)return;let e=y.el;e.hasAttribute("data-onselect")&&e.removeAttribute("data-onselect")};return t&&m!==p.mN.Disable&&(null==i?void 0:i.length)&&i[0].videoId===t?(0,a.jsxs)("div",{className:(0,s.Z)("vds-menu-button vds-button caption",o().captionBtn),"data-testid":"player-caption",children:[r?(0,a.jsx)(v.default,{}):(0,a.jsx)(h.default,{}),(0,a.jsxs)("select",{onBlur:x,onFocus:P,onChange:A,className:o().menuSelect,value:r?r.label:"off","data-testid":"caption-menu-mobile-select",children:[(0,a.jsx)("option",{value:"off",className:o().menuOpt,"data-testid":"caption-menu-mobile-off",children:g("videojs.off")}),i.map((e,t)=>e.label&&"NoCaption"!==e.label?(0,a.jsx)("option",{value:e.label,className:o().menuOpt,"data-testid":"caption-menu-mobile-item",children:e.label},"CaptionItem-".concat(e.label,"-").concat(t)):null)]})]}):null}
1f.displayname="CaptionMenuMobile",t.Z=(0,d.memo)(f)},71192:function(e,t,i){"use strict";var a=i(26042),n=i(85893),s=i(67294),r=i(73198),o=i(34375),l=i(35131);let d=e=>{let{video:t}=e,i=(0,o.nP)(e=>!!e.debug),d=(0,o.nP)(e=>e.forceLiveStream||e.liveStatus);return((0,s.useEffect)(()=>((0,l.tR)()&&o.nP.setState({debug:1}),()=>{i&&o.nP.setState({forceLiveStream:void 0,forceLiveAt:void 0})}),[t.id]),i)?(0,n.jsx)("div",{className:"absolute top-[10px] right-[45%] z-[100]",children:["Live","Movie"].includes(t.type)&&(0,n.jsx)(r.Z,{size:"small",variant:"contained",text:"Live Status: ".concat(d||"UPCOMING"),onClick(){o.nP.setState(e=>(e.forceLiveStream&&"UPCOMING"!==e.forceLiveStream?"LIVE"===e.forceLiveStream?e.forceLiveStream="FINISHED":(e.forceLiveStream="UPCOMING",e.forceLiveAt=void 0):(e.forceLiveStream="LIVE",e.forceLiveAt=Date.now()),(0,a.Z)({},e)))}})}):null};t.Z=(0,s.memo)(d)},71378:function(e,t,i){"use strict";var a=i(85893),n=i(67294),s=i(67421),r=i(46129),o=i(85479),l=i(7925),d=i(75272),c=i(73423),u=i(16066),v=i(4581);let h=e=>{var t;let{video:i,setShowEmbedShare:h,hidebrand:p}=e,{t:m}=(0,s.$G)(),f=()=>{if(h(!0),!window.player)return;let e=window.player;e.state.paused||(e.pausedByPopup=!0,e.remoteControl.pause())},g="Movie"===i.type||"TVSeries"===i.type,y=(0,n.useMemo)(()=>{var e;return(0,v.nR)(g?"/gjwplus":"/channel/".concat(null===(e=i.channel)||void 0===e?void 0:e.id))},[g,null===(t=i.channel)||void 0===t?void 0:t.id]),b=(0,n.useMemo)(()=>(0,v.nR)((0,u.Qw)(i)),[i]),w=(0,n.useMemo)(()=>(0,v.nR)("/"),[]);return(0,a.jsxs)("div",{"data-testid":"embed-video-header",className:"embed-video-header",children:[(0,a.jsxs)("div",{className:"video-info",children:[!p&&(0,a.jsx)("div",{"data-testid":"embed-header-channel-avatar",className:"h-9 w-9 mr-3.5 cursor-pointer relative rounded-full overflow-hidden b868:w-12 b868:h-12",children:(0,a.jsx)(c.Z,{dataTestId:"embed-header-channel-link",href:y,target:"_blank",children:(0,a.jsx)(r.Z,{src:(0,o.ab)(i.channel.icon,"avatar",o.fs.SMALL),name:g?"GJW+":i.channel.name,alt:g?"GJW+":i.channel.name,layout:"fill",roundedFull:!0})})}),(0,a.jsx)("div",{"data-testid":"embed-header-title",className:"title",children:(0,a.jsx)(c.Z,{dataTestId:"embed-header-title-link",href:b,target:"_blank",children:i.title})})]}),!p&&(0,a.jsxs)("div",{className:"actions",children:[(0,a.jsxs)("div",{"data-testid":"embed-header-share-btn",onClick:f,children:[(0,a.jsx)("span",{className:"icon",children:(0,a.jsx)(l.default,{className:" w-[18px] h-[18px]"})}),(0,a.jsx)("span",{className:"text",children:m("videoPlayPage.embedShare")})]}),(0,a.jsx)("div",{"data-testid":"embed-header-home-btn",className:"home-icon",children:(0,a.jsxs)(c.Z,{"data-testid":"embed-header-home-link",href:w,target:"_blank",rel:"noreferrer",children:[(0,a.jsx)("span",{className:"icon",children:(0,a.jsx)(d.default,{className:" w-[18px] h-[18px]"})}),(0,a.jsx)("span",{className:"text",children:m("videoPlayPage.embedHome")})]})})]})]})};t.Z=(0,n.memo)(h)},36524:function(e,t,i){"use strict";var a=i(85893),n=i(67294),s=i(67421),r=i(16573),o=i(1020),l=i(46616),d=i(87385),c=i(73198),u=i(61850),v=i(3988),h=i(2141),p=i(16066),m=i(61310);let f=e=>{let{video:t,setShowEmbedShare:i}=e,{t:f}=(0,s.$G)(),{0:g,1:y}=(0,n.useState)("");(0,n.useEffect)(()=>{let e=!1;return(async()=>{let i="".concat(window.origin,"/").concat((0,p.Qw)(t)),{data:a}=await (0,h.C9)({id:t.id,url:i});a&&!e&&y(a.shortUrl)})(),()=>{e=!0}},[t]);let b=async e=>{e.target.select(),navigator.clipboard&&navigator.clipboard.writeText(g).then(()=>{})},w=()=>{if(i(!1),(0,m.Zu)(window.player))return;let e=window.player;e.pausedByPopup&&(e.pausedByPopup=!1,e.remoteControl.play())};return(0,a.jsxs)("div",{"data-testid":"embed-video-share",className:"embed-video-share",children:[(0,a.jsx)("div",{className:"title text-s16 b375:text-s20",children:f("videoPlayPage.share")}),(0,a.jsx)("input",{"data-testid":"embed-video-share-url",className:"url",onClick:b,value:g}),(0,a.jsxs)("div",{className:"buttons",children:[(0,a.jsxs)(r.Z,{onClick:void 0,url:g,quote:"",children:[(0,a.jsx)(o.Z,{size:40,round:!0,style:{display:"inline-table"}}),(0,a.jsx)("div",{className:"text-center text-s12 mt-2",children:"Facebook"})]}),(0,a.jsxs)(l.Z,{onClick:void 0,title:t.title,url:g,children:[(0,a.jsx)(d.Z,{size:40,roun
1d:!0,style:{display:"inline-table"}}),(0,a.jsx)("div",{className:"text-center text-s12 mt-2",children:"Twitter"})]}),(0,a.jsx)(c.Z,{dataTestid:"embed-video-share-more-btn",btnClass:"btn-ellipsis",startIcon:(0,a.jsx)(u.default,{className:"w-5 h-5 cursor-pointer mr-2"}),onClick(){window.open(g)}})]}),(0,a.jsx)(c.Z,{dataTestid:"embed-video-share-close-btn",btnClass:"btn-close",onClick:w,startIcon:(0,a.jsx)(v.default,{className:"w-[16px] h-[16px]"})})]})};t.Z=(0,n.memo)(f)},47524:function(e,t,i){"use strict";i.d(t,{V:function(){return r},k:function(){return s}});var a=i(93041),n=i(61310);let s=e=>{var t;let{player:i,video:s,errType:r,errDetail:o,disableHistory:l,handleCanPlay:d}=e;if(!i||!r)return;let c=null===(t=i.provider)||void 0===t?void 0:t.instance;if(c)switch(r){case a.ZP.ErrorTypes.MEDIA_ERROR:if(o===a.ZP.ErrorDetails.BUFFER_APPEND_ERROR){(0,n.jC)(i,l?void 0:s);return}break;case a.ZP.ErrorTypes.NETWORK_ERROR:if("manifestLoadTimeOut"===o||"manifestLoadError"===o){null==d||d();return}(0,n.jC)(i,l?void 0:s);break;case a.ZP.ErrorTypes.OTHER_ERROR:if("pause"===i.userRecentAction)return;o===a.ZP.ErrorDetails.INTERNAL_EXCEPTION&&(0,n.jC)(i,l?void 0:s)}},r=e=>{var t;let i=null==e?void 0:null===(t=e.provider)||void 0===t?void 0:t.media;if(!i||i.readyState<2)return;let a=i.currentTime;i.currentTime=a}},32040:function(e,t,i){"use strict";i.d(t,{g:function(){return o}});var a=i(26042),n=i(69396),s=i(111),r=i(75844);class o{async getIsPaused(){return this.sessionData.isPaused||!1}async setIsPaused(e){this.sessionData.isPaused=e,this.save()}async getVolume(){return this.localData.volume||null}async setVolume(e){this.localData.volume=e,this.save()}async getMuted(){return this.sessionData.muted||null}async setMuted(e){(0,r.MY)("muted")||(this.sessionData.muted=e,this.save(!0))}async getTime(){return null}async setTime(e,t){}async getLang(){return null}async setLang(e){}async getCaptions(){return null}async setCaptions(e){}async getPlaybackRate(){return this.sessionData.rate||null}async setPlaybackRate(e){(0,r.MY)("rate")||(this.sessionData.rate=e,this.save(!0))}async getAudioGain(){return null}async setAudioGain(e){}async getVideoQuality(){return this.localData.quality||null}async setVideoQuality(e){(0,r.MY)("quality")||(this.localData.quality=e,this.save())}onChange(e,t){let i=this.playerId||r.bs,n=localStorage.getItem(i),s=sessionStorage.getItem(i);this.playerId=i,this.mediaId=t,this.localData=(0,a.Z)({volume:1,quality:null},n?JSON.parse(n):{}),this.sessionData=(0,a.Z)({muted:!1,rate:null},s?JSON.parse(s):{})}save(e){if(this.playerId){if(e){let t=JSON.stringify((0,n.Z)((0,a.Z)({},this.sessionData),{time:void 0}));sessionStorage.setItem(this.playerId,t)}else{let i=JSON.stringify((0,a.Z)({},this.localData));localStorage.setItem(this.playerId,i)}}}saveTime(){var e;if(!this.mediaId)return;let t=(null!==(e=this.sessionData.time)&&void 0!==e?e:0).toString();sessionStorage.setItem(this.mediaId,t)}constructor(){this.playerId=r.bs,this.mediaId=null,this.localData={volume:null,quality:null},this.sessionData={rate:null,muted:!1,isPaused:!1},this.saveTimeThrottled=(0,s.Z)(this.saveTime.bind(this),1e3)}}},46085:function(e,t,i){"use strict";i.r(t);var a=i(85893),n=i(67294),s=i(23114),r=i(5152),o=i.n(r);let l=o()(()=>i.e(2679).then(i.bind(i,2679)).then(e=>e.default),{loadableGenerated:{webpack:()=>[2679]}}),d=e=>{let{className:t}=e;return(0,a.jsx)(l,{id:"icon-audio-mode",className:(0,s.Z)("svgIcon",t)})};t.default=(0,n.memo)(d)},10194:function(e,t,i){"use strict";i.r(t);var a=i(85893),n=i(67294),s=i(23114),r=i(5152),o=i.n(r);let l=o()(()=>i.e(71184).then(i.bind(i,71184)).then(e=>e.default),{loadableGenerated:{webpack:()=>[71184]}}),d=e=>{let{className:t}=e;return(0,a.jsx)(l,{className:(0,s.Z)("svgIcon",t)})};t.default=(0,n.memo)(d)},89113:function(e,t,i){"use strict";i.r(t);var a=i(85893),n=i(67294),s=i(23114),r=i(5152),o=i.n(r);let l=o()(()=>i.e(43390).then(i.bind(i,43390)).then(e=>e.default),{loadableGenerated:{webpack:()=>[43390]}}),d=e=>{let{className:t}=e;return(0,a.jsx)(l,{className:(0,s.Z)("svgIcon",t)})};t.default=(0,n.memo)(d)},61850:function(e,t,i){"use strict";i.r(t);var a=i(85893),n=i(67294),s=i(23114),r=i(5152),o=i.n(r);let l=o()(()=>i.e(9973).then(i.bind(i,9973)).then(e=>e.default),{loadableGenerated:{webpack:()=>[9973]}}),d=e=>{let{className:t}=e;return(0,a.jsx)(l,{className:(0,s.Z)("svgIcon",t)})};t.default=(0,n.memo)(d)},75272:function(e,t,i){"use strict";i.r(t);var a=i(85893),n=i(67294),s=i(23114),r=i(5152),o=i.n(r);let l=o()(()=>i.e(70896).then(i.bind(i,70896)).then(e=>e.default),{loadableGenerated:{webpack:()=>[70896]}}),d=e=>{let{className:t}=e;return(0,a.jsx)(l,{className:(0,s.Z)("svgIcon",t)})};t.default=(0,n.memo)(d)},90942:function(e,t,i){"use strict";i.r(t);var a=i(85893),n=i(67294),s=i(23114),r=i(5152),o=i.n(r);let l=o()(()=>i.e(41538).then(i.bind(i,41538)).then(e=>e.default),{loadableGenerated:{webpack:()=>[41538]}}),d=e=>{let{className:t}=e;return(0,a.jsx)(l,{className:(0,s.Z)("svgIcon",t)})};t.default=(0,n.memo)(d)},7925:function(e,t,i){"use strict";i.r(t);var a=i(85893),n=i(67294),s=i(23114),r=i(5152),o=i.n(r);let l=o()(()=>i.e(35458).then(i.bind(i,35458)).then(e=>e.default),{loadableGenerated:{webpack:()=>[35458]}}),d=e=>{let{className:t}=e;return(0,a.jsx)(l,{className:(0,s.Z)("svgIcon",t)})};t.default=(0,n.memo)(d)},44407:function(e,t,i){"use strict";i.d(t,{Z:function(){return n}});var a=i(67294);function n(){let e=(0,a.useRef)(Date.now());return e.current}},11877:function(e,t,i){"use strict";i.d(t,{N:function(){return r}});var a=i(73366),n=i(94330),s=i(99565);let r=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GJW_INDIVIDUAL_STREAM",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=(0,a.gd)({type:"INDIVIDUAL",isEnable:e}),o=(0,n.yX)(),l=(0,s.Aq)(r),d=null==r?void 0:r.find(e=>e.data.ent===t&&"MONTH"===e.billing_cycle),c=i&&!!l;return{individualPlanOffer:o,promoPlan:c?l.plan:d,promoCode:c?l.code:void 0}}},14070:function(e,t,i){"use strict";i.d(t,{Z:function(){return c}});var a=i(67294),n=i(11163),s=i(34375),r=i(14664),o=i(89820),l=i(94330);let d=e=>{var t;let i=(null===(t=e.movie)||void 0===t?void 0:t.tv_series_id)||e.id,a=r.s.getState().cart.purchasedProducts,n=null==a?void 0:a.find(e=>e.id===i);return n};function c(e){let t=(0,l.JR)(),i=(0,l.Qe)(),r=function(){let{query:e}=(0,n.useRouter)(),t=(null==e?void 0:e.noVideoAds)==="1",i=null==e?void 0:e.embedIdEventId;return(0,a.useEffect)(()=>{t?i!=s.nP.getState().embedIdEventId&&s.nP.getState().setEmbedIdEventId(i):void 0!=s.nP.getState().embedIdEventId&&s.nP.getState().resetEmbedIdEventId()},[t,i]),t}(),c=(0,a.useMemo)(()=>
1{if(!e||e.skip_ads||r)return!0;let a=(null==t?void 0:t.skipAds)||[];if(a.includes(e.id))return!0;let n=(0,o.o1)(e),s=!n&&Boolean(e.premium||e.in_channel);if(s)return!0;let l=(0,o.cn)(e,"buy"),c=(0,o.FG)({content:e,purchaseType:"rent"})>0;if(l||c)return!0;let u=(e.vod_monetization||"").toLowerCase();return!!(d(e)||u.includes("svod")||u.includes("tvod"))||!!i.adFree},[e,r,null==t?void 0:t.skipAds,i.adFree]);return c}},78097:function(e,t,i){"use strict";i.d(t,{W:function(){return o},v:function(){return r}});var a=i(67294),n=i(13290),s=i(11163);let r="gjw_downlink",o=e=>{let t=(0,s.useRouter)(),i=(0,a.useCallback)(()=>new Promise((t,i)=>{var a;let n=new XMLHttpRequest,s=performance.now(),r=(a=e,(null==a?void 0:a.replace(/\/master\.m3u8$/,"/h264_360p.mp4"))||""||"https://video1-us-west.cloudokyo.cloud/video/v10/5c/5c/f4/5c5cf455-bc98-4f1e-8ebf-398789d104d4/h264_480p.mp4");n.open("GET",r,!0),n.setRequestHeader("Range","bytes=".concat(2558533,"-").concat(2693258)),n.onload=function(){if(n.status>=200&&n.status<300){let e=performance.now();t(Math.round(100*(1077808/(1e6*((e-s)/1e3))))/100)}else i(Error("HTTP error! status: ".concat(n.status)))},n.onerror=function(){i(Error("Network error occurred"))},n.send()}),[e]),o=(0,a.useCallback)(async()=>{let e=await i();if(null!==e&&void 0!=e){var t;null===(t=(0,n.safeLocalStorage)())||void 0===t||t.setItem(r,e.toString())}},[i]);(0,a.useEffect)(()=>{let e=async()=>{var e,t,i;let a=null===(e=(0,n.safeLocalStorage)())||void 0===e?void 0:e.getItem(r),s=null===(t=(0,n.safeLocalStorage)())||void 0===t?void 0:t.getItem("".concat(r,"_time")),l=!a||!s||Date.now()-parseInt(s,10)>6e5;if(l)try{await o(),null===(i=(0,n.safeLocalStorage)())||void 0===i||i.setItem("".concat(r,"_time"),Date.now().toString())}catch(d){}};"connection"in navigator||e()},[null==t?void 0:t.asPath])}},11366:function(e){e.exports={endScreenLayout:"CustomizeEndScreen_endScreenLayout__xoFQG","layout-1":"CustomizeEndScreen_layout-1__DatXj",video:"CustomizeEndScreen_video__PvDcw",follow:"CustomizeEndScreen_follow__K5tFl",playlist:"CustomizeEndScreen_playlist__pVCnw","layout-2":"CustomizeEndScreen_layout-2__Ou_7L","layout-3":"CustomizeEndScreen_layout-3__ohsIy","layout-4":"CustomizeEndScreen_layout-4__reyou",video2:"CustomizeEndScreen_video2__L4xbD","layout-5":"CustomizeEndScreen_layout-5__Y5EPb",info:"CustomizeEndScreen_info__4pigR",title:"CustomizeEndScreen_title__Xi8TA",meta:"CustomizeEndScreen_meta__0xhnY",duration:"CustomizeEndScreen_duration___Mcd2",thumbnail:"CustomizeEndScreen_thumbnail__kSBkr",img:"CustomizeEndScreen_img__Y1FJa",number_indicator:"CustomizeEndScreen_number_indicator__hczej",hover:"CustomizeEndScreen_hover__HQJJy",divider:"CustomizeEndScreen_divider__2qTL6",avatar:"CustomizeEndScreen_avatar__CkH5P","avatar-overlay":"CustomizeEndScreen_avatar-overlay__1sZHc","overlay-content":"CustomizeEndScreen_overlay-content__sxnMB","overlay-info":"CustomizeEndScreen_overlay-info__FTm1u","overlay-name":"CustomizeEndScreen_overlay-name__RdomF","overlay-desc":"CustomizeEndScreen_overlay-desc__NzBL_","overlay-actions":"CustomizeEndScreen_overlay-actions__l8NDs",activeUp:"CustomizeEndScreen_activeUp___IPzh",activeDown:"CustomizeEndScreen_activeDown__739Tm",hoverFollow:"CustomizeEndScreen_hoverFollow__B_tOt","max-lines-1":"CustomizeEndScreen_max-lines-1__StIee","max-lines-2":"CustomizeEndScreen_max-lines-2__3lHlh","max-lines-3":"CustomizeEndScreen_max-lines-3__mtmdA"}},6770:function(e){e.exports={videoCard:"videoEndScreenThumbnailV2_videoCard__NJe5H",thumbnail:"videoEndScreenThumbnailV2_thumbnail__ShbSL",img:"videoEndScreenThumbnailV2_img__rW1kN",duration:"videoEndScreenThumbnailV2_duration__2ak9C",info:"videoEndScreenThumbnailV2_info__POBQk",title:"videoEndScreenThumbnailV2_title__Ka8ch",channel:"videoEndScreenThumbnailV2_channel__gHzAn",meta:"videoEndScreenThumbnailV2_meta___Re4f"}}}]);
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.