{"version":3,"file":"LocalTime.DowRQMuE.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/4MW3lz87UOxFBY89FsDd/sYtATM5iDt9bXJ4Mwq1w/LocalTime.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useMemo,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Local Time\n *\n * Displays the current local time with customizable formatting options.\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 80\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LocalTime(props){const{showSeconds=true,use24Hour=false,showDate=false,backgroundColor=\"#000000\",textColor=\"#FFFFFF\",font,dateFont,gap=8,alignment=\"center\"}=props;const[time,setTime]=useState(null);useEffect(()=>{// Initialize time immediately on client\nstartTransition(()=>setTime(new Date));const interval=setInterval(()=>{startTransition(()=>setTime(new Date));},1e3);return()=>clearInterval(interval);},[]);const formattedTime=useMemo(()=>{if(!time)return\"--:--\";let hours=time.getHours();const minutes=time.getMinutes();const seconds=time.getSeconds();let period=\"\";if(!use24Hour){period=hours>=12?\" PM\":\" AM\";hours=hours%12||12;}const hoursStr=hours.toString().padStart(2,\"0\");const minutesStr=minutes.toString().padStart(2,\"0\");const secondsStr=seconds.toString().padStart(2,\"0\");if(showSeconds){return`${hoursStr}:${minutesStr}:${secondsStr}${period}`;}return`${hoursStr}:${minutesStr}${period}`;},[time,showSeconds,use24Hour]);const formattedDate=useMemo(()=>{if(!time)return\"\";return time.toLocaleDateString(undefined,{weekday:\"short\",year:\"numeric\",month:\"short\",day:\"numeric\"});},[time]);// Prevent hydration mismatch by not rendering until mounted\nif(!time){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor,borderRadius:12},children:/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,opacity:.5},children:\"Loading...\"})});}return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:alignment===\"left\"?\"flex-start\":alignment===\"right\"?\"flex-end\":\"center\",justifyContent:\"center\",backgroundColor,borderRadius:12,gap},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,fontSize:font?.fontSize||\"32px\",fontWeight:font?.fontWeight||600,fontFamily:font?.fontFamily||\"system-ui, -apple-system, sans-serif\",letterSpacing:font?.letterSpacing||\"-0.02em\",lineHeight:font?.lineHeight||\"1em\",fontStyle:font?.fontStyle||\"normal\",textAlign:alignment},children:formattedTime}),showDate&&/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,opacity:.7,fontSize:dateFont?.fontSize||\"14px\",fontWeight:dateFont?.fontWeight||400,fontFamily:dateFont?.fontFamily||\"system-ui, -apple-system, sans-serif\",letterSpacing:dateFont?.letterSpacing||\"0em\",lineHeight:dateFont?.lineHeight||\"1em\",fontStyle:dateFont?.fontStyle||\"normal\",textAlign:alignment},children:formattedDate})]});}addPropertyControls(LocalTime,{alignment:{type:ControlType.Enum,title:\"Alignment\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",displaySegmentedControl:true},showSeconds:{type:ControlType.Boolean,title:\"Show Seconds\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},use24Hour:{type:ControlType.Boolean,title:\"Time Format\",defaultValue:false,enabledTitle:\"24h\",disabledTitle:\"12h\"},showDate:{type:ControlType.Boolean,title:\"Show Date\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},font:{type:ControlType.Font,title:\"Time Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.02em\",lineHeight:\"1em\"}},dateFont:{type:ControlType.Font,title:\"Date Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Regular\",letterSpacing:\"0em\",lineHeight:\"1em\"},hidden:({showDate})=>!showDate},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LocalTime\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"80\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"200\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LocalTime.map"],"mappings":"sMAUG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,cAAY,GAAK,YAAU,GAAM,WAAS,GAAM,kBAAgB,UAAU,YAAU,UAAU,OAAK,WAAS,MAAI,EAAE,YAAU,UAAU,EAAW,CAAC,EAAK,GAASA,EAAS,IAAI,EAAE,MAAc,CAC/O,MAAoB,EAAQ,IAAI,IAAI,CAAC,EAAE,IAAM,EAAS,gBAAgB,CAAC,MAAoB,EAAQ,IAAI,IAAI,CAAC,CAAE,EAAE,GAAG,EAAE,UAAU,cAAc,CAAQ,CAAE,EAAE,CAAC,CAAC,EAAE,IAAM,EAAcC,MAAY,CAAC,GAAG,CAAC,EAAK,MAAM,QAAQ,IAAI,EAAM,EAAK,SAAS,EAAQ,EAAQ,EAAK,WAAW,EAAQ,EAAQ,EAAK,WAAW,EAAM,EAAO,GAAO,IAAW,EAAO,GAAO,GAAG,MAAM,MAAM,EAAM,EAAM,IAAI,IAAI,IAAM,EAAS,EAAM,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,EAAQ,EAAW,EAAQ,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,EAAQ,E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