1"use strict";(self.webpackChunkpratt_parent=self.webpackChunkpratt_parent||[]).push([[43],{7643:function(t,a){a.default=class{constructor(){if(this.rootEl=document.querySelector(".js-create-virtual-calendar"),!this.rootEl)throw new Error("Root calendar links holder not found.");if(this.ICSLink=this.rootEl.querySelector(".js-ics"),this.gcalLink=this.rootEl.querySelector(".js-gcal"),!this.ICSLink&&!this.gcalLink)throw new Error("No links for creating calendar.");this.data={title:this.rootEl.dataset.title,description:this.rootEl.dataset.description,location:this.rootEl.dataset.location,url:this.rootEl.dataset.url,start:this.rootEl.dataset.start,end:this.rootEl.dataset.end,isAllDay:"true"===this.rootEl.dataset.allday},this.init()}init(){this.ICSLink&&this.ICSLink.addEventListener("click",()=>this.downloadICS()),this.gcalLink&&this.gcalLink.addEventListener("click",()=>this.openGCal())}sanitizeICSValue=t=>t.replace(/\\/g,"\\\\").replace(/;/g,"\\;").replace(/,/g,"\\,").replace(/\n/g,"\\n");VTIMEZONE=["BEGIN:VTIMEZONE","TZID:America/New_York","BEGIN:DAYLIGHT","TZOFFSETFROM:-0500","TZOFFSETTO:-0400","TZNAME:EDT","DTSTART:19700308T020000","RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU","END:DAYLIGHT","BEGIN:STANDARD","TZOFFSETFROM:-0400","TZOFFSETTO:-0500","TZNAME:EST","DTSTART:19701101T020000","RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU","END:STANDARD","END:VTIMEZONE"];downloadICS(){const t=this.rootEl.dataset.timezone,a=this.data.isAllDay?`DTSTART;VALUE=DATE:${this.data.start.slice(0,8)}`:`DTSTART;TZID=${t}:${this.data.start}`,i=this.data.isAllDay?`DTEND;VALUE=DATE:${this.data.end.slice(0,8)}`:`DTEND;TZID=${t}:${this.data.end}`,e=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//Pratt//Events//EN",...this.data.isAllDay?[]:this.VTIMEZONE,"BEGIN:VEVENT",a,i,`SUMMARY:${this.data.title}`,`DESCRIPTION:${this.sanitizeICSValue(this.data.description)}\\nMore info: ${this.data.url}`,`URL:${this.data.url}`,`LOCATION:${this.data.location}`,"END:VEVENT","END:VCALENDAR"].join("\r\n"),s=new Blob([e],{type:"text/calendar;charset=utf-8"}),l=document.createElement("a");l.href=URL.createObjectURL(s),l.download=`${this.data.title}.ics`,l.click(),URL.revokeObjectURL(l.href)}openGCal(){const t=this.data.isAllDay?`${this.data.start.slice(0,8)}/${this.data.end.slice(0,8)}`:`${this.data.start}/${this.data.end}`,a=new URLSearchParams({action:"TEMPLATE",text:this.data.title,dates:t,ctz:this.rootEl.dataset.timezone,details:`${this.data.description}\n\nMore info: ${this.data.url}`,location:this.data.location});window.open(`https://calendar.google.com/calendar/render?${a}`,"_blank")}}}}]); 2//# sourceMappingURL=43.149653a3b281b38c981d.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.