{"version":3,"file":"TimeDisplay.deVCWSbK.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/tTtkIc8FUVwSRVbVIgr9/U57fop8KObnwnAMAL4Ds/TimeDisplay.js"],"sourcesContent":["import{jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function TimeDisplay(props){const{useCustomLocation,location,customLocation,font,color,style}=props;const[time,setTime]=useState(\"\");/* ─────────────────────────────────────────\n       1.  Zonas horarias admitidas (IANA tz DB)\n       ───────────────────────────────────────── */const supportedTimeZones=[\"Europe/Madrid\",\"Atlantic/Canary\",\"America/New_York\",\"America/New_York_NYC\",\"Europe/London\",\"America/Los_Angeles\",\"Europe/Paris\",\"Asia/Tokyo\",\"Australia/Sydney\",\"Asia/Kolkata\",\"Europe/Berlin\",\"America/Chicago\",\"America/Sao_Paulo\",\"Africa/Johannesburg\",\"Pacific/Auckland\"];/* ───────────────────────────────────────── */useEffect(()=>{function updateTime(){if(useCustomLocation){try{const now=new Date;const resolvedTimeZone=location===\"Custom\"?customLocation:location===\"America/New_York_NYC\"?\"America/New_York\":location;const formatted=new Intl.DateTimeFormat(undefined,{hour:\"2-digit\",minute:\"2-digit\",second:\"2-digit\",hour12:false,timeZone:resolvedTimeZone}).format(now);startTransition(()=>setTime(formatted));}catch{startTransition(()=>setTime(\"Invalid location\"));}}else{startTransition(()=>setTime(new Date().toLocaleTimeString(undefined,{hour:\"2-digit\",minute:\"2-digit\",second:\"2-digit\",hour12:false})));}}updateTime();const id=window.setInterval(updateTime,1e3);return()=>clearInterval(id);},[useCustomLocation,location,customLocation]);/* ─────────────────────────────────────────\n       Etiquetas (abreviaturas de ciudad)\n       ───────────────────────────────────────── */const cityLabels={\"Europe/Madrid\":\"MAD\",\"Atlantic/Canary\":\"TFN\",\"America/New_York\":\"MIA\",\"America/New_York_NYC\":\"NYC\",\"Europe/London\":\"LND\",\"America/Los_Angeles\":\"LA\",\"Europe/Paris\":\"PAR\",\"Asia/Tokyo\":\"TYO\",\"Australia/Sydney\":\"SYD\",\"Asia/Kolkata\":\"CCU\",\"Europe/Berlin\":\"BER\",\"America/Chicago\":\"CHI\",\"America/Sao_Paulo\":\"SAO\",\"Africa/Johannesburg\":\"JNB\",\"Pacific/Auckland\":\"AKL\"};const cityLabel=useCustomLocation&&location!==\"Custom\"?cityLabels[location]??location:useCustomLocation?customLocation:\"\";return /*#__PURE__*/_jsxs(\"span\",{style:{...font,color,...style,width:\"max-content\",display:\"inline-block\"},children:[time,\" \",cityLabel]});}/* ─────────────────────────────────────────\n   Controles de propiedades en Framer\n   ───────────────────────────────────────── */addPropertyControls(TimeDisplay,{useCustomLocation:{type:ControlType.Boolean,title:\"Custom Location\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Local\"},location:{type:ControlType.Enum,title:\"Location\",options:[\"Europe/Madrid\",\"Atlantic/Canary\",\"America/New_York\",\"America/New_York_NYC\",\"Europe/London\",\"America/Los_Angeles\",\"Europe/Paris\",\"Asia/Tokyo\",\"Australia/Sydney\",\"Asia/Kolkata\",\"Europe/Berlin\",\"America/Chicago\",\"America/Sao_Paulo\",\"Africa/Johannesburg\",\"Pacific/Auckland\",\"Custom\"],optionTitles:[\"Madrid\",\"Tenerife\",\"Miami\",\"New York\",\"London\",\"Los Angeles\",\"Paris\",\"Tokyo\",\"Sydney\",\"Kolkata\",\"Berlin\",\"Chicago\",\"Sao Paulo\",\"Johannesburg\",\"Auckland\",\"Custom...\"],defaultValue:\"America/New_York\",hidden:({useCustomLocation})=>!useCustomLocation},customLocation:{type:ControlType.String,title:\"Custom TZ\",placeholder:\"e.g. Europe/Lisbon\",defaultValue:\"Europe/Lisbon\",hidden:({useCustomLocation,location})=>!useCustomLocation||location!==\"Custom\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TimeDisplay\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TimeDisplay.map"],"mappings":"kMAAuJ,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,oBAAkB,WAAS,iBAAe,OAAK,QAAM,SAAO,EAAW,CAAC,EAAK,GAASA,EAAS,GAAG,CAEkG,MAAc,CAAC,SAAS,GAAY,CAAC,GAAG,EAAmB,GAAG,CAAC,IAAM,EAAI,IAAI,KAAW,EAAiB,IAAW,SAAS,EAAe,IAAW,uBAAuB,mBAAmB,EAAe,EAAU,IAAI,KAAK,eAAe,IAAA,GAAU,CAAC,KAAK,UAAU,OAAO,UAAU,OAAO,UAAU,OAAO,GAAM,SAAS,EAAiB,CAAC,CAAC,OAAO,EAAI,CAAC,MAAoB,EAAQ,EAAU,CAAC,MAAO,CAAC,MAAoB,EAAQ,mBAAmB,CAAC,MAAQ,MAAoB,EAAQ,IAAI,MAAM,CAAC,mBAAmB,IAAA,GAAU,CAAC,KAAK,UAAU,OAAO,UAAU,OAAO,UAAU,OAAO,GAAM,CAAC,CAAC,CAAC,CAAG,GAAY,CAAC,IAAM,EAAG,EAAO,YAAY,EAAW,IAAI,CAAC,UAAU,cAAc,EAAG,EAAG,CAAC,EAAkB,EAAS,EAAe,CAAC,CAEprB,IAAM,EAAU,GAAmB,IAAW,SAAxZ,CAAC,gBAAgB,MAAM,kBAAkB,MAAM,mBAAmB,MAAM,uBAAuB,MAAM,gBAAgB,MAAM,sBAAsB,KAAK,eAAe,MAAM,aAAa,MAAM,mBAAmB,MAAM,eAAe,MAAM,gBAAgB,MAAM,kBAAkB,MAAM,oBAAoB,MAAM,sBAAsB,MAAM,mBAAmB,MAAM,CAAmE,IAAW,EAAS,EAAkB,EAAe,GAAG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