dotfiles/.config/spicetify/Extracted/Raw/xpui/xpui-routes-show.js

2 lines
34 KiB
JavaScript
Raw Normal View History

2024-07-11 00:01:49 +05:30
"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[5713],{51450:(e,t,a)=>{a.d(t,{V:()=>E,e:()=>A});var i=a(59496),s=a(61740),o=a(37840),n=a(50346),r=a(23451),l=a(64238),c=a(73769),d=a(54126),u=a(84449),g=a(92009),m=a(97302),p=a(6142),h=a(95663),x=a(4055),y=a(65970),b=a(54299),k=a(4882),j=a(90303),f=a(98340),v=a(54186),P=a(91048),C=a(96170),S=a(73972),w=a(94033),I=a(72171),N=a(4637);function A(e){return{uri:e.uri,name:e.name,trailer:e.trailer,showTypes:e.showTypes}}const D=e=>`activation-trigger-mme-${e}`,E=i.memo((function({index:e=-1,showMetadata:t,episode:a,usePlayContextItem:E,status:R,variant:U}){const F=(0,I.E)(),B=a.playedState.playPositionMilliseconds,T=a.uri,O=(0,i.useRef)(null),[L,M]=(0,i.useState)(a.playedState.state===S.sY.Completed),_=(0,p.O)(),z=(0,x.g)(),W=(0,v.jh)(),G=(0,h.o)(),H=(0,s.I0)(),{UBIFragment:K,spec:V,logger:Z}=(0,C.fU)(o.createDesktopEpisodeBlockEventFactory,{data:{uri:T,reason:a.requestId||"",position:e}}),Y=(0,C.Wi)(V),{isActive:X,isPlaying:q,togglePlay:$}=E({uri:T}),[J]=(0,P.z)(1e4,(e=>e?.item?.uri===T));(0,i.useEffect)((()=>{q&&(O.current=J)}),[q,J]),(0,i.useEffect)((()=>{!q&&O.current&&a.duration.milliseconds<=O.current&&M(!0)}),[q,a.duration.milliseconds]);const Q=(0,i.useCallback)((e=>{e||(O.current=0),M(e)}),[]),ee=A(t),te=(0,y.s)({...a,coverArt:{sources:a.coverArt}},ee),ae=(0,i.useCallback)((()=>{if(a.episodeType===S.Wf.Episode&&F)g.y.set((()=>({triggerId:D(a.uri),triggerAction:null})));else if(z)te();else{let e;e=q?V.playButtonFactory().hitPause({itemToBePaused:T}):X?V.playButtonFactory().hitResume({itemToBeResumed:T}):V.playButtonFactory().hitPlay({itemToBePlayed:T});const t=Z.logInteraction(e);G({targetUri:T,intent:q?"pause":"play",type:"click"}),$({loggingParams:t})}}),[X,te,G,$,T,q,z,a,F,Z,V]),ie=(0,i.useCallback)((()=>{Z.logInteraction(V.hitUiNavigate({destination:T})),G({type:"click",targetUri:T,intent:"navigate"})}),[T,G,Z,V]),se=a.podcastSubscription?.isPaywalled??!1,oe=a.podcastSubscription?.isUserSubscribed??!1,ne=se&&!oe,re=se&&z,{badges:le}=(0,w.r)({contentRating:a.contentRating?.label,isPaywalled:se}),ce=(0,i.useCallback)((()=>H((0,r.RM)(t.uri))),[t.uri,H]),de=(0,i.useCallback)((e=>{let i=e;return(ne||re)&&(i=(0,N.jsx)(u.l,{enabled:!0,showUri:t.uri,children:i})),!a.playability.playable&&le.nineteen&&(i=(0,N.jsx)("div",{onClick:e=>{e.stopPropagation(),ce()},children:e})),i=(0,N.jsx)(l.D,{id:D(T),targetURI:(0,n.EC)(T),children:i}),i}),[T,ne,re,t.uri,le.nineteen,a.playability.playable,ce]);return(0,N.jsx)(K,{spec:V,children:(0,N.jsx)(f.ZP,{value:"row",index:e,children:(0,N.jsx)(b._,{onShow:()=>{Z.logInteraction(V.secondaryHitUiReveal())},menu:(0,N.jsx)(c.k,{uri:T,showUri:t.uri,sharingInfo:a.sharingInfo,isPlayed:L,onMarkAsPlayed:Q}),children:(0,N.jsx)(d.X,{ref:Y,requestId:a.requestId,index:e,uri:T,size:W,images:a.coverArt||[],name:a.name,showName:t.name,description:a.description,isPlayable:a.playability.playable||ne,fullyPlayed:L,durationMs:a.duration.milliseconds,releaseDate:a.releaseDate?.isoString||"",resumePositionMs:O.current??B,handleDragStart:e=>{if(e.target!==e.currentTarget)return;const i=`${a.name}${t.name}`;_(e,[T],i,t.uri)},handlePlaybackClick:ae,handleClick:ie,isCurrentlyPlaying:X,isPaywalled:se,isUserSubscribed:oe,isPlaying:q,position:q?J:void 0,episodeSharingInfo:a.sharingInfo,onMarkAsPlayed:Q,contentInformation:a.contentInformation,badges:(0,N.jsxs)(N.Fragment,{children:[le.explicit&&(0,N.jsx)(k.N,{}),le.paid&&(0,N.jsx)(m.g,{}),le.nineteen&&(0,N.jsx)(j.X,{size:16})]}),playButtonWrapper:de,onMoreButtonClick:()=>{Z.logInteraction(V.moreButtonFactory().hitUiReveal())},status:R,variant:U})})})})}))},67484:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Ma});var i=a(59496),s=a(61740),o=a(89605),n=a(11707),r=a(47792),l=a(3802),c=a(91703),d=a(23627),u=a(84875),g=a.n(u),m=a(56162),p=a(36844),h=a(20432),x=a(10650),y=a(35394),b=a(44355),k=a(95663),j=a(64826),f=a(69812),v=a(25915),P=a(4882),C=a(42543),S=a(38127);const w="_yl4tOZxcpoUt28k6B8I",I="lcJflizNrSwDM9yPNk6h",N="ret7iHkCxcJvsZU14oPY"
//# sourceMappingURL=xpui-routes-show.js.map