{"version":3,"file":"CountdownTimer_1.DF3VFB6R.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/f87ORL6ASJ5yGzARWSUr/fXkZgHVlX33JucRQnmnI/CountdownTimer_1.js"],"sourcesContent":["// Simple countdown timer component\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 100\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CountdownTimer(props){const{targetDate,showDays,showHours,showMinutes,showSeconds,backgroundColor,textColor,labelColor,font,labelFont,borderRadius,padding,gap,language}=props;const[timeLeft,setTimeLeft]=useState({days:0,hours:0,minutes:0,seconds:0});useEffect(()=>{if(typeof window===\"undefined\")return;const calculateTimeLeft=()=>{const difference=+new Date(targetDate)-+new Date;if(difference>0){return{days:Math.floor(difference/(1e3*60*60*24)),hours:Math.floor(difference/(1e3*60*60)%24),minutes:Math.floor(difference/1e3/60%60),seconds:Math.floor(difference/1e3%60)};}return{days:0,hours:0,minutes:0,seconds:0};};const timer=setInterval(()=>{startTransition(()=>{setTimeLeft(calculateTimeLeft());});},1e3);startTransition(()=>{setTimeLeft(calculateTimeLeft());});return()=>clearInterval(timer);},[targetDate]);const labels={en:{days:\"Days\",hours:\"Hours\",minutes:\"Minutes\",seconds:\"Seconds\"},de:{days:\"Tage\",hours:\"Stunden\",minutes:\"Minuten\",seconds:\"Sekunden\"}};const currentLabels=labels[language]||labels.en;const timeUnits=[{value:timeLeft.days,label:currentLabels.days,show:showDays},{value:timeLeft.hours,label:currentLabels.hours,show:showHours},{value:timeLeft.minutes,label:currentLabels.minutes,show:showMinutes},{value:timeLeft.seconds,label:currentLabels.seconds,show:showSeconds}].filter(unit=>unit.show);return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:`${gap}px`,padding:`${padding}px`,backgroundColor,borderRadius:`${borderRadius}px`,width:\"max-content\"},children:timeUnits.map((unit,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:\"8px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{...font,color:textColor,minWidth:\"60px\",textAlign:\"center\"},children:String(unit.value).padStart(2,\"0\")}),/*#__PURE__*/_jsx(\"div\",{style:{...labelFont,color:labelColor,textAlign:\"center\"},children:unit.label})]},unit.label))});}addPropertyControls(CountdownTimer,{targetDate:{type:ControlType.Date,title:\"Target Date\",displayTime:true},language:{type:ControlType.Enum,title:\"Language\",options:[\"en\",\"de\"],optionTitles:[\"English\",\"German\"],defaultValue:\"en\",displaySegmentedControl:true},showDays:{type:ControlType.Boolean,title:\"Show Days\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showHours:{type:ControlType.Boolean,title:\"Show Hours\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showMinutes:{type:ControlType.Boolean,title:\"Show Minutes\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showSeconds:{type:ControlType.Boolean,title:\"Show Seconds\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Number Color\",defaultValue:\"#000000\"},labelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"#CCCCCC\"},font:{type:ControlType.Font,title:\"Number Font\",defaultValue:{fontSize:\"28px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},labelFont:{type:ControlType.Font,title:\"Label Font\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:20,min:0,max:50},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:16,min:0,max:50}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountdownTimer\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"100\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountdownTimer_1.map"],"mappings":"yMAOG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,aAAW,WAAS,YAAU,cAAY,cAAY,kBAAgB,YAAU,aAAW,OAAK,YAAU,eAAa,UAAQ,MAAI,YAAU,EAAW,CAAC,EAAS,GAAaA,EAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAsB,CAAC,IAAM,EAAY,IAAI,KAAK,CAAU,EAAE,CAAC,IAAI,KAAqM,OAA7L,EAAW,EAAS,CAAC,KAAK,KAAK,MAAM,GAAY,IAAI,GAAG,GAAG,GAAG,EAAE,MAAM,KAAK,MAAM,GAAY,IAAI,GAAG,IAAI,EAAE,EAAE,QAAQ,KAAK,MAAM,EAAW,IAAI,GAAG,EAAE,EAAE,QAAQ,KAAK,MAAM,EAAW,IAAI,EAAE,CAAC,EAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAE,EAAQ,EAAM,gBAAgB,CAAC,MAAoB,CAAC,EAAY,EAAkB,CAAC,CAAE,CAAC,CAAE,EAAE,GAAG,EAA2D,OAAzD,MAAoB,CAAC,EAAY,EAAkB,CAAC,CAAE,CAAC,MAAY,cAAc,CAAK,CAAE,EAAE,CAAC,CAAU,CAAC,EAAE,IAAM,EAAO,CAAC,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