{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/LWc8oFskVVWy3Hp6Jb55/F1kZvrtkgLAOZha9ltAi/AddToCalendar.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";const containerStyle={height:\"100%\",display:\"inline-flex\",flexWrap:\"wrap\",justifyContent:\"center\",overflow:\"hidden\",gap:8};const actionStyle={border:\"1px solid rgb(231, 233, 232)\",borderRadius:\"8px\",padding:\"8px\",backgroundColor:\"white\",width:\"36px\",height:\"36px\"};const imageStyle={width:\"100%\",height:\"100%\",objectFit:\"contain\"};export default function AddToCalendar(props){const{text,service,title,description,startDate,startTime,end,timezone,backgroundColor,color,style}=props;const combineDateTime=(date,time)=>{return new Date(`${date}T${time}:00`);};const generateCalendarLinks=()=>{const formattedStartDate=combineDateTime(props.startDate,props.startTime);const formattedEndDate=combineDateTime(props.endDate,props.endTime);const eventData={title:props.title,date_raw:{start:formattedStartDate.toISOString(),end:props.endDate&&props.endTime?formattedEndDate.toISOString():new Date(formattedStartDate.getTime()+2*60*60*1e3).toISOString()},location:props.isOnline&&props.zoomUrl?props.zoomUrl:props.location,isOnline:props.isOnline,zoomUrl:props.ZoomURL||\"\"};let calendarLinks={google:\"#\",outlook:\"#\",office:\"#\",yahoo:\"#\",aol:\"#\",ics:\"#\"};// Parse dates from Notion date object\nconst startDate=new Date(eventData.date_raw.start);const endDate=eventData.date_raw.end?new Date(eventData.date_raw.end):new Date(startDate.getTime()+2*60*60*1e3)// Default 2 hours duration if no end time\n;// Format dates for calendar URLs (YYYYMMDDTHHMMSSZ format)\nconst formatDateForCalendar=date=>{return date.toISOString().replace(/-|:|\\.\\d+/g,\"\");};// Format dates for Outlook (ISO format with specific formatting)\nconst formatDateForOutlook=date=>{return date.toISOString().replace(/\\.\\d+Z$/,\"+00:00\");};const startFormatted=formatDateForCalendar(startDate);const endFormatted=formatDateForCalendar(endDate);const startOutlook=formatDateForOutlook(startDate);const endOutlook=formatDateForOutlook(endDate);// Prepare event details\nconst title=encodeURIComponent(eventData.title);// Set location to Zoom URL for online events if available\nlet location;if(eventData.isOnline&&eventData.zoomUrl){location=encodeURIComponent(eventData.zoomUrl);}else{location=encodeURIComponent(eventData.location);}// Create event details including Zoom link when available\nlet detailsText=`Event: ${eventData.title}\nLocation: ${eventData.isOnline?\"Online\":eventData.location}`;// Add Zoom link to details if it exists\nif(eventData.isOnline&&eventData.zoomUrl){detailsText+=`\nZoom Link: ${eventData.zoomUrl}`;}const details=encodeURIComponent(detailsText);// Google Calendar URL\ncalendarLinks.google=`https://calendar.google.com/calendar/render?action=TEMPLATE&dates=${startFormatted}%2F${endFormatted}&details=${details}&location=${location}&text=${title}`;// Outlook.com Calendar URL\ncalendarLinks.outlook=`https://outlook.live.com/calendar/0/deeplink/compose?body=${details}&enddt=${endOutlook}&location=${location}&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=${startOutlook}&subject=${title}`;// Office 365 Outlook Calendar URL\ncalendarLinks.office=`https://outlook.office.com/calendar/0/deeplink/compose?body=${details}&enddt=${endOutlook}&location=${location}&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=${startOutlook}&subject=${title}`;// Yahoo Calendar URL\ncalendarLinks.yahoo=`https://calendar.yahoo.com/?desc=${details}&dur=&et=${endFormatted}&in_loc=${location}&st=${startFormatted}&title=${title}&v=60`;// AOL Calendar URL\ncalendarLinks.aol=`https://calendar.aol.com/?desc=${details}&dur=&et=${endFormatted}&in_loc=${location}&st=${startFormatted}&title=${title}&v=60`;// ICS file URL (can be implemented with a separate endpoint that generates ICS files)\n// For now, using Google Calendar as fallback\n// ICS file URL - create URL with query parameters for ICS generator worker\nconst icsParams=new URLSearchParams({title:eventData.title,start:eventData.date_raw.start,end:eventData.date_raw.end||new Date(startDate.getTime()+2*60*60*1e3).toISOString(),location:eventData.isOnline&&eventData.zoomUrl?eventData.zoomUrl:eventData.location,description:detailsText,isOnline:eventData.isOnline?\"true\":\"false\",zoomUrl:eventData.zoomUrl||\"\"});// Replace with your actual ICS generator worker URL\ncalendarLinks.ics=`https://event-ics-generator.leitmotiv.work/?${icsParams.toString()}`;return calendarLinks;};const calendarLinks=generateCalendarLinks();return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsx(\"a\",{style:actionStyle,href:calendarLinks.google,target:\"_blank\",children:/*#__PURE__*/_jsx(\"img\",{style:imageStyle,src:\"https://cdn.worldvectorlogo.com/logos/google-calendar-icon-2020-.svg\"})}),/*#__PURE__*/_jsx(\"a\",{style:actionStyle,href:calendarLinks.outlook,target:\"_blank\",children:/*#__PURE__*/_jsx(\"img\",{style:imageStyle,src:\"https://cdn.worldvectorlogo.com/logos/outlook-icon.svg\"})}),/*#__PURE__*/_jsx(\"a\",{style:actionStyle,href:calendarLinks.office,target:\"_blank\",children:/*#__PURE__*/_jsx(\"img\",{style:imageStyle,src:\"https://cdn.worldvectorlogo.com/logos/office-1.svg\"})}),/*#__PURE__*/_jsx(\"a\",{style:actionStyle,href:calendarLinks.yahoo,target:\"_blank\",children:/*#__PURE__*/_jsx(\"img\",{style:imageStyle,src:\"https://framerusercontent.com/images/bJMTRh1JzWtS5LUBybjg0TvqI.png\"})}),/*#__PURE__*/_jsx(\"a\",{style:actionStyle,href:calendarLinks.aol,target:\"_blank\",children:/*#__PURE__*/_jsx(\"img\",{style:imageStyle,src:\"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTxbgqw5a2_TQWdR5pKtXd_oxu4YJr5P6AzZQ&s\"})}),/*#__PURE__*/_jsx(\"a\",{style:actionStyle,href:calendarLinks.ics,target:\"_blank\",children:/*#__PURE__*/_jsx(\"img\",{style:imageStyle,src:\"https://cdn-icons-png.flaticon.com/512/28/28835.png\"})})]});}AddToCalendar.defaultProps={title:\"My Event\",startDate:\"2025-02-08\",startTime:\"10:00\",endDate:null,endTime:null,location:null,isOnline:false,zoomUrl:\"\"};addPropertyControls(AddToCalendar,{title:{type:ControlType.String,title:\"Title\"},startDate:{type:ControlType.String,title:\"Start Date (YYYY-MM-DD)\"},startTime:{type:ControlType.String,title:\"Start Time (HH:MM)\"},endDate:{type:ControlType.String,title:\"End Date (YYYY-MM-DD)\"},endTime:{type:ControlType.String,title:\"End Time (HH:MM)\"},location:{type:ControlType.String,title:\"Location\"},isOnline:{type:ControlType.Boolean,title:\"Online\"},zoomUrl:{type:ControlType.String,title:\"Zoom URL\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AddToCalendar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AddToCalendar.map"],
  "mappings": "gEAA6G,IAAMA,EAAe,CAAC,OAAO,OAAO,QAAQ,cAAc,SAAS,OAAO,eAAe,SAAS,SAAS,SAAS,IAAI,CAAC,EAAQC,EAAY,CAAC,OAAO,+BAA+B,aAAa,MAAM,QAAQ,MAAM,gBAAgB,QAAQ,MAAM,OAAO,OAAO,MAAM,EAAQC,EAAW,CAAC,MAAM,OAAO,OAAO,OAAO,UAAU,SAAS,EAAiB,SAARC,EAA+BC,EAAM,CAAC,GAAK,CAAC,KAAAC,EAAK,QAAAC,EAAQ,MAAAC,EAAM,YAAAC,EAAY,UAAAC,EAAU,UAAAC,EAAU,IAAAC,EAAI,SAAAC,EAAS,gBAAAC,EAAgB,MAAAC,EAAM,MAAAC,CAAK,EAAEX,EAAYY,EAAgB,CAACC,EAAKC,IAAe,IAAI,KAAK,GAAGD,CAAI,IAAIC,CAAI,KAAK,EAmBjiBC,GAnBikB,IAAI,CAAC,IAAMC,EAAmBJ,EAAgBZ,EAAM,UAAUA,EAAM,SAAS,EAAQiB,EAAiBL,EAAgBZ,EAAM,QAAQA,EAAM,OAAO,EAAQkB,EAAU,CAAC,MAAMlB,EAAM,MAAM,SAAS,CAAC,MAAMgB,EAAmB,YAAY,EA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AAC,MAAMlC,EAAY,KAAKkB,EAAc,MAAM,OAAO,SAAS,SAAsBgB,EAAK,MAAM,CAAC,MAAMjC,EAAW,IAAI,oEAAoE,CAAC,CAAC,CAAC,EAAeiC,EAAK,IAAI,CAAC,MAAMlC,EAAY,KAAKkB,EAAc,IAAI,OAAO,SAAS,SAAsBgB,EAAK,MAAM,CAAC,MAAMjC,EAAW,IAAI,8FAA8F,CAAC,CAAC,CAAC,EAAeiC,EAAK,IAAI,CAAC,MAAMlC,EAAY,KAAKkB,EAAc,IAAI,OAAO,SAAS,SAAsBgB,EAAK,MAAM,CAAC,MAAMjC,EAAW,IAAI,qDAAqD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAACC,EAAc,aAAa,CAAC,MAAM,WAAW,UAAU,aAAa,UAAU,QAAQ,QAAQ,KAAK,QAAQ,KAAK,SAAS,KAAK,SAAS,GAAM,QAAQ,EAAE,EAAEiC,EAAoBjC,EAAc,CAAC,MAAM,CAAC,KAAKkC,EAAY,OAAO,MAAM,OAAO,EAAE,UAAU,CAAC,KAAKA,EAAY,OAAO,MAAM,yBAAyB,EAAE,UAAU,CAAC,KAAKA,EAAY,OAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,KAAKA,EAAY,OAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,KAAKA,EAAY,OAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,KAAKA,EAAY,OAAO,MAAM,UAAU,EAAE,SAAS,CAAC,KAAKA,EAAY,QAAQ,MAAM,QAAQ,EAAE,QAAQ,CAAC,KAAKA,EAAY,OAAO,MAAM,UAAU,CAAC,CAAC",
  "names": ["containerStyle", "actionStyle", "imageStyle", "AddToCalendar", "props", "text", "service", "title", "description", "startDate", "startTime", "end", "timezone", "backgroundColor", "color", "style", "combineDateTime", "date", "time", "calendarLinks", "formattedStartDate", "formattedEndDate", "eventData", "endDate", "formatDateForCalendar", "formatDateForOutlook", "startFormatted", "endFormatted", "startOutlook", "endOutlook", "location", "detailsText", "details", "icsParams", "u", "p", "addPropertyControls", "ControlType"]
}
