solorice/config/spicetify/Extracted/Raw/xpui/7034.js

2 lines
6.9 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[7034],{77034:(e,n,t)=>{t.d(n,{W:()=>H});var i=t(52542),r=(t(7651),t(14551),t(83234),t(30456),t(26701),t(25550),t(70750),t(47994),t(37417),t(11737),t(51691),t(702),t(5672),t(43379),t(34192),t(88856),t(51565),t(15342),t(18316),t(97500)),o=t.n(r),a=t(80366),s=t(92107),l=t(54769),c=t(86295),d=t(87718),u=new c.l("internalLinkRecommenderEpisode","query","28b3555816ad49290799e6697f0077e8f351d753b46cc2e6a195e1c72e47e7f2",null),p=t(37741),y=t(12341),f=t(30758),m=t(88677),v=t(7352),g=t(91471),b=t(83643),h=t(53163),P=t(88712),w=t(64333),_=t(57581),j=t(8016),x=t(86429),I=t(62562),E=t(64348),k=t(57186),O=t(46198),S=t(53607),A=t(60455),C=t(79431),R=t(33814),T=t(4140),D=t(97724),U=t(86070),M=function(e){return"activation-trigger-mme-".concat(e)},N=f.memo((function(e){var n,t,i,r=e.index,o=void 0===r?-1:r,s=e.audio,l=e.contentInformation,c=e.coverArt,d=e.contentRatingLabel,u=e.description,p=e.mediaTypes,N=e.isoString,F=e.name,V=e.playable,G=e.playedState,L=e.podcastSubscription,q=e.sharingInfo,z=e.showName,W=e.showTrailer,X=e.showTypes,Y=e.showUri,B=e.status,Q=e.totalMilliseconds,Z=e.type,H=e.uri,K=G.playPositionMilliseconds,J=(0,f.useRef)(null),$=(0,f.useState)(G.state===T._w.Completed),ee=(0,y.A)($,2),ne=ee[0],te=ee[1],ie=(0,j.P)(),re=ie.draggable,oe=ie.onDragStart,ae=(0,x.V)(),se=(0,A.y)(),le=(0,m.wA)(),ce=(0,C.P)({uri:H},{featureIdentifier:"episode"}),de=ce.isActive,ue=ce.isPlaying,pe=ce.togglePlay,ye=(0,R.S)(1e4,(function(e){var n;return(null==e||null===(n=e.item)||void 0===n?void 0:n.uri)===H})),fe=(0,y.A)(ye,1)[0];(0,f.useEffect)((function(){ue&&(J.current=fe)}),[ue,fe]),(0,f.useEffect)((function(){!ue&&J.current&&Q<=J.current&&te(!0)}),[ue,Q]);var me=(0,f.useCallback)((function(e){e||(J.current=0),te(e)}),[]),ve={uri:Y,name:z,trailer:W,showTypes:X},ge=(0,I.C)({audio:s,name:F,uri:H,mediaTypes:p,coverArt:{sources:c}},ve),be=(0,f.useCallback)((function(){Z!==T.I_.Episode?ae?ge():pe():_.h.set((function(){return{triggerId:M(H),triggerAction:null}}))}),[Z,ae,H,ge,pe]),he=null!==(n=null==L?void 0:L.isPaywalled)&&void 0!==n&&n,Pe=null!==(t=null==L?void 0:L.isUserSubscribed)&&void 0!==t&&t,we=he&&!Pe,_e=he&&ae,je=(0,D.b)({contentRating:d,isPaywalled:he}).badges,xe=(0,f.useCallback)((function(){return le((0,v.Tf)(Y))}),[Y,le]),Ie=(0,f.useCallback)((function(e){var n=e;return(we||_e)&&(n=(0,U.jsx)(w.f,{enabled:!0,showUri:Y,children:n})),!V&&je.nineteen&&(n=(0,U.jsx)("div",{onClick:function(e){e.stopPropagation(),xe()},children:e})),n=(0,U.jsx)(g.k,{id:M(H),targetURI:(0,a.o_)(H),children:n})}),[we,_e,V,je.nineteen,H,Y,xe]);return(0,U.jsx)(S.pZ,{value:"row",index:o,children:(0,U.jsx)(b.h,{menu:(0,U.jsx)(h.b,{uri:H,showUri:Y,sharingInfo:q,isPlayed:ne,onMarkAsPlayed:me}),children:(0,U.jsx)(P.k,{requestId:void 0,index:o,uri:H,size:se,images:c||[],name:F,showName:z,description:u,isPlayable:V||we,fullyPlayed:ne,durationMs:Q,releaseDate:N||"",resumePositionMs:null!==(i=J.current)&&void 0!==i?i:K,draggable:re,handleDragStart:function(e){if(e.target===e.currentTarget){var n="".concat(F," • ").concat(z);oe(e,{itemUris:[H],dragLabelText:n,contextUri:Y})}},handlePlaybackClick:be,isCurrentlyPlaying:de,isPaywalled:he,isUserSubscribed:Pe,isPlaying:ue,position:ue?fe:void 0,episodeSharingInfo:q,onMarkAsPlayed:me,contentInformation:l,showUri:Y,mediaTypes:null!=p?p:void 0,badges:(0,U.jsxs)(U.Fragment,{children:[je.explicit&&(0,U.jsx)(E.U,{}),je.paid&&(0,U.jsx)(k.y,{}),je.nineteen&&(0,U.jsx)(O.q,{size:16})]}),playButtonWrapper:Ie,status:B})})})}));var F=t(16920);var V=t(37778),G=t(39954),L=t(46112);const q="GgMHVmfXNzteIydSWMIA",z="GcupflQsYyy0IMOsCeD1",W="h6KkL9VhU8t6zFv7XQXc",X="A4FqrLbXeENogU0IRaPn",Y="YCYs0Gv5B5ctDN0f5Zby";function B(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Q(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?B(Object(t),!0).forEach((function(n){(0,i.A)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Z=function(e){var n,t,r,l=e.uri,c=e.isFullPage,p=void 0!==c&&c,y=(t={uri:l,seoExperimentId:L.R.EPISODE_DISCOVERY},(0,d.I)(u,t,r)).data,f=null==y?void 0:y.seoRecommendedEpisode.totalCount,m=function(e){return(e||[]).filter((function(e){return function(e){return"NotFound"!==(null==(n=e)?void 0:n.__typename)&&"GenericError"!==(null==n?void 0:n.__typename)&&"RestrictedContent"!==(null==n?void 0:n.__typename)&&"Episode"===e.__typename;var n}(e.data)}))}(null==y?void 0:y.seoRecommendedEpisode.items),v=p?m:m.slice(0,5);if(0===f)return null;var g=null===(n=(0,a.o_)(l))||void 0===n?void 0:n.id,b="spotify:app:episode:".concat(g,":more-like-this");return(0,U.jsxs)("section",{className:o()(q,(0,i.A)({},z,!p)),"data-testid":"episode-list",children:[(0,U.jsx)("header",{className:W,children:(0,U.jsx)(V.k,{title:s.Ru.get("internal-link-recommender.more-episodes-like-this"),hasMoreElements:!p,seeAllUri:b})}),v.map((function(e,n){var t,i,r,o,a,s=e.data,l=function(e){return"NotFound"!==(null==(n=e)?void 0:n.__typename)&&"GenericError"!==(null==n?void 0:n.__typename)&&"RestrictedContent"!==(null==n?void 0:n.__typename)&&"Podcast"===e.__typename;var n}(s.podcastV2.data)?s.podcastV2.data:null;return l?s&&(0,U.jsxs)("div",{className:Y,children:[(0,U.jsx)("hr",{className:X,"aria-hidden":!0}),(0,U.jsx)(N,{index:n,audio:s.audio,contentInformation:s.contentInformation,contentRatingLabel:null===(t=s.contentRating)||void 0===t?void 0:t.label,coverArt:s.coverArt?s.coverArt.sources:void 0,description:s.description,isoString:null===(i=s.releaseDate)||void 0===i?void 0:i.isoString,mediaTypes:s.mediaTypes,name:s.name,playable:s.playability.playable,playedState:s.playedState,podcastSubscription:(0,G.Wx)(s.restrictions,s.playability),sharingInfo:s.sharingInfo,showTrailer:(o=null===(r=l.trailerV2)||void 0===r?void 0:r.data,o&&function(e){return"NotFound"!==(null==(n=e)?void 0:n.__typename)&&"GenericError"!==(null==n?void 0:n.__typename)&&"RestrictedContent"!==(null==n?void 0:n.__typename)&&"Episode"===e.__typename;var n}(o)?{type:F.c.EPISODE,uri:o.uri,name:o.name,coverArt:(null===(a=o.coverArt)||void 0===a?void 0:a.sources)||[],audio:o.audio,audioPreview:o.audioPreview,sharingInfo:o.sharingInfo,duration:{milliseconds:o.duration.totalMilliseconds},contentRating:o.contentRating,mediaTypes:o.mediaTypes}:null),showName:l.name,showTypes:l.showTypes,showUri:l.uri,totalMilliseconds:s.duration.totalMilliseconds,type:s.type,uri:s.uri},"".concat(s.uri,"/").concat(n))]},"".concat(n).concat(s.uri)):null}))]})},H=function(e){var n=(0,p.D)({entityType:F.c.EPISODE,componentType:"list",uri:e.uri});return(0,U.jsx)(l.s,{onError:n,children:(0,U.jsx)(Z,Q({},e))})}}}]);
//# sourceMappingURL=7034.js.map