{"version":3,"file":"Timer.CqbeOSc0.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/TumBBmGqVENmWWWN8YMz/XjuWyFJJu3cJ7WcnaTbk/Timer.js"],"sourcesContent":["// Travel promotion timer component with countdown functionality\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Travel Promotion Timer\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function Timer(props){const{endDate,title,expiredMessage,showDays,showHours,showMinutes,showSeconds,textColor,accentColor,titleFont,numberFont,labelFont,borderRadius,size,scale}=props;const[timeLeft,setTimeLeft]=useState({days:0,hours:0,minutes:0,seconds:0});const[isExpired,setIsExpired]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const calculateTimeLeft=()=>{const difference=new Date(endDate).getTime()-new Date().getTime();if(difference<=0){startTransition(()=>{setIsExpired(true);setTimeLeft({days:0,hours:0,minutes:0,seconds:0});});return;}const days=Math.floor(difference/(1e3*60*60*24));const hours=Math.floor(difference/(1e3*60*60)%24);const minutes=Math.floor(difference/1e3/60%60);const seconds=Math.floor(difference/1e3%60);startTransition(()=>{setTimeLeft({days,hours,minutes,seconds});setIsExpired(false);});};calculateTimeLeft();const timer=setInterval(calculateTimeLeft,1e3);return()=>clearInterval(timer);},[endDate]);const isFixedWidth=props?.style&&props.style.width===\"100%\";const sizeConfig={small:{padding:16,gap:20,itemGap:16,numberPadding:\"8px 12px\",minWidth:50},medium:{padding:32,gap:24,itemGap:16,numberPadding:\"16px 24px\",minWidth:80},large:{padding:48,gap:32,itemGap:24,numberPadding:\"24px 32px\",minWidth:100}};const config=sizeConfig[size];const timeUnits=[{value:timeLeft.days,label:\"일\",show:showDays},{value:timeLeft.hours,label:\"시간\",show:showHours},{value:timeLeft.minutes,label:\"분\",show:showMinutes},{value:timeLeft.seconds,label:\"초\",show:showSeconds}].filter(unit=>unit.show);return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,position:\"relative\",...isFixedWidth?{}:{minWidth:\"max-content\"},borderRadius,padding:config.padding,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:config.gap,transform:`scale(${scale})`,transformOrigin:\"center center\"},children:[/*#__PURE__*/_jsx(\"h2\",{style:{margin:0,color:textColor,...titleFont},children:title}),isExpired?/*#__PURE__*/_jsx(\"div\",{style:{color:accentColor,...numberFont},children:expiredMessage}):/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:config.itemGap,alignItems:\"center\",justifyContent:\"center\"},children:timeUnits.map((unit,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:config.itemGap},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:8},children:[/*#__PURE__*/_jsx(\"div\",{style:{backgroundColor:\"#000000\",color:\"#FFFFFF\",padding:config.numberPadding,borderRadius:8,minWidth:config.minWidth,textAlign:\"center\",...numberFont},children:String(unit.value).padStart(2,\"0\")}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,opacity:.7,...labelFont},children:unit.label})]}),index<timeUnits.length-1&&/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,opacity:.5,...numberFont},children:\":\"})]},unit.label))})]});}addPropertyControls(Timer,{title:{type:ControlType.String,title:\"Title\",defaultValue:\"슈퍼세일\"},size:{type:ControlType.Enum,title:\"Size\",options:[\"small\",\"medium\",\"large\"],optionTitles:[\"Small\",\"Medium\",\"Large\"],defaultValue:\"medium\",displaySegmentedControl:true},scale:{type:ControlType.Number,title:\"Scale\",defaultValue:1,min:.1,max:3,step:.1,displayStepper:true},endDate:{type:ControlType.Date,title:\"End Date\",displayTime:true},expiredMessage:{type:ControlType.String,title:\"Expired Message\",defaultValue:\"프로모션이 종료되었습니다\"},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\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},accentColor:{type:ControlType.Color,title:\"Accent Color\",defaultValue:\"#FFA2B3\"},titleFont:{type:ControlType.Font,title:\"Title Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}},numberFont:{type:ControlType.Font,title:\"Number Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}},labelFont:{type:ControlType.Font,title:\"Label Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"27px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:16,min:0,max:50,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Timer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"200\",\"framerIntrinsicWidth\":\"600\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Timer.map"],"mappings":"6MASG,SAAwB,EAAM,EAAM,CAAC,GAAK,CAAC,UAAQ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