{"version":3,"file":"SpotifyPlayer.CMMKsdkX.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/3hOsnATmDtNKOl7IBuMO/RN23OFmK0mXtAjySnDSE/SpotifyPlayer.js"],"sourcesContent":["// Spotify Player component with customizable UI via property controls\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect,startTransition}from\"react\";/**\n * Spotify Player\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 232\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function SpotifyPlayer(props){const{spotifyUrl=\"https://open.spotify.com/episode/7makk4oTQel546B0PZlDM5\",theme=\"dark\",borderRadius=12,compactMode=false,backgroundColor=\"#000000\"}=props;const[embedUrl,setEmbedUrl]=useState(\"\");useEffect(()=>{if(typeof window!==\"undefined\"){const url=spotifyUrl.trim();let convertedUrl=\"\";// Convert regular Spotify URL to embed URL\nif(url.includes(\"open.spotify.com\")){const parts=url.split(\"open.spotify.com/\");if(parts.length>1){// Only use the pathname part (strip query/hash) before constructing the embed URL\nconst path=parts[1].split(\"?\")[0].split(\"#\")[0].replace(\"/embed/\",\"/\");convertedUrl=`https://open.spotify.com/embed/${path}`;}}else{convertedUrl=url;}// Build URL with proper parameters\nlet urlObj;try{urlObj=new URL(convertedUrl.startsWith(\"http\")?convertedUrl:`https://${convertedUrl}`);}catch{startTransition(()=>setEmbedUrl(\"\"));return;}urlObj.searchParams.set(\"utm_source\",\"generator\");urlObj.searchParams.set(\"theme\",theme===\"dark\"?\"0\":\"1\");// Compact mode is handled by setting the component height to 80px or less in Framer (Spotify doesn't support a compact-mode URL param).\nstartTransition(()=>setEmbedUrl(urlObj.toString()));}},[spotifyUrl,theme]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor,borderRadius,overflow:\"hidden\",padding:0,position:\"relative\"},children:embedUrl?/*#__PURE__*/_jsx(\"iframe\",{style:{borderRadius,width:\"100%\",height:\"100%\",border:\"none\",background:backgroundColor},src:embedUrl,allow:\"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture\",loading:\"lazy\",title:\"Spotify Player\"}):/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",height:\"100%\",color:\"#FFFFFF\",fontSize:14,fontFamily:\"system-ui, -apple-system, sans-serif\",background:\"linear-gradient(90deg, #222 25%, #333 37%, #222 63%)\",backgroundSize:\"400% 100%\",animation:\"spotify-skeleton-loading 1.2s ease-in-out infinite\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                        @keyframes spotify-skeleton-loading {\n                            0% { background-position: 100% 50%; }\n                            100% { background-position: 0 50%; }\n                        }\n                    `}),\"Loading Spotify Player...\"]})});}addPropertyControls(SpotifyPlayer,{spotifyUrl:{type:ControlType.String,title:\"Spotify URL\",defaultValue:\"https://open.spotify.com/episode/7makk4oTQel546B0PZlDM5\",placeholder:\"Paste Spotify link...\",displayTextArea:true},theme:{type:ControlType.Enum,title:\"Theme\",options:[\"light\",\"dark\"],optionTitles:[\"Light\",\"Dark\"],defaultValue:\"dark\",displaySegmentedControl:true},compactMode:{type:ControlType.Boolean,title:\"Compact Mode\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:12,min:0,max:32,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SpotifyPlayer\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"232\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutHeight\":\"any-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