ical-generator 11.1.3-develop.4 → 11.1.3-develop.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1778,7 +1778,9 @@ declare class ICalEvent {
1778
1778
  * is used.
1779
1779
  *
1780
1780
  * Please note that if the time zone is set, ical-generator assumes
1781
- * that all times are already in the correct time zone. Alternatively,
1781
+ * that all times are already in the correct time zone. For a native
1782
+ * `Date`, this means the local time of the machine running the code is
1783
+ * used, so the output depends on the server's time zone. Alternatively,
1782
1784
  * a `moment-timezone` or a Luxon object can be passed with `setZone`,
1783
1785
  * ical-generator will then set the time zone itself.
1784
1786
  *
@@ -2305,7 +2307,9 @@ declare class ICalCalendar {
2305
2307
  /**
2306
2308
  * Sets the time zone to be used in this calendar file for all times of all
2307
2309
  * events. Please note that if the time zone is set, ical-generator assumes
2308
- * that all times are already in the correct time zone. Alternatively, a
2310
+ * that all times are already in the correct time zone. For a native
2311
+ * `Date`, this means the local time of the machine running the code is
2312
+ * used, so the output depends on the server's time zone. Alternatively, a
2309
2313
  * `moment-timezone` or a Luxon object can be passed with `setZone`,
2310
2314
  * ical-generator will then set the time zone itself.
2311
2315
  *
package/dist/index.d.mts CHANGED
@@ -1778,7 +1778,9 @@ declare class ICalEvent {
1778
1778
  * is used.
1779
1779
  *
1780
1780
  * Please note that if the time zone is set, ical-generator assumes
1781
- * that all times are already in the correct time zone. Alternatively,
1781
+ * that all times are already in the correct time zone. For a native
1782
+ * `Date`, this means the local time of the machine running the code is
1783
+ * used, so the output depends on the server's time zone. Alternatively,
1782
1784
  * a `moment-timezone` or a Luxon object can be passed with `setZone`,
1783
1785
  * ical-generator will then set the time zone itself.
1784
1786
  *
@@ -2305,7 +2307,9 @@ declare class ICalCalendar {
2305
2307
  /**
2306
2308
  * Sets the time zone to be used in this calendar file for all times of all
2307
2309
  * events. Please note that if the time zone is set, ical-generator assumes
2308
- * that all times are already in the correct time zone. Alternatively, a
2310
+ * that all times are already in the correct time zone. For a native
2311
+ * `Date`, this means the local time of the machine running the code is
2312
+ * used, so the output depends on the server's time zone. Alternatively, a
2309
2313
  * `moment-timezone` or a Luxon object can be passed with `setZone`,
2310
2314
  * ical-generator will then set the time zone itself.
2311
2315
  *
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  let e=/* @__PURE__ */ function(e){return e.DAILY=`DAILY`,e.HOURLY=`HOURLY`,e.MINUTELY=`MINUTELY`,e.MONTHLY=`MONTHLY`,e.SECONDLY=`SECONDLY`,e.WEEKLY=`WEEKLY`,e.YEARLY=`YEARLY`,e}({}),t=/* @__PURE__ */ function(e){return e.AUTOMATIC=`AUTOMATIC`,e.DISABLED=`DISABLED`,e.ENABLED=`ENABLED`,e}({}),n=/* @__PURE__ */ function(e){return e.BICYCLE=`BICYCLE`,e.CAR=`CAR`,e.TRANSIT=`TRANSIT`,e.WALKING=`WALKING`,e}({}),r=/* @__PURE__ */ function(e){return e.FR=`FR`,e.MO=`MO`,e.SA=`SA`,e.SU=`SU`,e.TH=`TH`,e.TU=`TU`,e.WE=`WE`,e}({});function i(e,t,n){if(Array.isArray(t))e.x=t.map(e=>{if(Array.isArray(e))return e;if(typeof e.key!=`string`||typeof e.value!=`string`)throw Error(`Either key or value is not a string!`);if(e.key.substr(0,2)!==`X-`)throw Error("Key has to start with `X-`!");return[e.key,e.value]});else if(typeof t==`object`)e.x=Object.entries(t).map(([e,t])=>{if(typeof e!=`string`||typeof t!=`string`)throw Error(`Either key or value is not a string!`);if(e.substr(0,2)!==`X-`)throw Error("Key has to start with `X-`!");return[e,t]});else if(typeof t==`string`&&typeof n==`string`){if(t.substr(0,2)!==`X-`)throw Error("Key has to start with `X-`!");e.x.push([t,n])}else return e.x.map(e=>({key:e[0],value:e[1]}))}function a(e,t){if(e instanceof Date&&isNaN(e.getTime())||typeof e==`string`&&isNaN(new Date(e).getTime()))throw Error(`\`${t}\` has to be a valid date!`);if(e instanceof Date||typeof e==`string`||typeof e==`object`&&e&&(w(e)||C(e)||S(e)||x(e))||h(e)&&e.isValid===!0||(g(e)||m(e))&&e.isValid())return e;throw Error(`\`${t}\` has to be a valid date!`)}function o(e,t){let n=Object.values(e),r=String(t).toUpperCase();if(!r||!n.includes(r))throw Error(`Input must be one of the following: ${n.join(`, `)}`);return r}function s(e,t){let n=null;if(typeof t==`string`){let e=t.match(/^(.+) ?<([^>]+)>$/);e?n={email:e[2].trim(),name:e[1].trim()}:t.includes(`@`)&&(n={email:t.trim(),name:t.trim()})}else typeof t==`object`&&(n={email:t.email,mailto:t.mailto,name:t.name,sentBy:t.sentBy});if(!n&&typeof t==`string`)throw Error("`"+e+"` isn't formated correctly. See https://sebbo2002.github.io/ical-generator/develop/reference/interfaces/ICalOrganizer.html");if(!n)throw Error("`"+e+"` needs to be a valid formed string or an object. See https://sebbo2002.github.io/ical-generator/develop/reference/interfaces/ICalOrganizer.html");if(!n.name)throw Error("`"+e+".name` is empty!");if(!n.email)throw Error("`"+e+".email` is empty!");return n}function c(e,t){return t?l(e):String(e).replace(/[\\;,]/g,e=>`\\`+e).replace(/(?:\r\n|\r|\n)/g,`\\n`)}function l(e){return String(e).replace(/\^/g,`^^`).replace(/"/g,`^'`).replace(/(?:\r\n|\r|\n)/g,`^n`)}function u(e){return e.split(`\r
2
2
  `).map(function(e){if(e.length<=74&&A(e))return e;let t=``,n=0;for(let r=0;r<e.length;r++){let i=e.charAt(r),a=e.charCodeAt(r),o;a<128?o=1:a<2048?o=2:a>=55296&&a<=56319?(i+=e.charAt(++r),o=4):o=3,n+=o,n>74&&(t+=`\r
3
3
  `,n=o),t+=i}return t}).join(`\r
4
- `)}function d(e,t,n,r){if(e?.startsWith(`/`)&&(e=e.substr(1)),typeof t==`string`||t instanceof Date){let i=T(t)?t.withTimeZone(e):new Date(t),a=i.getUTCFullYear().toString().padStart(4,`0`)+String(i.getUTCMonth()+1).padStart(2,`0`)+i.getUTCDate().toString().padStart(2,`0`);return e&&(a=i.getFullYear().toString().padStart(2,`0`)+String(i.getMonth()+1).padStart(2,`0`)+i.getDate().toString().padStart(2,`0`)),n?a:e?(a+=`T`+i.getHours().toString().padStart(2,`0`)+i.getMinutes().toString().padStart(2,`0`)+i.getSeconds().toString().padStart(2,`0`),a):(a+=`T`+i.getUTCHours().toString().padStart(2,`0`)+i.getUTCMinutes().toString().padStart(2,`0`)+i.getUTCSeconds().toString().padStart(2,`0`)+(r?``:`Z`),a)}if(g(t)){let i=e?v(t)&&!t.tz()?t.clone().tz(e):t:r||n&&v(t)&&t.tz()?t:t.utc();return i.format(`YYYYMMDD`)+(n?``:`T`+i.format(`HHmmss`)+(r||e?``:`Z`))}if(h(t)){let i=e?t.setZone(e):r||n&&t.zone.type!==`system`?t:t.setZone(`utc`);return i.toFormat(`yyyyLLdd`)+(n?``:`T`+i.toFormat(`HHmmss`)+(r||e?``:`Z`))}if(w(t)){let i=t;return e&&(i=t.withTimeZone(e)),!e&&t.timeZoneId!==`UTC`&&(i=t.withTimeZone(`UTC`)),d(null,i.toPlainDateTime(),n,r||!!e)}if(C(t)){if(n)return t.year.toString().padStart(4,`0`)+t.month.toString().padStart(2,`0`)+t.day.toString().padStart(2,`0`);if(e){let i=t.toZonedDateTime(e);return d(e,i,n,r)}return t.year.toString().padStart(4,`0`)+t.month.toString().padStart(2,`0`)+t.day.toString().padStart(2,`0`)+`T`+t.hour.toString().padStart(2,`0`)+t.minute.toString().padStart(2,`0`)+t.second.toString().padStart(2,`0`)+(r||e?``:`Z`)}if(S(t))return t.year.toString().padStart(4,`0`)+t.month.toString().padStart(2,`0`)+t.day.toString().padStart(2,`0`)+(n?``:`T000000`+(r||e?``:`Z`));if(x(t)){let i=e||`UTC`,a=t.toZonedDateTimeISO(i);return d(e,a,n,r)}{let i=t;if(e)i=typeof t.tz==`function`?t.tz(e):t;else if(!r){if(typeof t.utc==`function`)i=t.utc();else throw Error(`Unable to convert dayjs object to UTC value: UTC plugin is not available!`)}return i.format(`YYYYMMDD`)+(n?``:`T`+i.format(`HHmmss`)+(r||e?``:`Z`))}}function f(e,t,n,r){let i=``,a=r?.floating||!1;return r?.timezone&&(i=`;TZID=`+r.timezone,a=!0),t+i+`:`+d(e,n,!1,a)}function p(e){let t=e.x.map(([e,t])=>e.toUpperCase()+`:`+c(t,!1)).join(`\r
4
+ `)}function d(e,t,n,r){if(e?.startsWith(`/`)&&(e=e.substr(1)),typeof t==`string`||t instanceof Date){let i=T(t)?t.withTimeZone(e):new Date(t),a=i.getUTCFullYear().toString().padStart(4,`0`)+String(i.getUTCMonth()+1).padStart(2,`0`)+i.getUTCDate().toString().padStart(2,`0`);return e&&(a=i.getFullYear().toString().padStart(4,`0`)+String(i.getMonth()+1).padStart(2,`0`)+i.getDate().toString().padStart(2,`0`)),n?a:e?(a+=`T`+i.getHours().toString().padStart(2,`0`)+i.getMinutes().toString().padStart(2,`0`)+i.getSeconds().toString().padStart(2,`0`),a):(a+=`T`+i.getUTCHours().toString().padStart(2,`0`)+i.getUTCMinutes().toString().padStart(2,`0`)+i.getUTCSeconds().toString().padStart(2,`0`)+(r?``:`Z`),a)}if(g(t)){let i=e?v(t)&&!t.tz()?t.clone().tz(e):t:r||n&&v(t)&&t.tz()?t:t.utc();return i.format(`YYYYMMDD`)+(n?``:`T`+i.format(`HHmmss`)+(r||e?``:`Z`))}if(h(t)){let i=e?t.setZone(e):r||n&&t.zone.type!==`system`?t:t.setZone(`utc`);return i.toFormat(`yyyyLLdd`)+(n?``:`T`+i.toFormat(`HHmmss`)+(r||e?``:`Z`))}if(w(t)){let i=t;return e&&(i=t.withTimeZone(e)),!e&&t.timeZoneId!==`UTC`&&(i=t.withTimeZone(`UTC`)),d(null,i.toPlainDateTime(),n,r||!!e)}if(C(t)){if(n)return t.year.toString().padStart(4,`0`)+t.month.toString().padStart(2,`0`)+t.day.toString().padStart(2,`0`);if(e){let i=t.toZonedDateTime(e);return d(e,i,n,r)}return t.year.toString().padStart(4,`0`)+t.month.toString().padStart(2,`0`)+t.day.toString().padStart(2,`0`)+`T`+t.hour.toString().padStart(2,`0`)+t.minute.toString().padStart(2,`0`)+t.second.toString().padStart(2,`0`)+(r||e?``:`Z`)}if(S(t))return t.year.toString().padStart(4,`0`)+t.month.toString().padStart(2,`0`)+t.day.toString().padStart(2,`0`)+(n?``:`T000000`+(r||e?``:`Z`));if(x(t)){let i=e||`UTC`,a=t.toZonedDateTimeISO(i);return d(e,a,n,r)}{let i=t;if(e)i=typeof t.tz==`function`?t.tz(e):t;else if(!r){if(typeof t.utc==`function`)i=t.utc();else throw Error(`Unable to convert dayjs object to UTC value: UTC plugin is not available!`)}return i.format(`YYYYMMDD`)+(n?``:`T`+i.format(`HHmmss`)+(r||e?``:`Z`))}}function f(e,t,n,r){let i=``,a=r?.floating||!1;return r?.timezone&&(i=`;TZID=`+r.timezone,a=!0),t+i+`:`+d(e,n,!1,a)}function p(e){let t=e.x.map(([e,t])=>e.toUpperCase()+`:`+c(t,!1)).join(`\r
5
5
  `);return t.length?t+`\r
6
6
  `:``}function m(e){return typeof e==`object`&&!!e&&!(e instanceof Date)&&!g(e)&&!h(e)&&!b(e)}function h(e){return typeof e==`object`&&!!e&&`toJSDate`in e&&typeof e.toJSDate==`function`&&!b(e)}function g(e){return e!=null&&e._isAMomentObject!=null&&!b(e)}function _(e){return typeof e==`object`&&!!e&&`asSeconds`in e&&typeof e.asSeconds==`function`}function v(e){return g(e)&&`tz`in e&&typeof e.tz==`function`}function y(e){return typeof e==`object`&&!!e&&`between`in e&&typeof e.between==`function`&&typeof e.toString==`function`}function b(e){return w(e)||C(e)||S(e)||x(e)}function x(e){return typeof e==`object`&&!!e&&!w(e)&&!C(e)&&!S(e)&&`toZonedDateTimeISO`in e&&typeof e.toZonedDateTimeISO==`function`&&!(`year`in e)&&!(`timeZoneId`in e)}function S(e){return typeof e==`object`&&!!e&&!w(e)&&!C(e)&&`toPlainDateTime`in e&&typeof e.toPlainDateTime==`function`&&`year`in e&&typeof e.year==`number`&&`month`in e&&typeof e.month==`number`&&`day`in e&&typeof e.day==`number`&&!(`hour`in e)&&!(`timeZoneId`in e)&&!(`epochSeconds`in e)}function C(e){return typeof e==`object`&&!!e&&!w(e)&&`toZonedDateTime`in e&&typeof e.toZonedDateTime==`function`&&`toPlainDate`in e&&typeof e.toPlainDate==`function`&&`year`in e&&typeof e.year==`number`&&`month`in e&&typeof e.month==`number`&&`day`in e&&typeof e.day==`number`&&`hour`in e&&typeof e.hour==`number`&&`minute`in e&&typeof e.minute==`number`&&`second`in e&&typeof e.second==`number`&&!(`timeZone`in e)}function w(e){return typeof e==`object`&&!!e&&`timeZoneId`in e&&typeof e.timeZoneId==`string`&&`toPlainDateTime`in e&&typeof e.toPlainDateTime==`function`&&`year`in e&&typeof e.year==`number`&&`month`in e&&typeof e.month==`number`&&`day`in e&&typeof e.day==`number`&&`hour`in e&&typeof e.hour==`number`&&`minute`in e&&typeof e.minute==`number`&&`second`in e&&typeof e.second==`number`}function T(e){return e instanceof Date&&`internal`in e&&e.internal instanceof Date&&`withTimeZone`in e&&typeof e.withTimeZone==`function`&&`tzComponents`in e&&typeof e.tzComponents==`function`}function E(e){let t=l(e);return/[,:;]/.test(t)?`"`+t+`"`:t}function D(e){if(typeof e==`string`||e instanceof Date)return new Date(e);if(w(e)){let t=e.toInstant();return new Date(t.epochMilliseconds)}return C(e)?new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second)):S(e)?new Date(Date.UTC(e.year,e.month-1,e.day)):x(e)?new Date(e.epochMilliseconds):h(e)?e.toJSDate():e.toDate()}function O(e){let t=``;return e<0&&(t=`-`,e*=-1),t+=`P`,e>=86400&&(t+=Math.floor(e/86400)+`D`,e%=86400),!e&&t.length>1||(t+=`T`,e>=3600&&(t+=Math.floor(e/3600)+`H`,e%=3600),e>=60&&(t+=Math.floor(e/60)+`M`,e%=60),e>0?t+=e+`S`:t.length<=2&&(t+=`0S`)),t}function k(e){return e?typeof e==`string`?e:w(e)?k(e.withTimeZone(`UTC`).toPlainDateTime()):(b(e),e.toJSON()):null}function A(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!1;return!0}let j=/* @__PURE__ */ function(e){return e.CHAIR=`CHAIR`,e.NON=`NON-PARTICIPANT`,e.OPT=`OPT-PARTICIPANT`,e.REQ=`REQ-PARTICIPANT`,e}({}),M=/* @__PURE__ */ function(e){return e.CLIENT=`CLIENT`,e.NONE=`NONE`,e.SERVER=`SERVER`,e}({}),N=/* @__PURE__ */ function(e){return e.ACCEPTED=`ACCEPTED`,e.DECLINED=`DECLINED`,e.DELEGATED=`DELEGATED`,e.NEEDSACTION=`NEEDS-ACTION`,e.TENTATIVE=`TENTATIVE`,e}({}),P=/* @__PURE__ */ function(e){return e.GROUP=`GROUP`,e.INDIVIDUAL=`INDIVIDUAL`,e.RESOURCE=`RESOURCE`,e.ROOM=`ROOM`,e.UNKNOWN=`UNKNOWN`,e}({});var F=class e{data;parent;constructor(e,t){if(this.data={delegatedFrom:null,delegatedTo:null,email:``,mailto:null,name:null,role:`REQ-PARTICIPANT`,rsvp:null,scheduleAgent:null,sentBy:null,status:null,type:null,x:[]},this.parent=t,!this.parent)throw Error("`event` option required!");if(!e.email)throw Error("No value for `email` in ICalAttendee given!");e.name!==void 0&&this.name(e.name),e.email!==void 0&&this.email(e.email),e.mailto!==void 0&&this.mailto(e.mailto),e.sentBy!==void 0&&this.sentBy(e.sentBy),e.status!==void 0&&this.status(e.status),e.role!==void 0&&this.role(e.role),e.rsvp!==void 0&&this.rsvp(e.rsvp),e.type!==void 0&&this.type(e.type),e.delegatedTo!==void 0&&this.delegatedTo(e.delegatedTo),e.delegatedFrom!==void 0&&this.delegatedFrom(e.delegatedFrom),e.delegatesTo&&this.delegatesTo(e.delegatesTo),e.delegatesFrom&&this.delegatesFrom(e.delegatesFrom),e.scheduleAgent!==void 0&&this.scheduleAgent(e.scheduleAgent),e.x!==void 0&&this.x(e.x)}delegatedFrom(t){return t===void 0?this.data.delegatedFrom:(t?typeof t==`string`?this.data.delegatedFrom=new e(s(`delegatedFrom`,t),this.parent):t instanceof e?this.data.delegatedFrom=t:this.data.delegatedFrom=new e(t,this.parent):this.data.delegatedFrom=null,this)}delegatedTo(t){return t===void 0?this.data.delegatedTo:t?(typeof t==`string`?this.data.delegatedTo=new e(s(`delegatedTo`,t),this.parent):t instanceof e?this.data.delegatedTo=t:this.data.delegatedTo=new e(t,this.parent),this.data.status=`DELEGATED`,this):(this.data.delegatedTo=null,this.data.status===`DELEGATED`&&(this.data.status=null),this)}delegatesFrom(t){let n=t instanceof e?t:this.parent.createAttendee(t);return this.delegatedFrom(n),n.delegatedTo(this),n}delegatesTo(t){let n=t instanceof e?t:this.parent.createAttendee(t);return this.delegatedTo(n),n.delegatedFrom(this),n}email(e){return e?(this.data.email=e,this):this.data.email}mailto(e){return e===void 0?this.data.mailto:(this.data.mailto=e||null,this)}name(e){return e===void 0?this.data.name:(this.data.name=e||null,this)}role(e){return e===void 0?this.data.role:(this.data.role=o(j,e),this)}rsvp(e){return e===void 0?this.data.rsvp:e===null?(this.data.rsvp=null,this):(this.data.rsvp=!!e,this)}scheduleAgent(e){return e===void 0?this.data.scheduleAgent:e?typeof e==`string`&&e.toUpperCase().startsWith(`X-`)?(this.data.scheduleAgent=e,this):(this.data.scheduleAgent=o(M,e),this):(this.data.scheduleAgent=null,this)}sentBy(e){return e?(this.data.sentBy=e,this):this.data.sentBy}status(e){return e===void 0?this.data.status:e?(this.data.status=o(N,e),this):(this.data.status=null,this)}toJSON(){return Object.assign({},this.data,{delegatedFrom:this.data.delegatedFrom?.email()||null,delegatedTo:this.data.delegatedTo?.email()||null,x:this.x()})}toString(){let e=`ATTENDEE`;if(!this.data.email)throw Error("No value for `email` in ICalAttendee given!");return e+=`;ROLE=`+this.data.role,this.data.type&&(e+=`;CUTYPE=`+this.data.type),this.data.status&&(e+=`;PARTSTAT=`+this.data.status),this.data.rsvp!==null&&(e+=`;RSVP=`+this.data.rsvp.toString().toUpperCase()),this.data.sentBy!==null&&(e+=`;SENT-BY="mailto:`+l(this.data.sentBy)+`"`),this.data.delegatedTo&&(e+=`;DELEGATED-TO="`+l(this.data.delegatedTo.email())+`"`),this.data.delegatedFrom&&(e+=`;DELEGATED-FROM="`+l(this.data.delegatedFrom.email())+`"`),this.data.name&&(e+=`;CN="`+l(this.data.name)+`"`),this.data.email&&this.data.mailto&&(e+=`;EMAIL=`+E(this.data.email)),this.data.scheduleAgent&&(e+=`;SCHEDULE-AGENT=`+this.data.scheduleAgent),this.data.x.length&&(e+=`;`+this.data.x.map(([e,t])=>e.toUpperCase()+`=`+E(t)).join(`;`)),e+=`:MAILTO:`+c(this.data.mailto||this.data.email,!1)+`\r
7
7
  `,e}type(e){return e===void 0?this.data.type:e?(this.data.type=o(P,e),this):(this.data.type=null,this)}x(e,t){if(e===void 0)return i(this.data);if(typeof e==`string`&&typeof t==`string`)i(this.data,e,t);else if(typeof e==`object`)i(this.data,e);else throw Error(`Either key or value is not a string!`);return this}};let I=/* @__PURE__ */ function(e){return e.audio=`audio`,e.display=`display`,e.email=`email`,e}({});const L={end:`END`,start:`START`};var R=class{data;event;constructor(e,t){if(this.data={attach:null,attendees:[],description:null,interval:null,relatesTo:null,repeat:null,summary:null,trigger:-600,type:`display`,x:[]},this.event=t,!t)throw Error("`event` option required!");e.type!==void 0&&this.type(e.type),`trigger`in e&&e.trigger!==void 0&&this.trigger(e.trigger),`triggerBefore`in e&&e.triggerBefore!==void 0&&this.triggerBefore(e.triggerBefore),`triggerAfter`in e&&e.triggerAfter!==void 0&&this.triggerAfter(e.triggerAfter),e.repeat&&this.repeat(e.repeat),e.attach!==void 0&&this.attach(e.attach),e.description!==void 0&&this.description(e.description),e.summary!==void 0&&this.summary(e.summary),e.attendees!==void 0&&this.attendees(e.attendees),e.x!==void 0&&this.x(e.x)}attach(e){if(e===void 0)return this.data.attach;if(!e)return this.data.attach=null,this;let t;if(typeof e==`string`)t={mime:null,uri:e};else if(typeof e==`object`)t={mime:e.mime||null,uri:e.uri};else throw Error("`attachment` needs to be a valid formed string or an object. See https://sebbo2002.github.io/ical-generator/develop/reference/classes/ICalAlarm.html#attach");if(!t.uri)throw Error("`attach.uri` is empty!");return this.data.attach={mime:t.mime,uri:t.uri},this}attendees(e){return e?(e.forEach(e=>this.createAttendee(e)),this):this.data.attendees}createAttendee(e){if(e instanceof F)return this.data.attendees.push(e),e;typeof e==`string`&&(e=s(`data`,e));let t=new F(e,this);return this.data.attendees.push(t),t}description(e){return e===void 0?this.data.description:e?(this.data.description=e,this):(this.data.description=null,this)}relatesTo(e){if(e===void 0)return this.data.relatesTo;if(!e)return this.data.relatesTo=null,this;if(!Object.values(L).includes(e))throw Error("`relatesTo` is not correct, must be either `START` or `END`!");return this.data.relatesTo=e,this}repeat(e){if(e===void 0)return this.data.repeat;if(!e)return this.data.repeat=null,this;if(typeof e!=`object`)throw Error("`repeat` is not correct, must be an object!");if(typeof e.times!=`number`||!isFinite(e.times))throw Error("`repeat.times` is not correct, must be numeric!");if(typeof e.interval!=`number`||!isFinite(e.interval))throw Error("`repeat.interval` is not correct, must be numeric!");return this.data.repeat=e,this}summary(e){return e===void 0?this.data.summary:e?(this.data.summary=e,this):(this.data.summary=null,this)}toJSON(){let e=this.trigger();return Object.assign({},this.data,{trigger:typeof e==`number`?e:k(e),x:this.x()})}toString(){let e=`BEGIN:VALARM\r