"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[3472],{85332:(e,t,s)=>{s.d(t,{o:()=>n});var i=s(10226),a=s(17676);function n(){return{version:(0,i.W6)(a.GEN)?2:1}}},75547:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Ut});s(86277);var i=s(50959),a=s(36275),n=s(75802),r=s(95109),o=s(75095),l=s(11317),c=s(85648),d=s(41038),u=s(71459),p=s(91643),m=s(6370),h=s(10226),x=s(17676),y=s(85332),g=s(32121),j=s(11527);const b=(0,i.lazy)((()=>s.e(3731).then(s.bind(s,23731)))),k=(0,i.lazy)((()=>s.e(5337).then(s.bind(s,15337))));function C(e){const t=(0,g.m)(),s=(0,h.W6)(x.XKk,{loadingValue:!1}),a=(0,y.o)();return t?s?e.uri?(0,j.jsx)(i.Suspense,{fallback:!0,children:(0,j.jsx)(k,{uri:e.uri})}):null:(0,j.jsx)(i.Suspense,{fallback:!0,children:(0,j.jsx)(b,{reason:"Episode page",...a,...e})}):null}const P="dpN5ViPOceUWNB5EQPHN",T="fBEA27lLw_sc60Zjd_qw",f="vBcxPq3E2okwgXOkVPEM",I="CxoSYuAjlcCDSOWnnbJe",S="HCCBXwdFvq6omWW2hR0N",v="bJOPO5Zo7dpjSVDwEpSw",E="TXdDDpokVTyJzDEDWHHf",U="tvj001zNcrC5VUZmTt9c",N="PC5kR03GYecc7syeoC0q",D="YldGldlfaI9myEGXQf9g",L="qJHVIpJn1vLPWsAKfTEZ",w="wSIzjkVlr0Zdy7di2vRm",A="hYS_K1NATGyWt6tCSRqQ",R="hVVaM4pF9arpQ8Nvn2a1",M="zf0Eac1LugsHUacz74Zf",B="TnNaqxbaI0hzhBQZ7wE0",F="zSw1lG1TNe_xm6KTqtCv",O="MlEQDkXnjdKKJueJ9kkB",z="jg0xlyD1yjh0DPNG6eOg",_="QiHXpFb4dLZNOFe5gpp3";var $=s(69736),H=s(73461),W=s(80626),K=s(3533),Z=s(33592);const V=({cardHeaderText:e,cardBodyText:t,buttonText:s,buttonTarget:i})=>(0,h.W6)(x.XdP)?(0,j.jsxs)("div",{className:D,children:[(0,j.jsxs)("div",{className:L,children:[(0,j.jsx)($.x,{variant:"bodyMediumBold",semanticColor:"textBase",children:e}),(0,j.jsx)($.x,{semanticColor:"textBase",children:t})]}),(0,j.jsx)(K.D,{size:"small",colorSet:"invertedLight",href:(0,l.EC)(i).toURLPath(!0),component:Z.Z,children:s})]}):null,Y=({areHTMLDescriptionsEnabled:e,contentInformation:t,description:s,hasDescription:a,htmlDescription:n,onExpanded:r,onTimeStampClick:o,playability:l,showHeader:d=!0,spec:u})=>{const p=(0,W.$P)(),m=(a||t)&&d,y=(0,i.useCallback)((e=>{const t=u.readMoreButtonFactory();p.logInteraction(e?t.hitUiReveal():t.hitUiHide()),r?.()}),[u,p,r]),g=(0,h.W6)(x._nP,{loadingValue:!1});return(0,j.jsxs)(j.Fragment,{children:[m&&(0,j.jsx)($.x,{as:"h2",variant:"titleSmall",semanticColor:"textBase",className:S,children:c.ag.get("episode.description-title")}),t&&(0,j.jsx)(V,{cardHeaderText:t.cardHeaderText,cardBodyText:t.cardBodyText,buttonText:t.buttonText,buttonTarget:t.buttonTarget}),a&&(0,j.jsx)(H.o,{className:f,onTimeStampClick:o,maxLines:4,onExpanded:y,content:(s||"").trim(),htmlContent:e&&n?n:void 0,enableTimestamps:l.playable,enableAutomaticLinkification:g&&e&&!!n})]})};var Q=s(82187),X=s.n(Q),q=s(75390),G=s(44614),J=s(55004),ee=s(92537),te=s(29391),se=s(2800),ie=function(e){return e.DESCRIPTION="description",e.TRANSCRIPT="transcript",e}(ie||{});const ae=i.memo((function({transcriptSections:e,descriptionContent:t,transcriptContent:s,spec:a}){const n=(0,W.$P)(),[r,o]=(0,i.useState)(ie.DESCRIPTION),l=(0,se.Mi)(),{ref:d,inView:u}=(0,q.YD)({threshold:[1],root:l.current,rootMargin:`-${te.K1+1}px 100000px 0px 100000px`}),p=(0,i.useRef)(null),m=(0,i.useCallback)((e=>{p.current=e,d(e)}),[d]);return(0,i.useEffect)((()=>{const e=p.current?.parentElement?.offsetTop,t=l?.current;if(!e||!t)return;const s=e-te.K1;t.scrollTop>s&&t.scrollTo({top:s})}),[l,r]),(0,j.jsx)(G.l,{list:(0,j.jsxs)(J.F,{className:X()(O,{[z]:!u}),ref:m,children:[(0,j.jsx)(ee.c,{label:c.ag.get("web-player.episode.description"),sentenceCase:!0,active:r===ie.DESCRIPTION,onClick:()=>{const e=a.tabsFactory().descriptionTabButtonFactory().hitUiReveal();n.logInteraction(e),o(ie.DESCRIPTION)},className:X()(_,{[w]:r===ie.DESCRIPTION})}),(0,j.jsx)(ee.c,{label:c.ag.get("web-player.episode.transcript"),sentenceCase:!0,disabled:null===e,active:r===ie.TRANSCRIPT,onClick:()=>{const e=a.tabsFactory().transcriptTabButtonFactory().hitUiReveal();n.logInteraction(e),o(ie.TRANSCRIPT)},className:X()(_,{[w]:r===ie.TRANSCRIPT})})]}),children:null===e||r===ie.DESCRIPTION?t:s})}));var ne=s(26664),re=s(4612),oe=s(22527),le=s(5380);const ce=(0,i.memo)((function({transcriptSections:e,onTimeStampClick:t,episodeUri:s}){const{spec:i,logger:a}=(0,W.fU)(ne.m,{data:{uri:s}}),{isPlaying:n}=(0,oe.n)({uri:s},{featureIdentifier:"episode"}),r=i.timestampLinkFactory();return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{className:R,children:(0,j.jsx)($.x,{variant:"bodySmall",semanticColor:"textBase",children:c.ag.get("web-player.episode.transcript.disclaimer")})}),e.map(((e,i)=>{const o=`transcript-section-${i}`;return(0,j.jsxs)("div",{className:A,children:[(0,j.jsx)("button",{className:M,onClick:()=>{t(e.startMs,o),a.logInteraction(n?r.hitSeekToTime({msToSeekTo:e.startMs}):r.hitPlay({itemToBePlayed:s}))},children:(0,j.jsx)(re.D,{id:o,targetURI:(0,l.EC)(s),fadeOut:!0,children:(0,j.jsx)($.x,{variant:"marginalBold",semanticColor:"textSubdued",className:B,children:(0,le.m)(e.startMs)})})}),e.content.map(((e,t)=>(0,j.jsx)($.x,{variant:"bodySmall",semanticColor:"textBase",className:F,dir:"auto",children:e},`transcript-text-${t}`)))]},o)}))]})}));s(46758),s(2836);var de=s(51440),ue=s(36199),pe=s(59582),me=s(70526),he=s(34514),xe=s(20580),ye=s(86696),ge=s(31360),je=s(85357),be=s(86017),ke=s(45438),Ce=s(19968);const Pe="OYehkMWcGJRKPkByp46K",Te="uc1bXkrZqrCz0CMK4lBb",fe="qZeibBbA3SVClzEueYND",Ie=({episodeUri:e,index:t,duration:s,start:a,stop:n,name:r,uri:o,artists:l,album:d,playable:u})=>{const{isActive:p,isPlaying:m,onClick:h}=(0,be.k)({episodeUri:e,start:a,stop:n}),x=(0,i.useCallback)(((e,t)=>{h(t)}),[h]),{spec:y}=(0,W.fU)(he.r,{data:{position:t,reason:"",uri:o}});return(0,j.jsx)(ke.JL,{value:"row",index:t,children:(0,j.jsx)(xe.xV,{trigger:"right-click",action:"open",menu:(0,j.jsx)(ye.$,{uri:o}),children:(0,j.jsxs)(je.c,{uri:o,index:t,ariaRowIndex:t+1,dragMetadata:{name:r,createdBy:l?.[0].name??""},onTriggerPlay:x,isActive:p,isPlayable:u,spec:y,children:[(0,j.jsxs)(ge.vZ,{ariaColIndex:0,children:[(0,j.jsx)(ge.Du,{uri:o,playAriaLabel:c.ag.get("tracklist.a11y.play",r,l?.[0].name),onClick:x,isPlaying:m,isActive:p,spec:y,children:(0,j.jsx)(ge.km,{children:(0,j.jsx)("img",{className:Te,src:d.image,alt:d.name})})}),(0,j.jsxs)(ge.vm,{children:[(0,j.jsx)(ge.Wh,{titleText:r,children:r}),(0,j.jsx)(ge.K9,{children:(0,j.jsx)(ge.T6,{artists:l,spec:y})})]})]}),(0,j.jsx)(ge.UA,{ariaColIndex:1,children:(0,j.jsx)(ge.BM,{uri:d.uri,name:d.name,spec:y,children:d.name})}),(0,j.jsxs)(ge.mU,{ariaColIndex:2,children:[(0,j.jsx)(Ce.f,{uri:o,spec:y}),(0,j.jsx)(ge.A$,{duration:s}),(0,j.jsx)(ge.Zv,{spec:y,menu:(0,j.jsx)(ye.$,{uri:o,artists:l}),label:c.ag.get("more.label.track",r,l?.[0].name)})]})]})})})};function Se(e,t,s){return e.reduce(((e,i,a)=>((a>0||t>0)&&e.push({type:"SPACER",id:`spacer-${e.length}`}),"MUSIC"===i.type?e.push(function(e,t,s){return{type:"MUSIC",index:t,uri:s.uri,episodeUri:e,start:s.start,stop:s.stop,duration:s.duration,name:s.track.name,artists:s.track.artists,album:s.track.album,playable:s.track.playable}}(s,a,i)):"TALK"===i.type&&e.push(function(e,t,s){return{type:"TALK",index:t,uri:e,title:s.title,subtitle:s.subtitle,start:s.start,stop:s.stop,duration:s.duration,showUri:s.show.uri,showName:s.show.name}}(s,a,i)),e)),[])}const ve=({uri:e,segmentCount:t})=>{const s=(0,pe.G)(),a=(0,i.useCallback)((async(i,a)=>{const n=Math.ceil(i/2);try{return{items:Se(await s.getSegments(e,n,a),n,e),totalLength:2*t-1}}catch(e){return{items:[],totalLength:0}}}),[t,s,e]),n=(0,i.useCallback)((t=>{switch(t.type){case"SPACER":return(0,j.jsx)("div",{className:fe},t.id);case"MUSIC":return(0,j.jsx)(Ie,{...t},`${e}-${t.index}`);case"TALK":return(0,j.jsx)(de.t,{...t},`${e}-${t.index}`);default:return(0,me.U)(t)}}),[e]),r=(0,i.useCallback)((e=>({uri:"MUSIC"===e.type?e.uri:""})),[]),o=c.ag.get("music_and_talk.in_this_episode");return(0,j.jsxs)("div",{children:[(0,j.jsx)($.x,{as:"h2",variant:"titleSmall",semanticColor:"textBase",className:Pe,children:o}),(0,j.jsx)(ue.Pv,{ariaLabel:o,hasHeaderRow:!0,rowPlaceholder:ue.hU,columns:[ue.QD.TITLE_AND_ARTIST,ue.QD.ALBUM_OR_SHOW,ue.QD.DURATION],renderRow:n,fetchTracks:a,resolveItem:r,limit:50,nrTracks:2*t-1,testID:"music-and-talk-tracklist"})]})};var Ee=s(48695);const Ue=({areHTMLDescriptionsEnabled:e,contentInformation:t,description:s,hasDescription:a,hasMusicAndTalkSegements:n,htmlDescription:r,onExpanded:o,onDescriptionTimestampClick:l,onTranscriptTimestampClick:d,playability:u,segmentCount:p,showUrl:h,transcript:x,uri:y,spec:g})=>{const b=(0,W.$P)(),k=(0,i.useMemo)((()=>g.descriptionSectionFactory()),[g]),P=(0,i.useMemo)((()=>k.trackListFactory()),[k]),[T,f]=(0,i.useState)(null),I=(0,i.useCallback)((async e=>{const t=await(0,Ee.l)(e);f(t)}),[]);(0,i.useEffect)((()=>{x&&x.length>0&&I(x[0].cdnUrl)}),[I,x]);const S=i=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Y,{hasDescription:a,contentInformation:t,onTimeStampClick:l,onExpanded:o,description:s,areHTMLDescriptionsEnabled:e,htmlDescription:r,playability:u,showHeader:i,spec:k}),n&&(0,j.jsx)(W.Nh,{spec:P,children:(0,j.jsx)(ve,{segmentCount:p,uri:y})}),h&&(0,j.jsx)(m.P,{size:"small",className:v,href:h,component:Z.Z,onClick:()=>{b.logInteraction(k.allEpisodesLinkFactory().hitUiNavigate({destination:h}))},children:c.ag.get("episode.see_all_episodes")}),(0,j.jsx)(C,{uri:y})]}),E=x&&x?.length>0&&u.playable;return(0,j.jsx)(j.Fragment,{children:E?(0,j.jsx)(ae,{transcriptSections:T,descriptionContent:S(!1),transcriptContent:(0,j.jsx)(ce,{transcriptSections:T||[],onTimeStampClick:d,episodeUri:y}),spec:g}):S(!0)})};var Ne=s(51040),De=s(61027),Le=s(50540),we=s(58301);const Ae="activation-trigger-mme",Re=({episodeUri:e,showUri:t,isLocked:s,isPlaying:i,isPlayDisabled:a,playButtonPlayLabel:n,playButtonPauseLabel:r,onClick:o,size:c="large"})=>{const d=(0,we.E)();if((0,Le.g)())return(0,j.jsx)(De.f,{size:c,onClick:o,isPlaying:i,disabled:a,locked:s,ariaPlayLabel:n,ariaPauseLabel:r});const u=(0,j.jsx)(Ne.l,{showUri:t,enabled:s,renderInline:!1,children:(0,j.jsx)(De.f,{size:c,onClick:o,isPlaying:i,disabled:a,locked:s,ariaPlayLabel:n,ariaPauseLabel:r})});return d?(0,j.jsx)(re.D,{id:Ae,targetURI:(0,l.EC)(e),fadeOut:!0,children:u}):u};var Me=s(13734),Be=s(53758),Fe=s(47262),Oe=s(8570),ze=s(70959),_e=s(65019),$e=s(86850),He=s(77861),We=s(29673),Ke=s(73928),Ze=s(82857),Ve=s(35869),Ye=s(8810),Qe=s(28185),Xe=s(97013),qe=s(6056),Ge=s(40235),Je=s(64329),et=s(27106),tt=s(64222),st=s(52993),it=s(23769),at=s(78706),nt=s(74234),rt=s(15842),ot=s(66205),lt=s(66819),ct=s(74434);const dt=({episode:e,onPlayEpisode:t,isPlaying:s,isActive:a,isFullyPlayed:n,setIsFullyPlayed:r,backgroundColor:o,isLocked:l,spec:d})=>{const{uri:u,playedState:p,contentRating:m,playability:h}=e,x=(0,W.$P)(),y=(0,Ve.I0)(),[g]=(0,it.z)(1e4,(e=>e?.item?.uri===u)),b=(0,_e.Y)((e=>e?.duration)),{badges:k}=(0,nt.r)({contentRating:m?.label}),C=(0,i.useCallback)((e=>{!h.playable&&k.nineteen&&(e.stopPropagation(),y((0,Ye.RM)(u||"")))}),[u,h.playable,k.nineteen,y]),P=(0,i.useCallback)((()=>{const e=d.contextMenuButtonFactory().hitUiReveal();x.logInteraction(e)}),[x,d]),T=(0,i.useCallback)(((e,t)=>{(0,tt.l7)(t,d.downloadButtonFactory(),x,u)}),[x,d,u]),f=(0,i.useCallback)((e=>{const t=d.saveButtonFactory();x.logInteraction(e?t.hitLike({itemToBeLiked:u}):t.hitRemoveLike({itemNoLongerLiked:u}))}),[x,d,u]),I=!l&&!e.playability.playable,S=c.ag.get("tracklist.a11y.play",e.name,e.podcast?.name),v=c.ag.get("tracklist.a11y.pause",e.name,e.podcast?.name),U=e.podcast?.uri,N=(0,lt.j)(),D=(0,et.r)(e.uri),L=!l;return(0,j.jsxs)(rt.o,{backgroundColor:o,children:[(0,j.jsxs)(ot.F,{children:[k.nineteen&&(0,j.jsx)(st.X,{className:E,size:16}),(0,j.jsx)(at.E,{fullyPlayed:n,durationMs:a&&b?b:e.duration.milliseconds,releaseDate:Nt(e.releaseDate?.isoString),resumePositionMs:p.playPositionMilliseconds,isPlaying:s,position:a&&g||void 0})]}),(0,j.jsxs)(ot.F,{children:[(0,j.jsx)("div",{onClick:C,children:(0,j.jsx)(Re,{episodeUri:e.uri,showUri:U,isLocked:l,onClick:()=>{t(p.playPositionMilliseconds)},isPlaying:s,isPlayDisabled:I,playButtonPlayLabel:S,playButtonPauseLabel:v,size:N})}),(0,j.jsx)(Qe.p,{uri:e.uri,onClick:T,size:N,canDownload:L}),D?(0,j.jsx)(ct.T,{uri:e.uri,size:N}):(0,j.jsx)(qe.w,{uri:e.uri,size:N,onClick:f}),(0,j.jsx)(Ge.y,{onShow:P,menu:(0,j.jsx)(Je.k,{uri:e.uri,sharingInfo:e.sharingInfo,showUri:U,contextUri:e.uri,isPlayed:n,onMarkAsPlayed:r}),children:(0,j.jsx)(Xe.z,{label:c.ag.get("more.label.context",e.name),size:N})})]})]})};s(54487);var ut=s(82579),pt=s(97922),mt=s(1502),ht=s(81639),xt=s(16118),yt=s(15632),gt=s(59099),jt=s(60046),bt=s(16473),kt=s(61058),Ct=s(93421),Pt=s(11401);const Tt=({coverArt:e,name:t})=>{const s=(0,kt.jh)(),i=s===kt.Uo.SMALL||s===kt.Uo.XSMALL;return(0,j.jsx)(Ct.O,{images:e,type:Ze.p.EPISODE,shape:Ct.K.ROUNDED_CORNERS,title:t,size:i?Pt.m$.SIZE_20:Pt.m$.SIZE_24,className:U})};const ft=({episode:e,isFullyPlayed:t,setIsFullyPlayed:s,backgroundColor:a,spec:n})=>{const{uri:r,name:o,sharingInfo:d,playedState:u,episodeType:p,releaseDate:m,coverArt:h}=e,x=(0,W.$P)(),y=function(e,t,s,i,a){const n=t===Ke.Wf.Episode;return(0,bt.G3)(e,i,s,a)?(0,j.jsx)(bt.Fg,{isMusicAndTalk:n}):n?c.ag.get("type.showEpisode"):c.ag.get("type.podcastEpisode")}(r,p||Ke.Wf.Unknown,u.playPositionMilliseconds,Nt(m?.isoString),u.state===Ke.sY.Completed),g=e.podcast?.uri,b=function(e){const t=(0,l.EC)(e);return`/show/${(0,l.HB)(t?.id||"")}`}(g),k=(0,i.useCallback)((()=>{x.logInteraction(n.podcastLinkFactory().hitUiNavigate({destination:b}))}),[x,b,n]),C=e.podcast?.coverArt,P=!!(C&&C.length===h.length&&h.every(((e,t)=>e.url===C[t].url))),f=(0,kt.jh)();return(0,j.jsxs)(pt.gF,{backgroundColor:a,children:[(0,j.jsx)(ht.W,{children:(0,j.jsx)(xt.i,{text:o,dragUri:r,dragLabel:o})}),!P&&(0,j.jsx)(mt.k,{children:(0,j.jsx)(ut._,{menu:(0,j.jsx)(Je.k,{uri:r,sharingInfo:d,showUri:g,contextUri:r,isPlayed:t,onMarkAsPlayed:s}),children:(0,j.jsx)(pt.Oe,{loading:"eager",name:o,images:h,placeholderType:"episode",shape:pt.Kc.SQUARE})})}),(0,j.jsxs)(pt.sP,{children:[(0,j.jsx)(yt.g,{children:y}),(0,j.jsx)(ut._,{menu:(0,j.jsx)(Je.k,{uri:r,sharingInfo:d,showUri:g,contextUri:r,isPlayed:t,onMarkAsPlayed:s}),children:(0,j.jsx)(pt.xd,{dragUri:r,dragLabel:o,scaleAtMinWidth:pt.vz,className:T,children:(0,j.jsx)("span",{"data-testid":"episodeTitle",children:o})})}),(0,j.jsx)(ut._,{menu:(0,j.jsx)(Je.k,{uri:r,sharingInfo:d,showUri:g,contextUri:r,isPlayed:t,onMarkAsPlayed:s}),children:(0,j.jsxs)(jt.default,{to:b,onClick:k,className:N,children:[P&&(0,j.jsx)(Tt,{name:o,coverArt:h}),(0,j.jsx)(gt.m,{className:f===kt.Uo.SMALL&&P?"":I,children:(0,j.jsx)("span",{"data-testid":"showTitle",children:e.podcast?.name})})]})})]})]})};var It=s(9443),St=s(96989),vt=s(71059);const Et=({episode:e})=>{const{uri:t,episodeType:s,description:n,htmlDescription:o,podcastSubscription:c,segmentsCount:p,podcast:m,contentInformation:h,playedState:x,coverArt:y}=e,{spec:g,logger:b}=(0,W.fU)(r.J,{data:{uri:t}}),k=(0,It.k)(),C=(0,i.useMemo)((()=>g.headerFactory()),[g]),T=(0,i.useMemo)((()=>g.actionBarFactory()),[g]),[f,I]=(0,i.useState)(x.state===Ke.sY.Completed),S=(0,Oe.g)(),v=(0,Me.o)(),E=void 0!==p&&p>0,U=(0,Le.g)(),{triggerPlay:N,togglePlay:D,isActive:L}=(0,oe.n)({uri:t,...k?{}:{pages:[{items:[{type:Ze.p.EPISODE,uri:t,uid:null,provider:null}]}]}},{featureIdentifier:"episode"}),{isActive:w,isPlaying:A}=(0,ze.$o)(t),R=y[0].url,M=(0,Fe.Zj)(R||null),B=(0,_e.Y)((e=>e?.isPaused??void 0)),F=(0,we.E)(),O=c.isPaywalled&&!c.isUserSubscribed,z=w||L,_=e?{name:e.name,uri:e.uri,mediaTypes:e.mediaTypes,audio:{items:e.audio.items.map((e=>({url:e.url})))}}:null,$=m?{name:m.name,uri:m.uri,trailer:m.trailer,showTypes:m.showTypes}:null,H=(0,Be.s)(_,$),K=(0,i.useCallback)(((e,i,a,n)=>{const r=()=>{B?(n?.("resume"),S.resume()):(n?.("pause"),S.pause())};if(O)return;let o="play";if(!A||0!==e&&i||(o="pause"),v({intent:o,targetUri:t,type:"click",itemIdSuffix:e>0?"podcast-description-timestamp":"button"}),s===Ke.Wf.Episode&&F)u.y.set((()=>({triggerId:a||Ae,triggerAction:null})));else if(L&&!i)U?r():D({loggingParams:n?.()});else if(w&&!i)r();else{const t=n?.("play");U?H({seekTo:e,loggingParams:t}):N({seekTo:e,loggingParams:t})}}),[O,A,v,t,s,F,w,L,U,B,S,D,H,N]),Z=(0,i.useCallback)((e=>{K(e,!1,void 0,(e=>{const s=g.actionBarFactory().playButtonFactory();let i;return i="pause"===e||A?s.hitPause({itemToBePaused:t}):"resume"===e||z?s.hitResume({itemToBeResumed:t}):s.hitPlay({itemToBePlayed:t}),b.logInteraction(i)}))}),[K,z,A,b,g,t]),V=(0,i.useCallback)((e=>{K(e,!0,void 0,(()=>b.logInteraction(g.descriptionSectionFactory().timestampLinkFactory().hitPlay({itemToBePlayed:t}))))}),[K,b,g,t]),Y=(0,i.useCallback)(((e,t)=>{K(e,!0,t)}),[K]),Q=(0,i.useCallback)((()=>{v({intent:"expand-description",type:"click"})}),[v]),[X,q]=(0,a.lr)();(0,i.useEffect)((()=>{if(e&&!z&&X.has("t")){const t=X.get("t")||"0",s=1e3*parseInt(t,10);s<=e.duration.milliseconds&&(X.delete("t"),q(X,{replace:!0}),K(s,!0))}}),[e,K,z,X,q]);const G=!!n||!!o,J=e.podcast?.uri,ee=(0,l.EC)(J)?.toURLPath(!0);return(0,j.jsxs)("section",{"data-testid":"episode",className:P,children:[(0,j.jsx)(d.$,{children:(0,We.mK)({episodeOrChapterName:e.name,showOrAudiobookName:e.podcast?.name??"",type:"Podcast"})}),(0,j.jsx)(ft,{episode:e,isFullyPlayed:f,setIsFullyPlayed:I,backgroundColor:M,spec:C}),(0,j.jsx)(dt,{episode:e,onPlayEpisode:Z,isPlaying:A,isActive:z,isFullyPlayed:f,setIsFullyPlayed:I,backgroundColor:M,isLocked:O,spec:T}),(0,j.jsx)("div",{className:"contentSpacing",children:(0,j.jsx)(Ue,{transcript:e.transcript,hasDescription:G,contentInformation:h,onDescriptionTimestampClick:V,onTranscriptTimestampClick:Y,onExpanded:Q,description:e.description,areHTMLDescriptionsEnabled:!0,htmlDescription:e.htmlDescription,playability:e.playability,hasMusicAndTalkSegements:E,segmentCount:p,uri:e.uri,showUrl:ee,spec:g})})]})},Ut=i.memo((function(){const{episodeId:e=""}=(0,n.UO)(),t=(0,l.YD)(e).toURI(),s=(0,$e.I)(t);return s?.isError||!s?.episodeOrChapter?(0,j.jsx)(p.h,{hasError:s?.isError||!1,errorMessage:c.ag.get("error.not_found.title.podcast")}):(0,He.Ey)(s.episodeOrChapter)?(0,j.jsx)(St.InstrumentedRedirect,{to:(0,l.EC)(s.episodeOrChapter.book?.uri).toURLPath(!0)}):(0,j.jsx)(i.Suspense,{fallback:null,children:(0,j.jsx)(vt.C,{pageId:o.Wg.PODCAST_EPISODE,uri:t,children:(0,j.jsx)(Et,{episode:s.episodeOrChapter})})})}));function Nt(e){return e?.replace(/T.*/,"")||""}}}]); //# sourceMappingURL=xpui-routes-episode.js.map