mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
2 lines
3.8 KiB
JavaScript
Executable File
2 lines
3.8 KiB
JavaScript
Executable File
"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[2233],{63964:(e,i,n)=>{n.r(i),n.d(i,{HomeChipsRow:()=>Z,HomeChipsRowWithEmptyStates:()=>q});var t=n(52542),l=(n(24302),n(79024),n(25550),n(57149),n(47994),n(43379),n(2823),n(97460),n(29426),n(34192),n(49166),n(15342),n(93577),n(54520),n(91531),n(93678),n(34145),n(30758)),a=n(97500),r=n.n(a),s=n(57574),o=n(88677),d=n(44286),c=n(15057),u=n(89255),h=n(93493),f=n(63900),p=n(92107),m=n(30747),v=n(28121),g=n(8540),C=n(98505),x=n(90379),j=n(83182),b=n(77752),y=n(29330),N=n(77730),I=n(86429),w=n(14267),R=n(55361),F=n(58114),S=n(74512),k=n(496),L=n(5280),M=n(12574);const _="main-home-filterChipsContainer",A="main-home-filterChipsSection",H="fIvMht6B9HdROywMNJZ4",P="mjZrvVI3CxfHJXu7y0Lg",J="LVMjmN2CaPruPAo62RAY",V="HXlt7CQ7uXgHZ9UKA4tS",X="g4woYb2pJFjxtIfizfeA",W="_bbW1oBra1fMJvD43SCl";var Y=n(86070),Z=l.memo((function(e){var i=e.filterChips,n=e.requestId,t=(0,h.NC)(F.MX4),a=(0,d.Zp)(),s=(0,b.f)(),o=(0,M.r)(f.Y,{data:{identifier:"home",uri:s?"spotify:home?facet=".concat(s):"spotify:home",reason:null!=n?n:""}}),v=o.spec,g=o.logger,C=i.flatMap((function(e){return e.id&&"wrapped-chip"!==e.id?{id:e.id,getName:function(){var i,n;return null!==(i=null===(n=e.label)||void 0===n?void 0:n.text)&&void 0!==i?i:""},ubiId:e.id}:[]})),x=(0,l.useCallback)((function(e){var i=v.homeSubfeedsFactory();if(e&&e!==s){var n=i.filterChipFactory({identifier:e});g.logInteraction(n.hitFilter()),a("/home?facet=".concat(e))}else{var t=i.filterChipFactory({identifier:"all"});g.logInteraction(t.hitFilter()),a("/")}}),[v,g,a,s]),j=(0,c.YQ)(x,100,{leading:!0,trailing:!1}),I=(0,h.NC)(F._Ie),w=(0,y.Td)().shelfURIs,R=(0,N.k)(),S=w.length>0,k="Pinned by ".concat(null==R?void 0:R.name);return(0,Y.jsx)("div",{className:r()(J,t?V:null,"contentSpacing"),children:(0,Y.jsxs)(m.FN,{ariaLabel:p.Ru.get("home.filters"),children:[(0,Y.jsx)(u.v,{"aria-label":p.Ru.get("search.title.all"),selectedColorSet:"invertedLight",onClick:function(){return j(null)},selected:""===s,children:p.Ru.get("search.title.all")},"all"),C.map((function(e){return(0,Y.jsx)(u.v,{"aria-label":e.getName(),selectedColorSet:"invertedLight",onClick:function(){return j(e.id)},selected:Boolean(s&&s===e.id),children:e.getName()},e.id)})),I&&(S||R)&&(0,Y.jsx)("div",{className:X}),I&&S&&(0,Y.jsxs)(u.v,{"aria-label":"Pinned",selectedColorSet:"invertedLight",onClick:function(){return j("pinned")},selected:"pinned"===s,children:[(0,Y.jsx)("span",{children:"Pinned"}),(0,Y.jsx)("span",{className:W,children:w.length})]},"pin"),I&&R&&(0,Y.jsx)(u.v,{"aria-label":"Pinned",selectedColorSet:"invertedLight",selected:"pinned-by"===s,children:(0,Y.jsx)("span",{children:k})},"pin")]})})})),q=function(){var e,i,n=(0,h.NC)(F.MX4),l=(0,w.p)(),a=(0,I.V)(),c=(0,R.A)(),u=(0,k.v7)(),f=(0,s.Wx)({initialInView:!0,threshold:[1],rootMargin:"-".concat(g.uC,"px 100%"),root:u.current}),p=f.ref,m=f.inView,b=void 0!==c,y=(0,d.zy)(),N=new URLSearchParams(y.search).get("pCountry"),M=(0,o.d4)(S.JJ),X=(0,C.W3)({timeZone:(0,x.Ff)(),sp_t:null!==(e=(0,L.v8)("sp_t"))&&void 0!==e?e:"",country:null!=N?N:M},{gcTime:x.gO,staleTime:x.jl}),W=X.data,q=X.loading,B=X.error,E=X.extensions;return q?(0,Y.jsx)("div",{className:_,children:(0,Y.jsx)("div",{className:r()(J,n?V:null,"contentSpacing"),children:(0,Y.jsx)(v.Y,{as:"h2",variant:"titleMedium",charCount:25,isLoading:!0})})}):B||!W||"HomeResponsePayload"!==(null===(i=W.home)||void 0===i?void 0:i.__typename)?null:!a&&l?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{ref:p}),(0,Y.jsxs)("div",{className:_,children:[(0,Y.jsx)("div",{className:r()((0,t.A)((0,t.A)({},P,!m),H,b),A),style:{backgroundColor:c}}),(0,Y.jsx)(Z,{filterChips:W.home.homeChips,requestId:(0,j.getRequestIdForImpressions)(E)})]})]}):null}}}]);
|
|
//# sourceMappingURL=dwp-home-chips-row.js.map
|