{"version":3,"file":"Countdown_1.BDFXVUT4.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/vMncbXNiK8Rx8mDQFDIS/8MDEHIy0vRoEEAtcekgM/Countdown_1.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function CountdownTimer(props){const{endDate,font,fontColor,labelFont,labelColor,showDays,showHours,showMinutes,showSeconds,gap,endMessage}=props;const calculateTimeLeft=()=>{const difference=new Date(endDate.replace(\":\",\"T\")).getTime()-new Date().getTime();if(difference<=0){return null// Expirado\n;}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)};};const[timeLeft,setTimeLeft]=useState(calculateTimeLeft());useEffect(()=>{const timer=setTimeout(()=>{setTimeLeft(calculateTimeLeft());},1e3);return()=>clearTimeout(timer);},[timeLeft])// Atualiza quando o tempo mudar\n;if(!timeLeft){return /*#__PURE__*/_jsx(\"div\",{style:{...font,color:fontColor},children:endMessage});}const timerComponents=[];const labels=[];if(showDays){timerComponents.push(/*#__PURE__*/_jsx(\"div\",{style:{...font,color:fontColor},children:timeLeft.days},\"Days\"));labels.push(/*#__PURE__*/_jsx(\"div\",{style:{...labelFont,color:labelColor},children:\"days\"},\"Days-label\"));}if(showHours){timerComponents.push(/*#__PURE__*/_jsx(\"div\",{style:{...font,color:fontColor},children:timeLeft.hours},\"Hours\"));labels.push(/*#__PURE__*/_jsx(\"div\",{style:{...labelFont,color:labelColor},children:\"hours\"},\"hours-label\"));}if(showMinutes){timerComponents.push(/*#__PURE__*/_jsx(\"div\",{style:{...font,color:fontColor},children:timeLeft.minutes},\"minutes\"));labels.push(/*#__PURE__*/_jsx(\"div\",{style:{...labelFont,color:labelColor},children:\"minutes\"},\"minutes-label\"));}if(showSeconds){timerComponents.push(/*#__PURE__*/_jsx(\"div\",{style:{...font,color:fontColor},children:timeLeft.seconds},\"seconds\"));labels.push(/*#__PURE__*/_jsx(\"div\",{style:{...labelFont,color:labelColor},children:\"seconds\"},\"seconds-label\"));}return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:`${gap}px`,justifyContent:\"center\",alignItems:\"center\"},children:timerComponents.map((component,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{textAlign:\"center\"},children:[component,labels[index]]},index))});}CountdownTimer.defaultProps={endDate:\"2025-04-21T09:00:00\",font:{fontFamily:\"Inter\",fontWeight:\"Regular\",fontSize:16,lineHeight:\"1.5em\"},fontColor:\"#000\",labelFont:{fontFamily:\"Inter\",fontWeight:\"Regular\",fontSize:12,lineHeight:\"1.5em\"},labelColor:\"#000\",showDays:true,showHours:true,showMinutes:true,showSeconds:true,gap:8,endMessage:\"Time's up!\"};addPropertyControls(CountdownTimer,{endDate:{type:ControlType.String,title:\"End Date\",placeholder:\"YYYY-MM-DD:HH:MM:SS\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:CountdownTimer.defaultProps.font,controls:\"extended\"},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#000\"},labelFont:{type:ControlType.Font,title:\"Label Font\",defaultValue:CountdownTimer.defaultProps.labelFont,controls:\"extended\"},labelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"#000\"},showDays:{type:ControlType.Boolean,title:\"Show Days\",defaultValue:true},showHours:{type:ControlType.Boolean,title:\"Show Hours\",defaultValue:true},showMinutes:{type:ControlType.Boolean,title:\"Show Minutes\",defaultValue:true},showSeconds:{type:ControlType.Boolean,title:\"Show Seconds\",defaultValue:true},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:8,min:0,max:100,step:1},endMessage:{type:ControlType.String,title:\"End Message\",placeholder:\"Time's up!\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"CountdownTimer\":{\"type\":\"reactComponent\",\"name\":\"CountdownTimer\",\"slots\":[],\"annotations\":{\"framerContractVers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