{"version":3,"file":"AddToCalendar.TuIncm1G.mjs","names":[],"sources":["https:/framerusercontent.com/modules/NDwELLPhXaHji3OBGPyW/bGecM3r7IqCSU6xCi5Wh/AddToCalendar.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";export function withAddEventToCalendar(Component){return props=>{const{style,...rest}=props;const eventName=\"Taking Octoparty to 30,000 feet\";const eventDescription=\"Your flight to ICE Barcelona\";const eventLocation=\"Malta International Airport\";// Define dates in Malta time (UTC+2)\nconst startDate=\"20250119T130000\"// 13:00 PM Malta time\n;const endDate=\"20250119T150000\"// 15:00 PM Barcelona time next day\n;const timeZone=\"Europe/Malta\";const generateGoogleCalendarUrl=()=>{const baseUrl=\"https://calendar.google.com/calendar/r/eventedit\";const params=new URLSearchParams({text:eventName,details:eventDescription,location:eventLocation,dates:`${startDate}/${endDate}`,ctz:timeZone});return`${baseUrl}?${params.toString()}`;};const generateAppleCalendarUrl=()=>{// Get current timestamp in correct format\nconst now=new Date().toISOString().replace(/[-:]/g,\"\").split(\".\")[0]+\"Z\";// Create Apple Calendar URL with explicit time zone\nconst baseUrl=\"data:text/calendar;charset=utf8,\";const calendarContent=encodeURIComponent(`BEGIN:VCALENDAR\nPRODID:-//Your Company//Your App//EN\nVERSION:2.0\nCALSCALE:GREGORIAN\nMETHOD:PUBLISH\nBEGIN:VEVENT\nUID:${new Date().getTime()}@yourdomain.com\nDTSTAMP:${now}\nDTSTART;TZID=Europe/Malta:${startDate}\nDTEND;TZID=Europe/Malta:${endDate}\nSUMMARY:${eventName}\nDESCRIPTION:${eventDescription}\nLOCATION:${eventLocation}\nSTATUS:CONFIRMED\nSEQUENCE:0\nBEGIN:VTIMEZONE\nTZID:Europe/Malta\nBEGIN:STANDARD\nDTSTART:20241027T020000\nRRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10\nTZOFFSETFROM:+0200\nTZOFFSETTO:+0100\nEND:STANDARD\nBEGIN:DAYLIGHT\nDTSTART:20240331T020000\nRRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3\nTZOFFSETFROM:+0100\nTZOFFSETTO:+0200\nEND:DAYLIGHT\nEND:VTIMEZONE\nEND:VEVENT\nEND:VCALENDAR`);return baseUrl+calendarContent;};const addToIOSCalendar=()=>{const icsFile=generateAppleCalendarUrl();const anchor=document.createElement(\"a\");anchor.href=icsFile;anchor.style.display=\"none\";anchor.setAttribute(\"download\",\"event.ics\");fetch(icsFile).then(response=>response.blob()).then(blob=>{const blobUrl=URL.createObjectURL(blob);anchor.href=blobUrl;document.body.appendChild(anchor);anchor.click();document.body.removeChild(anchor);setTimeout(()=>URL.revokeObjectURL(blobUrl),100);});};const handleClick=()=>{const userAgent=navigator.userAgent.toLowerCase();const isIOS=/iphone|ipad|ipod/.test(userAgent);const isMac=/macintosh/.test(userAgent)&&navigator.maxTouchPoints>0;if(isIOS||isMac){addToIOSCalendar();}else{window.open(generateGoogleCalendarUrl(),\"_blank\");}};return /*#__PURE__*/_jsx(Component,{...rest,style:style,onClick:handleClick});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withAddEventToCalendar\":{\"type\":\"reactHoc\",\"name\":\"withAddEventToCalendar\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AddToCalendar.map"],"mappings":"yHAA2C,SAAgB,EAAuB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,QAAM,GAAG,GAAM,EAAY,EAAU,kCAAwC,EAAiB,+BAAqC,EAAc,8BAC7P,EAAU,kBACT,EAAQ,kBACsB,MAAsP,oDAAc,IAAnJ,gBAAgB,CAAC,KAAK,EAAU,QAAQ,EAAiB,SAAS,EAAc,MAAM,GAAG,EAAU,GAAG,IAAU,IAAI,cAAQ,CAA4B,CAAC,CAAC,SAAS,IAAY,MAA6B,CAClW,IAAM,EAAI,IAAI,KAAK,CAAA,CAAE,YAAY,CAAC,CAAC,QAAQ,QAAQ,EAAE,CAAC,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