dotfiles/.config/spicetify/Extracted/Themed/xpui/xpui-routes-collection-song...

2 lines
5.7 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([[7553],{82620:(e,t,a)=>{a.r(t),a.d(t,{default:()=>X});var r=a(59496),l=a(61740),n=a(89605),o=a(21586),s=a(28680),i=a(50346),c=a(3802),u=a(4270),d=a(13655),g=a(91703),m=a(45911),f=a(23627),h=a(77312),y=a(18840),p=a(66806),x=a(53417),k=a(29939),j=a(9877),b=a(48271),D=a(9284),F=a(16201),C=a(46843),E=a(46164),I=a(82538),S=a(48607),T=a(96170),w=a(78690),P=a(8930),v=a(24256),L=a(38440),A=a(4637);const R=r.memo((({tracklistDomRef:e})=>{const{spec:t,logger:a}=(0,T.fU)(P.createDesktopSearchBarEventFactory,{}),l=(0,r.useCallback)((()=>{a.logInteraction(t.filterFieldFactory().keyStrokeFilter())}),[a,t]),n=(0,r.useCallback)((()=>{a.logInteraction(t.filterFieldFactory().hitClearFilter())}),[a,t]),o=(0,r.useCallback)((()=>{a.logInteraction(t.sortButtonFactory().hitSort())}),[a,t]);return(0,A.jsxs)("div",{className:y.Z.searchBoxContainer,children:[(0,A.jsx)(r.Suspense,{fallback:null,children:(0,A.jsx)(v.K,{placeholder:c.ag.get("playlist.search_in_playlist"),clearOnEscapeInElementRef:e,onFilter:l,onClear:n})}),(0,A.jsx)(L.l,{columns:k.P0,onSort:o})]})}));var U=a(12107),O=a(80964),_=a(82108),B=a(28853),N=a(9102),Q=a(72102),M=a(36472),z=a(79041),G=a(9637),H=a(79923);const $=18e5;const q=r.lazy((()=>Promise.all([a.e(1814),a.e(6639),a.e(682)]).then(a.bind(a,86639)))),K=[x.QD.INDEX,x.QD.TITLE,x.QD.ALBUM,x.QD.ADDED_AT,x.QD.DURATION],V="your_library",W=({data:e,canFilter:t,canSort:a})=>{const{uri:l,name:i,totalLength:b}=e.metadata,E=(0,r.useRef)(null),P=b>0,v=b>0,L=(0,F.Y5)("#5038a0"),{filter:_}=(0,r.useContext)(p.fo),{sortState:N,setSortState:Q}=(0,r.useContext)(k.Gb),{spec:M,logger:z}=(0,T.fU)(s.createDesktopLikedSongsEventFactory,{data:{uri:l}}),G=r.useMemo((()=>M.headerFactory()),[M]),H=r.useMemo((()=>M.tracklistFactory()),[M]);(0,r.useEffect)((()=>{null===N.column&&Q({column:x.QD.ADDED_AT,order:x.kn.DESC})}),[N,Q]);const $=(0,n.ur)(),q=(0,n.TH)(),W="POP"!==$?new URLSearchParams(q.search).get("uri"):null,{isPlaying:Z,togglePlay:X,usePlayContextItem:Y,isActive:J}=(0,S.n)((0,C.I)(l,(0,w.w)(N),_),{featureIdentifier:V,referrerIdentifier:"your_library"}),ee=()=>{const e=(0,O.aK)({isPlaying:Z,isActive:J,spec:M.actionBarFactory().playButtonFactory(),logger:z,uri:l});X({loggingParams:e})},te=(0,r.useCallback)(((e,t)=>{const a=M.actionBarFactory().downloadButtonFactory();t===I.mc.ADD?z.logInteraction(a.hitDownload({itemToDownload:l})):t===I.mc.REMOVE?z.logInteraction(a.hitRemoveDownload({itemToRemoveFromDownloads:l})):t===I.mc.NO_PERMISSION&&z.logInteraction(a.hitUiReveal())}),[z,M,l]);return(0,A.jsxs)("section",{role:"presentation",className:y.Z.playlist,"data-testid":"playlist-page",children:[(0,A.jsx)(g.$,{children:c.ag.get("playlist.page-title",i)}),(0,A.jsx)(D.s,{metadata:e.metadata,isPlaying:Z,togglePlay:ee,backgroundColor:L,specLikedSongs:G}),(0,A.jsx)(u.o,{backgroundColor:L,children:(0,A.jsxs)(u.F,{children:[v?(0,A.jsx)(h.$,{onClick:ee,isPlaying:Z,size:"lg",uri:l,ariaPauseLabel:c.ag.get("playlist.a11y.pause",i),ariaPlayLabel:c.ag.get("playlist.a11y.play",i)}):null,e.metadata.totalLength>0&&(0,A.jsx)(B.v,{uri:l,renderEnabled:()=>(0,A.jsx)(j.v,{uri:l})}),(0,A.jsx)(d.o,{uri:l,canDownload:P,isFollowing:!0,onFollow:()=>{},size:d.q.md,onClick:te}),t&&a&&(0,A.jsx)(T.Nh,{spec:M.actionBarFactory(),children:(0,A.jsx)(R,{tracklistDomRef:E})})]})}),(0,A.jsx)("div",{className:"contentSpacing",children:b>0?(0,A.jsx)(r.Suspense,{fallback:(0,A.jsx)(f.h,{hasError:!1,errorMessage:c.ag.get("error.request-collection-tracks-failure")}),children:(0,A.jsx)(T.Nh,{spec:H,children:(0,A.jsx)(U.p,{nrTracks:b,columns:K,collectionUri:l,scrollToUri:W,usePlayContextItem:Y,outerDomRef:E,spec:H,initialItems:e.contents.items})})}):(0,A.jsx)(m.u,{message:c.ag.get("collection.empty-page.songs-subtitle"),title:c.ag.get("collection.empty-page.songs-title"),linkTo:"/search",linkTitle:c.ag.get("collection.empty-page.songs-cta"),renderInline:!0,children:(0,A.jsx)(o.F,{"aria-hidden":"true"})})})]})},Z=r.memo((function({user:e,uri:t}){const{filter:
//# sourceMappingURL=xpui-routes-collection-songs.js.map