{"version":3,"file":"LatestVideos.C2FS2ZAM.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/5mB552HA1vGx7Or3fBdt/X1QPMxNaSSZmkLVVDcv6/LatestVideos.js"],"sourcesContent":["// Component that fetches and displays latest videos in a grid with editable card properties\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function LatestVideos(props){const{limit=3,gridMode=\"auto\",columns=3,rows=1,gap=20,minCardWidth=280,borderRadius=8,overlayOpacity=.45,overlayColor=\"#000000\",backgroundColor=\"#1a1a1a\",titleColor=\"#FFFFFF\",dateColor=\"#CCCCCC\",titleFont,dateFont,showPlatformIcon=true,iconSize=24,padding=16,useCustomButton=false,customButton,buttonText=\"VIEW VIDEO\",buttonBackgroundColor=\"#FFFFFF\",buttonTextColor=\"#000000\",buttonFont,titleTruncate=0}=props;const[content,setContent]=useState([]);const[loading,setLoading]=useState(true);const[hoveredIndex,setHoveredIndex]=useState(null);useEffect(()=>{async function load(){if(typeof window===\"undefined\")return;try{const res=await fetch(`https://vatic.doluk.workers.dev/media-content?limit=${limit}`);const data=await res.json();const formattedContent=data.data.map(item=>({thumbnailUrl:item.thumbnailUrl,publishedDate:new Date(item.publishedDate).toLocaleDateString(\"en-US\",{year:\"numeric\",month:\"long\",day:\"numeric\"}),title:item.title,platform:item.platform.toLowerCase(),url:item.url}));startTransition(()=>{setContent(formattedContent);setLoading(false);});}catch(e){console.error(\"Content fetch failed\",e);startTransition(()=>setLoading(false));}}load();},[limit]);const gridStyles={display:\"grid\",width:\"100%\",gap:`${gap}px`,gridTemplateColumns:gridMode===\"manual\"?`repeat(${columns}, 1fr)`:`repeat(auto-fit, minmax(${minCardWidth}px, 1fr))`,gridTemplateRows:gridMode===\"manual\"?`repeat(${rows}, 1fr)`:undefined,alignItems:\"stretch\"};const getPlatformIcon=platform=>{const icons={youtube:\"▶\",twitch:\"◆\",twitter:\"🐦\",instagram:\"📷\"};return icons[platform]||\"●\";};if(loading){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",padding:\"40px\",textAlign:\"center\",color:titleColor,...titleFont},children:\"Loading...\"});}return /*#__PURE__*/_jsx(\"div\",{style:gridStyles,children:content.map((item,index)=>/*#__PURE__*/_jsxs(\"a\",{href:item.url,target:\"_blank\",rel:\"noopener noreferrer\",onMouseEnter:()=>startTransition(()=>setHoveredIndex(index)),onMouseLeave:()=>startTransition(()=>setHoveredIndex(null)),style:{position:\"relative\",width:\"100%\",aspectRatio:\"1.75 / 1\",overflow:\"hidden\",borderRadius:`${borderRadius}px`,textDecoration:\"none\",display:\"block\",backgroundColor},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,backgroundImage:`url(${item.thumbnailUrl})`,backgroundSize:\"cover\",backgroundPosition:\"center\",zIndex:1,transform:hoveredIndex===index?\"scale(1.05)\":\"scale(1)\",transition:\"transform 0.3s ease\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,backgroundColor:overlayColor,opacity:overlayOpacity,zIndex:2,pointerEvents:\"none\"}}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",zIndex:4,height:\"100%\",display:\"flex\",flexDirection:\"column\",justifyContent:\"flex-end\",padding:`${padding}px`},children:[showPlatformIcon&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:`${padding}px`,right:`${padding}px`,fontSize:`${iconSize}px`,lineHeight:1},children:getPlatformIcon(item.platform)}),/*#__PURE__*/_jsx(\"div\",{style:{color:dateColor,marginBottom:\"8px\",...dateFont},children:item.publishedDate}),/*#__PURE__*/_jsx(\"div\",{style:{color:titleColor,...titleFont,...titleTruncate>0&&{display:\"-webkit-box\",WebkitLineClamp:titleTruncate,WebkitBoxOrient:\"vertical\",overflow:\"hidden\"}},children:item.title})]})]},index))});}addPropertyControls(LatestVideos,{limit:{type:ControlType.Number,title:\"Video Limit\",defaultValue:3,min:1,max:12,step:1},gridMode:{type:ControlType.Enum,title:\"Grid Mode\",options:[\"auto\",\"manual\"],optionTitles:[\"Auto Fit\",\"Manual\"],defaultValue:\"auto\",displaySegmentedControl:true},columns:{type:ControlType.Number,title:\"Columns\",defaultValue:3,min:1,max:6,step:1,hidden:({gridMode})=>gridMode!==\"manual\"},rows:{type:ControlType.Number,title:\"Rows\",defaultValue:1,min:1,max:4,step:1,hidden:({gridMode})=>gridMode!==\"manual\"},gap:{type:ControlType.Number,title:\"Grid Gap\",defaultValue:20,min:0,max:60,step:4,unit:\"px\"},minCardWidth:{type:ControlType.Number,title:\"Min Card Width\",defaultValue:280,min:200,max:500,step:20,unit:\"px\",hidden:({gridMode})=>gridMode!==\"auto\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,step:2,unit:\"px\"},padding:{type:ControlType.Number,title:\"Card Padding\",defaultValue:16,min:8,max:40,step:4,unit:\"px\"},overlayOpacity:{type:ControlType.Number,title:\"Overlay Opacity\",defaultValue:.45,min:0,max:1,step:.05},overlayColor:{type:ControlType.Color,title:\"Overlay Color\",defaultValue:\"#000000\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#1a1a1a\"},titleColor:{type:ControlType.Color,title:\"Title Color\",defaultValue:\"#FFFFFF\"},dateColor:{type:ControlType.Color,title:\"Date Color\",defaultValue:\"#CCCCCC\"},titleFont:{type:ControlType.Font,title:\"Title Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},titleTruncate:{type:ControlType.Enum,title:\"Title Truncate\",options:[0,1,2,3,4,5],optionTitles:[\"None\",\"1 Line\",\"2 Lines\",\"3 Lines\",\"4 Lines\",\"5 Lines\"],defaultValue:0,displaySegmentedControl:false},dateFont:{type:ControlType.Font,title:\"Date Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"13px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},showPlatformIcon:{type:ControlType.Boolean,title:\"Platform Icon\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:24,min:16,max:48,step:2,unit:\"px\",hidden:({showPlatformIcon})=>!showPlatformIcon},useCustomButton:{type:ControlType.Boolean,title:\"Button Type\",defaultValue:false,enabledTitle:\"Custom\",disabledTitle:\"Default\"},customButton:{type:ControlType.ComponentInstance,title:\"Custom Button\",hidden:({useCustomButton})=>!useCustomButton},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"VIEW VIDEO\",hidden:({useCustomButton})=>useCustomButton},buttonBackgroundColor:{type:ControlType.Color,title:\"Button Background\",defaultValue:\"#FFFFFF\",hidden:({useCustomButton})=>useCustomButton},buttonTextColor:{type:ControlType.Color,title:\"Button Text Color\",defaultValue:\"#000000\",hidden:({useCustomButton})=>useCustomButton},buttonFont:{type:ControlType.Font,title:\"Button Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},hidden:({useCustomButton})=>useCustomButton}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LatestVideos\",\"slots\":[\"customButton\"],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LatestVideos.map"],"mappings":"6MAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,EAAE,WAAS,OAAO,UAAQ,EAAE,OAAK,EAAE,MAAI,GAAG,eAAa,IAAI,eAAa,EAAE,iBAAe,IAAI,eAAa,UAAU,kBAAgB,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