koalagator 4.0.0 → 5.0.0

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.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +661 -0
  3. data/README.md +74 -21
  4. data/app/assets/config/calagator/manifest.js +5 -1
  5. data/app/assets/images/external_sites/mastodon.png +0 -0
  6. data/app/assets/images/nav_marker.png +0 -0
  7. data/app/assets/javascripts/calagator/forms.js +7 -0
  8. data/app/assets/stylesheets/calagator/custom/calendar.css +137 -0
  9. data/app/assets/stylesheets/calagator/errors.css +2 -4
  10. data/app/assets/stylesheets/calagator/forms.scss +5 -0
  11. data/app/assets/stylesheets/calagator/layout.scss +31 -9
  12. data/app/assets/stylesheets/calagator/typography.scss +39 -9
  13. data/app/assets/stylesheets/calagator/utils.scss +44 -0
  14. data/app/controllers/calagator/admin/curations_controller.rb +62 -0
  15. data/app/controllers/calagator/admin/users_controller.rb +79 -0
  16. data/app/controllers/calagator/application_controller.rb +29 -5
  17. data/app/controllers/calagator/curations_controller.rb +32 -0
  18. data/app/controllers/calagator/events_controller.rb +6 -0
  19. data/app/controllers/calagator/paper_trail_manager_controller.rb +5 -0
  20. data/app/controllers/calagator/passwords_controller.rb +4 -0
  21. data/app/controllers/calagator/registrations_controller.rb +5 -0
  22. data/app/controllers/calagator/sessions_controller.rb +4 -0
  23. data/app/controllers/calagator/site_controller.rb +10 -0
  24. data/app/controllers/calagator/sources_controller.rb +2 -0
  25. data/app/controllers/calagator/venues_controller.rb +5 -1
  26. data/app/controllers/calagator/versions_controller.rb +1 -1
  27. data/app/controllers/paper_trail_manager/changes_controller.rb +16 -16
  28. data/app/helpers/calagator/application_helper.rb +32 -3
  29. data/app/helpers/calagator/time_range_helper.rb +1 -1
  30. data/app/helpers/paper_trail_manager/changes_helper.rb +7 -7
  31. data/app/javascript/calagator/calendar/calendar.js +82 -0
  32. data/app/javascript/calagator/calendar/event.js +94 -0
  33. data/app/javascript/calagator/calendar/lib/components.js +120 -0
  34. data/app/javascript/calagator/calendar/lib/utils.js +67 -0
  35. data/app/models/calagator/curation.rb +32 -0
  36. data/app/models/calagator/event/browse.rb +3 -2
  37. data/app/models/calagator/event/cloner.rb +1 -1
  38. data/app/models/calagator/event/ical_renderer.rb +1 -1
  39. data/app/models/calagator/event/overview.rb +3 -1
  40. data/app/models/calagator/event/saver.rb +6 -1
  41. data/app/models/calagator/event/search.rb +1 -1
  42. data/app/models/calagator/event/search_engine.rb +1 -1
  43. data/app/models/calagator/event.rb +22 -5
  44. data/app/models/calagator/source/parser/hcal.rb +1 -1
  45. data/app/models/calagator/source/parser.rb +3 -3
  46. data/app/models/calagator/source.rb +23 -6
  47. data/app/models/calagator/user.rb +50 -0
  48. data/app/models/calagator/venue/geocoder.rb +1 -1
  49. data/app/models/calagator/venue/search.rb +1 -1
  50. data/app/models/calagator/venue/search_engine.rb +1 -1
  51. data/app/models/calagator/venue.rb +20 -1
  52. data/app/models/concerns/calagator/event_filterable.rb +22 -0
  53. data/app/views/calagator/admin/curations/_form.html.erb +56 -0
  54. data/app/views/calagator/admin/curations/_index.html.erb +12 -0
  55. data/app/views/calagator/admin/curations/edit.html.erb +2 -0
  56. data/app/views/calagator/admin/curations/index.html.erb +21 -0
  57. data/app/views/calagator/admin/curations/new.html.erb +2 -0
  58. data/app/views/calagator/admin/index.html.erb +6 -2
  59. data/app/views/calagator/admin/users/_form.html.erb +28 -0
  60. data/app/views/calagator/admin/users/edit.html.erb +7 -0
  61. data/app/views/calagator/admin/users/index.html.erb +38 -0
  62. data/app/views/calagator/admin/users/invite.html.erb +19 -0
  63. data/app/views/calagator/admin/users/new.html.erb +3 -0
  64. data/app/views/calagator/curations/show.html.erb +17 -0
  65. data/app/views/calagator/events/_index.html.erb +59 -0
  66. data/app/views/calagator/events/_item.html.erb +10 -3
  67. data/app/views/calagator/events/_subnav.html.erb +7 -2
  68. data/app/views/calagator/events/_subnav_custom.html.erb +0 -0
  69. data/app/views/calagator/events/index.atom.builder +1 -1
  70. data/app/views/calagator/events/index.html.erb +9 -60
  71. data/app/views/calagator/events/show.html.erb +5 -3
  72. data/app/views/calagator/shared/_calendar.html.erb +7 -0
  73. data/app/views/calagator/shared/_subnav_curations.html.erb +5 -0
  74. data/app/views/calagator/shared/_subnav_pinned_venues.html.erb +5 -0
  75. data/app/views/calagator/site/_contact.html.erb +1 -0
  76. data/app/views/calagator/site/_description.html.erb +2 -2
  77. data/app/views/calagator/site/about.html.erb +9 -0
  78. data/app/views/calagator/site/closed_registrations.html.erb +2 -0
  79. data/app/views/calagator/site/embed.html.erb +16 -0
  80. data/app/views/calagator/site/index.html.erb +1 -1
  81. data/app/views/calagator/sources/index.html.erb +1 -1
  82. data/app/views/calagator/sources/show.html.erb +1 -1
  83. data/app/views/calagator/venues/_form.html.erb +5 -1
  84. data/app/views/calagator/venues/_subnav.html.erb +9 -1
  85. data/app/views/calagator/venues/_subnav_custom.html.erb +0 -0
  86. data/app/views/calagator/venues/show.html.erb +1 -1
  87. data/app/views/layouts/calagator/_devise.html.erb +17 -0
  88. data/app/views/layouts/calagator/_footer.html.erb +3 -1
  89. data/app/views/layouts/calagator/_head.html.erb +0 -0
  90. data/app/views/layouts/calagator/_header.html.erb +3 -0
  91. data/app/views/layouts/calagator/application.html.erb +3 -0
  92. data/app/views/layouts/calagator/embed.html.erb +15 -0
  93. data/app/views/paper_trail_manager/changes/_version.html.erb +5 -5
  94. data/app/views/paper_trail_manager/changes/index.atom.builder +12 -12
  95. data/bin/{calagator → koalagator} +14 -9
  96. data/config/importmap.rb +11 -0
  97. data/config/initializers/admin_user.rb +15 -0
  98. data/config/initializers/observers.rb +1 -1
  99. data/config/initializers/paper_trail_manager.rb +1 -1
  100. data/config/locales/devise.en.yml +65 -0
  101. data/config/routes.rb +26 -1
  102. data/db/migrate/20240319042449_devise_create_calagator_users.rb +43 -0
  103. data/db/migrate/20240319061154_add_admin_flag_to_calagator_user.rb +5 -0
  104. data/db/migrate/20240320043535_add_name_to_calagator_user.rb +8 -0
  105. data/db/migrate/20240322035554_add_created_by_to_records.rb +12 -0
  106. data/db/migrate/20240510051940_create_calagator_curations.rb +15 -0
  107. data/db/migrate/20240628055300_add_pinned_to_venue.rb +5 -0
  108. data/db/seeds.rb +49 -0
  109. data/lib/calagator/decode_html_entities_hack.rb +1 -1
  110. data/lib/calagator/engine.rb +16 -1
  111. data/lib/calagator/machine_tag.rb +1 -1
  112. data/lib/calagator/strip_whitespace.rb +1 -1
  113. data/lib/calagator/vcalendar.rb +4 -4
  114. data/lib/calagator/version.rb +5 -2
  115. data/lib/generators/calagator/install_generator.rb +9 -1
  116. data/lib/generators/calagator/templates/app/views/devise/registrations/edit.html.erb +48 -0
  117. data/lib/generators/calagator/templates/app/views/devise/registrations/new.html.erb +29 -0
  118. data/lib/generators/calagator/templates/config/initializers/01_calagator.rb +34 -6
  119. data/lib/generators/calagator/templates/config/initializers/04_devise.rb +314 -0
  120. data/lib/{calagator.rb → koalagator.rb} +15 -3
  121. data/lib/paper_trail_manager.rb +11 -11
  122. data/lib/theme_reader.rb +1 -1
  123. data/rails_template.rb +6 -6
  124. data/vendor/javascript/@event-calendar--core.js +10 -0
  125. data/vendor/javascript/@event-calendar--day-grid.js +2 -0
  126. data/vendor/javascript/@event-calendar--list.js +2 -0
  127. data/vendor/javascript/ical.js.js +2 -0
  128. metadata +166 -105
  129. data/MIT-LICENSE.txt +0 -23
  130. data/app/models/calagator/event/search_engine/apache_sunspot.rb +0 -106
  131. data/app/models/calagator/venue/search_engine/apache_sunspot.rb +0 -85
  132. data/lib/tasks/sunspot_reindex_calagator.rake +0 -20
  133. data/lib/tasks/sunspot_solr_restart_enhancements.rake +0 -20
  134. data/lib/wait_for_solr.rb +0 -26
@@ -0,0 +1,10 @@
1
+ import{run_all as e,is_function as t,identity as n,tick as r,element as o,text as a,attr as i,insert as l,append as s,listen as c,set_data as u,detach as d,action_destroyer as f,empty as h,ensure_array_like as v,noop as g,destroy_each as m,component_subscribe as p,set_store_value as _,SvelteComponent as y,init as D,safe_not_equal as b,create_component as w,mount_component as E,transition_in as $,transition_out as T,destroy_component as x,group_outros as k,check_outros as C,space as S,construct_svelte_component as L,set_style as R,get_current_component as M}from"svelte/internal";import{getContext as P,setContext as U,beforeUpdate as O,afterUpdate as I}from"svelte";import{derived as F,get as W,writable as B,readable as N}from"svelte/store";function keyEnter(e){return function(t){return t.key==="Enter"||t.key===" "&&!t.preventDefault()?e.call(this,t):void 0}}function setContent(e,t){let n={update(t){typeof t=="string"?e.innerText=t:t?.domNodes?e.replaceChildren(...t.domNodes):t?.html&&(e.innerHTML=t.html)}};n.update(t);return n}function outsideEvent(e,t){const handlePointerDown=n=>{e&&!e.contains(n.target)&&e.dispatchEvent(new CustomEvent(t+"outside",{detail:{jsEvent:n}}))};document.addEventListener(t,handlePointerDown,true);return{destroy(){document.removeEventListener(t,handlePointerDown,true)}}}const V=86400;function createDate(e=void 0){return e!==void 0?e instanceof Date?_fromLocalDate(e):_fromISOString(e):_fromLocalDate(new Date)}function createDuration(e){if(typeof e==="number")e={seconds:e};else if(typeof e==="string"){let t=0,n=2;for(let r of e.split(":",3))t+=parseInt(r,10)*Math.pow(60,n--);e={seconds:t}}else e instanceof Date&&(e={hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds()});let t=e.weeks||e.week||0;return{years:e.years||e.year||0,months:e.months||e.month||0,days:t*7+(e.days||e.day||0),seconds:(e.hours||e.hour||0)*60*60+(e.minutes||e.minute||0)*60+(e.seconds||e.second||0),inWeeks:!!t}}function cloneDate(e){return new Date(e.getTime())}function addDuration(e,t,n=1){e.setUTCFullYear(e.getUTCFullYear()+n*t.years);let r=e.getUTCMonth()+n*t.months;e.setUTCMonth(r);r%=12;r<0&&(r+=12);while(e.getUTCMonth()!==r)subtractDay(e);e.setUTCDate(e.getUTCDate()+n*t.days);e.setUTCSeconds(e.getUTCSeconds()+n*t.seconds);return e}function subtractDuration(e,t,n=1){return addDuration(e,t,-n)}function addDay(e,t=1){e.setUTCDate(e.getUTCDate()+t);return e}function subtractDay(e,t=1){return addDay(e,-t)}function setMidnight(e){e.setUTCHours(0,0,0,0);return e}function toLocalDate(e){return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}function toISOString(e,t=19){return e.toISOString().substring(0,t)}function datesEqual(e,...t){return t.every((t=>e.getTime()===t.getTime()))}function nextClosestDay(e,t){let n=t-e.getUTCDay();e.setUTCDate(e.getUTCDate()+(n>=0?n:n+7));return e}function prevClosestDay(e,t){let n=t-e.getUTCDay();e.setUTCDate(e.getUTCDate()+(n<=0?n:n-7));return e}function noTimePart(e){return typeof e==="string"&&e.length<=10}function copyTime(e,t){e.setUTCHours(t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),0);return e}function toSeconds(e){return e.seconds}function nextDate(e,t){addDuration(e,t);return e}function prevDate(e,t,n){subtractDuration(e,t);if(n.length&&n.length<7)while(n.includes(e.getUTCDay()))subtractDay(e);return e}function _fromLocalDate(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()))}function _fromISOString(e){const t=e.match(/\d+/g);return new Date(Date.UTC(Number(t[0]),Number(t[1])-1,Number(t[2]),Number(t[3]||0),Number(t[4]||0),Number(t[5]||0)))}function debounce(e,t,n){n.update((n=>n.set(t,e)))}function flushDebounce(t){e(t);t.clear()}function task(e,t,n){t??=e;n.has(t)||n.set(t,setTimeout((()=>{n.delete(t);e()})))}function assign(...e){return Object.assign(...e)}function keys(e){return Object.keys(e)}function floor(e){return Math.floor(e)}function ceil(e){return Math.ceil(e)}function min(...e){return Math.min(...e)}function max(...e){return Math.max(...e)}function symbol(){return Symbol("ec")}function isArray(e){return Array.isArray(e)}function createElement(e,t,n,r=[]){let o=document.createElement(e);o.className=t;typeof n=="string"?o.innerText=n:n.domNodes?o.replaceChildren(...n.domNodes):n.html&&(o.innerHTML=n.html);for(let e of r)o.setAttribute(...e);return o}function hasYScroll(e){return e.scrollHeight>e.clientHeight}function rect(e){return e.getBoundingClientRect()}function ancestor(e,t){while(t--)e=e.parentElement;return e}function height(e){return rect(e).height}let A=symbol();function setPayload(e,t){e[A]=t}function hasPayload(e){return!!e?.[A]}function getPayload(e){return e[A]}function getElementWithPayload(e,t,n=document){for(let r of n.elementsFromPoint(e,t)){if(hasPayload(r))return r;if(r.shadowRoot){let n=getElementWithPayload(e,t,r.shadowRoot);if(n)return n}}return null}function createView(e,t,n,r){return{type:e,title:t,currentStart:n.start,currentEnd:n.end,activeStart:r.start,activeEnd:r.end,calendar:void 0}}function toViewWithLocalDates(e){e=assign({},e);e.currentStart=toLocalDate(e.currentStart);e.currentEnd=toLocalDate(e.currentEnd);e.activeStart=toLocalDate(e.activeStart);e.activeEnd=toLocalDate(e.activeEnd);return e}function listView(e){return e.startsWith("list")}function timelineView(e){return e.includes("Timeline")}let H=1;function createEvents(e){return e.map((e=>{let t={id:"id"in e?String(e.id):`{generated-${H++}}`,resourceIds:toArrayProp(e,"resourceId").map(String),allDay:e.allDay??(noTimePart(e.start)&&noTimePart(e.end)),start:createDate(e.start),end:createDate(e.end),title:e.title??"",editable:e.editable,startEditable:e.startEditable,durationEditable:e.durationEditable,display:e.display??"auto",extendedProps:e.extendedProps??{},backgroundColor:e.backgroundColor??e.color,textColor:e.textColor,classNames:toArrayProp(e,"className"),styles:toArrayProp(e,"style")};if(t.allDay){setMidnight(t.start);let e=cloneDate(t.end);setMidnight(t.end);datesEqual(t.end,e)&&!datesEqual(t.end,t.start)||addDay(t.end)}return t}))}function toArrayProp(e,t){let n=e[t+"s"]??e[t]??[];return isArray(n)?n:[n]}function createEventSources(e){return e.map((e=>({events:e.events,url:e.url&&e.url.trimEnd("&")||"",method:e.method&&e.method.toUpperCase()||"GET",extraParams:e.extraParams||{}})))}function createEventChunk(e,t,n){return{start:e.start>t?e.start:t,end:e.end<n?e.end:n,event:e}}function sortEventChunks(e){e.sort(((e,t)=>e.start-t.start||t.event.allDay-e.event.allDay))}function createEventContent(e,n,r,o,a,i){let l=a.formatRange(e.start,n&&e.event.display!=="pointer"?copyTime(cloneDate(e.start),e.end):e.start);let s;r&&(s=t(r)?r({event:toEventWithLocalDates(e.event),timeText:l,view:toViewWithLocalDates(i)}):r);if(s===void 0){let t;switch(e.event.display){case"background":t=[];break;case"pointer":t=[createTimeElement(l,e,o)];break;default:t=[...e.event.allDay?[]:[createTimeElement(l,e,o)],createElement("h4",o.eventTitle,e.event.title)]}s={domNodes:t}}return[l,s]}function createTimeElement(e,t,n){return createElement("time",n.eventTime,e,[["datetime",toISOString(t.start)]])}function createEventClasses(e,n,r){let o=n.classNames;if(e){t(e)&&(e=e({event:toEventWithLocalDates(n),view:toViewWithLocalDates(r)}));o=[...isArray(e)?e:[e],...o]}return o}function toEventWithLocalDates(e){return _cloneEvent(e,toLocalDate)}function cloneEvent(e){return _cloneEvent(e,cloneDate)}function _cloneEvent(e,t){e=assign({},e);e.start=t(e.start);e.end=t(e.end);return e}function prepareEventChunks(e,t){let n={};if(e.length){sortEventChunks(e);let r;for(let o of e){let e=[];let a=setMidnight(cloneDate(o.start));while(o.end>a){if(!t.includes(a.getUTCDay())){e.push(cloneDate(a));if(e.length>1){let e=a.getTime();n[e]?n[e].chunks.push(o):n[e]={sorted:false,chunks:[o]}}}addDay(a)}if(e.length){o.date=e[0];o.days=e.length;o.dates=e;o.start<e[0]&&(o.start=e[0]);let t=addDay(cloneDate(e.at(-1)));o.end>t&&(o.end=t)}else{o.date=setMidnight(cloneDate(o.start));o.days=1;o.dates=[o.date]}r&&datesEqual(r.date,o.date)&&(o.prev=r);r=o}}return n}function repositionEvent(e,t,n){e.top=0;e.prev&&(e.top=e.prev.bottom+1);e.bottom=e.top+n;let r=1;let o=e.date.getTime();if(t[o]){if(!t[o].sorted){t[o].chunks.sort(((e,t)=>e.top-t.top));t[o].sorted=true}for(let n of t[o].chunks)if(e.top<n.bottom&&e.bottom>n.top){let t=n.bottom-e.top+1;r+=t;e.top+=t;e.bottom+=t}}return r}function runReposition(e,t){e.length=t.length;let n=[];for(let t of e)n.push(t?.reposition?.());return n}
2
+ /**
3
+ * Check whether the event intersects with the given date range and resource
4
+ * @param event
5
+ * @param start
6
+ * @param end
7
+ * @param [resource]
8
+ * @return boolean
9
+ */function eventIntersects(e,t,n,r){return e.start<n&&e.end>t&&(r===void 0||e.resourceIds.includes(r.id))}function helperEvent(e){return previewEvent(e)||ghostEvent(e)||pointerEvent(e)}function bgEvent(e){return e==="background"}function previewEvent(e){return e==="preview"}function ghostEvent(e){return e==="ghost"}function pointerEvent(e){return e==="pointer"}function btnTextDay(e){return btnText(e,"day")}function btnTextWeek(e){return btnText(e,"week")}function btnTextMonth(e){return btnText(e,"month")}function btnTextYear(e){return btnText(e,"year")}function btnText(e,t){return{...e,next:"Next "+t,prev:"Previous "+t}}function themeView(e){return t=>({...t,view:e})}function createResources(e){return e.map((e=>({id:String(e.id),title:e.title||"",eventBackgroundColor:e.eventBackgroundColor,eventTextColor:e.eventTextColor})))}function resourceBackgroundColor(e,t){return findResource(e,t)?.eventBackgroundColor}function resourceTextColor(e,t){return findResource(e,t)?.eventTextColor}function findResource(e,t){return t.find((t=>e.resourceIds.includes(t.id)))}function intl(e,n){return F([e,n],(([e,n])=>{let r=t(n)?{format:n}:new Intl.DateTimeFormat(e,n);return{format:e=>r.format(toLocalDate(e))}}))}function intlRange(e,n){return F([e,n],(([e,n])=>{let r;if(t(n))r=n;else{let t=new Intl.DateTimeFormat(e,n);r=(e,n)=>{if(e<=n)return t.formatRange(e,n);{let r=t.formatRangeToParts(n,e);let o="";let a=["startRange","endRange"];let i=[false,false];for(let e of r){let t=a.indexOf(e.source);if(t>=0){if(!i[t]){o+=_getParts(a[1-t],r);i[t]=true}}else o+=e.value}return o}}}return{formatRange:(e,t)=>r(toLocalDate(e),toLocalDate(t))}}))}function _getParts(e,t){let n="";for(let r of t)r.source==e&&(n+=r.value);return n}function viewResources(e){return F([e.resources,e.filterResourcesWithEvents,e._events,e._activeRange],(([e,t,n,r])=>{let o=e;t&&(o=e.filter((e=>{for(let t of n)if(t.display!=="background"&&t.resourceIds.includes(e.id)&&t.start<r.end&&t.end>r.start)return true;return false})));o.length||(o=createResources([{}]));return o}))}function createTimes(e,t,n,r){e=cloneDate(e);let o=t.seconds<3600;let a=[];let i=cloneDate(e);let l=1;addDuration(e,n.min);addDuration(i,n.max);while(e<i){a.push([toISOString(e),r.format(e),a.length&&(l||!o)]);addDuration(e,t);l=1-l}return a}function createSlotTimeLimits(e,n,r,o,a){let i=createDuration(e);let l=createDuration(n);if(r){let e=createDuration(min(toSeconds(i),max(0,toSeconds(l)-V)));let n=createDuration(max(toSeconds(l),toSeconds(e)+V));let s=t(r?.eventFilter)?r.eventFilter:e=>!bgEvent(e.display);e:for(let t of o){let r=addDuration(cloneDate(t),i);let o=addDuration(cloneDate(t),l);let c=addDuration(cloneDate(t),e);let u=addDuration(cloneDate(t),n);for(let d of a)if(!d.allDay&&s(d)&&d.start<u&&d.end>c){if(d.start<r){let n=max((d.start-t)/1e3,toSeconds(e));n<toSeconds(i)&&(i.seconds=n)}if(d.end>o){let e=min((d.end-t)/1e3,toSeconds(n));e>toSeconds(l)&&(l.seconds=e)}if(toSeconds(i)===toSeconds(e)&&toSeconds(l)===toSeconds(n))break e}}}return{min:i,max:l}}function createOptions(e){let t={allDayContent:void 0,allDaySlot:true,buttonText:{today:"today"},customButtons:{},date:new Date,datesSet:void 0,dayHeaderFormat:{weekday:"short",month:"numeric",day:"numeric"},dayHeaderAriaLabelFormat:{dateStyle:"full"},displayEventEnd:true,duration:{weeks:1},events:[],eventAllUpdated:void 0,eventBackgroundColor:void 0,eventTextColor:void 0,eventClassNames:void 0,eventClick:void 0,eventColor:void 0,eventContent:void 0,eventDidMount:void 0,eventMouseEnter:void 0,eventMouseLeave:void 0,eventSources:[],eventTimeFormat:{hour:"numeric",minute:"2-digit"},filterResourcesWithEvents:false,firstDay:0,flexibleSlotTimeLimits:false,headerToolbar:{start:"title",center:"",end:"today prev,next"},height:void 0,hiddenDays:[],highlightedDates:[],lazyFetching:true,loading:void 0,locale:void 0,nowIndicator:false,resourceLabelContent:void 0,resourceLabelDidMount:void 0,resources:[],selectable:false,scrollTime:"06:00:00",slotDuration:"00:30:00",slotEventOverlap:true,slotHeight:24,slotLabelFormat:{hour:"numeric",minute:"2-digit"},slotMaxTime:"24:00:00",slotMinTime:"00:00:00",slotWidth:72,theme:{allDay:"ec-all-day",active:"ec-active",bgEvent:"ec-bg-event",bgEvents:"ec-bg-events",body:"ec-body",button:"ec-button",buttonGroup:"ec-button-group",calendar:"ec",compact:"ec-compact",content:"ec-content",day:"ec-day",dayHead:"ec-day-head",days:"ec-days",event:"ec-event",eventBody:"ec-event-body",eventTime:"ec-event-time",eventTitle:"ec-event-title",events:"ec-events",extra:"ec-extra",handle:"ec-handle",header:"ec-header",hiddenScroll:"ec-hidden-scroll",highlight:"ec-highlight",icon:"ec-icon",line:"ec-line",lines:"ec-lines",nowIndicator:"ec-now-indicator",otherMonth:"ec-other-month",resource:"ec-resource",sidebar:"ec-sidebar",sidebarTitle:"ec-sidebar-title",today:"ec-today",time:"ec-time",title:"ec-title",toolbar:"ec-toolbar",view:"",weekdays:["ec-sun","ec-mon","ec-tue","ec-wed","ec-thu","ec-fri","ec-sat"],withScroll:"ec-with-scroll"},titleFormat:{year:"numeric",month:"short",day:"numeric"},view:void 0,viewDidMount:void 0,views:{}};for(let n of e)n.createOptions?.(t);return t}function createParsers(e){let t={date:e=>setMidnight(createDate(e)),duration:createDuration,events:createEvents,eventSources:createEventSources,hiddenDays:e=>[...new Set(e)],highlightedDates:e=>e.map((e=>setMidnight(createDate(e)))),resources:createResources,scrollTime:createDuration,slotDuration:createDuration,slotMaxTime:createDuration,slotMinTime:createDuration};for(let n of e)n.createParsers?.(t);return t}function diff(e,t){let n=[];for(let r of keys(e))e[r]!==t[r]&&n.push([r,e[r]]);assign(t,e);return n}function dayGrid(e){return F(e.view,(e=>e?.startsWith("dayGrid")))}function activeRange(e){return F([e._currentRange,e.firstDay,e.slotMaxTime,e._dayGrid],(([e,t,n,r])=>{let o=cloneDate(e.start);let a=cloneDate(e.end);if(r){prevClosestDay(o,t);nextClosestDay(a,t)}else if(n.days||n.seconds>V){addDuration(subtractDay(a),n);let e=subtractDay(cloneDate(a));e<o&&(o=e)}return{start:o,end:a}}))}function currentRange(e){return F([e.date,e.duration,e.firstDay],(([e,t,n])=>{let r,o=cloneDate(e);t.months?o.setUTCDate(1):t.inWeeks&&prevClosestDay(o,n);r=addDuration(cloneDate(o),t);return{start:o,end:r}}))}function viewDates(e){return F([e._activeRange,e.hiddenDays],(([t,n])=>{let r=[];let o=setMidnight(cloneDate(t.start));let a=setMidnight(cloneDate(t.end));while(o<a){n.includes(o.getUTCDay())||r.push(cloneDate(o));addDay(o)}if(!r.length&&n.length&&n.length<7){e.date.update((e=>{while(n.includes(e.getUTCDay()))addDay(e);return e}));r=W(e._viewDates)}return r}))}function viewTitle(e){return F([e.date,e._activeRange,e._intlTitle,e._dayGrid],(([e,t,n,r])=>r?n.formatRange(e,e):n.formatRange(t.start,subtractDay(cloneDate(t.end)))))}function view(e){return F([e.view,e._viewTitle,e._currentRange,e._activeRange],(e=>createView(...e)))}function events(e){let n=B([]);let r;let o=0;let a={};F([e.events,e.eventSources,e._activeRange,e._fetchedRange,e.lazyFetching,e.loading],((n,i)=>debounce((()=>{let[e,a,l,s,c,u]=n;if(a.length){if(!s.start||s.start>l.start||s.end<l.end||!c){r&&r.abort();r=new AbortController;t(u)&&!o&&u(true);let stopLoading=()=>{--o===0&&t(u)&&u(false)};let e=[];let failure=e=>stopLoading();let success=t=>{e=e.concat(createEvents(t));i(e);stopLoading()};let n=toISOString(l.start);let c=toISOString(l.end);for(let e of a){if(t(e.events)){let t=e.events({start:toLocalDate(l.start),end:toLocalDate(l.end),startStr:n,endStr:c},success,failure);t!==void 0&&Promise.resolve(t).then(success,failure)}else{let o=t(e.extraParams)?e.extraParams():assign({},e.extraParams);o.start=n;o.end=c;o=new URLSearchParams(o);let a,i=e.url,l={};if(["GET","HEAD"].includes(e.method))i+=(i.includes("?")?"&":"?")+o;else{l["content-type"]="application/x-www-form-urlencoded;charset=UTF-8";a=String(o)}fetch(i,{method:e.method,headers:l,body:a,signal:r.signal,credentials:"same-origin"}).then((e=>e.json())).then(success).catch(failure)}++o}s.start=l.start;s.end=l.end}}else i(e)}),a,e._queue)),[]).subscribe(n.set);return n}function now(){return N(createDate(),(e=>{let t=setInterval((()=>{e(createDate())}),1e3);return()=>clearInterval(t)}))}function today(e){return F(e._now,(e=>setMidnight(cloneDate(e))))}class State{constructor(e,o){e=e||[];let a=createOptions(e);let i=createParsers(e);a=parseOpts(a,i);o=parseOpts(o,i);for(let[e,t]of Object.entries(a))this[e]=B(t);this._queue=B(new Map);this._queue2=B(new Map);this._tasks=new Map;this._auxiliary=B([]);this._dayGrid=dayGrid(this);this._currentRange=currentRange(this);this._activeRange=activeRange(this);this._fetchedRange=B({start:void 0,end:void 0});this._events=events(this);this._now=now();this._today=today(this);this._intlEventTime=intlRange(this.locale,this.eventTimeFormat);this._intlSlotLabel=intl(this.locale,this.slotLabelFormat);this._intlDayHeader=intl(this.locale,this.dayHeaderFormat);this._intlDayHeaderAL=intl(this.locale,this.dayHeaderAriaLabelFormat);this._intlTitle=intlRange(this.locale,this.titleFormat);this._bodyEl=B(void 0);this._scrollable=B(false);this._viewTitle=viewTitle(this);this._viewDates=viewDates(this);this._view=view(this);this._viewComponent=B(void 0);this._interaction=B({});this._iEvents=B([null,null]);this._iClasses=B(n);this._iClass=B(void 0);this._set=(e,t)=>{if(validKey(e,this)){i[e]&&(t=i[e](t));this[e].set(t)}};this._get=e=>validKey(e,this)?W(this[e]):void 0;for(let t of e)t.createStores?.(this);o.view&&this.view.set(o.view);let l=new Set([...keys(a.views),...keys(o.views??{})]);for(let e of l){let n=mergeOpts(a,a.views[e]??{});let i=mergeOpts(n,o,o.views?.[e]??{});let l=i.component;filterOpts(i,this);for(let e of keys(i)){let{set:r,_set:o=r,...a}=this[e];this[e]={set:["buttonText","theme"].includes(e)?a=>{if(t(a)){let t=a(n[e]);i[e]=t;r(r===o?t:a)}else{i[e]=a;r(a)}}:t=>{i[e]=t;r(t)},_set:o,...a}}this.view.subscribe((n=>{if(n===e){this._viewComponent.set(l);t(i.viewDidMount)&&r().then((()=>i.viewDidMount(W(this._view))));for(let e of keys(i))this[e]._set(i[e])}}))}}}function parseOpts(e,t){let n={...e};for(let e of keys(t))e in n&&(n[e]=t[e](n[e]));if(e.views){n.views={};for(let r of keys(e.views))n.views[r]=parseOpts(e.views[r],t)}return n}function mergeOpts(...e){let n={};for(let r of e){let e={};for(let o of["buttonText","theme"])t(r[o])&&(e[o]=r[o](n[o]));n={...n,...r,...e}}return n}function filterOpts(e,t){keys(e).filter((e=>!validKey(e,t)||e=="view")).forEach((t=>delete e[t]))}function validKey(e,t){return t.hasOwnProperty(e)&&e[0]!=="_"}function get_each_context$2(e,t,n){const r=e.slice();r[25]=t[n];return r}function create_if_block_5(e){let t;let n=e[5][e[25]]+"";let r;let f;let h;let v;function click_handler_1(){return e[22](e[25])}return{c(){t=o("button");r=a(n);i(t,"class",f=e[3].button+(e[7]===e[25]?" "+e[3].active:"")+" ec-"+e[25])},m(e,n){l(e,t,n);s(t,r);if(!h){v=c(t,"click",click_handler_1);h=true}},p(o,a){e=o;a&33&&n!==(n=e[5][e[25]]+"")&&u(r,n);a&137&&f!==(f=e[3].button+(e[7]===e[25]?" "+e[3].active:"")+" ec-"+e[25])&&i(t,"class",f)},d(e){e&&d(t);h=false;v()}}}function create_if_block_4(n){let r;let a;let s;let u;let h;return{c(){r=o("button");i(r,"class",a=n[3].button+" ec-"+n[25]+(n[6][n[25]].active?" "+n[3].active:""))},m(e,o){l(e,r,o);if(!u){h=[c(r,"click",(function(){t(n[6][n[25]].click)&&n[6][n[25]].click.apply(this,arguments)})),f(s=setContent.call(null,r,n[6][n[25]].text))];u=true}},p(e,o){n=e;o&73&&a!==(a=n[3].button+" ec-"+n[25]+(n[6][n[25]].active?" "+n[3].active:""))&&i(r,"class",a);s&&t(s.update)&&o&65&&s.update.call(null,n[6][n[25]].text)},d(t){t&&d(r);u=false;e(h)}}}function create_if_block_3(e){let t;let n=e[5][e[25]]+"";let r;let f;let h;let v;return{c(){t=o("button");r=a(n);i(t,"class",f=e[3].button+" ec-"+e[25]);t.disabled=e[1]},m(n,o){l(n,t,o);s(t,r);if(!h){v=c(t,"click",e[21]);h=true}},p(e,o){o&33&&n!==(n=e[5][e[25]]+"")&&u(r,n);o&9&&f!==(f=e[3].button+" ec-"+e[25])&&i(t,"class",f);o&2&&(t.disabled=e[1])},d(e){e&&d(t);h=false;v()}}}function create_if_block_2(e){let t;let n;let r;let a;let u;let f;let h;let v;return{c(){t=o("button");n=o("i");i(n,"class",r=e[3].icon+" ec-"+e[25]);i(t,"class",a=e[3].button+" ec-"+e[25]);i(t,"aria-label",u=e[5].next);i(t,"title",f=e[5].next)},m(r,o){l(r,t,o);s(t,n);if(!h){v=c(t,"click",e[19]);h=true}},p(e,o){o&9&&r!==(r=e[3].icon+" ec-"+e[25])&&i(n,"class",r);o&9&&a!==(a=e[3].button+" ec-"+e[25])&&i(t,"class",a);o&32&&u!==(u=e[5].next)&&i(t,"aria-label",u);o&32&&f!==(f=e[5].next)&&i(t,"title",f)},d(e){e&&d(t);h=false;v()}}}function create_if_block_1(e){let t;let n;let r;let a;let u;let f;let h;let v;return{c(){t=o("button");n=o("i");i(n,"class",r=e[3].icon+" ec-"+e[25]);i(t,"class",a=e[3].button+" ec-"+e[25]);i(t,"aria-label",u=e[5].prev);i(t,"title",f=e[5].prev)},m(r,o){l(r,t,o);s(t,n);if(!h){v=c(t,"click",e[18]);h=true}},p(e,o){o&9&&r!==(r=e[3].icon+" ec-"+e[25])&&i(n,"class",r);o&9&&a!==(a=e[3].button+" ec-"+e[25])&&i(t,"class",a);o&32&&u!==(u=e[5].prev)&&i(t,"aria-label",u);o&32&&f!==(f=e[5].prev)&&i(t,"title",f)},d(e){e&&d(t);h=false;v()}}}function create_if_block$1(e){let n;let r;let a;let s;let c;return{c(){n=o("h2");i(n,"class",r=e[3].title)},m(t,r){l(t,n,r);if(!s){c=f(a=setContent.call(null,n,e[4]));s=true}},p(e,o){o&8&&r!==(r=e[3].title)&&i(n,"class",r);a&&t(a.update)&&o&16&&a.update.call(null,e[4])},d(e){e&&d(n);s=false;c()}}}function create_each_block$2(e){let t;function select_block_type(e,t){return e[25]=="title"?create_if_block$1:e[25]=="prev"?create_if_block_1:e[25]=="next"?create_if_block_2:e[25]=="today"?create_if_block_3:e[6][e[25]]?create_if_block_4:e[25]!=""?create_if_block_5:void 0}let n=select_block_type(e);let r=n&&n(e);return{c(){r&&r.c();t=h()},m(e,n){r&&r.m(e,n);l(e,t,n)},p(e,o){if(n===(n=select_block_type(e))&&r)r.p(e,o);else{r&&r.d(1);r=n&&n(e);if(r){r.c();r.m(t.parentNode,t)}}},d(e){e&&d(t);r&&r.d(e)}}}function create_fragment$3(e){let t;let n=v(e[0]);let r=[];for(let t=0;t<n.length;t+=1)r[t]=create_each_block$2(get_each_context$2(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=h()},m(e,n){for(let t=0;t<r.length;t+=1)r[t]&&r[t].m(e,n);l(e,t,n)},p(e,[o]){if(o&917759){n=v(e[0]);let a;for(a=0;a<n.length;a+=1){const i=get_each_context$2(e,n,a);if(r[a])r[a].p(i,o);else{r[a]=create_each_block$2(i);r[a].c();r[a].m(t.parentNode,t)}}for(;a<r.length;a+=1)r[a].d(1);r.length=n.length}},i:g,o:g,d(e){e&&d(t);m(r,e)}}}function instance$3(e,t,n){let r;let o;let a;let i;let l;let s;let c;let u;let d;let{buttons:f}=t;let{_currentRange:h,_viewTitle:v,buttonText:g,customButtons:m,date:y,duration:D,hiddenDays:b,theme:w,view:E}=P("state");p(e,h,(e=>n(20,i=e)));p(e,v,(e=>n(4,s=e)));p(e,g,(e=>n(5,c=e)));p(e,m,(e=>n(6,u=e)));p(e,y,(e=>n(2,o=e)));p(e,D,(e=>n(23,r=e)));p(e,b,(e=>n(24,a=e)));p(e,w,(e=>n(3,l=e)));p(e,E,(e=>n(7,d=e)));let $,T=setMidnight(createDate());function prev(){_(y,o=prevDate(o,r,a),o)}function next(){_(y,o=nextDate(o,r),o)}const click_handler=()=>_(y,o=cloneDate(T),o);const click_handler_1=e=>_(E,d=e,d);e.$$set=e=>{"buttons"in e&&n(0,f=e.buttons)};e.$$.update=()=>{e.$$.dirty&1048576&&n(1,$=T>=i.start&&T<i.end||null)};return[f,$,o,l,s,c,u,d,h,v,g,m,y,D,b,w,E,T,prev,next,i,click_handler,click_handler_1]}class Buttons extends y{constructor(e){super();D(this,e,instance$3,create_fragment$3,b,{buttons:0})}}function get_each_context$1(e,t,n){const r=e.slice();r[5]=t[n];return r}function get_each_context_1(e,t,n){const r=e.slice();r[8]=t[n];return r}function create_else_block(e){let t;let n;t=new Buttons({props:{buttons:e[8]}});return{c(){w(t.$$.fragment)},m(e,r){E(t,e,r);n=true},p(e,n){const r={};n&1&&(r.buttons=e[8]);t.$set(r)},i(e){if(!n){$(t.$$.fragment,e);n=true}},o(e){T(t.$$.fragment,e);n=false},d(e){x(t,e)}}}function create_if_block(e){let t;let n;let r;let a;n=new Buttons({props:{buttons:e[8]}});return{c(){t=o("div");w(n.$$.fragment);i(t,"class",r=e[1].buttonGroup)},m(e,r){l(e,t,r);E(n,t,null);a=true},p(e,o){const l={};o&1&&(l.buttons=e[8]);n.$set(l);(!a||o&2&&r!==(r=e[1].buttonGroup))&&i(t,"class",r)},i(e){if(!a){$(n.$$.fragment,e);a=true}},o(e){T(n.$$.fragment,e);a=false},d(e){e&&d(t);x(n)}}}function create_each_block_1(e){let t;let n;let r;let o;const a=[create_if_block,create_else_block];const i=[];function select_block_type(e,t){return e[8].length>1?0:1}t=select_block_type(e);n=i[t]=a[t](e);return{c(){n.c();r=h()},m(e,n){i[t].m(e,n);l(e,r,n);o=true},p(e,o){let l=t;t=select_block_type(e);if(t===l)i[t].p(e,o);else{k();T(i[l],1,1,(()=>{i[l]=null}));C();n=i[t];if(n)n.p(e,o);else{n=i[t]=a[t](e);n.c()}$(n,1);n.m(r.parentNode,r)}},i(e){if(!o){$(n);o=true}},o(e){T(n);o=false},d(e){e&&d(r);i[t].d(e)}}}function create_each_block$1(e){let t;let n;let r;let a;let c=v(e[0][e[5]]);let u=[];for(let t=0;t<c.length;t+=1)u[t]=create_each_block_1(get_each_context_1(e,c,t));const out=e=>T(u[e],1,1,(()=>{u[e]=null}));return{c(){t=o("div");for(let e=0;e<u.length;e+=1)u[e].c();n=S();i(t,"class",r="ec-"+e[5])},m(e,r){l(e,t,r);for(let e=0;e<u.length;e+=1)u[e]&&u[e].m(t,null);s(t,n);a=true},p(e,o){if(o&3){c=v(e[0][e[5]]);let r;for(r=0;r<c.length;r+=1){const a=get_each_context_1(e,c,r);if(u[r]){u[r].p(a,o);$(u[r],1)}else{u[r]=create_each_block_1(a);u[r].c();$(u[r],1);u[r].m(t,n)}}k();for(r=c.length;r<u.length;r+=1)out(r);C()}(!a||o&1&&r!==(r="ec-"+e[5]))&&i(t,"class",r)},i(e){if(!a){for(let e=0;e<c.length;e+=1)$(u[e]);a=true}},o(e){u=u.filter(Boolean);for(let e=0;e<u.length;e+=1)T(u[e]);a=false},d(e){e&&d(t);m(u,e)}}}function create_fragment$2(e){let t;let n;let r;let a=v(keys(e[0]));let s=[];for(let t=0;t<a.length;t+=1)s[t]=create_each_block$1(get_each_context$1(e,a,t));const out=e=>T(s[e],1,1,(()=>{s[e]=null}));return{c(){t=o("nav");for(let e=0;e<s.length;e+=1)s[e].c();i(t,"class",n=e[1].toolbar)},m(e,n){l(e,t,n);for(let e=0;e<s.length;e+=1)s[e]&&s[e].m(t,null);r=true},p(e,[o]){if(o&3){a=v(keys(e[0]));let n;for(n=0;n<a.length;n+=1){const r=get_each_context$1(e,a,n);if(s[n]){s[n].p(r,o);$(s[n],1)}else{s[n]=create_each_block$1(r);s[n].c();$(s[n],1);s[n].m(t,null)}}k();for(n=a.length;n<s.length;n+=1)out(n);C()}(!r||o&2&&n!==(n=e[1].toolbar))&&i(t,"class",n)},i(e){if(!r){for(let e=0;e<a.length;e+=1)$(s[e]);r=true}},o(e){s=s.filter(Boolean);for(let e=0;e<s.length;e+=1)T(s[e]);r=false},d(e){e&&d(t);m(s,e)}}}function instance$2(e,t,n){let r;let o;let{headerToolbar:a,theme:i}=P("state");p(e,a,(e=>n(4,r=e)));p(e,i,(e=>n(1,o=e)));let l={start:[],center:[],end:[]};e.$$.update=()=>{if(e.$$.dirty&17)for(let e of keys(l))n(0,l[e]=r[e].split(" ").map((e=>e.split(","))),l)};return[l,o,a,i,r]}class Toolbar extends y{constructor(e){super();D(this,e,instance$2,create_fragment$2,b,{})}}function get_each_context(e,t,n){const r=e.slice();r[11]=t[n];return r}function create_each_block(e){let t;let n;let r;var o=e[11];function switch_props(e,t){return{}}o&&(t=L(o,switch_props()));return{c(){t&&w(t.$$.fragment);n=h()},m(e,o){t&&E(t,e,o);l(e,n,o);r=true},p(e,r){if(r&1&&o!==(o=e[11])){if(t){k();const e=t;T(e.$$.fragment,1,0,(()=>{x(e,1)}));C()}if(o){t=L(o,switch_props());w(t.$$.fragment);$(t.$$.fragment,1);E(t,n.parentNode,n)}else t=null}},i(e){if(!r){t&&$(t.$$.fragment,e);r=true}},o(e){t&&T(t.$$.fragment,e);r=false},d(e){e&&d(n);t&&x(t,e)}}}function create_fragment$1(e){let t;let n;let r=v(e[0]);let o=[];for(let t=0;t<r.length;t+=1)o[t]=create_each_block(get_each_context(e,r,t));const out=e=>T(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=h()},m(e,r){for(let t=0;t<o.length;t+=1)o[t]&&o[t].m(e,r);l(e,t,r);n=true},p(e,[n]){if(n&1){r=v(e[0]);let a;for(a=0;a<r.length;a+=1){const i=get_each_context(e,r,a);if(o[a]){o[a].p(i,n);$(o[a],1)}else{o[a]=create_each_block(i);o[a].c();$(o[a],1);o[a].m(t.parentNode,t)}}k();for(a=r.length;a<o.length;a+=1)out(a);C()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)$(o[e]);n=true}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)T(o[e]);n=false},d(e){e&&d(t);m(o,e)}}}function instance$1(e,n,r){let o;let a;let i;let l;let{datesSet:s,_auxiliary:c,_activeRange:u,_queue:d,_view:f}=P("state");p(e,s,(e=>r(7,a=e)));p(e,c,(e=>r(0,l=e)));p(e,u,(e=>r(5,i=e)));p(e,f,(e=>r(6,o=e)));let h={};function runDatesSet(e){t(a)&&debounce((()=>a({start:toLocalDate(e.start),end:toLocalDate(e.end),startStr:toISOString(e.start),endStr:toISOString(e.end),view:toViewWithLocalDates(o)})),h,d)}e.$$.update=()=>{e.$$.dirty&32&&runDatesSet(i)};return[l,s,c,u,f,i]}class Auxiliary extends y{constructor(e){super();D(this,e,instance$1,create_fragment$1,b,{})}}function create_fragment(e){let t;let n;let r;let a;let u;let f;let h;let v;let g;let m;let p;n=new Toolbar({});var _=e[5];function switch_props(e,t){return{}}_&&(a=L(_,switch_props()));v=new Auxiliary({});return{c(){t=o("div");w(n.$$.fragment);r=S();a&&w(a.$$.fragment);h=S();w(v.$$.fragment);i(t,"class",u=e[1].calendar+" "+e[1].view+(e[0]?" "+e[1].withScroll:"")+(e[2]?" "+e[1][e[2]]:""));i(t,"role",f=listView(e[4])?"list":"table");R(t,"height",e[3])},m(o,i){l(o,t,i);E(n,t,null);s(t,r);a&&E(a,t,null);l(o,h,i);E(v,o,i);g=true;if(!m){p=c(window,"resize",e[20]);m=true}},p(e,n){if(n[0]&32&&_!==(_=e[5])){if(a){k();const e=a;T(e.$$.fragment,1,0,(()=>{x(e,1)}));C()}if(_){a=L(_,switch_props());w(a.$$.fragment);$(a.$$.fragment,1);E(a,t,null)}else a=null}(!g||n[0]&7&&u!==(u=e[1].calendar+" "+e[1].view+(e[0]?" "+e[1].withScroll:"")+(e[2]?" "+e[1][e[2]]:"")))&&i(t,"class",u);(!g||n[0]&16&&f!==(f=listView(e[4])?"list":"table"))&&i(t,"role",f);n[0]&8&&R(t,"height",e[3])},i(e){if(!g){$(n.$$.fragment,e);a&&$(a.$$.fragment,e);$(v.$$.fragment,e);g=true}},o(e){T(n.$$.fragment,e);a&&T(a.$$.fragment,e);T(v.$$.fragment,e);g=false},d(e){if(e){d(t);d(h)}x(n);a&&x(a);x(v,e);m=false;p()}}}function instance(e,t,n){let r;let o;let a;let i;let l;let s;let c;let u;let d;let f;let h;let v;let g;let m;let{plugins:y=[]}=t;let{options:D={}}=t;let b=M();let w=new State(y,D);U("state",w);let{_viewComponent:E,_bodyEl:$,_interaction:T,_iClass:k,_events:C,_queue:S,_queue2:L,_tasks:R,_scrollable:P,date:F,duration:B,hiddenDays:N,height:V,theme:A,view:H}=w;p(e,E,(e=>n(5,m=e)));p(e,$,(e=>n(37,r=e)));p(e,T,(e=>n(43,u=e)));p(e,k,(e=>n(2,h=e)));p(e,C,(e=>n(44,d=e)));p(e,S,(e=>n(39,i=e)));p(e,L,(e=>n(38,a=e)));p(e,P,(e=>n(0,o=e)));p(e,F,(e=>n(42,c=e)));p(e,B,(e=>n(41,s=e)));p(e,N,(e=>n(40,l=e)));p(e,V,(e=>n(3,v=e)));p(e,A,(e=>n(1,f=e)));p(e,H,(e=>n(4,g=e)));let q={...D};function setOption(e,t){w._set(e,t);return this}function getOption(e){let t=w._get(e);return t instanceof Date?toLocalDate(t):t}function refetchEvents(){w._fetchedRange.set({start:void 0,end:void 0});return this}function getEvents(){return d.map(toEventWithLocalDates)}function getEventById(e){for(let t of d)if(t.id==e)return toEventWithLocalDates(t);return null}function addEvent(e){e=createEvents([e])[0];d.push(e);C.set(d);return e}function updateEvent(e){for(let t of d)if(t.id==e.id){e=createEvents([e])[0];assign(t,e);C.set(d);return e}return null}function removeEventById(e){let t=d.findIndex((t=>t.id==e));if(t>=0){d.splice(t,1);C.set(d)}return this}function getView(){return toViewWithLocalDates(W(w._view))}function unselect(){u.action?.unselect();return this}function dateFromPoint(e,t){let n=getElementWithPayload(e,t);if(n){let r=getPayload(n)(e,t);r.date=toLocalDate(r.date);return r}return null}function destroy(){x(b,true)}function next(){_(F,c=nextDate(c,s),c);return this}function prev(){_(F,c=prevDate(c,s,l),c);return this}O((()=>{flushDebounce(i)}));I((()=>{flushDebounce(a);task(recheckScrollable,null,R)}));function recheckScrollable(){r&&_(P,o=hasYScroll(r),o)}e.$$set=e=>{"plugins"in e&&n(21,y=e.plugins);"options"in e&&n(22,D=e.options)};e.$$.update=()=>{if(e.$$.dirty[0]&4194304)for(let[e,t]of diff(D,q))setOption(e,t)};return[o,f,h,v,g,m,E,$,T,k,C,S,L,P,F,B,N,V,A,H,recheckScrollable,y,D,setOption,getOption,refetchEvents,getEvents,getEventById,addEvent,updateEvent,removeEventById,getView,unselect,dateFromPoint,destroy,next,prev]}class Calendar extends y{constructor(e){super();D(this,e,instance,create_fragment,b,{plugins:21,options:22,setOption:23,getOption:24,refetchEvents:25,getEvents:26,getEventById:27,addEvent:28,updateEvent:29,removeEventById:30,getView:31,unselect:32,dateFromPoint:33,destroy:34,next:35,prev:36},null,[-1,-1])}get setOption(){return this.$$.ctx[23]}get getOption(){return this.$$.ctx[24]}get refetchEvents(){return this.$$.ctx[25]}get getEvents(){return this.$$.ctx[26]}get getEventById(){return this.$$.ctx[27]}get addEvent(){return this.$$.ctx[28]}get updateEvent(){return this.$$.ctx[29]}get removeEventById(){return this.$$.ctx[30]}get getView(){return this.$$.ctx[31]}get unselect(){return this.$$.ctx[32]}get dateFromPoint(){return this.$$.ctx[33]}get destroy(){return this.$$.ctx[34]}get next(){return this.$$.ctx[35]}get prev(){return this.$$.ctx[36]}}export{V as DAY_IN_SECONDS,addDay,addDuration,ancestor,assign,bgEvent,btnTextDay,btnTextMonth,btnTextWeek,btnTextYear,ceil,cloneDate,cloneEvent,copyTime,createDate,createDuration,createElement,createEventChunk,createEventClasses,createEventContent,createEventSources,createEvents,createResources,createSlotTimeLimits,createTimes,createView,datesEqual,debounce,Calendar as default,eventIntersects,floor,flushDebounce,getElementWithPayload,getPayload,ghostEvent,hasPayload,hasYScroll,height,helperEvent,intl,intlRange,isArray,keyEnter,keys,listView,max,min,nextClosestDay,nextDate,noTimePart,outsideEvent,pointerEvent,prepareEventChunks,prevClosestDay,prevDate,previewEvent,rect,repositionEvent,resourceBackgroundColor,resourceTextColor,runReposition,setContent,setMidnight,setPayload,sortEventChunks,subtractDay,subtractDuration,symbol,task,themeView,timelineView,toEventWithLocalDates,toISOString,toLocalDate,toSeconds,toViewWithLocalDates,viewResources};
10
+
@@ -0,0 +1,2 @@
1
+ import{derived as e,writable as t}from"svelte/store";import{cloneDate as l,subtractDay as n,addDay as o,setContent as i,keyEnter as a,helperEvent as r,toEventWithLocalDates as s,toViewWithLocalDates as c,task as u,rect as d,ancestor as f,repositionEvent as h,height as p,max as $,resourceBackgroundColor as g,resourceTextColor as _,bgEvent as m,createEventClasses as y,createEventContent as v,toISOString as k,outsideEvent as b,datesEqual as w,assign as x,createEventChunk as C,runReposition as D,setPayload as E,debounce as M,eventIntersects as T,prepareEventChunks as H,btnTextMonth as P,themeView as z,intl as F}from"@event-calendar/core";import{element as U,space as B,attr as L,insert as S,append as j,action_destroyer as A,is_function as G,detach as O,ensure_array_like as q,noop as V,destroy_each as W,component_subscribe as N,SvelteComponent as I,init as J,safe_not_equal as K,construct_svelte_component as Q,create_component as R,mount_component as X,listen as Y,group_outros as Z,transition_out as ee,destroy_component as te,check_outros as le,transition_in as ne,run_all as oe,binding_callbacks as ie,empty as ae,text as re,stop_propagation as se,update_keyed_each as ce,outro_and_destroy_block as ue,set_store_value as de,bubble as fe}from"svelte/internal";import{getContext as he,onMount as pe,afterUpdate as $e,tick as ge}from"svelte";function days(t){return e([t.date,t.firstDay,t.hiddenDays],(([e,t,i])=>{let a=[];let r=l(e);let s=7;while(r.getUTCDay()!==t&&s){n(r);--s}for(let e=0;e<7;++e){i.includes(r.getUTCDay())||a.push(l(r));o(r)}return a}))}function get_each_context$4(e,t,l){const n=e.slice();n[8]=t[l];return n}function create_each_block$4(e){let t;let l;let n;let o;let a;let r;let s;let c;return{c(){t=U("div");l=U("span");a=B();L(l,"aria-label",n=e[2].format(e[8]));L(t,"class",r=e[0].day+" "+e[0].weekdays?.[e[8].getUTCDay()]);L(t,"role","columnheader")},m(n,r){S(n,t,r);j(t,l);j(t,a);if(!s){c=A(o=i.call(null,l,e[3].format(e[8])));s=true}},p(i,a){e=i;a&6&&n!==(n=e[2].format(e[8]))&&L(l,"aria-label",n);o&&G(o.update)&&a&10&&o.update.call(null,e[3].format(e[8]));a&3&&r!==(r=e[0].day+" "+e[0].weekdays?.[e[8].getUTCDay()])&&L(t,"class",r)},d(e){e&&O(t);s=false;c()}}}function create_fragment$6(e){let t;let l;let n;let o;let i;let a;let r;let s=q(e[1]);let c=[];for(let t=0;t<s.length;t+=1)c[t]=create_each_block$4(get_each_context$4(e,s,t));return{c(){t=U("div");l=U("div");for(let e=0;e<c.length;e+=1)c[e].c();o=B();i=U("div");L(l,"class",n=e[0].days);L(l,"role","row");L(i,"class",a=e[0].hiddenScroll);L(t,"class",r=e[0].header)},m(e,n){S(e,t,n);j(t,l);for(let e=0;e<c.length;e+=1)c[e]&&c[e].m(l,null);j(t,o);j(t,i)},p(e,[o]){if(o&15){s=q(e[1]);let t;for(t=0;t<s.length;t+=1){const n=get_each_context$4(e,s,t);if(c[t])c[t].p(n,o);else{c[t]=create_each_block$4(n);c[t].c();c[t].m(l,null)}}for(;t<c.length;t+=1)c[t].d(1);c.length=s.length}o&1&&n!==(n=e[0].days)&&L(l,"class",n);o&1&&a!==(a=e[0].hiddenScroll)&&L(i,"class",a);o&1&&r!==(r=e[0].header)&&L(t,"class",r)},i:V,o:V,d(e){e&&O(t);W(c,e)}}}function instance$5(e,t,l){let n;let o;let i;let a;let{theme:r,_intlDayHeader:s,_intlDayHeaderAL:c,_days:u}=he("state");N(e,r,(e=>l(0,n=e)));N(e,s,(e=>l(3,a=e)));N(e,c,(e=>l(2,i=e)));N(e,u,(e=>l(1,o=e)));return[n,o,i,a,r,s,c,u]}class Header extends I{constructor(e){super();J(this,e,instance$5,create_fragment$6,K,{})}}function create_fragment$5(e){let t;let l;let n;let o;let s;let c;let u;let d;let f;let h;let p;var $=e[8].resizer;function switch_props(e,t){return{props:{event:e[0]}}}if($){c=Q($,switch_props(e));c.$on("pointerdown",(function(){G(e[32](e[8],"x"))&&e[32](e[8],"x").apply(this,arguments)}))}return{c(){t=U("article");l=U("div");s=B();c&&R(c.$$.fragment);L(l,"class",n=e[2].eventBody);L(t,"class",e[4]);L(t,"style",e[5]);L(t,"role",u=e[7]?"button":void 0);L(t,"tabindex",d=e[7]?0:void 0)},m(n,u){S(n,t,u);j(t,l);j(t,s);c&&X(c,t,null);e[51](t);f=true;if(!h){p=[A(o=i.call(null,l,e[6])),Y(t,"click",(function(){G(e[7]||void 0)&&(e[7]||void 0).apply(this,arguments)})),Y(t,"keydown",(function(){G(e[7]&&a(e[7]))&&(e[7]&&a(e[7])).apply(this,arguments)})),Y(t,"mouseenter",(function(){G(e[31](e[9],e[1]))&&e[31](e[9],e[1]).apply(this,arguments)})),Y(t,"mouseleave",(function(){G(e[31](e[10],e[1]))&&e[31](e[10],e[1]).apply(this,arguments)})),Y(t,"pointerdown",(function(){G(!r(e[1])&&e[32](e[8]))&&(!r(e[1])&&e[32](e[8])).apply(this,arguments)}))];h=true}},p(i,a){e=i;(!f||a[0]&4&&n!==(n=e[2].eventBody))&&L(l,"class",n);o&&G(o.update)&&a[0]&64&&o.update.call(null,e[6]);if(a[0]&256&&$!==($=e[8].resizer)){if(c){Z();const e=c;ee(e.$$.fragment,1,0,(()=>{te(e,1)}));le()}if($){c=Q($,switch_props(e));c.$on("pointerdown",(function(){G(e[32](e[8],"x"))&&e[32](e[8],"x").apply(this,arguments)}));R(c.$$.fragment);ne(c.$$.fragment,1);X(c,t,null)}else c=null}else if($){const t={};a[0]&1&&(t.event=e[0]);c.$set(t)}(!f||a[0]&16)&&L(t,"class",e[4]);(!f||a[0]&32)&&L(t,"style",e[5]);(!f||a[0]&128&&u!==(u=e[7]?"button":void 0))&&L(t,"role",u);(!f||a[0]&128&&d!==(d=e[7]?0:void 0))&&L(t,"tabindex",d)},i(e){if(!f){c&&ne(c.$$.fragment,e);f=true}},o(e){c&&ee(c.$$.fragment,e);f=false},d(l){l&&O(t);c&&te(c);e[51](null);h=false;oe(p)}}}function instance$4(e,t,l){let n;let o;let i;let a;let k;let b;let w;let x;let C;let D;let E;let M;let T;let H;let P;let z;let F;let U;let B;let L;let{chunk:S}=t;let{longChunks:j={}}=t;let{inPopup:A=false}=t;let{dates:O=[]}=t;let{dayMaxEvents:q,displayEventEnd:V,eventAllUpdated:W,eventBackgroundColor:I,eventTextColor:J,eventClick:K,eventColor:Q,eventContent:R,eventClassNames:X,eventDidMount:Y,eventMouseEnter:Z,eventMouseLeave:ee,resources:te,theme:le,_view:ne,_intlEventTime:oe,_interaction:ae,_iClasses:re,_hiddenEvents:se,_popupDate:ce,_tasks:ue}=he("state");N(e,q,(e=>l(54,i=e)));N(e,V,(e=>l(44,M=e)));N(e,W,(e=>l(56,w=e)));N(e,I,(e=>l(50,U=e)));N(e,J,(e=>l(47,P=e)));N(e,K,(e=>l(40,n=e)));N(e,Q,(e=>l(49,F=e)));N(e,R,(e=>l(43,E=e)));N(e,X,(e=>l(45,T=e)));N(e,Y,(e=>l(57,x=e)));N(e,Z,(e=>l(9,B=e)));N(e,ee,(e=>l(10,L=e)));N(e,te,(e=>l(48,z=e)));N(e,le,(e=>l(2,D=e)));N(e,ne,(e=>l(41,b=e)));N(e,oe,(e=>l(42,C=e)));N(e,ae,(e=>l(8,k=e)));N(e,re,(e=>l(46,H=e)));N(e,se,(e=>l(53,o=e)));N(e,ce,(e=>l(55,a=e)));let de;let fe;let ge;let _e;let me;let ye;let ve=1;let ke=false;let be;let we;pe((()=>{G(x)&&x({event:s(fe),timeText:ye,el:de,view:c(b)})}));$e((()=>{G(w)&&!r(be)&&u((()=>w({view:c(b)})),"eau",ue)}));function createHandler(e,t){return!r(t)&&G(e)?t=>e({event:s(fe),el:de,jsEvent:t,view:c(b)}):void 0}function createDragHandler(e,t){return e.action?e=>k.action.drag(fe,e,t,A?a:null,[d(de).top-d(f(de,1)).top,O]):void 0}function reposition(){if(de){l(38,ve=h(S,j,p(de)));i===true?hide():l(39,ke=false)}}function hide(){let e=f(de,2);let t=p(e)-p(e.firstElementChild)-footHeight(e);l(39,ke=S.bottom>t);let n=false;for(let e of S.dates){let t=o[e.getTime()];if(t){let e=t.size;ke?t.add(S.event):t.delete(S.event);e!==t.size&&(n=true)}}n&&se.set(o)}function footHeight(e){let t=0;for(let l=0;l<S.days;++l){t=$(t,p(e.lastElementChild));e=e.nextElementSibling;if(!e)break}return t}function article_binding(e){ie[e?"unshift":"push"]((()=>{de=e;l(3,de)}))}e.$$set=e=>{"chunk"in e&&l(33,S=e.chunk);"longChunks"in e&&l(34,j=e.longChunks);"inPopup"in e&&l(35,A=e.inPopup);"dates"in e&&l(36,O=e.dates)};e.$$.update=()=>{e.$$.dirty[1]&4&&l(0,fe=S.event);if(e.$$.dirty[0]&39|e.$$.dirty[1]&1033604){l(1,be=fe.display);let e=fe.backgroundColor||g(fe,z)||U||F;let t=fe.textColor||_(fe,z)||P;if(m(be))l(5,_e=`width:calc(${S.days*100}% + ${S.days-1}px);`);else{let e=ve;if(fe._margin){let[t,l]=fe._margin;S.date>=l[0]&&S.date<=l.at(-1)&&(e=t)}l(5,_e=`width:calc(${S.days*100}% + ${7*(S.days-1)}px);margin-top:${e}px;`)}e&&l(5,_e+=`background-color:${e};`);t&&l(5,_e+=`color:${t};`);ke&&l(5,_e+="visibility:hidden;");l(5,_e+=fe.styles.join(";"));l(4,ge=[m(be)?D.bgEvent:D.event,...H([],fe),...y(T,fe,b)].join(" "))}e.$$.dirty[0]&4|e.$$.dirty[1]&15364&&l(6,[ye,me]=v(S,M,E,D,C,b),me);e.$$.dirty[0]&2|e.$$.dirty[1]&512&&l(7,we=createHandler(n,be))};return[fe,be,D,de,ge,_e,me,we,k,B,L,q,V,W,I,J,K,Q,R,X,Y,Z,ee,te,le,ne,oe,ae,re,se,ce,createHandler,createDragHandler,S,j,A,O,reposition,ve,ke,n,b,C,E,M,T,H,P,z,F,U,article_binding]}class Event extends I{constructor(e){super();J(this,e,instance$4,create_fragment$5,K,{chunk:33,longChunks:34,inPopup:35,dates:36,reposition:37},null,[-1,-1])}get reposition(){return this.$$.ctx[37]}}function get_each_context$3(e,t,l){const n=e.slice();n[20]=t[l];return n}function create_each_block$3(e,t){let l;let n;let o;n=new Event({props:{chunk:t[20],inPopup:true}});return{key:e,first:null,c(){l=ae();R(n.$$.fragment);this.first=l},m(e,t){S(e,l,t);X(n,e,t);o=true},p(e,l){t=e;const o={};l&1&&(o.chunk=t[20]);n.$set(o)},i(e){if(!o){ne(n.$$.fragment,e);o=true}},o(e){ee(n.$$.fragment,e);o=false},d(e){e&&O(l);te(n,e)}}}function create_fragment$4(e){let t;let l;let n;let o;let r;let s;let c;let u;let d;let f;let h;let p;let $=[];let g=new Map;let _;let m;let y;let v;let w;let x=q(e[0]);const get_key=e=>e[20].event;for(let t=0;t<x.length;t+=1){let l=get_each_context$3(e,x,t);let n=get_key(l);g.set(n,$[t]=create_each_block$3(n,l))}return{c(){t=U("div");l=U("div");n=U("time");s=B();c=U("a");u=re("×");h=B();p=U("div");for(let e=0;e<$.length;e+=1)$[e].c();L(n,"datetime",o=k(e[3],10));L(c,"role","button");L(c,"tabindex","0");L(c,"aria-label",d=e[6].close);L(l,"class",f=e[4].dayHead);L(p,"class",_=e[4].events);L(t,"class",m=e[4].popup);L(t,"style",e[2])},m(o,d){S(o,t,d);j(t,l);j(l,n);j(l,s);j(l,c);j(c,u);j(t,h);j(t,p);for(let e=0;e<$.length;e+=1)$[e]&&$[e].m(p,null);e[16](t);y=true;if(!v){w=[A(r=i.call(null,n,e[5].format(e[3]))),Y(c,"click",se(e[13])),Y(c,"keydown",a(e[13])),A(b.call(null,t,"pointerdown")),Y(t,"pointerdown",se(e[15])),Y(t,"pointerdownoutside",e[14])];v=true}},p(e,[i]){(!y||i&8&&o!==(o=k(e[3],10)))&&L(n,"datetime",o);r&&G(r.update)&&i&40&&r.update.call(null,e[5].format(e[3]));(!y||i&64&&d!==(d=e[6].close))&&L(c,"aria-label",d);(!y||i&16&&f!==(f=e[4].dayHead))&&L(l,"class",f);if(i&1){x=q(e[0]);Z();$=ce($,i,get_key,1,e,x,g,p,ue,create_each_block$3,null,get_each_context$3);le()}(!y||i&16&&_!==(_=e[4].events))&&L(p,"class",_);(!y||i&16&&m!==(m=e[4].popup))&&L(t,"class",m);(!y||i&4)&&L(t,"style",e[2])},i(e){if(!y){for(let e=0;e<x.length;e+=1)ne($[e]);y=true}},o(e){for(let e=0;e<$.length;e+=1)ee($[e]);y=false},d(l){l&&O(t);for(let e=0;e<$.length;e+=1)$[e].d();e[16](null);v=false;oe(w)}}}function instance$3(e,t,l){let n;let o;let i;let a;let r;let s;let{buttonText:c,theme:u,_interaction:h,_intlDayPopover:p,_popupDate:$,_popupChunks:g}=he("state");N(e,c,(e=>l(6,s=e)));N(e,u,(e=>l(4,a=e)));N(e,h,(e=>l(17,n=e)));N(e,p,(e=>l(5,r=e)));N(e,$,(e=>l(3,o=e)));N(e,g,(e=>l(0,i=e)));let _;let m="";function position(){let e=f(_,1);let t=f(e,3);let n=d(_);let o=d(e);let i=d(t);l(2,m="");let a;if(n.width>=i.width){a=i.left-o.left;let e=o.right-i.right;l(2,m+=`right:${e}px;`)}else{a=(o.width-n.width)/2;o.left+a<i.left?a=i.left-o.left:o.left+a+n.width>i.right&&(a=i.right-o.left-n.width)}l(2,m+=`left:${a}px;`);let r;if(n.height>=i.height){r=i.top-o.top;let e=o.bottom-i.bottom;l(2,m+=`bottom:${e}px;`)}else{r=(o.height-n.height)/2;o.top+r<i.top?r=i.top-o.top:o.top+r+n.height>i.bottom&&(r=i.bottom-o.top-n.height)}l(2,m+=`top:${r}px;`)}function reposition(){if(_){l(2,m="");ge().then((()=>{i.length?position():close()}))}}function close(e){de($,o=null,o)}function handlePointerDownOutside(e){close();n.action?.noClick()}function pointerdown_handler(t){fe.call(this,e,t)}function div2_binding(e){ie[e?"unshift":"push"]((()=>{_=e;l(1,_)}))}e.$$.update=()=>{e.$$.dirty&1&&i&&reposition()};return[i,_,m,o,a,r,s,c,u,h,p,$,g,close,handlePointerDownOutside,pointerdown_handler,div2_binding]}class Popup extends I{constructor(e){super();J(this,e,instance$3,create_fragment$4,K,{})}}function get_each_context$2(e,t,l){const n=e.slice();n[44]=t[l];n[45]=t;n[46]=l;return n}function get_each_context_1(e,t,l){const n=e.slice();n[44]=t[l];return n}function create_each_block_1(e,t){let l;let n;let o;n=new Event({props:{chunk:t[44]}});return{key:e,first:null,c(){l=ae();R(n.$$.fragment);this.first=l},m(e,t){S(e,l,t);X(n,e,t);o=true},p(e,l){t=e;const o={};l[0]&256&&(o.chunk=t[44]);n.$set(o)},i(e){if(!o){ne(n.$$.fragment,e);o=true}},o(e){ee(n.$$.fragment,e);o=false},d(e){e&&O(l);te(n,e)}}}function create_if_block_3(e){let t;let l;let n;let o;l=new Event({props:{chunk:e[2][2]}});return{c(){t=U("div");R(l.$$.fragment);L(t,"class",n=e[14].events)},m(e,n){S(e,t,n);X(l,t,null);o=true},p(e,i){const a={};i[0]&4&&(a.chunk=e[2][2]);l.$set(a);(!o||i[0]&16384&&n!==(n=e[14].events))&&L(t,"class",n)},i(e){if(!o){ne(l.$$.fragment,e);o=true}},o(e){ee(l.$$.fragment,e);o=false},d(e){e&&O(t);te(l)}}}function create_if_block_2(e){let t;let l;let n;let o;l=new Event({props:{chunk:e[2][0]}});return{c(){t=U("div");R(l.$$.fragment);L(t,"class",n=e[14].events+" "+e[14].preview)},m(e,n){S(e,t,n);X(l,t,null);o=true},p(e,i){const a={};i[0]&4&&(a.chunk=e[2][0]);l.$set(a);(!o||i[0]&16384&&n!==(n=e[14].events+" "+e[14].preview))&&L(t,"class",n)},i(e){if(!o){ne(l.$$.fragment,e);o=true}},o(e){ee(l.$$.fragment,e);o=false},d(e){e&&O(t);te(l)}}}function create_each_block$2(e,t){let l;let n;let o=t[46];let i;const assign_event=()=>t[38](n,o);const unassign_event=()=>t[38](null,o);let a={chunk:t[44],longChunks:t[1],dates:t[3]};n=new Event({props:a});assign_event();return{key:e,first:null,c(){l=ae();R(n.$$.fragment);this.first=l},m(e,t){S(e,l,t);X(n,e,t);i=true},p(e,l){t=e;if(o!==t[46]){unassign_event();o=t[46];assign_event()}const i={};l[0]&32&&(i.chunk=t[44]);l[0]&2&&(i.longChunks=t[1]);l[0]&8&&(i.dates=t[3]);n.$set(i)},i(e){if(!i){ne(n.$$.fragment,e);i=true}},o(e){ee(n.$$.fragment,e);i=false},d(e){e&&O(l);unassign_event();te(n,e)}}}function create_if_block_1(e){let t;let l;t=new Popup({});return{c(){R(t.$$.fragment)},m(e,n){X(t,e,n);l=true},i(e){if(!l){ne(t.$$.fragment,e);l=true}},o(e){ee(t.$$.fragment,e);l=false},d(e){te(t,e)}}}function create_if_block(e){let t;let l;let n;let o;return{c(){t=U("a");L(t,"role","button");L(t,"tabindex","0");L(t,"aria-haspopup","true")},m(r,s){S(r,t,s);if(!n){o=[Y(t,"click",se(e[27])),Y(t,"keydown",a(e[27])),Y(t,"pointerdown",se(e[37])),A(l=i.call(null,t,e[12]))];n=true}},p(e,t){l&&G(l.update)&&t[0]&4096&&l.update.call(null,e[12])},d(e){e&&O(t);n=false;oe(o)}}}function create_fragment$3(e){let t;let l;let n;let o;let a;let r;let s;let c=[];let u=new Map;let d;let f;let h=e[2][2]&&w(e[2][2].date,e[0]);let p;let $=e[2][0]&&w(e[2][0].date,e[0]);let g;let _;let m=[];let y=new Map;let v;let b;let x;let C;let D;let E;let M;let T;let H;let P=q(e[8]);const get_key=e=>e[44].event;for(let t=0;t<P.length;t+=1){let l=get_each_context_1(e,P,t);let n=get_key(l);u.set(n,c[t]=create_each_block_1(n,l))}let z=h&&create_if_block_3(e);let F=$&&create_if_block_2(e);let V=q(e[5]);const get_key_1=e=>e[44].event;for(let t=0;t<V.length;t+=1){let l=get_each_context$2(e,V,t);let n=get_key_1(l);y.set(n,m[t]=create_each_block$2(n,l))}let W=e[7]&&create_if_block_1();let N=e[6].size&&create_if_block(e);return{c(){t=U("div");l=U("time");r=B();s=U("div");for(let e=0;e<c.length;e+=1)c[e].c();f=B();z&&z.c();p=B();F&&F.c();g=B();_=U("div");for(let e=0;e<m.length;e+=1)m[e].c();b=B();W&&W.c();x=B();C=U("div");N&&N.c();L(l,"class",n=e[14].dayHead);L(l,"datetime",o=k(e[0],10));L(s,"class",d=e[14].bgEvents);L(_,"class",v=e[14].events);L(C,"class",D=e[14].dayFoot);L(t,"class",E=e[14].day+" "+e[14].weekdays?.[e[0].getUTCDay()]+(e[9]?" "+e[14].today:"")+(e[10]?" "+e[14].otherMonth:"")+(e[11]?" "+e[14].highlight:""));L(t,"role","cell")},m(n,o){S(n,t,o);j(t,l);j(t,r);j(t,s);for(let e=0;e<c.length;e+=1)c[e]&&c[e].m(s,null);j(t,f);z&&z.m(t,null);j(t,p);F&&F.m(t,null);j(t,g);j(t,_);for(let e=0;e<m.length;e+=1)m[e]&&m[e].m(_,null);j(t,b);W&&W.m(t,null);j(t,x);j(t,C);N&&N.m(C,null);e[39](t);M=true;if(!T){H=[A(a=i.call(null,l,e[16].format(e[0]))),Y(t,"pointerleave",(function(){G(e[15].pointer?.leave)&&e[15].pointer?.leave.apply(this,arguments)})),Y(t,"pointerdown",(function(){G(e[15].action?.select)&&e[15].action?.select.apply(this,arguments)}))];T=true}},p(i,r){e=i;(!M||r[0]&16384&&n!==(n=e[14].dayHead))&&L(l,"class",n);(!M||r[0]&1&&o!==(o=k(e[0],10)))&&L(l,"datetime",o);a&&G(a.update)&&r[0]&65537&&a.update.call(null,e[16].format(e[0]));if(r[0]&256){P=q(e[8]);Z();c=ce(c,r,get_key,1,e,P,u,s,ue,create_each_block_1,null,get_each_context_1);le()}(!M||r[0]&16384&&d!==(d=e[14].bgEvents))&&L(s,"class",d);r[0]&5&&(h=e[2][2]&&w(e[2][2].date,e[0]));if(h)if(z){z.p(e,r);r[0]&5&&ne(z,1)}else{z=create_if_block_3(e);z.c();ne(z,1);z.m(t,p)}else if(z){Z();ee(z,1,1,(()=>{z=null}));le()}r[0]&5&&($=e[2][0]&&w(e[2][0].date,e[0]));if($)if(F){F.p(e,r);r[0]&5&&ne(F,1)}else{F=create_if_block_2(e);F.c();ne(F,1);F.m(t,g)}else if(F){Z();ee(F,1,1,(()=>{F=null}));le()}if(r[0]&8234){V=q(e[5]);Z();m=ce(m,r,get_key_1,1,e,V,y,_,ue,create_each_block$2,null,get_each_context$2);le()}(!M||r[0]&16384&&v!==(v=e[14].events))&&L(_,"class",v);if(e[7])if(W)r[0]&128&&ne(W,1);else{W=create_if_block_1();W.c();ne(W,1);W.m(t,x)}else if(W){Z();ee(W,1,1,(()=>{W=null}));le()}if(e[6].size)if(N)N.p(e,r);else{N=create_if_block(e);N.c();N.m(C,null)}else if(N){N.d(1);N=null}(!M||r[0]&16384&&D!==(D=e[14].dayFoot))&&L(C,"class",D);(!M||r[0]&19969&&E!==(E=e[14].day+" "+e[14].weekdays?.[e[0].getUTCDay()]+(e[9]?" "+e[14].today:"")+(e[10]?" "+e[14].otherMonth:"")+(e[11]?" "+e[14].highlight:"")))&&L(t,"class",E)},i(e){if(!M){for(let e=0;e<P.length;e+=1)ne(c[e]);ne(z);ne(F);for(let e=0;e<V.length;e+=1)ne(m[e]);ne(W);M=true}},o(e){for(let e=0;e<c.length;e+=1)ee(c[e]);ee(z);ee(F);for(let e=0;e<m.length;e+=1)ee(m[e]);ee(W);M=false},d(l){l&&O(t);for(let e=0;e<c.length;e+=1)c[e].d();z&&z.d();F&&F.d();for(let e=0;e<m.length;e+=1)m[e].d();W&&W.d();N&&N.d();e[39](null);T=false;oe(H)}}}function instance$2(e,t,n){let i;let a;let r;let s;let c;let u;let d;let f;let h;let p;let{date:$}=t;let{chunks:g}=t;let{bgChunks:_}=t;let{longChunks:m}=t;let{iChunks:y=[]}=t;let{dates:v}=t;let{date:k,dayMaxEvents:b,highlightedDates:M,moreLinkContent:T,theme:H,_hiddenEvents:P,_intlDayCell:z,_popupDate:F,_popupChunks:U,_today:B,_interaction:L,_queue:S}=he("state");N(e,k,(e=>n(35,u=e)));N(e,M,(e=>n(34,c=e)));N(e,T,(e=>n(32,r=e)));N(e,H,(e=>n(14,f=e)));N(e,P,(e=>n(33,s=e)));N(e,z,(e=>n(16,p=e)));N(e,F,(e=>n(31,a=e)));N(e,U,(e=>n(40,i=e)));N(e,B,(e=>n(36,d=e)));N(e,L,(e=>n(15,h=e)));let j;let A,O;let q;let V;let W;let I=new Set;let J="";let K;let Q=[];function showMore(){de(F,a=$,a)}function setPopupChunks(){let e=o(l($));let t=A.concat(m[$.getTime()]?.chunks||[]);de(U,i=t.map((t=>x({},t,C(t.event,$,e),{days:1,dates:[$]}))).sort(((e,t)=>e.top-t.top)),i)}function reposition(){D(Q,A)}function pointerdown_handler(t){fe.call(this,e,t)}function event_binding(e,t){ie[e?"unshift":"push"]((()=>{Q[t]=e;n(13,Q)}))}function div3_binding(e){ie[e?"unshift":"push"]((()=>{j=e;n(4,j)}))}e.$$set=e=>{"date"in e&&n(0,$=e.date);"chunks"in e&&n(28,g=e.chunks);"bgChunks"in e&&n(29,_=e.bgChunks);"longChunks"in e&&n(1,m=e.longChunks);"iChunks"in e&&n(2,y=e.iChunks);"dates"in e&&n(3,v=e.dates)};e.$$.update=()=>{if(e.$$.dirty[0]&805306465){n(5,A=[]);n(8,O=_.filter((e=>w(e.date,$))));I.clear();n(6,I),n(29,_),n(0,$),n(28,g),n(5,A);for(let e of g)w(e.date,$)&&A.push(e)}e.$$.dirty[0]&65&&de(P,s[$.getTime()]=I,s);e.$$.dirty[0]&1|e.$$.dirty[1]&32&&n(9,q=w($,d));if(e.$$.dirty[0]&1|e.$$.dirty[1]&24){n(10,V=$.getUTCMonth()!==u.getUTCMonth());n(11,W=c.some((e=>w(e,$))))}if(e.$$.dirty[0]&64|e.$$.dirty[1]&6&&s&&I.size){let e="+"+I.size+" more";n(12,J=r?G(r)?r({num:I.size,text:e}):r:e)}e.$$.dirty[0]&1|e.$$.dirty[1]&1&&n(7,K=a&&w($,a));e.$$.dirty[0]&162&&K&&m&&A&&ge().then(setPopupChunks);e.$$.dirty[0]&17&&j&&E(j,(()=>({allDay:true,date:$,resource:void 0,dayEl:j})))};return[$,m,y,v,j,A,I,K,O,q,V,W,J,Q,f,h,p,k,M,T,H,P,z,F,U,B,L,showMore,g,_,reposition,a,r,s,c,u,d,pointerdown_handler,event_binding,div3_binding]}class Day extends I{constructor(e){super();J(this,e,instance$2,create_fragment$3,K,{date:0,chunks:28,bgChunks:29,longChunks:1,iChunks:2,dates:3,reposition:30},null,[-1,-1])}get reposition(){return this.$$.ctx[30]}}function get_each_context$1(e,t,l){const n=e.slice();n[22]=t[l];n[23]=t;n[24]=l;return n}function create_each_block$1(e){let t;let l=e[24];let n;const assign_day=()=>e[19](t,l);const unassign_day=()=>e[19](null,l);let o={date:e[22],chunks:e[1],bgChunks:e[2],longChunks:e[3],iChunks:e[4],dates:e[0]};t=new Day({props:o});assign_day();return{c(){R(t.$$.fragment)},m(e,l){X(t,e,l);n=true},p(e,n){if(l!==e[24]){unassign_day();l=e[24];assign_day()}const o={};n&1&&(o.date=e[22]);n&2&&(o.chunks=e[1]);n&4&&(o.bgChunks=e[2]);n&8&&(o.longChunks=e[3]);n&16&&(o.iChunks=e[4]);n&1&&(o.dates=e[0]);t.$set(o)},i(e){if(!n){ne(t.$$.fragment,e);n=true}},o(e){ee(t.$$.fragment,e);n=false},d(e){unassign_day();te(t,e)}}}function create_fragment$2(e){let t;let l;let n;let o;let i;let a=q(e[0]);let r=[];for(let t=0;t<a.length;t+=1)r[t]=create_each_block$1(get_each_context$1(e,a,t));const out=e=>ee(r[e],1,1,(()=>{r[e]=null}));return{c(){t=U("div");for(let e=0;e<r.length;e+=1)r[e].c();L(t,"class",l=e[6].days);L(t,"role","row")},m(l,a){S(l,t,a);for(let e=0;e<r.length;e+=1)r[e]&&r[e].m(t,null);n=true;if(!o){i=Y(window,"resize",e[12]);o=true}},p(e,[o]){if(o&63){a=q(e[0]);let l;for(l=0;l<a.length;l+=1){const n=get_each_context$1(e,a,l);if(r[l]){r[l].p(n,o);ne(r[l],1)}else{r[l]=create_each_block$1(n);r[l].c();ne(r[l],1);r[l].m(t,null)}}Z();for(l=a.length;l<r.length;l+=1)out(l);le()}(!n||o&64&&l!==(l=e[6].days))&&L(t,"class",l)},i(e){if(!n){for(let e=0;e<a.length;e+=1)ne(r[e]);n=true}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)ee(r[e]);n=false},d(e){e&&O(t);W(r,e);o=false;i()}}}function instance$1(e,t,n){let i;let a;let r;let s;let c;let{dates:u}=t;let{_events:d,_iEvents:f,_queue2:h,_hiddenEvents:p,hiddenDays:$,theme:g}=he("state");N(e,d,(e=>n(18,s=e)));N(e,f,(e=>n(17,r=e)));N(e,p,(e=>n(15,i=e)));N(e,$,(e=>n(16,a=e)));N(e,g,(e=>n(6,c=e)));let _,y,v,k=[];let b;let w;let x=[];let E={};function reposition(){M((()=>D(x,u)),E,h)}function day_binding(e,t){ie[e?"unshift":"push"]((()=>{x[t]=e;n(5,x)}))}e.$$set=e=>{"dates"in e&&n(0,u=e.dates)};e.$$.update=()=>{if(e.$$.dirty&1){n(13,b=u[0]);n(14,w=o(l(u.at(-1))))}if(e.$$.dirty&352262){n(1,_=[]);n(2,y=[]);for(let e of s)if(T(e,b,w)){let t=C(e,b,w);m(e.display)?e.allDay&&y.push(t):_.push(t)}H(y,a);n(3,v=H(_,a));reposition()}e.$$.dirty&221184&&n(4,k=r.map((e=>{let t;if(e&&T(e,b,w)){t=C(e,b,w);H([t],a)}else t=null;return t})));e.$$.dirty&32768&&i&&ge().then(reposition)};return[u,_,y,v,k,x,c,d,f,p,$,g,reposition,b,w,i,a,r,s,day_binding]}class Week extends I{constructor(e){super();J(this,e,instance$1,create_fragment$2,K,{dates:0})}}function get_each_context(e,t,l){const n=e.slice();n[15]=t[l];return n}function create_each_block(e){let t;let l;t=new Week({props:{dates:e[15]}});return{c(){R(t.$$.fragment)},m(e,n){X(t,e,n);l=true},p(e,l){const n={};l&1&&(n.dates=e[15]);t.$set(n)},i(e){if(!l){ne(t.$$.fragment,e);l=true}},o(e){ee(t.$$.fragment,e);l=false},d(e){te(t,e)}}}function create_fragment$1(e){let t;let l;let n;let o;let i;let a=q(e[0]);let r=[];for(let t=0;t<a.length;t+=1)r[t]=create_each_block(get_each_context(e,a,t));const out=e=>ee(r[e],1,1,(()=>{r[e]=null}));return{c(){t=U("div");l=U("div");for(let e=0;e<r.length;e+=1)r[e].c();L(l,"class",n=e[2].content);L(t,"class",o=e[2].body+(e[1]===true?" "+e[2].uniform:""))},m(n,o){S(n,t,o);j(t,l);for(let e=0;e<r.length;e+=1)r[e]&&r[e].m(l,null);e[13](t);i=true},p(e,[s]){if(s&1){a=q(e[0]);let t;for(t=0;t<a.length;t+=1){const n=get_each_context(e,a,t);if(r[t]){r[t].p(n,s);ne(r[t],1)}else{r[t]=create_each_block(n);r[t].c();ne(r[t],1);r[t].m(l,null)}}Z();for(t=a.length;t<r.length;t+=1)out(t);le()}(!i||s&4&&n!==(n=e[2].content))&&L(l,"class",n);(!i||s&6&&o!==(o=e[2].body+(e[1]===true?" "+e[2].uniform:"")))&&L(t,"class",o)},i(e){if(!i){for(let e=0;e<a.length;e+=1)ne(r[e]);i=true}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)ee(r[e]);i=false},d(l){l&&O(t);W(r,l);e[13](null)}}}function instance(e,t,l){let n;let o;let i;let a;let r;let s;let{_bodyEl:c,_viewDates:u,_hiddenEvents:d,dayMaxEvents:f,hiddenDays:h,theme:p}=he("state");N(e,c,(e=>l(3,s=e)));N(e,u,(e=>l(11,n=e)));N(e,d,(e=>l(14,i=e)));N(e,f,(e=>l(1,o=e)));N(e,h,(e=>l(12,a=e)));N(e,p,(e=>l(2,r=e)));let $;let g;function div1_binding(e){ie[e?"unshift":"push"]((()=>{s=e;c.set(s)}))}e.$$.update=()=>{if(e.$$.dirty&7171){l(0,$=[]);l(10,g=7-a.length);de(d,i={},i);for(let e=0;e<n.length/g;++e){let t=[];for(let l=0;l<g;++l)t.push(n[e*g+l]);$.push(t)}}};return[$,o,r,s,c,u,d,f,h,p,g,n,a,div1_binding]}class Body extends I{constructor(e){super();J(this,e,instance,create_fragment$1,K,{})}}function create_fragment(e){let t;let l;let n;let o;t=new Header({});n=new Body({});return{c(){R(t.$$.fragment);l=B();R(n.$$.fragment)},m(e,i){X(t,e,i);S(e,l,i);X(n,e,i);o=true},p:V,i(e){if(!o){ne(t.$$.fragment,e);ne(n.$$.fragment,e);o=true}},o(e){ee(t.$$.fragment,e);ee(n.$$.fragment,e);o=false},d(e){e&&O(l);te(t,e);te(n,e)}}}class View extends I{constructor(e){super();J(this,e,null,create_fragment,K,{})}}var _e={createOptions(e){e.dayMaxEvents=false;e.dayCellFormat={day:"numeric"};e.dayPopoverFormat={month:"long",day:"numeric",year:"numeric"};e.moreLinkContent=void 0;e.buttonText.dayGridMonth="month";e.buttonText.close="Close";e.theme.uniform="ec-uniform";e.theme.dayFoot="ec-day-foot";e.theme.popup="ec-popup";e.view="dayGridMonth";e.views.dayGridMonth={buttonText:P,component:View,dayHeaderFormat:{weekday:"short"},dayHeaderAriaLabelFormat:{weekday:"long"},displayEventEnd:false,duration:{months:1},theme:z("ec-day-grid ec-month-view"),titleFormat:{year:"numeric",month:"long"}}},createStores(e){e._days=days(e);e._intlDayCell=F(e.locale,e.dayCellFormat);e._intlDayPopover=F(e.locale,e.dayPopoverFormat);e._hiddenEvents=t({});e._popupDate=t(null);e._popupChunks=t([])}};export{_e as default};
2
+
@@ -0,0 +1,2 @@
1
+ import{setContent as e,keyEnter as t,toEventWithLocalDates as l,toViewWithLocalDates as n,task as i,resourceBackgroundColor as a,resourceTextColor as o,createEventClasses as c,createEventContent as s,addDay as r,cloneDate as u,bgEvent as d,eventIntersects as f,createEventChunk as h,sortEventChunks as m,datesEqual as v,toISOString as $,setPayload as y,btnTextDay as _,themeView as p,btnTextWeek as g,btnTextMonth as k,btnTextYear as b,intl as w}from"@event-calendar/core";import{element as x,space as D,attr as E,insert as C,append as T,action_destroyer as S,listen as B,is_function as M,noop as H,detach as L,run_all as V,component_subscribe as j,binding_callbacks as F,SvelteComponent as N,init as A,safe_not_equal as U,ensure_array_like as W,group_outros as Y,update_keyed_each as O,outro_and_destroy_block as q,check_outros as z,transition_in as G,transition_out as I,empty as J,create_component as K,mount_component as P,destroy_component as Q,destroy_each as R}from"svelte/internal";import{getContext as X,onMount as Z,afterUpdate as ee}from"svelte";function create_fragment$3(l){let n;let i;let a;let o;let c;let s;let r;let u;let d;let f;let h;return{c(){n=x("article");i=x("div");o=D();c=x("div");E(i,"class",a=l[0].eventTag);E(i,"style",l[3]);E(c,"class",s=l[0].eventBody);E(n,"class",l[2]);E(n,"role",u=l[5]?"button":void 0);E(n,"tabindex",d=l[5]?0:void 0)},m(a,s){C(a,n,s);T(n,i);T(n,o);T(n,c);l[38](n);if(!f){h=[S(r=e.call(null,c,l[4])),B(n,"click",(function(){M(l[5])&&l[5].apply(this,arguments)})),B(n,"keydown",(function(){M(l[5]&&t(l[5]))&&(l[5]&&t(l[5])).apply(this,arguments)})),B(n,"mouseenter",(function(){M(l[25](l[6]))&&l[25](l[6]).apply(this,arguments)})),B(n,"mouseleave",(function(){M(l[25](l[7]))&&l[25](l[7]).apply(this,arguments)})),B(n,"pointerdown",(function(){M(l[8].action?.noAction)&&l[8].action?.noAction.apply(this,arguments)}))];f=true}},p(e,t){l=e;t[0]&1&&a!==(a=l[0].eventTag)&&E(i,"class",a);t[0]&8&&E(i,"style",l[3]);t[0]&1&&s!==(s=l[0].eventBody)&&E(c,"class",s);r&&M(r.update)&&t[0]&16&&r.update.call(null,l[4]);t[0]&4&&E(n,"class",l[2]);t[0]&32&&u!==(u=l[5]?"button":void 0)&&E(n,"role",u);t[0]&32&&d!==(d=l[5]?0:void 0)&&E(n,"tabindex",d)},i:H,o:H,d(e){e&&L(n);l[38](null);f=false;V(h)}}}function instance$2(e,t,r){let u;let d;let f;let h;let m;let v;let $;let y;let _;let p;let g;let k;let b;let w;let x;let D;let{chunk:E}=t;let{displayEventEnd:C,eventAllUpdated:T,eventBackgroundColor:S,eventTextColor:B,eventColor:H,eventContent:L,eventClassNames:V,eventClick:N,eventDidMount:A,eventMouseEnter:U,eventMouseLeave:W,resources:Y,theme:O,_view:q,_intlEventTime:z,_interaction:G,_tasks:I}=X("state");j(e,C,(e=>r(32,y=e)));j(e,T,(e=>r(40,f=e)));j(e,S,(e=>r(37,b=e)));j(e,B,(e=>r(34,p=e)));j(e,H,(e=>r(36,k=e)));j(e,L,(e=>r(31,$=e)));j(e,V,(e=>r(33,_=e)));j(e,N,(e=>r(28,u=e)));j(e,A,(e=>r(41,h=e)));j(e,U,(e=>r(6,w=e)));j(e,W,(e=>r(7,x=e)));j(e,Y,(e=>r(35,g=e)));j(e,O,(e=>r(0,v=e)));j(e,q,(e=>r(29,d=e)));j(e,z,(e=>r(30,m=e)));j(e,G,(e=>r(8,D=e)));let J;let K;let P;let Q;let R;let te;let le;Z((()=>{M(h)&&h({event:l(K),timeText:te,el:J,view:n(d)})}));ee((()=>{M(f)&&i((()=>f({view:n(d)})),"eau",I)}));function createHandler(e){return M(e)?t=>e({event:l(K),el:J,jsEvent:t,view:n(d)}):void 0}function article_binding(e){F[e?"unshift":"push"]((()=>{J=e;r(1,J)}))}e.$$set=e=>{"chunk"in e&&r(26,E=e.chunk)};e.$$.update=()=>{e.$$.dirty[0]&67108864&&r(27,K=E.event);if(e.$$.dirty[0]&671088649|e.$$.dirty[1]&124){r(3,Q="");let e=K.backgroundColor||a(K,g)||b||k;e&&r(3,Q=`background-color:${e};`);let t=K.textColor||o(K,g)||p;t&&r(3,Q+=`color:${t};`);r(3,Q+=K.styles.join(";"));r(2,P=[v.event,...c(_,K,d)].join(" "))}e.$$.dirty[0]&1677721601|e.$$.dirty[1]&3&&r(4,[te,R]=s(E,y,$,v,m,d),R);e.$$.dirty[0]&268435456&&r(5,le=createHandler(u))};return[v,J,P,Q,R,le,w,x,D,C,T,S,B,H,L,V,N,A,U,W,Y,O,q,z,G,createHandler,E,K,u,d,m,$,y,_,p,g,k,b,article_binding]}class Event extends N{constructor(e){super();A(this,e,instance$2,create_fragment$3,U,{chunk:26},null,[-1,-1])}}function get_each_context$1(e,t,l){const n=e.slice();n[21]=t[l];return n}function create_if_block$1(t){let l;let n;let i;let a;let o;let c;let s;let r;let u;let d;let f=[];let h=new Map;let m;let v;let $;let y;let _=W(t[2]);const get_key=e=>e[21].event;for(let e=0;e<_.length;e+=1){let l=get_each_context$1(t,_,e);let n=get_key(l);h.set(n,f[e]=create_each_block$1(n,l))}return{c(){l=x("div");n=x("h4");i=x("time");o=D();c=x("time");d=D();for(let e=0;e<f.length;e+=1)f[e].c();E(i,"datetime",t[5]);E(c,"class",s=t[6].daySide);E(c,"datetime",t[5]);E(n,"class",u=t[6].dayHead);E(l,"class",m=t[6].day+" "+t[6].weekdays?.[t[0].getUTCDay()]+(t[3]?" "+t[6].today:"")+(t[4]?" "+t[6].highlight:""));E(l,"role","listitem")},m(s,u){C(s,l,u);T(l,n);T(n,i);T(n,o);T(n,c);T(l,d);for(let e=0;e<f.length;e+=1)f[e]&&f[e].m(l,null);t[20](l);v=true;if(!$){y=[S(a=e.call(null,i,t[8].format(t[0]))),S(r=e.call(null,c,t[9].format(t[0]))),B(l,"pointerdown",(function(){M(t[7].action?.select)&&t[7].action?.select.apply(this,arguments)}))];$=true}},p(e,o){t=e;(!v||o&32)&&E(i,"datetime",t[5]);a&&M(a.update)&&o&257&&a.update.call(null,t[8].format(t[0]));(!v||o&64&&s!==(s=t[6].daySide))&&E(c,"class",s);(!v||o&32)&&E(c,"datetime",t[5]);r&&M(r.update)&&o&513&&r.update.call(null,t[9].format(t[0]));(!v||o&64&&u!==(u=t[6].dayHead))&&E(n,"class",u);if(o&4){_=W(t[2]);Y();f=O(f,o,get_key,1,t,_,h,l,q,create_each_block$1,null,get_each_context$1);z()}(!v||o&89&&m!==(m=t[6].day+" "+t[6].weekdays?.[t[0].getUTCDay()]+(t[3]?" "+t[6].today:"")+(t[4]?" "+t[6].highlight:"")))&&E(l,"class",m)},i(e){if(!v){for(let e=0;e<_.length;e+=1)G(f[e]);v=true}},o(e){for(let e=0;e<f.length;e+=1)I(f[e]);v=false},d(e){e&&L(l);for(let e=0;e<f.length;e+=1)f[e].d();t[20](null);$=false;V(y)}}}function create_each_block$1(e,t){let l;let n;let i;n=new Event({props:{chunk:t[21]}});return{key:e,first:null,c(){l=J();K(n.$$.fragment);this.first=l},m(e,t){C(e,l,t);P(n,e,t);i=true},p(e,l){t=e;const i={};l&4&&(i.chunk=t[21]);n.$set(i)},i(e){if(!i){G(n.$$.fragment,e);i=true}},o(e){I(n.$$.fragment,e);i=false},d(e){e&&L(l);Q(n,e)}}}function create_fragment$2(e){let t;let l;let n=e[2].length&&create_if_block$1(e);return{c(){n&&n.c();t=J()},m(e,i){n&&n.m(e,i);C(e,t,i);l=true},p(e,[l]){if(e[2].length)if(n){n.p(e,l);l&4&&G(n,1)}else{n=create_if_block$1(e);n.c();G(n,1);n.m(t.parentNode,t)}else if(n){Y();I(n,1,1,(()=>{n=null}));z()}},i(e){if(!l){G(n);l=true}},o(e){I(n);l=false},d(e){e&&L(t);n&&n.d(e)}}}function instance$1(e,t,l){let n;let i;let a;let o;let c;let s;let _;let{date:p}=t;let{_events:g,_interaction:k,_intlListDay:b,_intlListDaySide:w,_today:x,highlightedDates:D,theme:E}=X("state");j(e,g,(e=>l(19,a=e)));j(e,k,(e=>l(7,c=e)));j(e,b,(e=>l(8,s=e)));j(e,w,(e=>l(9,_=e)));j(e,x,(e=>l(18,i=e)));j(e,D,(e=>l(17,n=e)));j(e,E,(e=>l(6,o=e)));let C;let T;let S,B;let M;function div_binding(e){F[e?"unshift":"push"]((()=>{C=e;l(1,C)}))}e.$$set=e=>{"date"in e&&l(0,p=e.date)};e.$$.update=()=>{if(e.$$.dirty&524293){l(2,T=[]);let e=p;let t=r(u(p));for(let l of a)if(!d(l.display)&&f(l,e,t)){let n=h(l,e,t);T.push(n)}m(T)}e.$$.dirty&262145&&l(3,S=v(p,i));e.$$.dirty&131073&&l(4,B=n.some((e=>v(e,p))));e.$$.dirty&1&&l(5,M=$(p,10));e.$$.dirty&3&&C&&y(C,(()=>({allDay:true,date:p,resource:void 0,dayEl:C})))};return[p,C,T,S,B,M,o,c,s,_,g,k,b,w,x,D,E,n,i,a,div_binding]}class Day extends N{constructor(e){super();A(this,e,instance$1,create_fragment$2,U,{date:0})}}function get_each_context(e,t,l){const n=e.slice();n[18]=t[l];return n}function create_else_block(e){let t;let l;let n=W(e[1]);let i=[];for(let t=0;t<n.length;t+=1)i[t]=create_each_block(get_each_context(e,n,t));const out=e=>I(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=J()},m(e,n){for(let t=0;t<i.length;t+=1)i[t]&&i[t].m(e,n);C(e,t,n);l=true},p(e,l){if(l&2){n=W(e[1]);let a;for(a=0;a<n.length;a+=1){const o=get_each_context(e,n,a);if(i[a]){i[a].p(o,l);G(i[a],1)}else{i[a]=create_each_block(o);i[a].c();G(i[a],1);i[a].m(t.parentNode,t)}}Y();for(a=n.length;a<i.length;a+=1)out(a);z()}},i(e){if(!l){for(let e=0;e<n.length;e+=1)G(i[e]);l=true}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)I(i[e]);l=false},d(e){e&&L(t);R(i,e)}}}function create_if_block(t){let l;let n;let i;let a;let o;return{c(){l=x("div");E(l,"class",n=t[3].noEvents)},m(n,c){C(n,l,c);if(!a){o=[S(i=e.call(null,l,t[0])),B(l,"click",t[12])];a=true}},p(e,t){t&8&&n!==(n=e[3].noEvents)&&E(l,"class",n);i&&M(i.update)&&t&1&&i.update.call(null,e[0])},i:H,o:H,d(e){e&&L(l);a=false;V(o)}}}function create_each_block(e){let t;let l;t=new Day({props:{date:e[18]}});return{c(){K(t.$$.fragment)},m(e,n){P(t,e,n);l=true},p(e,l){const n={};l&2&&(n.date=e[18]);t.$set(n)},i(e){if(!l){G(t.$$.fragment,e);l=true}},o(e){I(t.$$.fragment,e);l=false},d(e){Q(t,e)}}}function create_fragment$1(e){let t;let l;let n;let i;let a;let o;let c;const s=[create_if_block,create_else_block];const r=[];function select_block_type(e,t){return e[2]?0:1}n=select_block_type(e);i=r[n]=s[n](e);return{c(){t=x("div");l=x("div");i.c();E(l,"class",a=e[3].content);E(t,"class",o=e[3].body)},m(i,a){C(i,t,a);T(t,l);r[n].m(l,null);e[15](t);c=true},p(e,[u]){let d=n;n=select_block_type(e);if(n===d)r[n].p(e,u);else{Y();I(r[d],1,1,(()=>{r[d]=null}));z();i=r[n];if(i)i.p(e,u);else{i=r[n]=s[n](e);i.c()}G(i,1);i.m(l,null)}(!c||u&8&&a!==(a=e[3].content))&&E(l,"class",a);(!c||u&8&&o!==(o=e[3].body))&&E(t,"class",o)},i(e){if(!c){G(i);c=true}},o(e){I(i);c=false},d(l){l&&L(t);r[n].d();e[15](null)}}}function instance(e,t,l){let i;let a;let o;let c;let s;let f;let h;let{_bodyEl:m,_events:v,_view:$,_viewDates:y,noEventsClick:_,noEventsContent:p,theme:g}=X("state");j(e,m,(e=>l(4,h=e)));j(e,v,(e=>l(14,c=e)));j(e,$,(e=>l(16,i=e)));j(e,y,(e=>l(1,s=e)));j(e,_,(e=>l(17,a=e)));j(e,p,(e=>l(13,o=e)));j(e,g,(e=>l(3,f=e)));let k,b;function handleClick(e){M(a)&&a({jsEvent:e,view:n(i)})}function div1_binding(e){F[e?"unshift":"push"]((()=>{h=e;m.set(h)}))}e.$$.update=()=>{if(e.$$.dirty&16386){l(2,k=true);if(s.length){let e=s[0];let t=r(u(s.at(-1)));for(let n of c)if(!d(n.display)&&n.start<t&&n.end>e){l(2,k=false);break}}}if(e.$$.dirty&8193){l(0,b=M(o)?o():o);typeof b==="string"&&l(0,b={html:b})}};return[b,s,k,f,h,m,v,$,y,_,p,g,handleClick,o,c,div1_binding]}class Body extends N{constructor(e){super();A(this,e,instance,create_fragment$1,U,{})}}function create_fragment(e){let t;let l;t=new Body({});return{c(){K(t.$$.fragment)},m(e,n){P(t,e,n);l=true},p:H,i(e){if(!l){G(t.$$.fragment,e);l=true}},o(e){I(t.$$.fragment,e);l=false},d(e){Q(t,e)}}}class View extends N{constructor(e){super();A(this,e,null,create_fragment,U,{})}}var te={createOptions(e){e.buttonText.listDay="list";e.buttonText.listWeek="list";e.buttonText.listMonth="list";e.buttonText.listYear="list";e.listDayFormat={weekday:"long"};e.listDaySideFormat={year:"numeric",month:"long",day:"numeric"};e.noEventsClick=void 0;e.noEventsContent="No events";e.theme.daySide="ec-day-side";e.theme.eventTag="ec-event-tag";e.theme.noEvents="ec-no-events";e.view="listWeek";e.views.listDay={buttonText:_,component:View,duration:{days:1},theme:p("ec-list ec-day-view")};e.views.listWeek={buttonText:g,component:View,duration:{weeks:1},theme:p("ec-list ec-week-view")};e.views.listMonth={buttonText:k,component:View,duration:{months:1},theme:p("ec-list ec-month-view")};e.views.listYear={buttonText:b,component:View,duration:{years:1},theme:p("ec-list ec-year-view")}},createStores(e){e._intlListDay=w(e.locale,e.listDayFormat);e._intlListDaySide=w(e.locale,e.listDaySideFormat)}};export{te as default};
2
+
@@ -0,0 +1,2 @@
1
+ class t{static fromString(e){return new t(e)}constructor(e){this.value=e}icaltype="binary";decodeValue(){return this._b64_decode(this.value)}setEncodedValue(e){this.value=this._b64_encode(e)}_b64_encode(e){let o,u,b,w,x,v,N,I,M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",L=0,P=0,U="",V=[];if(!e)return e;do{o=e.charCodeAt(L++),u=e.charCodeAt(L++),b=e.charCodeAt(L++),I=o<<16|u<<8|b,w=I>>18&63,x=I>>12&63,v=I>>6&63,N=63&I,V[P++]=M.charAt(w)+M.charAt(x)+M.charAt(v)+M.charAt(N)}while(L<e.length);U=V.join("");let H=e.length%3;return(H?U.slice(0,H-3):U)+"===".slice(H||3)}_b64_decode(e){let o,u,b,w,x,v,N,I,M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",L=0,P=0,U="",V=[];if(!e)return e;e+="";do{w=M.indexOf(e.charAt(L++)),x=M.indexOf(e.charAt(L++)),v=M.indexOf(e.charAt(L++)),N=M.indexOf(e.charAt(L++)),I=w<<18|x<<12|v<<6|N,o=I>>16&255,u=I>>8&255,b=255&I,V[P++]=64==v?String.fromCharCode(o):64==N?String.fromCharCode(o,u):String.fromCharCode(o,u,b)}while(L<e.length);return U=V.join(""),U}toString(){return this.value}}const e=/([PDWHMTS]{1,1})/,o=["weeks","days","hours","minutes","seconds","isNegative"];class r{static fromSeconds(e){return(new r).fromSeconds(e)}static isValueString(e){return"P"===e[0]||"P"===e[1]}static fromString(o){let u=0,b=Object.create(null),w=0;for(;-1!==(u=o.search(e));){let e=o[u],x=o.slice(0,Math.max(0,u));o=o.slice(u+1),w+=n(e,x,b)}if(w<2)throw new Error('invalid duration value: Not enough duration components in "'+o+'"');return new r(b)}static fromData(e){return new r(e)}constructor(e){this.wrappedJSObject=this,this.fromData(e)}weeks=0;days=0;hours=0;minutes=0;seconds=0;isNegative=!1;icalclass="icalduration";icaltype="duration";clone(){return r.fromData(this)}toSeconds(){let e=this.seconds+60*this.minutes+3600*this.hours+86400*this.days+604800*this.weeks;return this.isNegative?-e:e}fromSeconds(e){let o=Math.abs(e);return this.isNegative=e<0,this.days=A(o/86400),this.days%7==0?(this.weeks=this.days/7,this.days=0):this.weeks=0,o-=86400*(this.days+7*this.weeks),this.hours=A(o/3600),o-=3600*this.hours,this.minutes=A(o/60),o-=60*this.minutes,this.seconds=o,this}fromData(e){for(let u of o)this[u]=e&&u in e?e[u]:0}reset(){this.isNegative=!1,this.weeks=0,this.days=0,this.hours=0,this.minutes=0,this.seconds=0}compare(e){let o=this.toSeconds(),u=e.toSeconds();return(o>u)-(o<u)}normalize(){this.fromSeconds(this.toSeconds())}toString(){if(0==this.toSeconds())return"PT0S";{let e="";return this.isNegative&&(e+="-"),e+="P",this.weeks&&(e+=this.weeks+"W"),this.days&&(e+=this.days+"D"),(this.hours||this.minutes||this.seconds)&&(e+="T",this.hours&&(e+=this.hours+"H"),this.minutes&&(e+=this.minutes+"M"),this.seconds&&(e+=this.seconds+"S")),e}}toICALString(){return this.toString()}}function n(e,o,u){let b;switch(e){case"P":u.isNegative=!(!o||"-"!==o);break;case"D":b="days";break;case"W":b="weeks";break;case"H":b="hours";break;case"M":b="minutes";break;case"S":b="seconds";break;default:return 0}if(b){if(!o&&0!==o)throw new Error('invalid duration value: Missing number before "'+e+'"');let w=parseInt(o,10);if(f(w))throw new Error('invalid duration value: Invalid number "'+o+'" before "'+e+'"');u[b]=w}return 1}class s{static _dowCache={};static _wnCache={};static daysInMonth(e,o){let u=30;return e<1||e>12||(u=[0,31,28,31,30,31,30,31,31,30,31,30,31][e],2==e&&(u+=s.isLeapYear(o))),u}static isLeapYear(e){return e<=1752?e%4==0:e%4==0&&e%100!=0||e%400==0}static fromDayOfYear(e,o){let u=o,b=e,w=new s;w.auto_normalize=!1;let x=s.isLeapYear(u)?1:0;if(b<1)return u--,x=s.isLeapYear(u)?1:0,b+=s.daysInYearPassedMonth[x][12],s.fromDayOfYear(b,u);if(b>s.daysInYearPassedMonth[x][12])return x=s.isLeapYear(u)?1:0,b-=s.daysInYearPassedMonth[x][12],u++,s.fromDayOfYear(b,u);w.year=u,w.isDate=!0;for(let e=11;e>=0;e--)if(b>s.daysInYearPassedMonth[x][e]){w.month=e+1,w.day=b-s.daysInYearPassedMonth[x][e];break}return w.auto_normalize=!0,w}static fromStringv2(e){return new s({year:parseInt(e.slice(0,4),10),month:parseInt(e.slice(5,7),10),day:parseInt(e.slice(8,10),10),isDate:!0})}static fromDateString(e){return new s({year:p(e.slice(0,4)),month:p(e.slice(5,7)),day:p(e.slice(8,10)),isDate:!0})}static fromDateTimeString(e,o){if(e.length<19)throw new Error('invalid date-time value: "'+e+'"');let u,b;e[19]&&"Z"===e[19]?u=c.utcTimezone:o&&(b=o.getParameter("tzid"),o.parent&&("standard"===o.parent.name||"daylight"===o.parent.name?u=c.localTimezone:b&&(u=o.parent.getTimeZoneByID(b))));const w={year:p(e.slice(0,4)),month:p(e.slice(5,7)),day:p(e.slice(8,10)),hour:p(e.slice(11,13)),minute:p(e.slice(14,16)),second:p(e.slice(17,19))};return b&&!u&&(w.timezone=b),new s(w,u)}static fromString(e,o){return e.length>10?s.fromDateTimeString(e,o):s.fromDateString(e)}static fromJSDate(e,o){return(new s).fromJSDate(e,o)}static fromData=function(e,o){return(new s).fromData(e,o)};static now(){return s.fromJSDate(new Date,!1)}static weekOneStarts(e,o){let u=s.fromData({year:e,month:1,day:1,isDate:!0}),b=u.dayOfWeek(),w=o||s.DEFAULT_WEEK_START;return b>s.THURSDAY&&(u.day+=7),w>s.THURSDAY&&(u.day-=7),u.day-=b-w,u}static getDominicalLetter(e){let o="GFEDCBA",u=(e+(e/4|0)+(e/400|0)-(e/100|0)-1)%7;return s.isLeapYear(e)?o[(u+6)%7]+o[u]:o[u]}static#t=null;static get epochTime(){return this.#t||(this.#t=s.fromData({year:1970,month:1,day:1,hour:0,minute:0,second:0,isDate:!1,timezone:"Z"})),this.#t}static _cmp_attr(e,o,u){return e[u]>o[u]?1:e[u]<o[u]?-1:0}static daysInYearPassedMonth=[[0,31,59,90,120,151,181,212,243,273,304,334,365],[0,31,60,91,121,152,182,213,244,274,305,335,366]];static SUNDAY=1;static MONDAY=2;static TUESDAY=3;static WEDNESDAY=4;static THURSDAY=5;static FRIDAY=6;static SATURDAY=7;static DEFAULT_WEEK_START=2;constructor(e,o){this.wrappedJSObject=this;let u=this._time=Object.create(null);u.year=0,u.month=1,u.day=1,u.hour=0,u.minute=0,u.second=0,u.isDate=!1,this.fromData(e,o)}icalclass="icaltime";_cachedUnixTime=null;get icaltype(){return this.isDate?"date":"date-time"}zone=null;_pendingNormalization=!1;clone(){return new s(this._time,this.zone)}reset(){this.fromData(s.epochTime),this.zone=c.utcTimezone}resetTo(e,o,u,b,w,x,v){this.fromData({year:e,month:o,day:u,hour:b,minute:w,second:x,zone:v})}fromJSDate(e,o){return e?o?(this.zone=c.utcTimezone,this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()):(this.zone=c.localTimezone,this.year=e.getFullYear(),this.month=e.getMonth()+1,this.day=e.getDate(),this.hour=e.getHours(),this.minute=e.getMinutes(),this.second=e.getSeconds()):this.reset(),this._cachedUnixTime=null,this}fromData(e,o){if(e)for(let[o,u]of Object.entries(e))"icaltype"!==o&&(this[o]=u);if(o&&(this.zone=o),e&&!("isDate"in e)?this.isDate=!("hour"in e):e&&"isDate"in e&&(this.isDate=e.isDate),e&&"timezone"in e){let o=v.get(e.timezone);this.zone=o||c.localTimezone}return e&&"zone"in e&&(this.zone=e.zone),this.zone||(this.zone=c.localTimezone),this._cachedUnixTime=null,this}dayOfWeek(e){let o=e||s.SUNDAY,u=(this.year<<12)+(this.month<<8)+(this.day<<3)+o;if(u in s._dowCache)return s._dowCache[u];let b=this.day,w=this.month+(this.month<3?12:0),x=this.year-(this.month<3?1:0),v=b+x+A(26*(w+1)/10)+A(x/4);return v+=6*A(x/100)+A(x/400),v=(v+7-o)%7+1,s._dowCache[u]=v,v}dayOfYear(){let e=s.isLeapYear(this.year)?1:0;return s.daysInYearPassedMonth[e][this.month-1]+this.day}startOfWeek(e){let o=e||s.SUNDAY,u=this.clone();return u.day-=(this.dayOfWeek()+7-o)%7,u.isDate=!0,u.hour=0,u.minute=0,u.second=0,u}endOfWeek(e){let o=e||s.SUNDAY,u=this.clone();return u.day+=(7-this.dayOfWeek()+o-s.SUNDAY)%7,u.isDate=!0,u.hour=0,u.minute=0,u.second=0,u}startOfMonth(){let e=this.clone();return e.day=1,e.isDate=!0,e.hour=0,e.minute=0,e.second=0,e}endOfMonth(){let e=this.clone();return e.day=s.daysInMonth(e.month,e.year),e.isDate=!0,e.hour=0,e.minute=0,e.second=0,e}startOfYear(){let e=this.clone();return e.day=1,e.month=1,e.isDate=!0,e.hour=0,e.minute=0,e.second=0,e}endOfYear(){let e=this.clone();return e.day=31,e.month=12,e.isDate=!0,e.hour=0,e.minute=0,e.second=0,e}startDoyWeek(e){let o=e||s.SUNDAY,u=this.dayOfWeek()-o;return u<0&&(u+=7),this.dayOfYear()-u}getDominicalLetter(){return s.getDominicalLetter(this.year)}nthWeekDay(e,o){let u,b=s.daysInMonth(this.month,this.year),w=o,x=0,v=this.clone();if(w>=0){v.day=1,0!=w&&w--,x=v.day;let o=e-v.dayOfWeek();o<0&&(o+=7),x+=o,x-=e,u=e}else v.day=b,w++,u=v.dayOfWeek()-e,u<0&&(u+=7),u=b-u;return u+=7*w,x+u}isNthWeekDay(e,o){let u=this.dayOfWeek();return 0===o&&u===e||this.nthWeekDay(e,o)===this.day}weekNumber(e){let o,u=(this.year<<12)+(this.month<<8)+(this.day<<3)+e;if(u in s._wnCache)return s._wnCache[u];let b=this.clone();b.isDate=!0;let w=this.year;12==b.month&&b.day>25?(o=s.weekOneStarts(w+1,e),b.compare(o)<0?o=s.weekOneStarts(w,e):w++):(o=s.weekOneStarts(w,e),b.compare(o)<0&&(o=s.weekOneStarts(--w,e)));let x=A(b.subtractDate(o).toSeconds()/86400/7)+1;return s._wnCache[u]=x,x}addDuration(e){let o=e.isNegative?-1:1,u=this.second,b=this.minute,w=this.hour,x=this.day;u+=o*e.seconds,b+=o*e.minutes,w+=o*e.hours,x+=o*e.days,x+=7*o*e.weeks,this.second=u,this.minute=b,this.hour=w,this.day=x,this._cachedUnixTime=null}subtractDate(e){let o=this.toUnixTime()+this.utcOffset(),u=e.toUnixTime()+e.utcOffset();return r.fromSeconds(o-u)}subtractDateTz(e){let o=this.toUnixTime(),u=e.toUnixTime();return r.fromSeconds(o-u)}compare(e){let o=this.toUnixTime(),u=e.toUnixTime();return o>u?1:u>o?-1:0}compareDateOnlyTz(e,o){let u=this.convertToZone(o),b=e.convertToZone(o),w=0;return 0!=(w=s._cmp_attr(u,b,"year"))||0!=(w=s._cmp_attr(u,b,"month"))||(w=s._cmp_attr(u,b,"day")),w}convertToZone(e){let o=this.clone(),u=this.zone.tzid==e.tzid;return this.isDate||u||c.convert_time(o,this.zone,e),o.zone=e,o}utcOffset(){return this.zone==c.localTimezone||this.zone==c.utcTimezone?0:this.zone.utcOffset(this)}toICALString(){let e=this.toString();return e.length>10?Yt.icalendar.value["date-time"].toICAL(e):Yt.icalendar.value.date.toICAL(e)}toString(){let e=this.year+"-"+Y(this.month)+"-"+Y(this.day);return this.isDate||(e+="T"+Y(this.hour)+":"+Y(this.minute)+":"+Y(this.second),this.zone===c.utcTimezone&&(e+="Z")),e}toJSDate(){return this.zone==c.localTimezone?this.isDate?new Date(this.year,this.month-1,this.day):new Date(this.year,this.month-1,this.day,this.hour,this.minute,this.second,0):new Date(1e3*this.toUnixTime())}_normalize(){return this._time.isDate&&(this._time.hour=0,this._time.minute=0,this._time.second=0),this.adjust(0,0,0,0),this}adjust(e,o,u,b,w){let x,v,N,I,M,L,P,U=0,V=0,H=w||this._time;if(H.isDate||(N=H.second+b,H.second=N%60,x=A(N/60),H.second<0&&(H.second+=60,x--),I=H.minute+u+x,H.minute=I%60,v=A(I/60),H.minute<0&&(H.minute+=60,v--),M=H.hour+o+v,H.hour=M%24,U=A(M/24),H.hour<0&&(H.hour+=24,U--)),H.month>12?V=A((H.month-1)/12):H.month<1&&(V=A(H.month/12)-1),H.year+=V,H.month-=12*V,L=H.day+e+U,L>0)for(;P=s.daysInMonth(H.month,H.year),!(L<=P);)H.month++,H.month>12&&(H.year++,H.month=1),L-=P;else for(;L<=0;)1==H.month?(H.year--,H.month=12):H.month--,L+=s.daysInMonth(H.month,H.year);return H.day=L,this._cachedUnixTime=null,this}fromUnixTime(e){this.zone=c.utcTimezone;let o=new Date(1e3*e);this.year=o.getUTCFullYear(),this.month=o.getUTCMonth()+1,this.day=o.getUTCDate(),this._time.isDate?(this.hour=0,this.minute=0,this.second=0):(this.hour=o.getUTCHours(),this.minute=o.getUTCMinutes(),this.second=o.getUTCSeconds()),this._cachedUnixTime=null}toUnixTime(){if(null!==this._cachedUnixTime)return this._cachedUnixTime;let e=this.utcOffset(),o=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second-e);return this._cachedUnixTime=o/1e3,this._cachedUnixTime}toJSON(){let e,o=["year","month","day","hour","minute","second","isDate"],u=Object.create(null),b=0,w=o.length;for(;b<w;b++)e=o[b],u[e]=this[e];return this.zone&&(u.timezone=this.zone.tzid),u}}!function(){function t(e){Object.defineProperty(s.prototype,e,{get:function(){return this._pendingNormalization&&(this._normalize(),this._pendingNormalization=!1),this._time[e]},set:function(o){"isDate"===e&&o&&!this._time.isDate&&this.adjust(0,0,0,0),this._cachedUnixTime=null,this._pendingNormalization=!0,this._time[e]=o}})}t("year"),t("month"),t("day"),t("hour"),t("minute"),t("second"),t("isDate")}();const u=/[^ \t]/,b={"^'":'"',"^n":"\n","^^":"^"};function l(e){let o={},u=o.component=[];if(o.stack=[u],l._eachLine(e,(function(e,u){l._handleContentLine(u,o)})),o.stack.length>1)throw new h("invalid ical body. component began but did not end");return o=null,1==u.length?u[0]:u}l.property=function(e,o){let u={component:[[],[]],designSet:o||Yt.defaultSet};return l._handleContentLine(e,u),u.component[1][0]},l.component=function(e){return l(e)};class h extends Error{constructor(e){super(e),this.name=this.constructor.name;try{throw new Error}catch(e){if(e.stack){let o=e.stack.split("\n");o.shift(),this.stack=o.join("\n")}}}}l.ParserError=h,l._handleContentLine=function(e,o){let u,b,w,x,v,N,I=e.indexOf(":"),M=e.indexOf(";"),L={};if(-1!==M&&-1!==I&&M>I&&(M=-1),-1!==M){if(w=e.slice(0,Math.max(0,M)).toLowerCase(),v=l._parseParameters(e.slice(Math.max(0,M)),0,o.designSet),-1==v[2])throw new h("Invalid parameters in '"+e+"'");if(L=v[0],u=v[1].length+v[2]+M,-1===(b=e.slice(Math.max(0,u)).indexOf(":")))throw new h("Missing parameter value in '"+e+"'");x=e.slice(Math.max(0,u+b+1))}else{if(-1===I)throw new h('invalid line (no token ";" or ":") "'+e+'"');if(w=e.slice(0,Math.max(0,I)).toLowerCase(),x=e.slice(Math.max(0,I+1)),"begin"===w){let e=[x.toLowerCase(),[],[]];return 1===o.stack.length?o.component.push(e):o.component[2].push(e),o.stack.push(o.component),o.component=e,void(o.designSet||(o.designSet=Yt.getDesignSet(o.component[0])))}if("end"===w)return void(o.component=o.stack.pop())}let P,U,V,H,R=!1,W=!1;o.designSet.propertyGroups&&-1!==w.indexOf(".")?(U=w.split("."),L.group=U[0],V=U[1]):V=w,V in o.designSet.property&&(P=o.designSet.property[V],"multiValue"in P&&(R=P.multiValue),"structuredValue"in P&&(W=P.structuredValue),x&&"detectType"in P&&(N=P.detectType(x))),N||(N="value"in L?L.value.toLowerCase():P?P.defaultType:"unknown"),delete L.value,R&&W?(x=l._parseMultiValue(x,W,N,[],R,o.designSet,W),H=[V,L,N,x]):R?(H=[V,L,N],l._parseMultiValue(x,R,N,H,null,o.designSet,!1)):W?(x=l._parseMultiValue(x,W,N,[],null,o.designSet,W),H=[V,L,N,x]):(x=l._parseValue(x,N,o.designSet,!1),H=[V,L,N,x]),"vcard"!==o.component[0]||0!==o.component[1].length||"version"===w&&"4.0"===x||(o.designSet=Yt.getDesignSet("vcard3")),o.component[1].push(H)},l._parseValue=function(e,o,u,b){return o in u.value&&"fromICAL"in u.value[o]?u.value[o].fromICAL(e,b):e},l._parseParameters=function(e,o,u){let b,w,x,v,N,I,M=o,L=0,P={},U=-1;for(;!1!==L&&-1!==(L=_(e,"=",L+1));){if(b=e.slice(M+1,L),0==b.length)throw new h("Empty parameter name in '"+e+"'");if(w=b.toLowerCase(),I=!1,N=!1,v=w in u.param&&u.param[w].valueType?u.param[w].valueType:"text",w in u.param&&(N=u.param[w].multiValue,u.param[w].multiValueSeparateDQuote&&(I=l._rfc6868Escape('"'+N+'"'))),'"'===e[L+1]){if(U=L+2,L=_(e,'"',U),N&&-1!=L){let o=!0;for(;o;)e[L+1]==N&&'"'==e[L+2]?L=_(e,'"',L+3):o=!1}if(-1===L)throw new h('invalid line (no matching double quote) "'+e+'"');x=e.slice(U,L),M=_(e,";",L),-1===M&&(L=!1)}else{U=L+1;let o=_(e,";",U),u=_(e,":",U);-1!==u&&o>u?(o=u,L=!1):-1===o?(o=-1===u?e.length:u,L=!1):(M=o,L=o),x=e.slice(U,o)}if(x=l._rfc6868Escape(x),N){let e=I||N;x=l._parseMultiValue(x,e,v,[],null,u)}else x=l._parseValue(x,v,u);N&&w in P?Array.isArray(P[w])?P[w].push(x):P[w]=[P[w],x]:P[w]=x}return[P,x,U]},l._rfc6868Escape=function(e){return e.replace(/\^['n^]/g,(function(e){return b[e]}))},l._parseMultiValue=function(e,o,u,b,w,x,v){let N,I=0,M=0;if(0===o.length)return e;for(;-1!==(I=_(e,o,M));)N=e.slice(M,I),N=w?l._parseMultiValue(N,w,u,[],null,x,v):l._parseValue(N,u,x,v),b.push(N),M=I+o.length;return N=e.slice(M),N=w?l._parseMultiValue(N,w,u,[],null,x,v):l._parseValue(N,u,x,v),b.push(N),1==b.length?b[0]:b},l._eachLine=function(e,o){let b,w,x,v=e.length,N=e.search(u),I=N;do{I=e.indexOf("\n",N)+1,x=I>1&&"\r"===e[I-2]?2:1,0===I&&(I=v,x=0),w=e[N]," "===w||"\t"===w?b+=e.slice(N+1,I-x):(b&&o(null,b),b=e.slice(N,I-x)),N=I}while(I!==v);b=b.trim(),b.length&&o(null,b)};const w=["tzid","location","tznames","latitude","longitude"];class c{static _compare_change_fn(e,o){return e.year<o.year?-1:e.year>o.year?1:e.month<o.month?-1:e.month>o.month?1:e.day<o.day?-1:e.day>o.day?1:e.hour<o.hour?-1:e.hour>o.hour?1:e.minute<o.minute?-1:e.minute>o.minute?1:e.second<o.second?-1:e.second>o.second?1:0}static convert_time(e,o,u){if(e.isDate||o.tzid==u.tzid||o==c.localTimezone||u==c.localTimezone)return e.zone=u,e;let b=o.utcOffset(e);return e.adjust(0,0,0,-b),b=u.utcOffset(e),e.adjust(0,0,0,b),null}static fromData(e){return(new c).fromData(e)}static#e=null;static get utcTimezone(){return this.#e||(this.#e=c.fromData({tzid:"UTC"})),this.#e}static#i=null;static get localTimezone(){return this.#i||(this.#i=c.fromData({tzid:"floating"})),this.#i}static adjust_change(e,o,u,b,w){return s.prototype.adjust.call(e,o,u,b,w,e)}static _minimumExpansionYear=-1;static EXTRA_COVERAGE=5;constructor(e){this.wrappedJSObject=this,this.fromData(e)}tzid="";location="";tznames="";latitude=0;longitude=0;component=null;expandedUntilYear=0;icalclass="icaltimezone";fromData(e){if(this.expandedUntilYear=0,this.changes=[],e instanceof yt)this.component=e;else{if(e&&"component"in e)if("string"==typeof e.component){let o=l(e.component);this.component=new yt(o)}else e.component instanceof yt?this.component=e.component:this.component=null;for(let o of w)e&&o in e&&(this[o]=e[o])}return this.component instanceof yt&&!this.tzid&&(this.tzid=this.component.getFirstPropertyValue("tzid")),this}utcOffset(e){if(this==c.utcTimezone||this==c.localTimezone)return 0;if(this._ensureCoverage(e.year),!this.changes.length)return 0;let o={year:e.year,month:e.month,day:e.day,hour:e.hour,minute:e.minute,second:e.second},u=this._findNearbyChange(o),b=-1,w=1;for(;;){let e=D(this.changes[u],!0);if(e.utcOffset<e.prevUtcOffset?c.adjust_change(e,0,0,0,e.utcOffset):c.adjust_change(e,0,0,0,e.prevUtcOffset),c._compare_change_fn(o,e)>=0?b=u:w=-1,-1==w&&-1!=b)break;if(u+=w,u<0)return 0;if(u>=this.changes.length)break}let x=this.changes[b];if(x.utcOffset-x.prevUtcOffset<0&&b>0){let e=D(x,!0);if(c.adjust_change(e,0,0,0,e.prevUtcOffset),c._compare_change_fn(o,e)<0){let e=this.changes[b-1],o=!1;x.is_daylight!=o&&e.is_daylight==o&&(x=e)}}return x.utcOffset}_findNearbyChange(e){let o=g(this.changes,e,c._compare_change_fn);return o>=this.changes.length?this.changes.length-1:o}_ensureCoverage(e){if(-1==c._minimumExpansionYear){let e=s.now();c._minimumExpansionYear=e.year}let o=e;if(o<c._minimumExpansionYear&&(o=c._minimumExpansionYear),o+=c.EXTRA_COVERAGE,!this.changes.length||this.expandedUntilYear<e){let e=this.component.getAllSubcomponents(),u=e.length,b=0;for(;b<u;b++)this._expandComponent(e[b],o,this.changes);this.changes.sort(c._compare_change_fn),this.expandedUntilYear=o}}_expandComponent(e,o,u){if(!e.hasProperty("dtstart")||!e.hasProperty("tzoffsetto")||!e.hasProperty("tzoffsetfrom"))return null;let b,w=e.getFirstProperty("dtstart").getFirstValue();function s(e){return e.factor*(3600*e.hours+60*e.minutes)}function a(){let o={};return o.is_daylight="daylight"==e.name,o.utcOffset=s(e.getFirstProperty("tzoffsetto").getFirstValue()),o.prevUtcOffset=s(e.getFirstProperty("tzoffsetfrom").getFirstValue()),o}if(e.hasProperty("rrule")||e.hasProperty("rdate")){let x=e.getAllProperties("rdate");for(let e of x){let o=e.getFirstValue();b=a(),b.year=o.year,b.month=o.month,b.day=o.day,o.isDate?(b.hour=w.hour,b.minute=w.minute,b.second=w.second,w.zone!=c.utcTimezone&&c.adjust_change(b,0,0,0,-b.prevUtcOffset)):(b.hour=o.hour,b.minute=o.minute,b.second=o.second,o.zone!=c.utcTimezone&&c.adjust_change(b,0,0,0,-b.prevUtcOffset)),u.push(b)}let v=e.getFirstProperty("rrule");if(v){v=v.getFirstValue(),b=a(),v.until&&v.until.zone==c.utcTimezone&&(v.until.adjust(0,0,0,b.prevUtcOffset),v.until.zone=c.localTimezone);let e,x=v.iterator(w);for(;(e=x.next())&&(b=a(),!(e.year>o)&&e);)b.year=e.year,b.month=e.month,b.day=e.day,b.hour=e.hour,b.minute=e.minute,b.second=e.second,b.isDate=e.isDate,c.adjust_change(b,0,0,0,-b.prevUtcOffset),u.push(b)}}else b=a(),b.year=w.year,b.month=w.month,b.day=w.day,b.hour=w.hour,b.minute=w.minute,b.second=w.second,c.adjust_change(b,0,0,0,-b.prevUtcOffset),u.push(b);return u}toString(){return this.tznames?this.tznames:this.tzid}}let x=null;const v={get count(){return null===x?0:Object.keys(x).length},reset:function(){x=Object.create(null);let e=c.utcTimezone;x.Z=e,x.UTC=e,x.GMT=e},has:function(e){return null!==x&&!!x[e]},get:function(e){return null===x&&this.reset(),x[e]},register:function(e,o){if(null===x&&this.reset(),e instanceof yt&&"vtimezone"===e.name&&(e=(o=new c(e)).tzid),!(o instanceof c))throw new TypeError("timezone must be ICAL.Timezone or ICAL.Component");x[e]=o},remove:function(e){return null===x?null:delete x[e]}};function f(e){return"number"==typeof e&&isNaN(e)}function p(e){let o=parseInt(e,10);if(f(o))throw new Error('Could not extract integer from "'+e+'"');return o}function y(e,o){if(void 0!==e)return e instanceof o?e:new o(e)}function _(e,o,u){for(;-1!==(u=e.indexOf(o,u));){if(!(u>0&&"\\"===e[u-1]))return u;u+=1}return-1}function g(e,o,u){if(!e.length)return 0;let b,w,x=0,v=e.length-1;for(;x<=v;)if(b=x+Math.floor((v-x)/2),w=u(o,e[b]),w<0)v=b-1;else{if(!(w>0))break;x=b+1}return w<0?b:w>0?b+1:b}function D(e,o){if(e&&"object"==typeof e){if(e instanceof Date)return new Date(e.getTime());if("clone"in e)return e.clone();if(Array.isArray(e)){let u=[];for(let b=0;b<e.length;b++)u.push(o?D(e[b],!0):e[b]);return u}{let u={};for(let[b,w]of Object.entries(e))u[b]=o?D(w,!0):w;return u}}return e}function T(e){let o="",u=e||"",b=0,w=0;for(;u.length;){let e=u.codePointAt(b);e<128?++w:w+=e<2048?2:e<65536?3:4,w<St.foldLength+1?b+=e>65535?2:1:(o+=St.newLineChar+" "+u.slice(0,Math.max(0,b)),u=u.slice(Math.max(0,b)),b=w=0)}return o.slice(St.newLineChar.length+1)}function Y(e){switch("string"!=typeof e&&("number"==typeof e&&(e=parseInt(e)),e=String(e)),e.length){case 0:return"00";case 1:return"0"+e;default:return e}}function A(e){return e<0?Math.ceil(e):Math.floor(e)}function O(e,o){for(let u in e){let b=Object.getOwnPropertyDescriptor(e,u);b&&!Object.getOwnPropertyDescriptor(o,u)&&Object.defineProperty(o,u,b)}return o}var N=Object.freeze({__proto__:null,updateTimezones:function(e){let o,u,b,w,x;if(!e||"vcalendar"!==e.name)return e;for(o=e.getAllSubcomponents(),u=[],b={},x=0;x<o.length;x++)"vtimezone"===o[x].name?b[o[x].getFirstProperty("tzid").getFirstValue()]=o[x]:u=u.concat(o[x].getAllProperties());for(w={},x=0;x<u.length;x++){let e=u[x].getParameter("tzid");e&&(w[e]=!0)}for(let[o,u]of Object.entries(b))w[o]||e.removeSubcomponent(u);for(let o of Object.keys(w))!b[o]&&v.has(o)&&e.addSubcomponent(v.get(o).component);return e},isStrictlyNaN:f,strictParseInt:p,formatClassType:y,unescapedIndexOf:_,binsearchInsert:g,clone:D,foldline:T,pad2:Y,trunc:A,extend:O});class S{static fromString(e){let o={};return o.factor="+"===e[0]?1:-1,o.hours=p(e.slice(1,3)),o.minutes=p(e.slice(4,6)),new S(o)}static fromSeconds(e){let o=new S;return o.fromSeconds(e),o}constructor(e){this.fromData(e)}hours=0;minutes=0;factor=1;icaltype="utc-offset";clone(){return S.fromSeconds(this.toSeconds())}fromData(e){if(e)for(let[o,u]of Object.entries(e))this[o]=u;this._normalize()}fromSeconds(e){let o=Math.abs(e);return this.factor=e<0?-1:1,this.hours=A(o/3600),o-=3600*this.hours,this.minutes=A(o/60),this}toSeconds(){return this.factor*(60*this.minutes+3600*this.hours)}compare(e){let o=this.toSeconds(),u=e.toSeconds();return(o>u)-(u>o)}_normalize(){let e=this.toSeconds(),o=this.factor;for(;e<-43200;)e+=97200;for(;e>50400;)e-=97200;this.fromSeconds(e),0==e&&(this.factor=o)}toICALString(){return Yt.icalendar.value["utc-offset"].toICAL(this.toString())}toString(){return(1==this.factor?"+":"-")+Y(this.hours)+":"+Y(this.minutes)}}class E extends s{static fromDateAndOrTimeString(e,o){function i(e,o,u){return e?p(e.slice(o,o+u)):null}let u=e.split("T"),b=u[0],w=u[1],x=w?Yt.vcard.value.time._splitZone(w):[],v=x[0],N=x[1],I=b?b.length:0,M=N?N.length:0,L=b&&"-"==b[0]&&"-"==b[1],P=N&&"-"==N[0],U={year:L?null:i(b,0,4),month:!L||4!=I&&7!=I?7==I||10==I?i(b,5,2):null:i(b,2,2),day:5==I?i(b,3,2):7==I&&L?i(b,5,2):10==I?i(b,8,2):null,hour:P?null:i(N,0,2),minute:P&&3==M?i(N,1,2):M>4?i(N,P?1:3,2):null,second:4==M?i(N,2,2):6==M?i(N,4,2):8==M?i(N,6,2):null};return v="Z"==v?c.utcTimezone:v&&":"==v[3]?S.fromString(v):null,new E(U,v,o)}constructor(e,o,u){super(e,o),this.icaltype=u||"date-and-or-time"}icalclass="vcardtime";icaltype="date-and-or-time";clone(){return new E(this._time,this.zone,this.icaltype)}_normalize(){return this}utcOffset(){return this.zone instanceof S?this.zone.toSeconds():s.prototype.utcOffset.apply(this,arguments)}toICALString(){return Yt.vcard.value[this.icaltype].toICAL(this.toString())}toString(){let e,o=this.year,u=this.month,b=this.day,w=this.hour,x=this.minute,v=this.second,N=null!==u,I=null!==b,M=null!==w,L=null!==x,P=null!==v,U=(null!==o?Y(o)+(N||I?"-":""):N||I?"--":"")+(N?Y(u):"")+(I?"-"+Y(b):""),V=(M?Y(w):"-")+(M&&L?":":"")+(L?Y(x):"")+(M||L?"":"-")+(L&&P?":":"")+(P?Y(v):"");e=this.zone===c.utcTimezone?"Z":this.zone instanceof S?this.zone.toString():this.zone===c.localTimezone?"":this.zone instanceof c?S.fromSeconds(this.zone.utcOffset(this)).toString():"";switch(this.icaltype){case"time":return V+e;case"date-and-or-time":case"date-time":return U+("--"==V?"":"T"+V+e);case"date":return U}return null}}class C{static _indexMap={BYSECOND:0,BYMINUTE:1,BYHOUR:2,BYDAY:3,BYMONTHDAY:4,BYYEARDAY:5,BYWEEKNO:6,BYMONTH:7,BYSETPOS:8};static _expandMap={SECONDLY:[1,1,1,1,1,1,1,1],MINUTELY:[2,1,1,1,1,1,1,1],HOURLY:[2,2,1,1,1,1,1,1],DAILY:[2,2,2,1,1,1,1,1],WEEKLY:[2,2,2,2,3,3,1,1],MONTHLY:[2,2,2,2,2,3,3,1],YEARLY:[2,2,2,2,2,2,2,2]};static UNKNOWN=0;static CONTRACT=1;static EXPAND=2;static ILLEGAL=3;constructor(e){this.fromData(e)}completed=!1;rule=null;dtstart=null;last=null;occurrence_number=0;by_indices=null;initialized=!1;by_data=null;days=null;days_index=0;fromData(e){if(this.rule=y(e.rule,B),!this.rule)throw new Error("iterator requires a (ICAL.Recur) rule");if(this.dtstart=y(e.dtstart,s),!this.dtstart)throw new Error("iterator requires a (ICAL.Time) dtstart");e.by_data?this.by_data=e.by_data:this.by_data=D(this.rule.parts,!0),e.occurrence_number&&(this.occurrence_number=e.occurrence_number),this.days=e.days||[],e.last&&(this.last=y(e.last,s)),this.by_indices=e.by_indices,this.by_indices||(this.by_indices={BYSECOND:0,BYMINUTE:0,BYHOUR:0,BYDAY:0,BYMONTH:0,BYWEEKNO:0,BYMONTHDAY:0}),this.initialized=e.initialized||!1,this.initialized||this.init()}init(){this.initialized=!0,this.last=this.dtstart.clone();let e=this.by_data;if("BYDAY"in e&&this.sort_byday_rules(e.BYDAY),"BYYEARDAY"in e&&("BYMONTH"in e||"BYWEEKNO"in e||"BYMONTHDAY"in e||"BYDAY"in e))throw new Error("Invalid BYYEARDAY rule");if("BYWEEKNO"in e&&"BYMONTHDAY"in e)throw new Error("BYWEEKNO does not fit to BYMONTHDAY");if("MONTHLY"==this.rule.freq&&("BYYEARDAY"in e||"BYWEEKNO"in e))throw new Error("For MONTHLY recurrences neither BYYEARDAY nor BYWEEKNO may appear");if("WEEKLY"==this.rule.freq&&("BYYEARDAY"in e||"BYMONTHDAY"in e))throw new Error("For WEEKLY recurrences neither BYMONTHDAY nor BYYEARDAY may appear");if("YEARLY"!=this.rule.freq&&"BYYEARDAY"in e)throw new Error("BYYEARDAY may only appear in YEARLY rules");this.last.second=this.setup_defaults("BYSECOND","SECONDLY",this.dtstart.second),this.last.minute=this.setup_defaults("BYMINUTE","MINUTELY",this.dtstart.minute),this.last.hour=this.setup_defaults("BYHOUR","HOURLY",this.dtstart.hour);let o=this.last.day=this.setup_defaults("BYMONTHDAY","DAILY",this.dtstart.day);if(this.last.month=this.setup_defaults("BYMONTH","MONTHLY",this.dtstart.month),"WEEKLY"==this.rule.freq)if("BYDAY"in e){let[,o]=this.ruleDayOfWeek(e.BYDAY[0],this.rule.wkst),u=o-this.last.dayOfWeek(this.rule.wkst);(this.last.dayOfWeek(this.rule.wkst)<o&&u>=0||u<0)&&(this.last.day+=u)}else{let o=B.numericDayToIcalDay(this.dtstart.dayOfWeek());e.BYDAY=[o]}if("YEARLY"==this.rule.freq){for(;this.expand_year_days(this.last.year),!(this.days.length>0);)this.increment_year(this.rule.interval);this._nextByYearDay()}if("MONTHLY"==this.rule.freq&&this.has_by_data("BYDAY")){let e=null,o=this.last.clone(),u=s.daysInMonth(this.last.month,this.last.year);for(let b of this.by_data.BYDAY){this.last=o.clone();let[w,x]=this.ruleDayOfWeek(b),v=this.last.nthWeekDay(x,w);if(w>=6||w<=-6)throw new Error("Malformed values in BYDAY part");if(v>u||v<=0){if(e&&e.month==o.month)continue;for(;v>u||v<=0;)this.increment_month(),u=s.daysInMonth(this.last.month,this.last.year),v=this.last.nthWeekDay(x,w)}this.last.day=v,(!e||this.last.compare(e)<0)&&(e=this.last.clone())}if(this.last=e.clone(),this.has_by_data("BYMONTHDAY")&&this._byDayAndMonthDay(!0),this.last.day>u||0==this.last.day)throw new Error("Malformed values in BYDAY part")}else if(this.has_by_data("BYMONTHDAY")){this.last.day=1;let e=s.daysInMonth(this.last.month,this.last.year);if(o<0)this.last.day=e+o+1;else if(this.by_data.BYMONTHDAY[0]>e){if(!this.next_month()&&!this.next_month()&&!this.next_month())throw new Error("No possible occurrences")}else this.last.day=o}}next(){let e,o=this.last?this.last.clone():null;if(this.rule.count&&this.occurrence_number>=this.rule.count||this.rule.until&&this.last.compare(this.rule.until)>0)return this.completed=!0,null;if(0==this.occurrence_number&&this.last.compare(this.dtstart)>=0)return this.occurrence_number++,this.last;do{switch(e=1,this.rule.freq){case"SECONDLY":this.next_second();break;case"MINUTELY":this.next_minute();break;case"HOURLY":this.next_hour();break;case"DAILY":this.next_day();break;case"WEEKLY":this.next_week();break;case"MONTHLY":e=this.next_month();break;case"YEARLY":this.next_year();break;default:return null}}while(!this.check_contracting_rules()||this.last.compare(this.dtstart)<0||!e);if(0==this.last.compare(o))throw new Error("Same occurrence found twice, protecting you from death by recursion");return this.rule.until&&this.last.compare(this.rule.until)>0?(this.completed=!0,null):(this.occurrence_number++,this.last)}next_second(){return this.next_generic("BYSECOND","SECONDLY","second","minute")}increment_second(e){return this.increment_generic(e,"second",60,"minute")}next_minute(){return this.next_generic("BYMINUTE","MINUTELY","minute","hour","next_second")}increment_minute(e){return this.increment_generic(e,"minute",60,"hour")}next_hour(){return this.next_generic("BYHOUR","HOURLY","hour","monthday","next_minute")}increment_hour(e){this.increment_generic(e,"hour",24,"monthday")}next_day(){let e="DAILY"==this.rule.freq;return 0==this.next_hour()||(e?this.increment_monthday(this.rule.interval):this.increment_monthday(1)),0}next_week(){let e=0;if(0==this.next_weekday_by_week())return e;if(this.has_by_data("BYWEEKNO")){this.by_indices.BYWEEKNO++,this.by_indices.BYWEEKNO==this.by_data.BYWEEKNO.length&&(this.by_indices.BYWEEKNO=0,e=1),this.last.month=1,this.last.day=1;let o=this.by_data.BYWEEKNO[this.by_indices.BYWEEKNO];this.last.day+=7*o,e&&this.increment_year(1)}else this.increment_monthday(7*this.rule.interval);return e}normalizeByMonthDayRules(e,o,u){let b,w=s.daysInMonth(o,e),x=[],v=0,N=u.length;for(;v<N;v++)if(b=u[v],!(Math.abs(b)>w)){if(b<0)b=w+(b+1);else if(0===b)continue;-1===x.indexOf(b)&&x.push(b)}return x.sort((function(e,o){return e-o}))}_byDayAndMonthDay(e){let o,u,b,w,x=this.by_data.BYDAY,v=0,N=x.length,I=0,M=this,L=this.last.day;function d(){for(w=s.daysInMonth(M.last.month,M.last.year),o=M.normalizeByMonthDayRules(M.last.year,M.last.month,M.by_data.BYMONTHDAY),b=o.length;o[v]<=L&&(!e||o[v]!=L)&&v<b-1;)v++}function m(){L=0,M.increment_month(),v=0,d()}d(),e&&(L-=1);let P=48;for(;!I&&P;){if(P--,u=L+1,u>w){m();continue}let e=o[v++];if(e>=u){L=e;for(let e=0;e<N;e++){let o=this.ruleDayOfWeek(x[e]),u=o[0],b=o[1];if(this.last.day=L,this.last.isNthWeekDay(b,u)){I=1;break}}I||v!==b||m()}else m()}if(P<=0)throw new Error("Malformed values in BYDAY combined with BYMONTHDAY parts");return I}next_month(){let e=1;if(0==this.next_hour())return e;if(this.has_by_data("BYDAY")&&this.has_by_data("BYMONTHDAY"))e=this._byDayAndMonthDay();else if(this.has_by_data("BYDAY")){let o,u=s.daysInMonth(this.last.month,this.last.year),b=0,w=0;if(this.has_by_data("BYSETPOS")){let e=this.last.day;for(let o=1;o<=u;o++)this.last.day=o,this.is_day_in_byday(this.last)&&(w++,o<=e&&b++);this.last.day=e}for(e=0,o=this.last.day+1;o<=u;o++)if(this.last.day=o,this.is_day_in_byday(this.last)&&(!this.has_by_data("BYSETPOS")||this.check_set_position(++b)||this.check_set_position(b-w-1))){e=1;break}o>u&&(this.last.day=1,this.increment_month(),this.is_day_in_byday(this.last)?this.has_by_data("BYSETPOS")&&!this.check_set_position(1)||(e=1):e=0)}else if(this.has_by_data("BYMONTHDAY")){this.by_indices.BYMONTHDAY++,this.by_indices.BYMONTHDAY>=this.by_data.BYMONTHDAY.length&&(this.by_indices.BYMONTHDAY=0,this.increment_month());let o=s.daysInMonth(this.last.month,this.last.year),u=this.by_data.BYMONTHDAY[this.by_indices.BYMONTHDAY];u<0&&(u=o+u+1),u>o?(this.last.day=1,e=this.is_day_in_byday(this.last)):this.last.day=u}else{this.increment_month();let o=s.daysInMonth(this.last.month,this.last.year);this.by_data.BYMONTHDAY[0]>o?e=0:this.last.day=this.by_data.BYMONTHDAY[0]}return e}next_weekday_by_week(){let e=0;if(0==this.next_hour())return e;if(!this.has_by_data("BYDAY"))return 1;for(;;){let o=new s;this.by_indices.BYDAY++,this.by_indices.BYDAY==Object.keys(this.by_data.BYDAY).length&&(this.by_indices.BYDAY=0,e=1);let u=this.by_data.BYDAY[this.by_indices.BYDAY],b=this.ruleDayOfWeek(u)[1];b-=this.rule.wkst,b<0&&(b+=7),o.year=this.last.year,o.month=this.last.month,o.day=this.last.day;let w=o.startDoyWeek(this.rule.wkst);if(b+w<1&&!e)continue;let x=s.fromDayOfYear(w+b,this.last.year);return this.last.year=x.year,this.last.month=x.month,this.last.day=x.day,e}}next_year(){if(0==this.next_hour())return 0;if(++this.days_index==this.days.length){this.days_index=0;do{this.increment_year(this.rule.interval),this.expand_year_days(this.last.year)}while(0==this.days.length)}return this._nextByYearDay(),1}_nextByYearDay(){let e=this.days[this.days_index],o=this.last.year;e<1&&(e+=1,o+=1);let u=s.fromDayOfYear(e,o);this.last.day=u.day,this.last.month=u.month}ruleDayOfWeek(e,o){let u=e.match(/([+-]?[0-9])?(MO|TU|WE|TH|FR|SA|SU)/);return u?[parseInt(u[1]||0,10),e=B.icalDayToNumericDay(u[2],o)]:[0,0]}next_generic(e,o,u,b,w){let x=e in this.by_data,v=this.rule.freq==o,N=0;if(w&&0==this[w]())return N;if(x){this.by_indices[e]++;let o=this.by_data[e];this.by_indices[e]==o.length&&(this.by_indices[e]=0,N=1),this.last[u]=o[this.by_indices[e]]}else v&&this["increment_"+u](this.rule.interval);return x&&N&&v&&this["increment_"+b](1),N}increment_monthday(e){for(let o=0;o<e;o++){let e=s.daysInMonth(this.last.month,this.last.year);this.last.day++,this.last.day>e&&(this.last.day-=e,this.increment_month())}}increment_month(){if(this.last.day=1,this.has_by_data("BYMONTH"))this.by_indices.BYMONTH++,this.by_indices.BYMONTH==this.by_data.BYMONTH.length&&(this.by_indices.BYMONTH=0,this.increment_year(1)),this.last.month=this.by_data.BYMONTH[this.by_indices.BYMONTH];else{"MONTHLY"==this.rule.freq?this.last.month+=this.rule.interval:this.last.month++,this.last.month--;let e=A(this.last.month/12);this.last.month%=12,this.last.month++,0!=e&&this.increment_year(e)}}increment_year(e){this.last.year+=e}increment_generic(e,o,u,b){this.last[o]+=e;let w=A(this.last[o]/u);this.last[o]%=u,0!=w&&this["increment_"+b](w)}has_by_data(e){return e in this.rule.parts}expand_year_days(e){let o=new s;this.days=[];let u={},b=["BYDAY","BYWEEKNO","BYMONTHDAY","BYMONTH","BYYEARDAY"];for(let e of b)e in this.rule.parts&&(u[e]=this.rule.parts[e]);if("BYMONTH"in u&&"BYWEEKNO"in u){let b=1,w={};o.year=e,o.isDate=!0;for(let u=0;u<this.by_data.BYMONTH.length;u++){let b=this.by_data.BYMONTH[u];o.month=b,o.day=1;let x=o.weekNumber(this.rule.wkst);o.day=s.daysInMonth(b,e);let v=o.weekNumber(this.rule.wkst);for(u=x;u<v;u++)w[u]=1}for(let e=0;e<this.by_data.BYWEEKNO.length&&b;e++)this.by_data.BYWEEKNO[e]<52?b&=w[e]:b=0;b?delete u.BYMONTH:delete u.BYWEEKNO}let w=Object.keys(u).length;if(0==w){let e=this.dtstart.clone();e.year=this.last.year,this.days.push(e.dayOfYear())}else if(1==w&&"BYMONTH"in u)for(let o of this.by_data.BYMONTH){let u=this.dtstart.clone();u.year=e,u.month=o,u.isDate=!0,this.days.push(u.dayOfYear())}else if(1==w&&"BYMONTHDAY"in u)for(let o of this.by_data.BYMONTHDAY){let u=this.dtstart.clone();o<0&&(o=o+s.daysInMonth(u.month,e)+1);u.day=o,u.year=e,u.isDate=!0,this.days.push(u.dayOfYear())}else if(2==w&&"BYMONTHDAY"in u&&"BYMONTH"in u)for(let u of this.by_data.BYMONTH){let b=s.daysInMonth(u,e);for(let w of this.by_data.BYMONTHDAY)w<0&&(w=w+b+1),o.day=w,o.month=u,o.year=e,o.isDate=!0,this.days.push(o.dayOfYear())}else if(1==w&&"BYWEEKNO"in u);else if(2==w&&"BYWEEKNO"in u&&"BYMONTHDAY"in u);else if(1==w&&"BYDAY"in u)this.days=this.days.concat(this.expand_by_day(e));else if(2==w&&"BYDAY"in u&&"BYMONTH"in u){for(let u of this.by_data.BYMONTH){let b=s.daysInMonth(u,e);o.year=e,o.month=u,o.day=1,o.isDate=!0;let w=o.dayOfWeek(),x=o.dayOfYear()-1;o.day=b;let v=o.dayOfWeek();if(this.has_by_data("BYSETPOS")){let e=[];for(let u=1;u<=b;u++)o.day=u,this.is_day_in_byday(o)&&e.push(u);for(let o=0;o<e.length;o++)(this.check_set_position(o+1)||this.check_set_position(o-e.length))&&this.days.push(x+e[o])}else for(let e of this.by_data.BYDAY){let o,u=this.ruleDayOfWeek(e),N=u[0],I=u[1],M=(I+7-w)%7+1,L=b-(v+7-I)%7;if(0==N)for(let e=M;e<=b;e+=7)this.days.push(x+e);else N>0?(o=M+7*(N-1),o<=b&&this.days.push(x+o)):(o=L+7*(N+1),o>0&&this.days.push(x+o))}}this.days.sort((function(e,o){return e-o}))}else if(2==w&&"BYDAY"in u&&"BYMONTHDAY"in u){let o=this.expand_by_day(e);for(let u of o){let o=s.fromDayOfYear(u,e);this.by_data.BYMONTHDAY.indexOf(o.day)>=0&&this.days.push(u)}}else if(3==w&&"BYDAY"in u&&"BYMONTHDAY"in u&&"BYMONTH"in u){let o=this.expand_by_day(e);for(let u of o){let o=s.fromDayOfYear(u,e);this.by_data.BYMONTH.indexOf(o.month)>=0&&this.by_data.BYMONTHDAY.indexOf(o.day)>=0&&this.days.push(u)}}else if(2==w&&"BYDAY"in u&&"BYWEEKNO"in u){let o=this.expand_by_day(e);for(let u of o){let o=s.fromDayOfYear(u,e).weekNumber(this.rule.wkst);this.by_data.BYWEEKNO.indexOf(o)&&this.days.push(u)}}else 3==w&&"BYDAY"in u&&"BYWEEKNO"in u&&"BYMONTHDAY"in u||(this.days=1==w&&"BYYEARDAY"in u?this.days.concat(this.by_data.BYYEARDAY):[]);return 0}expand_by_day(e){let o=[],u=this.last.clone();u.year=e,u.month=1,u.day=1,u.isDate=!0;let b=u.dayOfWeek();u.month=12,u.day=31,u.isDate=!0;let w=u.dayOfWeek(),x=u.dayOfYear();for(let e of this.by_data.BYDAY){let u=this.ruleDayOfWeek(e),v=u[0],N=u[1];if(0==v)for(let e=(N+7-b)%7+1;e<=x;e+=7)o.push(e);else if(v>0){let e;e=N>=b?N-b+1:N-b+8,o.push(e+7*(v-1))}else{let e;v=-v,e=N<=w?x-w+N:x-w+N-7,o.push(e-7*(v-1))}}return o}is_day_in_byday(e){if(this.by_data.BYDAY)for(let o of this.by_data.BYDAY){let u=this.ruleDayOfWeek(o),b=u[0],w=u[1],x=e.dayOfWeek();if(0==b&&w==x||e.nthWeekDay(w,b)==e.day)return 1}return 0}check_set_position(e){return!!this.has_by_data("BYSETPOS")&&-1!==this.by_data.BYSETPOS.indexOf(e)}sort_byday_rules(e){for(let o=0;o<e.length;o++)for(let u=0;u<o;u++)if(this.ruleDayOfWeek(e[u],this.rule.wkst)[1]>this.ruleDayOfWeek(e[o],this.rule.wkst)[1]){let b=e[o];e[o]=e[u],e[u]=b}}check_contract_restriction(e,o){let u=C._indexMap[e],b=C._expandMap[this.rule.freq][u],w=!1;if(e in this.by_data&&b==C.CONTRACT){let u=this.by_data[e];for(let e of u)if(e==o){w=!0;break}}else w=!0;return w}check_contracting_rules(){let e=this.last.dayOfWeek(),o=this.last.weekNumber(this.rule.wkst),u=this.last.dayOfYear();return this.check_contract_restriction("BYSECOND",this.last.second)&&this.check_contract_restriction("BYMINUTE",this.last.minute)&&this.check_contract_restriction("BYHOUR",this.last.hour)&&this.check_contract_restriction("BYDAY",B.numericDayToIcalDay(e))&&this.check_contract_restriction("BYWEEKNO",o)&&this.check_contract_restriction("BYMONTHDAY",this.last.day)&&this.check_contract_restriction("BYMONTH",this.last.month)&&this.check_contract_restriction("BYYEARDAY",u)}setup_defaults(e,o,u){let b=C._indexMap[e];return C._expandMap[this.rule.freq][b]!=C.CONTRACT&&(e in this.by_data||(this.by_data[e]=[u]),this.rule.freq!=o)?this.by_data[e][0]:u}toJSON(){let e=Object.create(null);return e.initialized=this.initialized,e.rule=this.rule.toJSON(),e.dtstart=this.dtstart.toJSON(),e.by_data=this.by_data,e.days=this.days,e.last=this.last.toJSON(),e.by_indices=this.by_indices,e.occurrence_number=this.occurrence_number,e}}const I=/^(SU|MO|TU|WE|TH|FR|SA)$/,M=/^([+-])?(5[0-3]|[1-4][0-9]|[1-9])?(SU|MO|TU|WE|TH|FR|SA)$/,L={SU:s.SUNDAY,MO:s.MONDAY,TU:s.TUESDAY,WE:s.WEDNESDAY,TH:s.THURSDAY,FR:s.FRIDAY,SA:s.SATURDAY},P=Object.fromEntries(Object.entries(L).map((e=>e.reverse()))),U=["SECONDLY","MINUTELY","HOURLY","DAILY","WEEKLY","MONTHLY","YEARLY"];class B{static fromString(e){let o=this._stringToData(e,!1);return new B(o)}static fromData(e){return new B(e)}static _stringToData(e,o){let u=Object.create(null),b=e.split(";"),w=b.length;for(let e=0;e<w;e++){let w=b[e].split("="),x=w[0].toUpperCase(),v=w[0].toLowerCase(),N=o?v:x,I=w[1];if(x in H){let e=I.split(","),o=0,b=e.length;for(;o<b;o++)e[o]=H[x](e[o]);u[N]=1==e.length?e[0]:e}else x in V?V[x](I,u,o):u[v]=I}return u}static icalDayToNumericDay(e,o){let u=o||s.SUNDAY;return(L[e]-u+7)%7+1}static numericDayToIcalDay(e,o){let u=e+(o||s.SUNDAY)-s.SUNDAY;return u>7&&(u-=7),P[u]}constructor(e){this.wrappedJSObject=this,this.parts={},e&&"object"==typeof e&&this.fromData(e)}parts=null;interval=1;wkst=s.MONDAY;until=null;count=null;freq=null;icalclass="icalrecur";icaltype="recur";iterator(e){return new C({rule:this,dtstart:e})}clone(){return new B(this.toJSON())}isFinite(){return!(!this.count&&!this.until)}isByCount(){return!(!this.count||this.until)}addComponent(e,o){let u=e.toUpperCase();u in this.parts?this.parts[u].push(o):this.parts[u]=[o]}setComponent(e,o){this.parts[e.toUpperCase()]=o.slice()}getComponent(e){let o=e.toUpperCase();return o in this.parts?this.parts[o].slice():[]}getNextOccurrence(e,o){let u,b=this.iterator(e);do{u=b.next()}while(u&&u.compare(o)<=0);return u&&o.zone&&(u.zone=o.zone),u}fromData(e){for(let o in e){let u=o.toUpperCase();u in H?Array.isArray(e[o])?this.parts[u]=e[o]:this.parts[u]=[e[o]]:this[o]=e[o]}this.interval&&"number"!=typeof this.interval&&V.INTERVAL(this.interval,this),this.wkst&&"number"!=typeof this.wkst&&(this.wkst=B.icalDayToNumericDay(this.wkst)),!this.until||this.until instanceof s||(this.until=s.fromString(this.until))}toJSON(){let e=Object.create(null);e.freq=this.freq,this.count&&(e.count=this.count),this.interval>1&&(e.interval=this.interval);for(let[o,u]of Object.entries(this.parts))Array.isArray(u)&&1==u.length?e[o.toLowerCase()]=u[0]:e[o.toLowerCase()]=D(u);return this.until&&(e.until=this.until.toString()),"wkst"in this&&this.wkst!==s.DEFAULT_WEEK_START&&(e.wkst=B.numericDayToIcalDay(this.wkst)),e}toString(){let e="FREQ="+this.freq;this.count&&(e+=";COUNT="+this.count),this.interval>1&&(e+=";INTERVAL="+this.interval);for(let[o,u]of Object.entries(this.parts))e+=";"+o+"="+u;return this.until&&(e+=";UNTIL="+this.until.toICALString()),"wkst"in this&&this.wkst!==s.DEFAULT_WEEK_START&&(e+=";WKST="+B.numericDayToIcalDay(this.wkst)),e}}function z(e,o,u,b){let w=b;if("+"===b[0]&&(w=b.slice(1)),w=p(w),void 0!==o&&b<o)throw new Error(e+': invalid value "'+b+'" must be > '+o);if(void 0!==u&&b>u)throw new Error(e+': invalid value "'+b+'" must be < '+o);return w}const V={FREQ:function(e,o,u){if(-1===U.indexOf(e))throw new Error('invalid frequency "'+e+'" expected: "'+U.join(", ")+'"');o.freq=e},COUNT:function(e,o,u){o.count=p(e)},INTERVAL:function(e,o,u){o.interval=p(e),o.interval<1&&(o.interval=1)},UNTIL:function(e,o,u){e.length>10?o.until=Yt.icalendar.value["date-time"].fromICAL(e):o.until=Yt.icalendar.value.date.fromICAL(e),u||(o.until=s.fromString(o.until))},WKST:function(e,o,u){if(!I.test(e))throw new Error('invalid WKST value "'+e+'"');o.wkst=B.icalDayToNumericDay(e)}},H={BYSECOND:z.bind(void 0,"BYSECOND",0,60),BYMINUTE:z.bind(void 0,"BYMINUTE",0,59),BYHOUR:z.bind(void 0,"BYHOUR",0,23),BYDAY:function(e){if(M.test(e))return e;throw new Error('invalid BYDAY value "'+e+'"')},BYMONTHDAY:z.bind(void 0,"BYMONTHDAY",-31,31),BYYEARDAY:z.bind(void 0,"BYYEARDAY",-366,366),BYWEEKNO:z.bind(void 0,"BYWEEKNO",-53,53),BYMONTH:z.bind(void 0,"BYMONTH",1,12),BYSETPOS:z.bind(void 0,"BYSETPOS",-366,366)};class k{static fromString(e,o){let u=e.split("/");if(2!==u.length)throw new Error('Invalid string value: "'+e+'" must contain a "/" char.');let b={start:s.fromDateTimeString(u[0],o)},w=u[1];return r.isValueString(w)?b.duration=r.fromString(w):b.end=s.fromDateTimeString(w,o),new k(b)}static fromData(e){return new k(e)}static fromJSON(e,o,u){function n(e,o){return u?s.fromString(e,o):s.fromDateTimeString(e,o)}return r.isValueString(e[1])?k.fromData({start:n(e[0],o),duration:r.fromString(e[1])}):k.fromData({start:n(e[0],o),end:n(e[1],o)})}constructor(e){if(this.wrappedJSObject=this,e&&"start"in e){if(e.start&&!(e.start instanceof s))throw new TypeError(".start must be an instance of ICAL.Time");this.start=e.start}if(e&&e.end&&e.duration)throw new Error("cannot accept both end and duration");if(e&&"end"in e){if(e.end&&!(e.end instanceof s))throw new TypeError(".end must be an instance of ICAL.Time");this.end=e.end}if(e&&"duration"in e){if(e.duration&&!(e.duration instanceof r))throw new TypeError(".duration must be an instance of ICAL.Duration");this.duration=e.duration}}start=null;end=null;duration=null;icalclass="icalperiod";icaltype="period";clone(){return k.fromData({start:this.start?this.start.clone():null,end:this.end?this.end.clone():null,duration:this.duration?this.duration.clone():null})}getDuration(){return this.duration?this.duration:this.end.subtractDate(this.start)}getEnd(){if(this.end)return this.end;{let e=this.start.clone();return e.addDuration(this.duration),e}}toString(){return this.start+"/"+(this.end||this.duration)}toJSON(){return[this.start.toString(),(this.end||this.duration).toString()]}toICALString(){return this.start.toICALString()+"/"+(this.end||this.duration).toICALString()}}const R=/\\\\|\\,|\\[Nn]/g,W=/\\|,|\n/g;function j(e,o){return{matches:/.*/,fromICAL:function(o,u){return function(e,o,u){if(-1===e.indexOf("\\"))return e;u&&(o=new RegExp(o.source+"|\\\\"+u,o.flags));return e.replace(o,X)}(o,e,u)},toICAL:function(e,u){let b=o;return u&&(b=new RegExp(b.source+"|"+u,b.flags)),e.replace(b,(function(e){switch(e){case"\\":return"\\\\";case";":return"\\;";case",":return"\\,";case"\n":return"\\n";default:return e}}))}}}const F={defaultType:"text"},K={defaultType:"text",multiValue:","},q={defaultType:"text",structuredValue:";"},J={defaultType:"integer"},Z={defaultType:"date-time",allowedTypes:["date-time","date"]},G={defaultType:"date-time"},Q={defaultType:"uri"},$={defaultType:"utc-offset"},tt={defaultType:"recur"},et={defaultType:"date-and-or-time",allowedTypes:["date-time","date","text"]};function X(e){switch(e){case"\\\\":return"\\";case"\\;":return";";case"\\,":return",";case"\\n":case"\\N":return"\n";default:return e}}let it={categories:K,url:Q,version:F,uid:F},rt={boolean:{values:["TRUE","FALSE"],fromICAL:function(e){return"TRUE"===e},toICAL:function(e){return e?"TRUE":"FALSE"}},float:{matches:/^[+-]?\d+\.\d+$/,fromICAL:function(e){let o=parseFloat(e);return f(o)?0:o},toICAL:function(e){return String(e)}},integer:{fromICAL:function(e){let o=parseInt(e);return f(o)?0:o},toICAL:function(e){return String(e)}},"utc-offset":{toICAL:function(e){return e.length<7?e.slice(0,3)+e.slice(4,6):e.slice(0,3)+e.slice(4,6)+e.slice(7,9)},fromICAL:function(e){return e.length<6?e.slice(0,3)+":"+e.slice(3,5):e.slice(0,3)+":"+e.slice(3,5)+":"+e.slice(5,7)},decorate:function(e){return S.fromString(e)},undecorate:function(e){return e.toString()}}};const nt=O(rt,{text:j(/\\\\|\\;|\\,|\\[Nn]/g,/\\|;|,|\n/g),uri:{},binary:{decorate:function(e){return t.fromString(e)},undecorate:function(e){return e.toString()}},"cal-address":{},date:{decorate:function(e,o){return mt.strict?s.fromDateString(e,o):s.fromString(e,o)},undecorate:function(e){return e.toString()},fromICAL:function(e){return!mt.strict&&e.length>=15?nt["date-time"].fromICAL(e):e.slice(0,4)+"-"+e.slice(4,6)+"-"+e.slice(6,8)},toICAL:function(e){let o=e.length;return 10==o?e.slice(0,4)+e.slice(5,7)+e.slice(8,10):o>=19?nt["date-time"].toICAL(e):e}},"date-time":{fromICAL:function(e){if(mt.strict||8!=e.length){let o=e.slice(0,4)+"-"+e.slice(4,6)+"-"+e.slice(6,8)+"T"+e.slice(9,11)+":"+e.slice(11,13)+":"+e.slice(13,15);return e[15]&&"Z"===e[15]&&(o+="Z"),o}return nt.date.fromICAL(e)},toICAL:function(e){let o=e.length;if(10!=o||mt.strict){if(o>=19){let o=e.slice(0,4)+e.slice(5,7)+e.slice(8,13)+e.slice(14,16)+e.slice(17,19);return e[19]&&"Z"===e[19]&&(o+="Z"),o}return e}return nt.date.toICAL(e)},decorate:function(e,o){return mt.strict?s.fromDateTimeString(e,o):s.fromString(e,o)},undecorate:function(e){return e.toString()}},duration:{decorate:function(e){return r.fromString(e)},undecorate:function(e){return e.toString()}},period:{fromICAL:function(e){let o=e.split("/");return o[0]=nt["date-time"].fromICAL(o[0]),r.isValueString(o[1])||(o[1]=nt["date-time"].fromICAL(o[1])),o},toICAL:function(e){return e=e.slice(),mt.strict||10!=e[0].length?e[0]=nt["date-time"].toICAL(e[0]):e[0]=nt.date.toICAL(e[0]),r.isValueString(e[1])||(mt.strict||10!=e[1].length?e[1]=nt["date-time"].toICAL(e[1]):e[1]=nt.date.toICAL(e[1])),e.join("/")},decorate:function(e,o){return k.fromJSON(e,o,!mt.strict)},undecorate:function(e){return e.toJSON()}},recur:{fromICAL:function(e){return B._stringToData(e,!0)},toICAL:function(e){let o="";for(let[u,b]of Object.entries(e))"until"==u?b=b.length>10?nt["date-time"].toICAL(b):nt.date.toICAL(b):"wkst"==u?"number"==typeof b&&(b=B.numericDayToIcalDay(b)):Array.isArray(b)&&(b=b.join(",")),o+=u.toUpperCase()+"="+b+";";return o.slice(0,Math.max(0,o.length-1))},decorate:function(e){return B.fromData(e)},undecorate:function(e){return e.toJSON()}},time:{fromICAL:function(e){if(e.length<6)return e;let o=e.slice(0,2)+":"+e.slice(2,4)+":"+e.slice(4,6);return"Z"===e[6]&&(o+="Z"),o},toICAL:function(e){if(e.length<8)return e;let o=e.slice(0,2)+e.slice(3,5)+e.slice(6,8);return"Z"===e[8]&&(o+="Z"),o}}});let st=O(it,{action:F,attach:{defaultType:"uri"},attendee:{defaultType:"cal-address"},calscale:F,class:F,comment:F,completed:G,contact:F,created:G,description:F,dtend:Z,dtstamp:G,dtstart:Z,due:Z,duration:{defaultType:"duration"},exdate:{defaultType:"date-time",allowedTypes:["date-time","date"],multiValue:","},exrule:tt,freebusy:{defaultType:"period",multiValue:","},geo:{defaultType:"float",structuredValue:";"},"last-modified":G,location:F,method:F,organizer:{defaultType:"cal-address"},"percent-complete":J,priority:J,prodid:F,"related-to":F,repeat:J,rdate:{defaultType:"date-time",allowedTypes:["date-time","date","period"],multiValue:",",detectType:function(e){return-1!==e.indexOf("/")?"period":-1===e.indexOf("T")?"date":"date-time"}},"recurrence-id":Z,resources:K,"request-status":q,rrule:tt,sequence:J,status:F,summary:F,transp:F,trigger:{defaultType:"duration",allowedTypes:["duration","date-time"]},tzoffsetfrom:$,tzoffsetto:$,tzurl:Q,tzid:F,tzname:F});const at=O(rt,{text:j(R,W),uri:j(R,W),date:{decorate:function(e){return E.fromDateAndOrTimeString(e,"date")},undecorate:function(e){return e.toString()},fromICAL:function(e){return 8==e.length?nt.date.fromICAL(e):"-"==e[0]&&6==e.length?e.slice(0,4)+"-"+e.slice(4):e},toICAL:function(e){return 10==e.length?nt.date.toICAL(e):"-"==e[0]&&7==e.length?e.slice(0,4)+e.slice(5):e}},time:{decorate:function(e){return E.fromDateAndOrTimeString("T"+e,"time")},undecorate:function(e){return e.toString()},fromICAL:function(e){let o=at.time._splitZone(e,!0),u=o[0],b=o[1];return 6==b.length?b=b.slice(0,2)+":"+b.slice(2,4)+":"+b.slice(4,6):4==b.length&&"-"!=b[0]?b=b.slice(0,2)+":"+b.slice(2,4):5==b.length&&(b=b.slice(0,3)+":"+b.slice(3,5)),5!=u.length||"-"!=u[0]&&"+"!=u[0]||(u=u.slice(0,3)+":"+u.slice(3)),b+u},toICAL:function(e){let o=at.time._splitZone(e),u=o[0],b=o[1];return 8==b.length?b=b.slice(0,2)+b.slice(3,5)+b.slice(6,8):5==b.length&&"-"!=b[0]?b=b.slice(0,2)+b.slice(3,5):6==b.length&&(b=b.slice(0,3)+b.slice(4,6)),6!=u.length||"-"!=u[0]&&"+"!=u[0]||(u=u.slice(0,3)+u.slice(4)),b+u},_splitZone:function(e,o){let u,b,w=e.length-1,x=e.length-(o?5:6),v=e[x];return"Z"==e[w]?(u=e[w],b=e.slice(0,Math.max(0,w))):e.length>6&&("-"==v||"+"==v)?(u=e.slice(x),b=e.slice(0,Math.max(0,x))):(u="",b=e),[u,b]}},"date-time":{decorate:function(e){return E.fromDateAndOrTimeString(e,"date-time")},undecorate:function(e){return e.toString()},fromICAL:function(e){return at["date-and-or-time"].fromICAL(e)},toICAL:function(e){return at["date-and-or-time"].toICAL(e)}},"date-and-or-time":{decorate:function(e){return E.fromDateAndOrTimeString(e,"date-and-or-time")},undecorate:function(e){return e.toString()},fromICAL:function(e){let o=e.split("T");return(o[0]?at.date.fromICAL(o[0]):"")+(o[1]?"T"+at.time.fromICAL(o[1]):"")},toICAL:function(e){let o=e.split("T");return at.date.toICAL(o[0])+(o[1]?"T"+at.time.toICAL(o[1]):"")}},timestamp:nt["date-time"],"language-tag":{matches:/^[a-zA-Z0-9-]+$/},"phone-number":{fromICAL:function(e){return Array.from(e).filter((function(e){return"\\"===e?void 0:e})).join("")},toICAL:function(e){return Array.from(e).map((function(e){return","===e||";"===e?"\\"+e:e})).join("")}}});let ot=O(it,{adr:{defaultType:"text",structuredValue:";",multiValue:","},anniversary:et,bday:et,caladruri:Q,caluri:Q,clientpidmap:q,email:F,fburl:Q,fn:F,gender:q,geo:Q,impp:Q,key:Q,kind:F,lang:{defaultType:"language-tag"},logo:Q,member:Q,n:{defaultType:"text",structuredValue:";",multiValue:","},nickname:K,note:F,org:{defaultType:"text",structuredValue:";"},photo:Q,related:Q,rev:{defaultType:"timestamp"},role:F,sound:Q,source:Q,tel:{defaultType:"uri",allowedTypes:["uri","text"]},title:F,tz:{defaultType:"text",allowedTypes:["text","utc-offset","uri"]},xml:F}),lt=O(rt,{binary:nt.binary,date:at.date,"date-time":at["date-time"],"phone-number":at["phone-number"],uri:nt.uri,text:nt.text,time:nt.time,vcard:nt.text,"utc-offset":{toICAL:function(e){return e.slice(0,7)},fromICAL:function(e){return e.slice(0,7)},decorate:function(e){return S.fromString(e)},undecorate:function(e){return e.toString()}}}),ht=O(it,{fn:F,n:{defaultType:"text",structuredValue:";",multiValue:","},nickname:K,photo:{defaultType:"binary",allowedTypes:["binary","uri"]},bday:{defaultType:"date-time",allowedTypes:["date-time","date"],detectType:function(e){return-1===e.indexOf("T")?"date":"date-time"}},adr:{defaultType:"text",structuredValue:";",multiValue:","},label:F,tel:{defaultType:"phone-number"},email:F,mailer:F,tz:{defaultType:"utc-offset",allowedTypes:["utc-offset","text"]},geo:{defaultType:"float",structuredValue:";"},title:F,role:F,logo:{defaultType:"binary",allowedTypes:["binary","uri"]},agent:{defaultType:"vcard",allowedTypes:["vcard","text","uri"]},org:q,note:K,prodid:F,rev:{defaultType:"date-time",allowedTypes:["date-time","date"],detectType:function(e){return-1===e.indexOf("T")?"date":"date-time"}},"sort-string":F,sound:{defaultType:"binary",allowedTypes:["binary","uri"]},class:F,key:{defaultType:"binary",allowedTypes:["binary","text"]}}),ut={value:nt,param:{cutype:{values:["INDIVIDUAL","GROUP","RESOURCE","ROOM","UNKNOWN"],allowXName:!0,allowIanaToken:!0},"delegated-from":{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},"delegated-to":{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},encoding:{values:["8BIT","BASE64"]},fbtype:{values:["FREE","BUSY","BUSY-UNAVAILABLE","BUSY-TENTATIVE"],allowXName:!0,allowIanaToken:!0},member:{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},partstat:{values:["NEEDS-ACTION","ACCEPTED","DECLINED","TENTATIVE","DELEGATED","COMPLETED","IN-PROCESS"],allowXName:!0,allowIanaToken:!0},range:{values:["THISANDFUTURE"]},related:{values:["START","END"]},reltype:{values:["PARENT","CHILD","SIBLING"],allowXName:!0,allowIanaToken:!0},role:{values:["REQ-PARTICIPANT","CHAIR","OPT-PARTICIPANT","NON-PARTICIPANT"],allowXName:!0,allowIanaToken:!0},rsvp:{values:["TRUE","FALSE"]},"sent-by":{valueType:"cal-address"},tzid:{matches:/^\//},value:{values:["binary","boolean","cal-address","date","date-time","duration","float","integer","period","recur","text","time","uri","utc-offset"],allowXName:!0,allowIanaToken:!0}},property:st,propertyGroups:!1},ct={value:at,param:{type:{valueType:"text",multiValue:","},value:{values:["text","uri","date","time","date-time","date-and-or-time","timestamp","boolean","integer","float","utc-offset","language-tag"],allowXName:!0,allowIanaToken:!0}},property:ot,propertyGroups:!0},dt={value:lt,param:{type:{valueType:"text",multiValue:","},value:{values:["text","uri","date","date-time","phone-number","time","boolean","integer","float","utc-offset","vcard","binary"],allowXName:!0,allowIanaToken:!0}},property:ht,propertyGroups:!0};const mt={strict:!0,defaultSet:ut,defaultType:"unknown",components:{vcard:ct,vcard3:dt,vevent:ut,vtodo:ut,vjournal:ut,valarm:ut,vtimezone:ut,daylight:ut,standard:ut},icalendar:ut,vcard:ct,vcard3:dt,getDesignSet:function(e){return e&&e in mt.components?mt.components[e]:mt.defaultSet}};var Yt=mt;const Tt="\r\n",At="unknown",Ot={'"':"^'","\n":"^n","^":"^^"};function ft(e){"string"==typeof e[0]&&(e=[e]);let o=0,u=e.length,b="";for(;o<u;o++)b+=ft.component(e[o])+Tt;return b}ft.component=function(e,o){let u=e[0].toUpperCase(),b="BEGIN:"+u+Tt,w=e[1],x=0,v=w.length,N=e[0];for("vcard"===N&&e[1].length>0&&("version"!==e[1][0][0]||"4.0"!==e[1][0][3])&&(N="vcard3"),o=o||Yt.getDesignSet(N);x<v;x++)b+=ft.property(w[x],o)+Tt;let I=e[2]||[],M=0,L=I.length;for(;M<L;M++)b+=ft.component(I[M],o)+Tt;return b+="END:"+u,b},ft.property=function(e,o,u){let b=e[0].toUpperCase(),w=e[0],x=e[1];o||(o=Yt.defaultSet);let v,N=x.group;v=o.propertyGroups&&N?N.toUpperCase()+"."+b:b;for(let[e,u]of Object.entries(x)){if(o.propertyGroups&&"group"==e)continue;let b=o.param[e],w=b&&b.multiValue;w&&Array.isArray(u)?(u=u.map((function(e){return e=ft._rfc6868Unescape(e),ft.paramPropertyValue(e,b.multiValueSeparateDQuote)})),u=ft.multiValue(u,w,"unknown",null,o)):(u=ft._rfc6868Unescape(u),u=ft.paramPropertyValue(u)),v+=";"+e.toUpperCase()+"="+u}if(3===e.length)return v+":";let I,M=e[2],L=!1,P=!1,U=!1;return w in o.property?(I=o.property[w],"multiValue"in I&&(L=I.multiValue),"structuredValue"in I&&Array.isArray(e[3])&&(P=I.structuredValue),"defaultType"in I?M===I.defaultType&&(U=!0):M===At&&(U=!0)):M===At&&(U=!0),U||(v+=";VALUE="+M.toUpperCase()),v+=":",v+=L&&P?ft.multiValue(e[3],P,M,L,o,P):L?ft.multiValue(e.slice(3),L,M,null,o,!1):P?ft.multiValue(e[3],P,M,null,o,P):ft.value(e[3],M,o,!1),u?v:T(v)},ft.paramPropertyValue=function(e,o){return o||-1!==_(e,",")||-1!==_(e,":")||-1!==_(e,";")?'"'+e+'"':e},ft.multiValue=function(e,o,u,b,w,x){let v="",N=e.length,I=0;for(;I<N;I++)b&&Array.isArray(e[I])?v+=ft.multiValue(e[I],b,u,null,w,x):v+=ft.value(e[I],u,w,x),I!==N-1&&(v+=o);return v},ft.value=function(e,o,u,b){return o in u.value&&"toICAL"in u.value[o]?u.value[o].toICAL(e,b):e},ft._rfc6868Unescape=function(e){return e.replace(/[\n^"]/g,(function(e){return Ot[e]}))};class pt{static fromString(e,o){return new pt(l.property(e,o))}constructor(e,o){this._parent=o||null,"string"==typeof e?(this.jCal=[e,{},Yt.defaultType],this.jCal[2]=this.getDefaultType()):this.jCal=e,this._updateType()}get type(){return this.jCal[2]}get name(){return this.jCal[0]}get parent(){return this._parent}set parent(e){let o=!this._parent||e&&e._designSet!=this._parent._designSet;this._parent=e,this.type==Yt.defaultType&&o&&(this.jCal[2]=this.getDefaultType(),this._updateType())}get _designSet(){return this.parent?this.parent._designSet:Yt.defaultSet}_updateType(){let e=this._designSet;this.type in e.value&&("decorate"in e.value[this.type]?this.isDecorated=!0:this.isDecorated=!1,this.name in e.property&&(this.isMultiValue="multiValue"in e.property[this.name],this.isStructuredValue="structuredValue"in e.property[this.name]))}_hydrateValue(e){return this._values&&this._values[e]?this._values[e]:this.jCal.length<=3+e?null:this.isDecorated?(this._values||(this._values=[]),this._values[e]=this._decorate(this.jCal[3+e])):this.jCal[3+e]}_decorate(e){return this._designSet.value[this.type].decorate(e,this)}_undecorate(e){return this._designSet.value[this.type].undecorate(e,this)}_setDecoratedValue(e,o){this._values||(this._values=[]),"object"==typeof e&&"icaltype"in e?(this.jCal[3+o]=this._undecorate(e),this._values[o]=e):(this.jCal[3+o]=e,this._values[o]=this._decorate(e))}getParameter(e){return e in this.jCal[1]?this.jCal[1][e]:void 0}getFirstParameter(e){let o=this.getParameter(e);return Array.isArray(o)?o[0]:o}setParameter(e,o){let u=e.toLowerCase();"string"==typeof o&&u in this._designSet.param&&"multiValue"in this._designSet.param[u]&&(o=[o]),this.jCal[1][e]=o}removeParameter(e){delete this.jCal[1][e]}getDefaultType(){let e=this.jCal[0],o=this._designSet;if(e in o.property){let u=o.property[e];if("defaultType"in u)return u.defaultType}return Yt.defaultType}resetType(e){this.removeAllValues(),this.jCal[2]=e,this._updateType()}getFirstValue(){return this._hydrateValue(0)}getValues(){let e=this.jCal.length-3;if(e<1)return[];let o=0,u=[];for(;o<e;o++)u[o]=this._hydrateValue(o);return u}removeAllValues(){this._values&&(this._values.length=0),this.jCal.length=3}setValues(e){if(!this.isMultiValue)throw new Error(this.name+": does not not support mulitValue.\noverride isMultiValue");let o=e.length,u=0;if(this.removeAllValues(),o>0&&"object"==typeof e[0]&&"icaltype"in e[0]&&this.resetType(e[0].icaltype),this.isDecorated)for(;u<o;u++)this._setDecoratedValue(e[u],u);else for(;u<o;u++)this.jCal[3+u]=e[u]}setValue(e){this.removeAllValues(),"object"==typeof e&&"icaltype"in e&&this.resetType(e.icaltype),this.isDecorated?this._setDecoratedValue(e,0):this.jCal[3]=e}toJSON(){return this.jCal}toICALString(){return ft.property(this.jCal,this._designSet,!0)}}class yt{static fromString(e){return new yt(l.component(e))}constructor(e,o){"string"==typeof e&&(e=[e,[],[]]),this.jCal=e,this.parent=o||null,this.parent||"vcalendar"!==this.name||(this._timezoneCache=new Map)}_hydratedPropertyCount=0;_hydratedComponentCount=0;_timezoneCache=null;get name(){return this.jCal[0]}get _designSet(){return this.parent&&this.parent._designSet||Yt.getDesignSet(this.name)}_hydrateComponent(e){if(this._components||(this._components=[],this._hydratedComponentCount=0),this._components[e])return this._components[e];let o=new yt(this.jCal[2][e],this);return this._hydratedComponentCount++,this._components[e]=o}_hydrateProperty(e){if(this._properties||(this._properties=[],this._hydratedPropertyCount=0),this._properties[e])return this._properties[e];let o=new pt(this.jCal[1][e],this);return this._hydratedPropertyCount++,this._properties[e]=o}getFirstSubcomponent(e){if(e){let o=0,u=this.jCal[2],b=u.length;for(;o<b;o++)if(u[o][0]===e)return this._hydrateComponent(o)}else if(this.jCal[2].length)return this._hydrateComponent(0);return null}getAllSubcomponents(e){let o=this.jCal[2].length,u=0;if(e){let b=this.jCal[2],w=[];for(;u<o;u++)e===b[u][0]&&w.push(this._hydrateComponent(u));return w}if(!this._components||this._hydratedComponentCount!==o)for(;u<o;u++)this._hydrateComponent(u);return this._components||[]}hasProperty(e){let o=this.jCal[1],u=o.length,b=0;for(;b<u;b++)if(o[b][0]===e)return!0;return!1}getFirstProperty(e){if(e){let o=0,u=this.jCal[1],b=u.length;for(;o<b;o++)if(u[o][0]===e)return this._hydrateProperty(o)}else if(this.jCal[1].length)return this._hydrateProperty(0);return null}getFirstPropertyValue(e){let o=this.getFirstProperty(e);return o?o.getFirstValue():null}getAllProperties(e){let o=this.jCal[1].length,u=0;if(e){let b=this.jCal[1],w=[];for(;u<o;u++)e===b[u][0]&&w.push(this._hydrateProperty(u));return w}if(!this._properties||this._hydratedPropertyCount!==o)for(;u<o;u++)this._hydrateProperty(u);return this._properties||[]}_removeObjectByIndex(e,o,u){if((o=o||[])[u]){let e=o[u];"parent"in e&&(e.parent=null)}o.splice(u,1),this.jCal[e].splice(u,1)}_removeObject(e,o,u){let b=0,w=this.jCal[e],x=w.length,v=this[o];if("string"==typeof u){for(;b<x;b++)if(w[b][0]===u)return this._removeObjectByIndex(e,v,b),!0}else if(v)for(;b<x;b++)if(v[b]&&v[b]===u)return this._removeObjectByIndex(e,v,b),!0;return!1}_removeAllObjects(e,o,u){let b=this[o],w=this.jCal[e],x=w.length-1;for(;x>=0;x--)u&&w[x][0]!==u||this._removeObjectByIndex(e,b,x)}addSubcomponent(e){this._components||(this._components=[],this._hydratedComponentCount=0),e.parent&&e.parent.removeSubcomponent(e);let o=this.jCal[2].push(e.jCal);return this._components[o-1]=e,this._hydratedComponentCount++,e.parent=this,e}removeSubcomponent(e){let o=this._removeObject(2,"_components",e);return o&&this._hydratedComponentCount--,o}removeAllSubcomponents(e){let o=this._removeAllObjects(2,"_components",e);return this._hydratedComponentCount=0,o}addProperty(e){if(!(e instanceof pt))throw new TypeError("must be instance of ICAL.Property");this._properties||(this._properties=[],this._hydratedPropertyCount=0),e.parent&&e.parent.removeProperty(e);let o=this.jCal[1].push(e.jCal);return this._properties[o-1]=e,this._hydratedPropertyCount++,e.parent=this,e}addPropertyWithValue(e,o){let u=new pt(e);return u.setValue(o),this.addProperty(u),u}updatePropertyWithValue(e,o){let u=this.getFirstProperty(e);return u?u.setValue(o):u=this.addPropertyWithValue(e,o),u}removeProperty(e){let o=this._removeObject(1,"_properties",e);return o&&this._hydratedPropertyCount--,o}removeAllProperties(e){let o=this._removeAllObjects(1,"_properties",e);return this._hydratedPropertyCount=0,o}toJSON(){return this.jCal}toString(){return ft.component(this.jCal,this._designSet)}getTimeZoneByID(e){if(this.parent)return this.parent.getTimeZoneByID(e);if(!this._timezoneCache)return null;if(this._timezoneCache.has(e))return this._timezoneCache.get(e);const o=this.getAllSubcomponents("vtimezone");for(const u of o)if(u.getFirstProperty("tzid").getFirstValue()===e){const o=new c({component:u,tzid:e});return this._timezoneCache.set(e,o),o}return null}}class _t{constructor(e){this.ruleDates=[],this.exDates=[],this.fromData(e)}complete=!1;ruleIterators=null;ruleDates=null;exDates=null;ruleDateInc=0;exDateInc=0;exDate=null;ruleDate=null;dtstart=null;last=null;fromData(e){let o=y(e.dtstart,s);if(!o)throw new Error(".dtstart (ICAL.Time) must be given");if(this.dtstart=o,e.component)this._init(e.component);else{if(this.last=y(e.last,s)||o.clone(),!e.ruleIterators)throw new Error(".ruleIterators or .component must be given");this.ruleIterators=e.ruleIterators.map((function(e){return y(e,C)})),this.ruleDateInc=e.ruleDateInc,this.exDateInc=e.exDateInc,e.ruleDates&&(this.ruleDates=e.ruleDates.map((e=>y(e,s))),this.ruleDate=this.ruleDates[this.ruleDateInc]),e.exDates&&(this.exDates=e.exDates.map((e=>y(e,s))),this.exDate=this.exDates[this.exDateInc]),void 0!==e.complete&&(this.complete=e.complete)}}next(){let e,o,u,b=0;for(;;){if(b++>500)throw new Error("max tries have occurred, rule may be impossible to fulfill.");if(o=this.ruleDate,e=this._nextRecurrenceIter(this.last),!o&&!e){this.complete=!0;break}if((!o||e&&o.compare(e.last)>0)&&(o=e.last.clone(),e.next()),this.ruleDate===o&&this._nextRuleDay(),this.last=o,!this.exDate||(u=this.exDate.compare(this.last),u<0&&this._nextExDay(),0!==u))return this.last;this._nextExDay()}}toJSON(){function t(e){return e.toJSON()}let e=Object.create(null);return e.ruleIterators=this.ruleIterators.map(t),this.ruleDates&&(e.ruleDates=this.ruleDates.map(t)),this.exDates&&(e.exDates=this.exDates.map(t)),e.ruleDateInc=this.ruleDateInc,e.exDateInc=this.exDateInc,e.last=this.last.toJSON(),e.dtstart=this.dtstart.toJSON(),e.complete=this.complete,e}_extractDates(e,o){let u=[],b=e.getAllProperties(o);for(let e=0,o=b.length;e<o;e++)for(let o of b[e].getValues()){let e=g(u,o,((e,o)=>e.compare(o)));u.splice(e,0,o)}return u}_init(e){if(this.ruleIterators=[],this.last=this.dtstart.clone(),!e.hasProperty("rdate")&&!e.hasProperty("rrule")&&!e.hasProperty("recurrence-id"))return this.ruleDate=this.last.clone(),void(this.complete=!0);if(e.hasProperty("rdate")&&(this.ruleDates=this._extractDates(e,"rdate"),this.ruleDates[0]&&this.ruleDates[0].compare(this.dtstart)<0?(this.ruleDateInc=0,this.last=this.ruleDates[0].clone()):this.ruleDateInc=g(this.ruleDates,this.last,((e,o)=>e.compare(o))),this.ruleDate=this.ruleDates[this.ruleDateInc]),e.hasProperty("rrule")){let o,u,b=e.getAllProperties("rrule"),w=0,x=b.length;for(;w<x;w++)o=b[w].getFirstValue(),u=o.iterator(this.dtstart),this.ruleIterators.push(u),u.next()}e.hasProperty("exdate")&&(this.exDates=this._extractDates(e,"exdate"),this.exDateInc=g(this.exDates,this.last,((e,o)=>e.compare(o))),this.exDate=this.exDates[this.exDateInc])}_nextExDay(){this.exDate=this.exDates[++this.exDateInc]}_nextRuleDay(){this.ruleDate=this.ruleDates[++this.ruleDateInc]}_nextRecurrenceIter(){let e=this.ruleIterators;if(0===e.length)return null;let o,u,b,w=e.length,x=0;for(;x<w;x++)o=e[x],u=o.last,o.completed?(w--,0!==x&&x--,e.splice(x,1)):(!b||b.last.compare(u)>0)&&(b=o);return b}}class gt{constructor(e,o){e instanceof yt||(o=e,e=null),this.component=e||new yt("vevent"),this._rangeExceptionCache=Object.create(null),this.exceptions=Object.create(null),this.rangeExceptions=[],o&&o.strictExceptions&&(this.strictExceptions=o.strictExceptions),o&&o.exceptions?o.exceptions.forEach(this.relateException,this):this.component.parent&&!this.isRecurrenceException()&&this.component.parent.getAllSubcomponents("vevent").forEach((function(e){e.hasProperty("recurrence-id")&&this.relateException(e)}),this)}static THISANDFUTURE="THISANDFUTURE";exceptions=null;strictExceptions=!1;relateException(e){if(this.isRecurrenceException())throw new Error("cannot relate exception to exceptions");if(e instanceof yt&&(e=new gt(e)),this.strictExceptions&&e.uid!==this.uid)throw new Error("attempted to relate unrelated exception");let o=e.recurrenceId.toString();if(this.exceptions[o]=e,e.modifiesFuture()){let u=[e.recurrenceId.toUnixTime(),o],b=g(this.rangeExceptions,u,Dt);this.rangeExceptions.splice(b,0,u)}}modifiesFuture(){return!!this.component.hasProperty("recurrence-id")&&this.component.getFirstProperty("recurrence-id").getParameter("range")===gt.THISANDFUTURE}findRangeException(e){if(!this.rangeExceptions.length)return null;let o=e.toUnixTime(),u=g(this.rangeExceptions,[o],Dt);if(u-=1,u<0)return null;let b=this.rangeExceptions[u];return o<b[0]?null:b[1]}getOccurrenceDetails(e){let o,u=e.toString(),b=e.convertToZone(c.utcTimezone).toString(),w={recurrenceId:e};if(u in this.exceptions)o=w.item=this.exceptions[u],w.startDate=o.startDate,w.endDate=o.endDate,w.item=o;else if(b in this.exceptions)o=this.exceptions[b],w.startDate=o.startDate,w.endDate=o.endDate,w.item=o;else{let o,u=this.findRangeException(e);if(u){let b=this.exceptions[u];w.item=b;let x=this._rangeExceptionCache[u];if(!x){let e=b.recurrenceId.clone(),o=b.startDate.clone();e.zone=o.zone,x=o.subtractDate(e),this._rangeExceptionCache[u]=x}let v=e.clone();v.zone=b.startDate.zone,v.addDuration(x),o=v.clone(),o.addDuration(b.duration),w.startDate=v,w.endDate=o}else o=e.clone(),o.addDuration(this.duration),w.endDate=o,w.startDate=e,w.item=this}return w}iterator(e){return new _t({component:this.component,dtstart:e||this.startDate})}isRecurring(){let e=this.component;return e.hasProperty("rrule")||e.hasProperty("rdate")}isRecurrenceException(){return this.component.hasProperty("recurrence-id")}getRecurrenceTypes(){let e=this.component.getAllProperties("rrule"),o=0,u=e.length,b=Object.create(null);for(;o<u;o++)b[e[o].getFirstValue().freq]=!0;return b}get uid(){return this._firstProp("uid")}set uid(e){this._setProp("uid",e)}get startDate(){return this._firstProp("dtstart")}set startDate(e){this._setTime("dtstart",e)}get endDate(){let e=this._firstProp("dtend");if(!e){let o=this._firstProp("duration");e=this.startDate.clone(),o?e.addDuration(o):e.isDate&&(e.day+=1)}return e}set endDate(e){this.component.hasProperty("duration")&&this.component.removeProperty("duration"),this._setTime("dtend",e)}get duration(){let e=this._firstProp("duration");return e||this.endDate.subtractDateTz(this.startDate)}set duration(e){this.component.hasProperty("dtend")&&this.component.removeProperty("dtend"),this._setProp("duration",e)}get location(){return this._firstProp("location")}set location(e){this._setProp("location",e)}get attendees(){return this.component.getAllProperties("attendee")}get summary(){return this._firstProp("summary")}set summary(e){this._setProp("summary",e)}get description(){return this._firstProp("description")}set description(e){this._setProp("description",e)}get color(){return this._firstProp("color")}set color(e){this._setProp("color",e)}get organizer(){return this._firstProp("organizer")}set organizer(e){this._setProp("organizer",e)}get sequence(){return this._firstProp("sequence")}set sequence(e){this._setProp("sequence",e)}get recurrenceId(){return this._firstProp("recurrence-id")}set recurrenceId(e){this._setTime("recurrence-id",e)}_setTime(e,o){let u=this.component.getFirstProperty(e);u||(u=new pt(e),this.component.addProperty(u)),o.zone===c.localTimezone||o.zone===c.utcTimezone?u.removeParameter("tzid"):u.setParameter("tzid",o.zone.tzid),u.setValue(o)}_setProp(e,o){this.component.updatePropertyWithValue(e,o)}_firstProp(e){return this.component.getFirstPropertyValue(e)}toString(){return this.component.toString()}}function Dt(e,o){return e[0]>o[0]?1:o[0]>e[0]?-1:0}var St={foldLength:75,debug:!1,newLineChar:"\r\n",Binary:t,Component:yt,ComponentParser:class{constructor(e){void 0===e&&(e={});for(let[o,u]of Object.entries(e))this[o]=u}parseEvent=!0;parseTimezone=!0;oncomplete=function(){};onerror=function(e){};ontimezone=function(e){};onevent=function(e){};process(e){"string"==typeof e&&(e=l(e)),e instanceof yt||(e=new yt(e));let o,u=e.getAllSubcomponents(),b=0,w=u.length;for(;b<w;b++)switch(o=u[b],o.name){case"vtimezone":if(this.parseTimezone){let e=o.getFirstPropertyValue("tzid");e&&this.ontimezone(new c({tzid:e,component:o}))}break;case"vevent":this.parseEvent&&this.onevent(new gt(o));break;default:continue}this.oncomplete()}},Duration:r,Event:gt,Period:k,Property:pt,Recur:B,RecurExpansion:_t,RecurIterator:C,Time:s,Timezone:c,TimezoneService:v,UtcOffset:S,VCardTime:E,parse:l,stringify:ft,design:Yt,helpers:N};export{St as default};
2
+