Files
dotfiles/.config/spicetify/Extracted/Raw/xpui/browse-v2.js
T
2024-05-05 19:02:45 +02:00

2 lines
22 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[3817],{30435:(e,i,n)=>{n.d(i,{Z:()=>o});var t=n(8071),a=n(32540),s=n(79865),r=n(11527);const o=({name:e,uri:i,images:n,isHero:o,testId:l,description:d,index:c,requestId:m,color:u})=>(0,r.jsx)(t.C,{index:c,featureIdentifier:"artist_concerts",headerText:e,uri:i,isPlayable:!1,renderCardImage:()=>(0,r.jsx)(a.x,{isHero:o,images:n,color:u}),renderSubHeaderContent:()=>(0,r.jsx)(s.i,{isHero:o,children:(0,r.jsx)("span",{children:d||""})}),testId:l,requestId:m})},20537:(e,i,n)=>{n.d(i,{T:()=>C});n(86277);var t=n(50959),a=n(69736),s=n(60702),r=n(79126),o=n(98779),l=n(24441),d=n(21933),c=n(76463),m=n(10226),u=n(85255),p=n(85648),k=n(80626),g=n(58912),f=n(17676);const x="iSdDcgYotxUpyRSGLR62",b="EqZ5uEZ02bJiKlZNijVQ",S="UroGtnEGQiwN1yKyNXjC",N="Tv3tod8ggHvNrrRzE1Kg",v="dWaG35yHF_9XzU2FlAce";var h=n(11527);const y=({content:e})=>(0,h.jsxs)(a.x,{as:"p",semanticColor:"textBrightAccent",className:v,children:[(0,h.jsx)(s.V,{size:"small"}),e]}),j=({content:e})=>(0,h.jsxs)(a.x,{as:"p",semanticColor:"textBrightAccent",className:v,children:[(0,h.jsx)(r.o,{size:"small"}),e]}),w=({content:e})=>(0,h.jsx)(a.x,{as:"p",className:v,children:e}),I=e=>{switch(e.type){case"SPOTIFY_EXCLUSIVE":return(0,h.jsx)(y,{...e});case"TOP_FANS_EXCLUSIVE":case"TOP_FANS_DISCOUNT":case"LIMITED_EDITION":return(0,h.jsx)(j,{...e});default:return(0,h.jsx)(w,{...e})}},F=({price:e,salePrice:i})=>i?(0,h.jsxs)("div",{children:[(0,h.jsxs)(a.x,{variant:"bodySmall",semanticColor:"textBrightAccent",children:[i," "]}),(0,h.jsx)(a.x,{variant:"bodySmall",style:{textDecoration:"line-through"},children:e})]}):(0,h.jsx)(a.x,{variant:"bodySmall",children:e}),C=({name:e,uri:i,href:n,images:a,index:s,price:r,testId:v,salePrice:y,label:j,artists:w})=>{const C=(0,m.W6)(f.WDb),_=(0,t.useMemo)((()=>w.items.map((e=>"profile"in e.data?e.data.profile.name:"")).join(p.ag.getSeparator())),[w.items]),{spec:P,logger:T}=(0,k.fU)(u.I,{data:{position:s,uri:i,reason:j?.type||""}}),L=(0,g.X)(a,{desiredSize:300}),O=(0,t.useCallback)((()=>{T.logInteraction(P.cardLinkFactory({position:0}).hitNavigateToExternalUri({destination:n})),window.open(n,"_blank")}),[n,T,P]);return(0,h.jsx)(o.Z,{id:i,"data-testid":v,title:(0,h.jsx)(l.l,{className:N,children:e}),pretitle:j&&(0,h.jsx)(I,{type:j.type,content:j.content}),media:(0,h.jsx)("div",{className:x,children:L?(0,h.jsx)(d.x,{size:"sm",src:L?.url,alt:e}):(0,h.jsx)("div",{className:b,children:(0,h.jsx)("div",{className:S,children:(0,h.jsx)(c.C,{size:"xxlarge","aria-hidden":!0,"data-testid":"card-image-fallback"})})})}),onClick:O,size:C?"md":"sm",subtitle:(0,h.jsx)(F,{price:r,salePrice:y}),body:_},i)}},90941:(e,i,n)=>{n.r(i),n.d(i,{BrowsePage:()=>Y});n(86277);var t=n(50959),a=n(82187),s=n.n(a),r=n(80128),o=n(85648),l=n(80936),d=n(80626),c=n(39505),m=n(69736),u=n(98716),p=n(97922),k=n(81639),g=n(16118);const f="lXcKpCtaEeFf1HifX139",x="KZy9ufUbVUdmV7qnCE2e",b="xcTrtCsYOPtSElbX9inq",S="SRs2_Y3HzK0cy8JMy9li",N="DMiqZINqPhstZTTXScSC";var v=n(11527);const h=({images:e,color:i=c.k77,title:n,subtitle:t})=>{const a=0===e.length?p.fR.SMALL:p.fR.DEFAULT;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(p.gF,{backgroundImages:e,backgroundColor:i,size:a,children:[(0,v.jsx)(k.W,{children:n?(0,v.jsx)(g.i,{text:n}):null}),(0,v.jsxs)(p.sP,{children:[n?(0,v.jsx)(p.xd,{children:n}):null,t&&(0,v.jsx)(m.x,{variant:"bodySmall",className:S,children:t})]})]}),(0,v.jsx)(u.H,{color:i})]})};n(46758),n(53321);var y=n(36353),j=n(10226),w=n(91054),I=n(70526),F=n(66197),C=n(94260),_=n(33592),P=n(4222);const T={chips:"T8Vmv6htAP7bht774xG5",chip:"BX1DapBHMyHxwyF1aFRv"};function L({section:e}){return(0,v.jsx)("div",{className:T.chips,children:e.sectionItems.items.map((e=>function(e){return"BrowseSectionContainerWrapper"===e.content.__typename&&"BrowseSectionContainer"===e.content.data.__typename&&e.content.data.data?.cardRepresentation?.title?.transformedLabel?(0,v.jsxs)(F.A,{as:_.Z,href:(0,P.t1)(e.uri),className:T.chip,children:[e.content.data.data.cardRepresentation.title.transformedLabel,(0,v.jsx)(C.V,{size:"xsmall"})]},e.uri):null}(e)))})}var O=n(42694),R=n(36255),B=n(17676),D=n(24422);const A=({section:e,position:i,showAll:n})=>{const a=(0,t.useMemo)((()=>e.sectionItems.items.map(((e,i)=>(0,O.O)(e,i))).filter(w.K)),[e.sectionItems.items]),r=(0,j.W6)(B.WDb);switch(e.data?.__typename){case"BrowseGenericSectionData":return(0,v.jsx)(R.q,{title:e.data?.title?.transformedLabel??"",tagline:e.data?.subtitle?.transformedLabel??"",total:e.sectionItems.totalCount,seeAllUri:(0,P.px)(e.uri),index:i,id:e.uri,showAll:n,children:a});case"BrowseGridSectionData":return(0,v.jsx)(R.q,{title:e.data?.title?.transformedLabel??"",tagline:e.data?.subtitle?.transformedLabel??"",total:e.sectionItems.totalCount,index:i,id:e.uri,seeAllUri:e.targetLocation?(0,P.t1)(e.targetLocation):void 0,forceTitleClickNavigation:Boolean(e.targetLocation),className:s()(N,{[D.Z.titleSpacing]:r}),showAll:!0,colGap:y.g4,rowGap:y.g4,removeOffsetMargin:!0,children:a});case"BrowseRelatedSectionData":return(0,v.jsx)(L,{section:e});case"BrowseSingleItemSectionData":case"BrowseUnsupportedSectionData":case void 0:return null;default:return(0,I._)(e.data),null}};var E=n(40022);const U=({uri:e,fallback:i})=>{const{section:n,error:t,fetchNextItems:a}=(0,E.X)(e),s=n?.data?.title?.transformedLabel,r=n?.data?.subtitle?.transformedLabel,o=n?.sectionItems.items??[];return 0===o.length||null!==t?i():(0,v.jsx)(l.C,{onReachBottom:a,children:(0,v.jsx)(R.q,{title:s??"",tagline:r??"",index:0,id:e,showAll:!0,children:o.map(((e,i)=>(0,O.O)(e,i)))})})};var V=n(37335),M=n(41038),W=n(91643),q=n(50540),Z=(n(2836),n(70207)),G=n(65441),X=n(7627),z=n(77033),H=n(80845),K=(n(20069),n(5254));const J={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"browsePage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uri"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pagePagination"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PaginationInput"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sectionPagination"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PaginationInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"browse"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"pagePagination"},value:{kind:"Variable",name:{kind:"Name",value:"pagePagination"}}},{kind:"ObjectField",name:{kind:"Name",value:"sectionPagination"},value:{kind:"Variable",name:{kind:"Name",value:"sectionPagination"}}},{kind:"ObjectField",name:{kind:"Name",value:"uri"},value:{kind:"Variable",name:{kind:"Name",value:"uri"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BrowseSectionContainer"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"header"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"backgroundImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"browseImageSources"}}]}},{kind:"Field",name:{kind:"Name",value:"color"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hex"}}]}},{kind:"Field",name:{kind:"Name",value:"title"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"transformedLabel"}}]}},{kind:"Field",name:{kind:"Name",value:"subtitle"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"transformedLabel"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"sections"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOffset"}}]}},{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"FragmentSpread",name:{kind:"Name",value:"browseSectionItem"}}]}}]}}]}}]}}]}},...K.N9.definitions,...K.K1.definitions,{kind:"FragmentDefinition",name:{kind:"Name",value:"browseSectionItem"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BrowseSection"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"title"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"transformedLabel"}}]}},{kind:"Field",name:{kind:"Name",value:"subtitle"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"transformedLabel"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"sectionItems"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"browseItem"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"targetLocation"}}]}},...K.H5.definitions,...K.RL.definitions,...K.X6.definitions,...K.nE.definitions,...K._C.definitions,...K.Tf.definitions,...K.tl.definitions,...K.dV.definitions,...K.qJ.definitions,...K.YJ.definitions,...K.zZ.definitions,...K.Fk.definitions,...K.Go.definitions,...K.dK.definitions,...K.$z.definitions]};const Y=({uri:e,id:i})=>{const{header:n,sections:a,error:c,fetchNextSections:m}=(e=>{const{request:i}=(0,t.useContext)(G.Ax),{data:n,isLoading:a,error:s,fetchNextPage:r}=(0,Z.N)({queryKey:["browse","page",e,{numberOfSections:10,numberOfItems:10}],queryFn:({pageParam:n})=>(0,X.J)(i,J,function(e,i,n,t){return{pagePagination:{offset:i,limit:10},sectionPagination:{offset:0,limit:10},uri:e}}(e,n)),initialPageParam:0,gcTime:z.ws,staleTime:z._p,getNextPageParam:e=>{if("BrowseSectionContainer"===e?.data?.browse?.__typename)return e.data.browse.sections?.pagingInfo.nextOffset??void 0}}),o=(0,t.useCallback)((async()=>{await r()}),[r]),l=(0,t.useMemo)((()=>n?.pages?n.pages.reduce(((e,i)=>"BrowseSectionContainer"===i?.data?.browse?.__typename&&i.data.browse.sections?.items?[...e,...i.data.browse.sections.items]:e),[]):[]),[n?.pages]);return{header:(0,t.useMemo)((()=>{if(n?.pages)for(const e of n.pages)if("BrowseSectionContainer"===e?.data?.browse?.__typename)return{title:e.data.browse.header?.title?.transformedLabel??void 0,color:e.data.browse.header?.color?.hex??void 0,images:e.data.browse.header?.backgroundImage?.sources.map(H.Np)??[],subtitle:e.data.browse.header?.subtitle?.transformedLabel??void 0}}),[n?.pages]),sections:l,error:s,loading:a,fetchNextSections:o}})(e),{spec:u,UBIFragment:k}=(0,d.fU)(r.createDesktopGenreEventFactory,{data:{identifier:e,uri:e}}),g=(0,t.useMemo)((()=>u.shelvesFactory()),[u]),S=(0,q.g)(),N=(0,p.oX)(i);if(0===a.length||null!==c)return(0,v.jsx)(W.h,{hasError:null!==c,errorMessage:o.ag.get("error.generic")});const y=n?.title;return(0,v.jsxs)(k,{spec:u,children:[(0,v.jsx)(M.$,{children:n?.title??o.ag.get("browse")}),y?(0,v.jsx)("div",{className:f,children:N?(0,v.jsx)(p.YD,{isAnonymous:S}):(0,v.jsx)(h,{title:n.title,subtitle:n.subtitle,color:n.color,images:n.images})}):null,(0,v.jsx)(k,{spec:g,children:(0,v.jsxs)("div",{className:b,children:[y&&(0,v.jsx)(V.I,{backgroundColor:n.color}),(0,v.jsx)("div",{className:s()("contentSpacing",x),children:1===a.length?(0,v.jsx)(U,{uri:a[0].uri,fallback:()=>(0,v.jsx)(A,{section:a[0],position:0,showAll:!0})}):(0,v.jsx)(l.C,{onReachBottom:m,children:a.map(((e,i)=>(0,v.jsx)(A,{section:e,position:i,showAll:!1},e.uri)))})})]})})]})}},66736:(e,i,n)=>{n.r(i),n.d(i,{BrowseSection:()=>x});n(86277);var t=n(50959),a=n(82187),s=n.n(a),r=n(80128),o=n(85648),l=n(80936),d=n(80626),c=n(42694),m=n(41038),u=n(91643),p=n(36255),k=n(40022);const g="Z3ISr2E5M6kLGdC7dCDQ";var f=n(11527);const x=({uri:e})=>{const{section:i,error:n,fetchNextItems:a}=(0,k.X)(e),{spec:x,UBIFragment:b}=(0,d.fU)(r.createDesktopGenreEventFactory,{data:{identifier:e,uri:e}}),S=(0,t.useMemo)((()=>x.shelvesFactory()),[x]),N=i?.data?.title?.transformedLabel,v=i?.data?.subtitle?.transformedLabel,h=i?.sectionItems.items??[];return 0===h.length||null!==n?(0,f.jsx)(u.h,{hasError:null!==n,errorMessage:o.ag.get("error.generic")}):(0,f.jsxs)(b,{spec:x,children:[(0,f.jsx)(m.$,{children:N??o.ag.get("browse")}),(0,f.jsx)(b,{spec:S,children:(0,f.jsx)("div",{className:s()("contentSpacing",g),children:(0,f.jsx)(l.C,{onReachBottom:a,children:(0,f.jsx)(p.q,{title:N??"",tagline:v??"",index:0,id:e,showAll:!0,children:h.map(((e,i)=>(0,c.O)(e,i)))})})})})]})}},42694:(e,i,n)=>{n.d(i,{O:()=>L});var t=n(70526),a=n(11317),s=n(85648),r=n(72543),o=n(25959),l=n(30435),d=n(33563),c=n(50959),m=n(43106),u=n(57217),p=n(80626),k=n(8071),g=n(32540),f=n(60046);const x="NyZJZ8IWZ7Pxvy3yA81D";var b=n(11527);const S=({title:e,uri:i,images:n,href:t,index:s,ubiId:r})=>{const{spec:o,logger:l}=(0,p.fU)(u.createDesktopCategoryCardEventFactory,{data:{position:s,identifier:r}}),d=(0,c.useCallback)((()=>{const e=(0,a.EC)(t)?.toURI();e&&l.logInteraction(o.hitUiNavigate({destination:e}))}),[l,o,t]),S=(0,p.Wi)(o);return(0,b.jsx)(f.Link,{to:t,onClick:d,ref:S,children:(0,b.jsx)(k.C,{index:s,onClick:d,headerText:e,featureIdentifier:"unknown",isPlayable:!1,delegateNavigation:!0,uri:i,className:x,renderCardImage:()=>(0,b.jsx)(g.x,{images:n,FallbackComponent:e=>(0,b.jsx)(m.U,{size:"xxlarge",...e})})})})};var N=n(20109),v=n(20537),h=n(87964),y=n(15103),j=n(88195),w=n(48672),I=n(54644),F=n(73928),C=n(8696),_=n(80845),P=n(4222),T=n(35990);function L(e,i){switch(e.content.__typename){case"AlbumResponseWrapper":case"ArtistResponseWrapper":case"EpisodeOrChapterResponseWrapper":case"PlaylistResponseWrapper":case"PodcastOrAudiobookResponseWrapper":case"TrackResponseWrapper":case"UserResponseWrapper":case"BrowseXlinkResponseWrapper":case"BrowseSectionContainerWrapper":case"MerchResponseWrapper":case"ArtistConcertsResponseWrapper":return function(e,i,n){if("GenericError"===e.__typename||"NotFound"===e.__typename||"RestrictedContent"===e.__typename)return null;const c=(0,_._k)(e);switch(e.__typename){case"Album":return(0,b.jsx)(r.r,{uri:e.uri,name:e.name,images:c,sharingInfo:null,artists:(0,C.BH)(e.artists),index:i},e.uri);case"Artist":return(0,b.jsx)(o.I,{uri:e.uri,name:e.profile.name,images:c,index:i},e.uri);case"Audiobook":return(0,b.jsx)(d.c,{uri:e.uri,signifierText:e.accessInfo?.signifier?.text??void 0,name:e.name,images:c,authorName:e.authors?.map((e=>e?.name)).join(s.ag.getSeparator())??"",index:i},e.uri);case"Chapter":return(0,b.jsx)(N.B,{uri:e.uri,name:e.name,images:c,showImages:c,description:"",durationMilliseconds:e.duration.totalMilliseconds,releaseDate:"Audiobook"===e.audiobookV2.data.__typename?(0,C.Bq)(e.audiobookV2.data.publishDate):null,resume_point:{resume_position_ms:e.playedState.playPositionMilliseconds,fully_played:e.playedState.state===F.sY.Completed},isExplicit:(0,C.sW)(e.contentRating),is19PlusOnly:(0,C.R7)(e.contentRating),sharingInfo:null,index:i},e.uri);case"Episode":return(0,b.jsx)(N.B,{uri:e.uri,name:e.name,images:c,showImages:(0,_.Cn)(e),description:e.description??"",durationMilliseconds:e.duration.totalMilliseconds,releaseDate:(0,C.Bq)(e.releaseDate),resume_point:{resume_position_ms:e.playedState.playPositionMilliseconds,fully_played:e.playedState.state===F.sY.Completed},isExplicit:(0,C.sW)(e.contentRating),is19PlusOnly:(0,C.R7)(e.contentRating),sharingInfo:null,index:i},e.uri);case"Playlist":{let n="";return"User"===e.ownerV2.data.__typename&&(n=e.ownerV2.data.name),(0,b.jsx)(h.Z,{uri:e.uri,name:e.name,images:c,description:e.description,authorName:n,index:i,isPlayable:!(0,I.T)(e?.attributes)},e.uri)}case"Podcast":return(0,b.jsx)(j._,{uri:e.uri,name:e.name,images:c,publisher:e.publisher?.name??"",sharingInfo:null,mediaType:(0,C.x7)(e.mediaType),index:i},e.uri);case"Track":return(0,b.jsx)(w.G,{uri:e.uri,name:e.name,images:c,artists:(0,C.mQ)(e.artists),album:e.albumOfTrack?{uri:e.albumOfTrack.uri,name:e.albumOfTrack.name}:null,isExplicit:(0,C.sW)(e.contentRating),is19PlusOnly:(0,C.R7)(e.contentRating),sharingInfo:null,index:i},e.uri);case"User":return(0,b.jsx)(y.P,{uri:e.uri,name:e.name,images:c,index:i},e.uri);case"BrowseSectionContainer":return(0,b.jsx)(T.p,{title:e.data?.cardRepresentation?.title?.transformedLabel??"",pageId:"search",href:(0,P.t1)(n),color:e.data?.cardRepresentation?.backgroundColor?.hex,imageUrl:c[0]?.url,ubiId:n,index:i},n);case"BrowseSpacesHub":return(0,b.jsx)(T.p,{title:e.title?.transformedLabel??"",pageId:"search",href:(0,P.wJ)(e.spaceId),color:e.backgroundColor?.hex,imageUrl:c[0]?.url,ubiId:n,index:i},n);case"BrowseClientFeature":return(0,b.jsx)(S,{uri:n,title:e.title?.transformedLabel??"",href:`/${(0,a.EC)(e?.featureUri,{parseUnknown:!0})?.toURLPath()}`,images:e.iconOverlay?.sources??[],ubiId:n,index:i},n);case"Merch":return(0,b.jsx)(v.T,{name:e.name,uri:e.uri,href:e.url||e.uri,index:i,images:c,price:e.price||"",artists:e.artists,salePrice:e.salePrice,label:e.label},n);case"ArtistConcerts":{const t=e.mainArtist.data;return"Artist"!==t.__typename?null:(0,b.jsx)(l.Z,{uri:n,name:t.profile.name,images:c,description:s.ag.get("concerts.count",e.concerts.totalCount),index:i},n)}case"BrowseExternalHref":return null;default:return(0,t._)(e),null}}(e.content.data,i,e.uri);case"UnknownType":case"NoContent":case"ConcertResponseWrapper":break;default:(0,t._)(e.content)}return null}},40022:(e,i,n)=>{n.d(i,{X:()=>m});n(46758),n(2836),n(31546),n(37890);var t=n(50959),a=n(70207),s=n(65441),r=n(7627),o=n(70526),l=n(77033),d=(n(20069),n(5254));const c={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"browseSection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pagination"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PaginationInput"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uri"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"browseSection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"sectionPagination"},value:{kind:"Variable",name:{kind:"Name",value:"pagination"}}},{kind:"ObjectField",name:{kind:"Name",value:"sectionUri"},value:{kind:"Variable",name:{kind:"Name",value:"uri"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BrowseSection"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"title"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"transformedLabel"}}]}},{kind:"Field",name:{kind:"Name",value:"subtitle"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"transformedLabel"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"sectionItems"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOffset"}}]}},{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"browseItem"}}]}}]}}]}}]}}]}},...d.H5.definitions,...d.RL.definitions,...d.X6.definitions,...d.N9.definitions,...d.K1.definitions,...d.nE.definitions,...d._C.definitions,...d.Tf.definitions,...d.tl.definitions,...d.dV.definitions,...d.qJ.definitions,...d.YJ.definitions,...d.zZ.definitions,...d.Fk.definitions,...d.Go.definitions,...d.dK.definitions,...d.$z.definitions]},m=e=>{const{request:i}=(0,t.useContext)(s.Ax),{data:n,isLoading:d,error:m,fetchNextPage:u}=(0,a.N)({queryKey:["browse","section",e,{numberOfItems:20}],queryFn:({pageParam:n})=>(0,r.J)(i,c,function(e,i,n){return{pagination:{offset:i,limit:n},uri:e}}(e,n,20)),gcTime:l.ws,staleTime:l._p,initialPageParam:0,getNextPageParam:e=>{if("BrowseSection"===e?.data?.browseSection?.__typename){return e.data.browseSection.sectionItems.pagingInfo.nextOffset&&e.data.browseSection.sectionItems.pagingInfo.nextOffset>0?e.data.browseSection.sectionItems.pagingInfo.nextOffset:void 0}}}),p=(0,t.useCallback)((async()=>{await u()}),[u]);return{section:(0,t.useMemo)((()=>n?.pages?n.pages.reduce(((e,i)=>{if(!i?.data?.browseSection)return e;switch(i.data.browseSection.__typename){case"BrowseSection":return null===e?function(e){if("object"!=typeof e||null===e)return e;if(window.structuredClone)return window.structuredClone(e);return JSON.parse(JSON.stringify(e))}(i.data.browseSection):(e.sectionItems.items=[...e.sectionItems.items,...i.data.browseSection.sectionItems.items],e);case"GenericError":case"NotFound":return e;default:return(0,o._)(i.data.browseSection),e}}),null):null),[n?.pages]),error:m,loading:d,fetchNextItems:p}}}}]);
//# sourceMappingURL=browse-v2.js.map