{"version":3,"file":"CalendarEventGenerator.CotTL4VM.mjs","names":["useMemo","__esmMin","pe","init_npm_react_18_3_1","p","c","init_jsx_runtime","init_framer_BisrWwwE","addPropertyControls","ControlType","formatDateForCalendar","date","dateString","getGoogleCalendarUrl","title","start","end","description","getOutlookCalendarUrl","getYahooCalendarUrl","location","CalendarEventGenerator","rest","props","eventInfo","startDateTime","zoomRoom","googleLink","outlookLink","yahooLink","init_CalendarEventGenerator"],"sources":["https:/framerusercontent.com/modules/un8bvcIhbqXiOogcFG7X/j3eUT1ZcIGrNFvdjkQbJ/CalendarEventGenerator.js"],"sourcesContent":["// Text component pulling title, Zoom link, date/time from CMS, generating Google/Outlook/Yahoo calendar links\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * Text With Calendar Links from CMS\n *\n * @framerIntrinsicWidth 500\n * @framerIntrinsicHeight 200\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */function formatDateForCalendar(dateString){// Returns: YYYYMMDDTHHmmssZ for Google/Outlook, or YYYYMMDDTHHmmssZ in UTC\nconst date=new Date(dateString);const yyyy=date.getUTCFullYear();const mm=String(date.getUTCMonth()+1).padStart(2,\"0\");const dd=String(date.getUTCDate()).padStart(2,\"0\");const hh=String(date.getUTCHours()).padStart(2,\"0\");const mi=String(date.getUTCMinutes()).padStart(2,\"0\");const ss=String(date.getUTCSeconds()).padStart(2,\"0\");return`${yyyy}${mm}${dd}T${hh}${mi}${ss}Z`;}function getGoogleCalendarUrl({title,start,end,description,location}){const params=new URLSearchParams({action:\"TEMPLATE\",text:title,dates:`${formatDateForCalendar(start)}/${formatDateForCalendar(end)}`,details:description,location});return`https://www.google.com/calendar/render?${params.toString()}`;}function getOutlookCalendarUrl({title,start,end,description,location}){// Outlook uses outlook.live.com link\nconst params=new URLSearchParams({path:\"/calendar/action/compose\",rru:\"addevent\",subject:title,body:description,location,startdt:new Date(start).toISOString(),enddt:new Date(end).toISOString()});return`https://outlook.live.com/calendar/0/deeplink/compose?${params.toString()}`;}function getYahooCalendarUrl({title,start,end,description,location}){// Yahoo: parameters in native time format YYYYMMDDTHHmmssZ\nconst params=new URLSearchParams({v:\"60\",title,st:formatDateForCalendar(start),et:formatDateForCalendar(end),desc:description,in_loc:location});return`https://calendar.yahoo.com/?${params.toString()}`;}export default function CalendarEventGenerator(props){const{title,zoomRoom,startDateTime,description,style,...rest}=props;const eventInfo=useMemo(()=>({title:title||\"Sample Meeting\",start:startDateTime||new Date().toISOString(),end:new Date(new Date(startDateTime||Date.now()).getTime()+60*60*1e3).toISOString(),description:zoomRoom?`👉 Join Live Event here: ${zoomRoom}`:undefined,location:zoomRoom||\"Online Event Link\"}),[title,zoomRoom,startDateTime]);if(!title&&!startDateTime&&!zoomRoom){return /*#__PURE__*/_jsx(\"div\",{style:{color:\"#000\",fontSize:20},children:\"Missing required event information\"});}const googleLink=useMemo(()=>getGoogleCalendarUrl(eventInfo),[eventInfo]);const outlookLink=useMemo(()=>getOutlookCalendarUrl(eventInfo),[eventInfo]);const yahooLink=useMemo(()=>getYahooCalendarUrl(eventInfo),[eventInfo]);return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",flexWrap:\"wrap\",padding:0,margin:0,color:\"#2C2C2C\",fontFamily:\"figtree, sans-serif\",fontSize:18,lineHeight:1.2,fontWeight:400,background:\"none\",boxShadow:\"none\",border:\"none\",gap:0,textAlign:\"left\"},...rest,children:[props.showGoogle!==false&&/*#__PURE__*/_jsxs(\"span\",{style:{padding:0,margin:0},children:[\"(\",/*#__PURE__*/_jsx(\"a\",{href:googleLink,target:\"_blank\",rel:\"noopener noreferrer\",style:{all:\"unset\",cursor:\"pointer\",color:\"#2C2C2C\",textDecoration:\"underline\"},\"aria-label\":\"Add to Google Calendar\",children:\"Google\"}),\")\"]}),props.showOutlook!==false&&/*#__PURE__*/_jsxs(\"span\",{style:{padding:0,margin:0},children:[\"(\",/*#__PURE__*/_jsx(\"a\",{href:outlookLink,target:\"_blank\",rel:\"noopener noreferrer\",style:{all:\"unset\",cursor:\"pointer\",color:\"#2C2C2C\",textDecoration:\"underline\"},\"aria-label\":\"Add to Outlook Calendar\",children:\"Outlook\"}),\")\"]}),props.showYahoo!==false&&/*#__PURE__*/_jsxs(\"span\",{style:{padding:0,margin:0},children:[\"(\",/*#__PURE__*/_jsx(\"a\",{href:yahooLink,target:\"_blank\",rel:\"noopener noreferrer\",style:{all:\"unset\",cursor:\"pointer\",color:\"#2C2C2C\",textDecoration:\"underline\"},\"aria-label\":\"Add to Yahoo Calendar\",children:\"Yahoo\"}),\")\"]})]});}addPropertyControls(CalendarEventGenerator,{title:{type:ControlType.String,title:\"Title\",defaultValue:\"Team Meeting on Zoom\"},zoomRoom:{type:ControlType.Link,title:\"Live Event Link\",defaultValue:\"https://zoom.us/j/yourmeeting\"},startDateTime:{type:ControlType.Date,title:\"Start Time\",defaultValue:new Date(Date.now()+24*60*60*1e3).toISOString(),displayTime:true},showGoogle:{type:ControlType.Boolean,title:\"Google Link\",defaultValue:true},showOutlook:{type:ControlType.Boolean,title:\"Outlook Link\",defaultValue:true},showYahoo:{type:ControlType.Boolean,title:\"Yahoo Link\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CalendarEventGenerator\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CalendarEventGenerator.map"],"mappings":"A,iLAQG,SAASU,EAAsB,EAAW,CAC7C,IAAMC,EAAK,IAAI,KAAKC,CAAU,EAA4S,MAAM,GAArSD,EAAK,eAAsS,IAA5Q,OAAOA,EAAK,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,GAAyO,IAA3N,OAAOA,EAAK,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,GAA2L,EAAE,GA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