solorice/config/spicetify/Extracted/Themed/xpui/home-v2.js
Kristofers Solo a42ded1119 Use dotter
2024-08-28 09:02:07 +03:00

2 lines
6.1 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[9319],{97484:(e,s,t)=>{t.r(s),t.d(s,{SKELETON_CARDS_COUNT:()=>pe,SKELETON_SHELVES_COUNT:()=>de,default:()=>ge});var r=t(30758),i=t(97500),n=t.n(i),a=t(41978),o=t(9183),c=t(81987),l=t(57758),d=t(11808),p=t(31685),m=t(311),u=t(83028),g=t(17534),h=t(95534),x=t(12783),b=t(19643),j=t(30171),f=t(58593),w=t(38273),y=t(79303),v=t(72091);const C="iC5KPBY1LYMrQkGPnG8m";var S=t(86070);const k=()=>{const e=(0,a.wA)(),s=(0,y.s)(),{spec:t}=(0,v.r)(f.V,{}),i=(0,r.useCallback)((()=>{e(w.r8.actions.open()),s.logInteraction(t.learnMoreButtonFactory().hitUiReveal())}),[e,s,t]);return(0,S.jsxs)(x.E,{as:"p",semanticColor:"textBase",className:C,children:[(0,S.jsx)(b.p,{size:"small"}),d.Ru.get("home.dsa-message",(0,S.jsx)(j.H,{condensedAll:!0,size:"small",semanticColor:"textBase",onClick:i,children:d.Ru.get("home.dsa-message-link")}))]})};var N=t(49566),M=t(63198),R=t(19159),A=t(72973),L=t(31322),P=t(43830),T=t(75721),$=t(84492),_=t(32994),E=t(42116),D=t(73356);const U="oncgBAFkunsYPz4icLG7",I="bctyR0DdgoudSxC6j8nw",z="ZlJQ9zbhmUTk2MeTziP7",B="uOT2oirHdJA8NsGlsyA2",F="_0Zn5lYC3o0cU44PBPnvN",O="V2fn7ev3_1mroI9UxjL7",H="iNxrs2Niil0QTvUYbTxf",W=({isMWP:e})=>(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,disablePictureInPicture:!0,className:`${B} ${F}`,"aria-hidden":"true",children:[(0,S.jsx)("source",{src:(0,$.b)(`videos/Sw23-${e?"Mobile":"Desktop"}-Left.webm`),type:"video/webm; codecs=vp09.01.41.08"}),(0,S.jsx)("source",{src:(0,$.b)(`videos/Sw23-${e?"Mobile":"Desktop"}-Left.mp4`),type:"video/mp4"})]}),(0,S.jsxs)("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,disablePictureInPicture:!0,className:`${B} ${O}`,"aria-hidden":"true",children:[(0,S.jsx)("source",{src:(0,$.b)(`videos/Sw23-${e?"Mobile":"Desktop"}-Right.webm`),type:"video/webm; codecs=vp09.01.41.08"}),(0,S.jsx)("source",{src:(0,$.b)(`videos/Sw23-${e?"Mobile":"Desktop"}-Right.mp4`),type:"video/mp4"})]})]}),Y=({isMWP:e})=>(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("picture",{children:[(0,S.jsx)("source",{srcSet:(0,$.b)(`images/Sw23-${e?"Mobile":"Desktop"}-Left.webp`),type:"image/webp"}),(0,S.jsx)("source",{srcSet:(0,$.b)(`images/Sw23-${e?"Mobile":"Desktop"}-Left.png`),type:"image/png"}),(0,S.jsx)("img",{className:`${B} ${F}`,src:"",alt:""})]}),(0,S.jsxs)("picture",{children:[(0,S.jsx)("source",{srcSet:(0,$.b)(`images/Sw23-${e?"Mobile":"Desktop"}-Right.webp`),type:"image/webp"}),(0,S.jsx)("source",{srcSet:(0,$.b)(`images/Sw23-${e?"Mobile":"Desktop"}-Right.png`),type:"image/png"}),(0,S.jsx)("img",{className:`${B} ${O}`,src:"",alt:""})]})]}),J=(0,r.forwardRef)((({linkUri:e,loggedIn:s,isMWP:t,isStatic:r=!1,onClick:i},a)=>{const o=(0,E.y)(),c=(0,D.j)();return(0,S.jsx)("div",{className:U,ref:a,children:(0,S.jsxs)("div",{className:(0,A.Ju)("invertedLight",n()(I,{[z]:t})),children:[r||c?(0,S.jsx)(Y,{isMWP:t}):(0,S.jsx)(W,{isMWP:t}),(0,S.jsx)(L.Z,{as:"h2",variant:"brio",semanticColor:"textBase",className:H,children:s?d.Ru.get("shared.wrapped-banner.title"):d.Ru.get("shared.wrapped-banner.title-loggedout")}),(0,S.jsx)(L.Z,{as:"p",variant:o===_.E.SMALL||t?"mesto":"ballad",semanticColor:"textBase",children:s?d.Ru.get("shared.wrapped-banner.body"):d.Ru.get("shared.wrapped-banner.body-loggedout")}),(0,S.jsx)(P.$,{colorSet:"invertedDark",iconTrailing:T.H,href:e,target:"_blank",size:o===_.E.SMALL||t?"small":"medium",onClick:i,children:d.Ru.get("shared.wrapped-banner.button")})]})})}));var Z=t(23679),G=t(48905);const Q=()=>{const e=(0,M.V)(),s=(0,c.NC)(R.ATM),{openURLWithSessionTransfer:t}=(0,Z.L)(),{spec:i,logger:n}=(0,v.r)(N.S,{data:{identifier:"wrapped",uri:"spotify:2023wrapped"}}),a=(0,r.useMemo)((()=>i.campaignFactory({identifier:"wrapped",uri:"spotify:2023wrapped"}).bannerFactory({identifier:"home_wrapped_banner",uri:"desktop_banner"})),[i]),o=(0,G.t)(a),l="https://spotify.com/wrapped",d=(0,r.useCallback)((e=>{n.logInteraction(a.hitUiNavigate({destination:l})),t(l),e.preventDefault()}),[n,t,a]);return(0,S.jsx)(J,{linkUri:l,loggedIn:!e,onClick:d,ref:o,isStatic:s})};var V=t(89070),K=t(68046),X=t(41695),q=t(22252);const ee=()=>(0,c.NC)(R.FAj)===R.z3X.ONHOME?(0,S.jsx)(X.g,{children:(0,S.jsx)(q.o,{onSearch:!1})}):null;var se=t(80460),te=t(90224),re=t(2628),ie=t(47721),ne=t(95625),ae=t(75621),oe=t(56376),ce=t(17869),le=t(18232);const de=6,pe=6,me=(0,r.memo)((({shelfCount:e,cardCount:s})=>(0,S.jsx)("section",{className:le.A.home,"data-testid":"home-page",children:(0,S.jsxs)("div",{className:n()(le.A.content,"contentSpacing"),children:[(0,S.jsx)(m.y,{withTitle:!1}),[...new Array(e).keys()].map(((e,t)=>(0,S.jsx)(K.f,{withTitle:!0,cardCount:s},t)))]})}))),ue=({spec:e})=>{(0,re.m)("home");const s=(0,a.d4)(ie.JJ),t=(0,o.zy)(),r=new URLSearchParams(t.search).get("pCountry"),{subfeedId:i=null}=(0,o.g)(),{data:l,error:p,fetching:m}=(0,g.B8)({timeZone:(0,h.Ff)(),sp_t:(0,ne.v8)("sp_t")??"",country:r??s,facet:i,sectionItemsLimit:10},{gcTime:h.gO,staleTime:h.jl}),x=(0,c.NC)(R.Y_Z),b=(0,c.NC)(R.ATM),j=x||b,f=!(0,te.p)();if(m)return(0,S.jsx)(me,{shelfCount:de,cardCount:pe});if(null!==p)return(0,S.jsx)(u.A,{hasError:!0,errorMessage:d.Ru.get("error.generic")});const w=l?.home;return"HomeResponsePayload"!==w?.__typename?(0,S.jsx)(u.A,{hasError:!0,errorMessage:d.Ru.get("error.generic")}):0===w.sectionContainer.sections.totalCount||0===w.sectionContainer.sections.items.length?((0,ae.Jy)(new Error("Empty response from pathfinder"),"Home"),(0,S.jsx)(u.A,{hasError:!0,errorMessage:d.Ru.get("error.generic")})):(0,S.jsx)("section",{className:n()(le.A.home,le.A.homepage),"data-testid":"home-page",children:(0,S.jsxs)("div",{className:n()(le.A.content,"contentSpacing"),children:[j&&(0,S.jsx)(Q,{}),f&&(0,S.jsx)(k,{}),(0,S.jsx)(V.g,{spec:e,greeting:w.greeting?.text??null,container:w.sectionContainer})]})})},ge=()=>{const{spec:e}=(0,v.r)(l.Y,{data:{identifier:"home",uri:"spotify:home"}}),s=(0,se.W)({type:"locale",uri:"home"});return(0,S.jsxs)(ce.r,{spec:e,children:[(0,S.jsx)(p.Q,{children:(0,oe.pr)({i18n:d.Ru,shouldLocalize:s})}),(0,S.jsx)(r.Suspense,{fallback:null,children:(0,S.jsx)(ee,{})}),(0,S.jsx)(ue,{spec:e})]})}}}]);
//# sourceMappingURL=home-v2.js.map