PageSourceSearch

https://kasbu.bio/assets/js/SpotifyCard-CSnDFlYn.js

js kasbu.bio collected 2026-09-24 13:23:16 UTC 2,705 bytes, 1 lines download raw bytes

1import{r as e,a as t,j as l}from"../index-DEUA2RFd.js";import{I as a}from"./iosMusicPlayer-BgppFFin.js";import"./cjs-helpers-BrGt3VpK.js";import"./supabase-vendor-DuR9KhUO.js";const s=e=>{if(!e)return"";try{const t=e.split("?")[0].match(/https:\/\/open\.spotify\.com\/(?:intl-[a-z]+\/)?([a-z]+)\/([a-zA-Z0-9]+)/);return t?`https://open.spotify.com/embed/${t[1]}/${t[2]}?utm_source=oembed`:e}catch{return e}},o=({size:e=24})=>l.jsx("svg",{viewBox:"0 0 24 24",width:e,height:e,fill:"white",children:l.jsx("path",{d:"M12.438 1.009C6.368.769 1.251 5.494 1.008 11.565c-.24 6.07 4.485 11.186 10.556 11.426 6.07.242 11.185-4.484 11.427-10.554S18.507 1.251 12.438 1.009m4.644 16.114a.657.657 0 0 1-.897.246 13.2 13.2 0 0 0-4.71-1.602 13.2 13.2 0 0 0-4.968.242.658.658 0 0 1-.31-1.278 14.5 14.5 0 0 1 5.46-.265c1.837.257 3.579.851 5.177 1.76.315.178.425.58.246.896zm1.445-2.887a.853.853 0 0 1-1.158.344 16.2 16.2 0 0 0-5.475-1.797 16.2 16.2 0 0 0-5.758.219.855.855 0 0 1-1.018-.65.85.85 0 0 1 .65-1.018 17.9 17.9 0 0 1 6.362-.241 17.9 17.9 0 0 1 6.049 1.985c.415.224.57.743.344 1.158zm1.602-3.255a1.05 1.05 0 0 1-1.418.448 19.7 19.7 0 0 0-6.341-2.025 19.6 19.6 0 0 0-6.655.199 1.05 1.05 0 1 1-.417-2.06 21.7 21.7 0 0 1 7.364-.22 21.7 21.7 0 0 1 7.019 2.24c.515.268.715.903.448 1.418"})}),r=e.memo(({onDelete:r,size:i,url:n="",customColor:c,variant:u,data:p})=>{const{t:d}=t(),[m,f]=e.useState(null),[y,b]=e.useState(!1),h=!!n&&(e=>/open\.spotify\.com\/(?:intl-[a-z]+\/)?(track|album|artist|playlist)\//.test(e))(n);e.useEffect(()=>{if(!n||!h)return;const e=new AbortController;return b(!0),f(null),fetch(`/api/spotify-resolve?url=${encodeURIComponent(n)}`,{signal:e.signal}).then(e=>e.ok?e.json():null).then(e=>{e&&!e.error&&f(e)}).catch(()=>{}).finally(()=>b(!1)),()=>e.abort()},[n,h]);return h?l.jsx(a,{onDelete:r,size:i,url:n,customColor:c,variant:u,data:p,meta:m,isLoading:y,Logo:o,openLabel:d("cards.spotify.playOn"),fallbackArtist:d("cards.spotify.artistFallback"),fallbackAlbum:d("cards.spotify.albumFallback"),fallbackTitle:"Spotify",defaultVinyl:!0,resolvePreview:async e=>{const t=await fetch(`/api/spotify-resolve?url=${encodeURIComponent(e.url)}`),l=t.ok?await t.json():null;return(null==l?void 0:l.previewUrl)||null}}):l.jsxs("div",{className:"relative size-full overflow-hidden rounded-3xl bg-white",children:[l.jsx("iframe",{src:s(n),className:"absolute inset-0 size-full rounded-3xl border border-gray-200",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",title:"Spotify Player"}),r&&l.jsx("div",{className:"absolute inset-0 cursor-move",style:{zIndex:30}})]})});r.displayName="SpotifyCard";export{r as SpotifyCard,r as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.