{"version":3,"file":"Count_down.46vStSfO.mjs","names":["useState","useMemo","useCallback"],"sources":["https:/framerusercontent.com/modules/Eavfop8s2keWsGkwFOnf/FAHtFmD0STVNZfwbsI15/Count_down.js"],"sourcesContent":["// Update the existing Count_down code component in Count_down.tsx. Add a property control for title alignment with choices left, center, right and apply it to the optional title. Add a property control for layout orientation with choices stacked and inline. In inline mode, render the optional title and countdown display in one responsive horizontal row, vertically centered, with the title retaining its chosen alignment and the timer remaining readable; allow wrapping or a sensible small-screen fallback so it never overflows. In stacked mode preserve the current appearance. Keep all existing controls and behavior intact, including expired state and canvas-safe live ticking. Do not create a new file.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{startTransition,useCallback,useEffect,useMemo,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function Count_down(props){const{targetDate,showLabels,expiredMessage,accentColor,textColor,surfaceColor,borderColor,cornerRadius,spacing,layoutOrientation,valueFont,labelFont,expiredFont,style}=props;const isStaticRenderer=useIsStaticRenderer();const[now,setNow]=useState(()=>Date.now());useEffect(()=>{if(isStaticRenderer)return;if(typeof window===\"undefined\")return;const intervalId=window.setInterval(()=>{startTransition(()=>{setNow(Date.now());});},1e3);return()=>{window.clearInterval(intervalId);};},[isStaticRenderer]);const targetTimestamp=useMemo(()=>{const parsed=new Date(targetDate).getTime();return Number.isFinite(parsed)?parsed:Date.now();},[targetDate]);const remainingMs=useMemo(()=>{const activeNow=isStaticRenderer?Date.now():now;return Math.max(0,targetTimestamp-activeNow);},[isStaticRenderer,now,targetTimestamp]);const isExpired=remainingMs<=0;const values=useMemo(()=>{const totalSeconds=Math.floor(remainingMs/1e3);const days=Math.floor(totalSeconds/86400);const hours=Math.floor(totalSeconds%86400/3600);const minutes=Math.floor(totalSeconds%3600/60);const seconds=totalSeconds%60;return{days,hours,minutes,seconds};},[remainingMs]);const formatUnit=useCallback((value,minDigits=2)=>String(value).padStart(minDigits,\"0\"),[]);const isInline=layoutOrientation===\"inline\";const unitGap=useMemo(()=>Math.max(4,Math.round(spacing*.4)),[spacing]);const unitPadding=useMemo(()=>Math.max(2,Math.round(spacing*.25)),[spacing]);return /*#__PURE__*/_jsx(\"section\",{style:{...style,position:\"relative\",width:style?.width===\"100%\"?\"100%\":\"max-content\",minWidth:260,display:\"flex\",flexDirection:isInline?\"row\":\"column\",alignItems:isInline?\"center\":\"stretch\",justifyContent:isInline?\"space-between\":\"flex-start\",flexWrap:isInline?\"wrap\":\"nowrap\",gap:spacing,padding:spacing*1.25,borderRadius:cornerRadius,border:`1px solid ${borderColor}`,backgroundColor:surfaceColor,boxSizing:\"border-box\"},children:isExpired?/*#__PURE__*/_jsx(\"p\",{style:{margin:0,flex:isInline?\"1 1 260px\":\"0 0 auto\",minWidth:isInline?240:undefined,color:accentColor,fontSize:expiredFont.fontSize,textAlign:expiredFont.textAlign,fontWeight:expiredFont.fontWeight,fontFamily:expiredFont.fontFamily,lineHeight:expiredFont.lineHeight,letterSpacing:expiredFont.letterSpacing,fontStyle:expiredFont.fontStyle},children:expiredMessage}):/*#__PURE__*/_jsx(\"div\",{\"aria-live\":\"polite\",style:{flex:isInline?\"1 1 260px\":\"0 0 auto\",minWidth:isInline?240:undefined,display:\"grid\",width:\"max-content\",maxWidth:\"100%\",gridTemplateColumns:\"repeat(4, max-content)\",gap:unitGap,alignItems:\"stretch\",justifyContent:\"center\",justifySelf:isInline?\"start\":\"center\",marginInline:isInline?0:\"auto\"},children:[{label:\"Days\",value:formatUnit(values.days,2)},{label:\"Hours\",value:formatUnit(values.hours)},{label:\"Minutes\",value:formatUnit(values.minutes)},{label:\"Seconds\",value:formatUnit(values.seconds)}].map((item,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"center\",padding:unitPadding,borderLeft:index===0?\"none\":`1px solid ${borderColor}`},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:index===3?accentColor:textColor,fontSize:valueFont.fontSize,textAlign:valueFont.textAlign,fontWeight:valueFont.fontWeight,fontFamily:valueFont.fontFamily,lineHeight:valueFont.lineHeight,letterSpacing:valueFont.letterSpacing,fontStyle:valueFont.fontStyle,minWidth:\"max-content\"},children:item.value}),showLabels?/*#__PURE__*/_jsx(\"span\",{style:{marginTop:spacing*.35,color:textColor,opacity:.7,textTransform:\"uppercase\",fontSize:labelFont.fontSize,textAlign:labelFont.textAlign,fontWeight:labelFont.fontWeight,fontFamily:labelFont.fontFamily,lineHeight:labelFont.lineHeight,letterSpacing:labelFont.letterSpacing,fontStyle:labelFont.fontStyle},children:item.label}):null]},item.label))})});}addPropertyControls(Count_down,{targetDate:{type:ControlType.Date,title:\"Target\",defaultValue:new Date(Date.now()+7*24*60*60*1e3).toJSON(),displayTime:true},title:{type:ControlType.String,title:\"Title\",placeholder:\"Optional title\"},titleAlignment:{type:ControlType.Enum,title:\"Title Align\",defaultValue:\"left\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],displaySegmentedControl:true},layoutOrientation:{type:ControlType.Enum,title:\"Layout\",defaultValue:\"stacked\",options:[\"stacked\",\"inline\"],optionTitles:[\"Stacked\",\"Inline\"],displaySegmentedControl:true},showLabels:{type:ControlType.Boolean,title:\"Labels\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},expiredMessage:{type:ControlType.String,title:\"Expired\",defaultValue:\"Reservations are now closed.\"},accentColor:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#CCCCCC\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#FFFFFF\"},surfaceColor:{type:ControlType.Color,title:\"Surface\",defaultValue:\"#000000\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"#EEEEEE\"},cornerRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"16px\"},spacing:{type:ControlType.Number,title:\"Spacing\",defaultValue:12,min:6,max:24,step:1},titleFont:{type:ControlType.Font,title:\"Title Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\",textAlign:\"left\"}},valueFont:{type:ControlType.Font,title:\"Value Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"30px\",variant:\"Bold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\",textAlign:\"center\"}},labelFont:{type:ControlType.Font,title:\"Label Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"11px\",variant:\"Semibold\",letterSpacing:\"0.08em\",lineHeight:\"1em\",textAlign:\"center\"}},expiredFont:{type:ControlType.Font,title:\"Expired Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\",textAlign:\"left\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Count_down\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Count_down.map"],"mappings":"mOAIG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,aAAW,aAAW,iBAAe,cAAY,YAAU,eAAa,cAAY,eAAa,UAAQ,oBAAkB,YAAU,YAAU,cAAY,SAAO,EAAY,EAAiB,EAAoB,EAAO,CAAC,EAAI,GAAQA,MAAa,KAAK,IAAI,CAAC,EAAE,MAAc,CAA4B,GAAxB,GAAkC,IAAS,OAAY,OAAO,IAAM,EAAW,EAAO,gBAAgB,CAAC,MAAoB,CAAC,EAAO,KAAK,IAAI,CAAC,CAAE,CAAC,CAAE,EAAE,GAAG,EAAE,UAAU,CAAC,EAAO,cAA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