import{N as e,k as t,t as n}from"./jsx-runtime-ktpX_HJe.js";import{n as r,t as i}from"./LastPlayed-DXY9A300.js";import{_ as a}from"./Image-Cn5a1pql.js";import{n as o,t as s}from"./InterestGraph-BEEbJaCi.js";import{t as c}from"./TopTracks-8M0YCasH.js";import{t as l}from"./MediaItemNote-BeBQbxRX.js";var u=n();async function d({params:e}){let t=await fetch(`/apis/web/v1/artist/${e.id}`);if(!t.ok)throw new Response(`Failed to load artist`,{status:500});return await t.json()}var f=e(function(){let e=t(),n=e.aliases.indexOf(e.name);return n!==-1&&e.aliases.splice(n,1),(0,u.jsx)(o,{type:`Artist`,title:e.name,img:e.image,id:e.id,rank:e.all_time_rank,musicbrainzId:e.musicbrainz_id,timeListened:e.time_listened,listenCount:e.listen_count,firstListen:e.first_listen,imgItemId:e.id,mergeFunc:a,mergeCleanerFunc:(e,t)=>{e.albums=[],e.tracks=[];for(let n=0;n<e.artists.length;n++)e.artists[n].id===t&&e.artists.splice(n,1);return e},subContent:(0,u.jsx)(u.Fragment,{}),children:(0,u.jsxs)(`div`,{className:`flex flex-col gap-14`,children:[(0,u.jsxs)(`div`,{className:`flex flex-col gap-10 md:gap-12 mt-8 max-w-[1400px]`,children:[(0,u.jsxs)(`div`,{className:`flex gap-10 md:gap-20 flex-wrap xl:flex-nowrap items-start`,children:[(0,u.jsx)(c,{limit:8,period:`all_time`,artistId:e.id,showSeeMore:!0,className:`max-w-[750px] lg:max-w-[450px]`}),(0,u.jsx)(`div`,{className:`min-w-[350px] flex-1`,children:(0,u.jsx)(i,{limit:11,artistId:e.id,showNowPlaying:!0,showSeeMore:!0})})]}),(0,u.jsxs)(`div`,{className:`flex flex-wrap gap-10`,children:[(0,u.jsx)(s,{type:`artist`,id:e.id}),(0,u.jsx)(r,{configurable:!0,artistId:e.id})]})]}),(0,u.jsx)(l,{artistId:e.id,name:e.name,period:`all_time`})]})})});export{d as clientLoader,f as default};