kalendly 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # kalendly
2
2
 
3
- A universal calendar web component — works in React, Vue, Svelte, Angular, Solid.js, and plain HTML with no framework dependency.
3
+ A calendar web component — works in React, Vue, Svelte, Angular, Solid.js, and plain HTML with no framework dependency.
4
4
 
5
5
  ## Features
6
6
 
@@ -310,13 +310,13 @@ kalendly uses Light DOM — all standard CSS techniques work:
310
310
  ```css
311
311
  /* 1. CSS custom properties (recommended) */
312
312
  :root {
313
- --calendar-primary-color: #6366f1;
314
- --calendar-background: #1e1e2e;
315
- --calendar-border-color: #334155;
313
+ --kalendly-primary-color: #6366f1;
314
+ --kalendly-background: #1e1e2e;
315
+ --kalendly-border-color: #334155;
316
316
  }
317
317
 
318
318
  /* 2. Direct class overrides */
319
- .kalendly-calendar .calendar-card {
319
+ .kalendly .kalendly-card {
320
320
  border-radius: 12px;
321
321
  }
322
322
  ```
@@ -336,7 +336,6 @@ Primitives are set as HTML attributes:
336
336
  | Attribute | Type | Default | Description |
337
337
  | ----------------------- | ----------------- | ---------------- | -------------------------------------------------- |
338
338
  | `heading` | `string` | — | Calendar heading |
339
- | `title` | `string` | — | **Deprecated** — use `heading` |
340
339
  | `initial-date` | `string` | today | ISO date string for initial view |
341
340
  | `months` | `"1"\|"2"` | `"1"` | Render two months side by side |
342
341
  | `min-year` | `string` | currentYear - 30 | Minimum year in picker |
@@ -371,7 +370,7 @@ Rich objects are set as JS properties (not attributes):
371
370
 
372
371
  ### Why `heading` and not `title`
373
372
 
374
- `title` is a global HTML attribute, so the browser renders it as a tooltip floating over the whole calendar as well as using it as the heading. `heading` does the same job without the tooltip. `title` still works and warns once per page; it will be removed in a future release.
373
+ `title` is a global HTML attribute, so the browser renders it as a tooltip floating over the whole calendar as well as using it as the heading. `heading` does the same job without the tooltip. `title` is no longer read set `heading` instead.
375
374
 
376
375
  ## Custom Events
377
376
 
@@ -489,7 +488,7 @@ Clicking a day opens a popup with a grid of slots. Each shows only "Booked" or "
489
488
 
490
489
  #### Slot length
491
490
 
492
- `slot-duration` sets the grid granularity in minutes. It must divide 1440 evenly; anything else falls back to 60 with a console warning.
491
+ `slot-duration` sets the grid granularity in minutes. It must divide 1440 evenly; anything else throws, naming the value.
493
492
 
494
493
  ```html
495
494
  <kal-calendar availability-mode="time" slot-duration="30"></kal-calendar>
@@ -497,28 +496,73 @@ Clicking a day opens a popup with a grid of slots. Each shows only "Booked" or "
497
496
 
498
497
  The grid renders `1440 / slot-duration` slots, and `cal-availability-select` emits times on that granularity — half-hour slots produce half-hour selections.
499
498
 
500
- Precision below `slot-duration` is not representable: a booking from 17:30 on a 60-minute grid marks 17:00–18:00 booked, because that hour cannot be sold. A vendor working in half-hours sets `slot-duration="30"` rather than expecting the grid to subdivide itself.
499
+ Precision below `slot-duration` is not representable: a booking from 17:30 on a 60-minute grid marks 17:00–18:00 booked, because that hour cannot be sold. A schedule kept in half-hours sets `slot-duration="30"` rather than expecting the grid to subdivide itself.
501
500
 
502
501
  ### Colouring the navigation arrows
503
502
 
504
- The `‹` and `›` arrows take their hover fill from `--calendar-primary-color` by
503
+ The `‹` and `›` arrows take their hover fill from `--kalendly-primary-color` by
505
504
  default, so changing `primary` moves them along with the selected-day fill and
506
- today outline. To colour them on their own:
505
+ today outline. Five tokens colour them on their own:
506
+
507
+ | Token | Theme key | Default |
508
+ | ------------------------------- | ----------------- | -------------------------- |
509
+ | `--kalendly-nav-arrow-fg` | `navArrowFg` | `--kalendly-text-color` |
510
+ | `--kalendly-nav-arrow-bg` | `navArrowBg` | `--kalendly-background` |
511
+ | `--kalendly-nav-arrow-border` | `navArrowBorder` | `--kalendly-border-color` |
512
+ | `--kalendly-nav-arrow-hover-fg` | `navArrowHoverFg` | `--kalendly-on-accent` |
513
+ | `--kalendly-nav-arrow-hover-bg` | `navArrowHoverBg` | `--kalendly-primary-color` |
514
+
515
+ Each defaults to the value it replaces, so setting none of them changes nothing.
516
+
517
+ **Set them straight on the element.** This is the only way that scopes to one
518
+ calendar:
519
+
520
+ ```html
521
+ <kal-calendar
522
+ style="
523
+ --kalendly-nav-arrow-fg: #0f766e;
524
+ --kalendly-nav-arrow-border: #0f766e;
525
+ --kalendly-nav-arrow-hover-bg: #0f766e;
526
+ --kalendly-nav-arrow-hover-fg: #fff;
527
+ "
528
+ ></kal-calendar>
529
+ ```
530
+
531
+ Or from a stylesheet, which is usually tidier. There is no shadow DOM, so your
532
+ CSS reaches the component:
533
+
534
+ ```css
535
+ #booking-calendar {
536
+ --kalendly-nav-arrow-fg: #0f766e;
537
+ --kalendly-nav-arrow-border: #0f766e;
538
+ --kalendly-nav-arrow-hover-bg: #0f766e;
539
+ --kalendly-nav-arrow-hover-fg: #fff;
540
+ }
541
+ ```
542
+
543
+ The same works in every framework, since it is just an attribute or a class:
544
+
545
+ ```jsx
546
+ <kal-calendar style={{ '--kalendly-nav-arrow-hover-bg': '#0f766e' }} />
547
+ ```
548
+
549
+ **Or use the `theme` property** — but note it is page-wide:
507
550
 
508
551
  ```js
509
- cal.theme = {
510
- navArrowFg: '#0f766e',
511
- navArrowBorder: '#0f766e',
512
- navArrowHoverBg: '#0f766e',
513
- navArrowHoverFg: '#ffffff',
514
- };
552
+ cal.theme = { navArrowFg: '#0f766e', navArrowHoverBg: '#0f766e' };
515
553
  ```
516
554
 
517
- Each defaults to the value it replaces, so setting none of them changes nothing.
555
+ > `theme` writes its values to `:root`, so it colours **every** `<kal-calendar>`
556
+ > on the page, not the element you set it on. With one calendar that is
557
+ > harmless. With two, the last assignment wins for both — use the CSS custom
558
+ > properties above to theme them separately.
559
+
560
+ Every other token works the same way: anything in the theming table can be set
561
+ per element as a CSS variable, or page-wide through `theme`.
518
562
 
519
563
  ### Booking constraints
520
564
 
521
- Four optional attributes describe when a vendor is open. Omit them all and nothing is constrained.
565
+ Four optional attributes describe when bookings are accepted. Omit them all and nothing is constrained.
522
566
 
523
567
  ```html
524
568
  <kal-calendar
@@ -544,9 +588,9 @@ None substitutes for another. A horizon cannot say "weekdays only", a weekday li
544
588
 
545
589
  `available-hours` takes a comma-separated list because a working day is not always contiguous: `"09:00-12:00,13:00-17:00"` closes for lunch, and `"09:00-17:00,17:30-22:00"` runs meetings then an evening class. Each range is half-open, `[start, end)` — `"09:00-17:00"` on an hourly grid makes 16:00–17:00 the last bookable slot, the same convention events use.
546
590
 
547
- Excluded **days** are not click targets at all: no hover response, and neither `cal-date-select` nor `cal-availability-select` fires. Excluded **hours** render greyed and marked `Closed`, and emit no `cal-slot-select`. They are shown rather than hidden so a booking that falls outside the window is still visible to the vendor.
591
+ Excluded **days** are not click targets at all: no hover response, and neither `cal-date-select` nor `cal-availability-select` fires. Excluded **hours** render greyed and marked `Closed`, and emit no `cal-slot-select`. They are shown rather than hidden so a booking that falls outside the window is still visible.
548
592
 
549
- Style either with `--calendar-out-of-range-bg` and `--calendar-out-of-range-fg`, or the `outOfRangeBg` / `outOfRangeFg` theme keys.
593
+ Style either with `--kalendly-out-of-range-bg` and `--kalendly-out-of-range-fg`, or the `outOfRangeBg` / `outOfRangeFg` theme keys.
550
594
 
551
595
  Bad input throws and names the attribute — an unreadable date, `min-date` after `max-date`, a weekday outside `0`–`6`, a malformed or inverted range, ranges that overlap, or a boundary that misses the `slot-duration` grid (`"09:30-17:00"` with hourly slots has no slot to land on).
552
596
 
@@ -715,8 +759,8 @@ cal.getEngine();
715
759
 
716
760
  > **Custom values.** `status`, `category` and `priority` accept any string. An
717
761
  > unrecognised value renders as an uppercased badge with a neutral fill, which
718
- > you can style via `.badge.status-<your-value>` or recolour through
719
- > `--calendar-badge-bg` / `--calendar-badge-text`.
762
+ > you can style via `.kalendly-badge.kalendly-status-<your-value>` or recolour through
763
+ > `--kalendly-badge-bg` / `--kalendly-badge-text`.
720
764
 
721
765
  ```typescript
722
766
  interface CalendarEvent {
@@ -766,85 +810,161 @@ interface CalendarEvent {
766
810
  ### Design tokens
767
811
 
768
812
  Every colour, size, radius, shadow and spacing step is a custom property. Two
769
- tiers: `--kal-*` holds the raw palette, `--calendar-*` names what each value is
770
- for. Override the `--calendar-*` layer — the primitives are internal.
813
+ tiers: `--kal-*` holds the raw palette, `--kalendly-*` names what each value is
814
+ for. Override the `--kalendly-*` layer — the primitives are internal.
771
815
 
772
816
  ```css
773
817
  :root {
774
818
  /* Brand */
775
- --calendar-primary-color: #fc8917;
776
- --calendar-secondary-color: #fca045;
777
- --calendar-tertiary-color: #fdb873;
819
+ --kalendly-primary-color: #fc8917;
820
+ --kalendly-secondary-color: #fca045;
821
+ --kalendly-tertiary-color: #fdb873;
778
822
 
779
823
  /* Surfaces and text */
780
- --calendar-text-color: #2c3e50;
781
- --calendar-text-light: #6b7280;
782
- --calendar-on-accent: #fff;
783
- --calendar-background: #fff;
784
- --calendar-border-color: #dee2e6;
785
- --calendar-cell-hover: #f3f4f6;
786
- --calendar-header-bg: #f8f9fa;
787
- --calendar-selected-bg: #eff6ff;
788
- --calendar-out-of-range-bg: #f3f4f6;
789
- --calendar-out-of-range-fg: #6b7280;
790
- --calendar-nav-arrow-fg: #2c3e50;
791
- --calendar-nav-arrow-bg: #fff;
792
- --calendar-nav-arrow-border: #dee2e6;
793
- --calendar-nav-arrow-hover-fg: #fff;
794
- --calendar-nav-arrow-hover-bg: #fc8917;
795
- --calendar-input-invalid-bg: rgba(239, 68, 68, 0.1);
796
- --calendar-popup-header-fg: #fff;
797
- --calendar-popup-close-fg: #fff;
798
- --calendar-popup-close-bg: rgba(255, 255, 255, 0.2);
799
- --calendar-popup-close-hover-bg: rgba(255, 255, 255, 0.3);
800
- --calendar-popup-bg: #fff;
801
- --calendar-picker-bg: #fff;
802
- --calendar-today-outline: #f7db04;
803
- --calendar-event-indicator: #1890ff;
804
- --calendar-input-invalid: #ef4444;
805
- --calendar-link: #2563eb;
806
- --calendar-skeleton-base: #f0f0f0;
807
- --calendar-skeleton-highlight: #e8e8e8;
824
+ --kalendly-text-color: #2c3e50;
825
+ --kalendly-text-light: #6b7280;
826
+ --kalendly-on-accent: #fff;
827
+ --kalendly-background: #fff;
828
+ --kalendly-border-color: #dee2e6;
829
+ --kalendly-cell-hover: #f3f4f6;
830
+ --kalendly-header-bg: #f8f9fa;
831
+ --kalendly-selected-bg: #eff6ff;
832
+ --kalendly-out-of-range-bg: #f3f4f6;
833
+ --kalendly-out-of-range-fg: #6b7280;
834
+ --kalendly-nav-arrow-fg: #2c3e50;
835
+ --kalendly-nav-arrow-bg: #fff;
836
+ --kalendly-nav-arrow-border: #dee2e6;
837
+ --kalendly-nav-arrow-hover-fg: #fff;
838
+ --kalendly-nav-arrow-hover-bg: #fc8917;
839
+ --kalendly-input-invalid-bg: rgba(239, 68, 68, 0.1);
840
+ --kalendly-popup-header-fg: #fff;
841
+ --kalendly-popup-close-fg: #fff;
842
+ --kalendly-popup-close-bg: rgba(255, 255, 255, 0.2);
843
+ --kalendly-popup-close-hover-bg: rgba(255, 255, 255, 0.3);
844
+ --kalendly-popup-bg: #fff;
845
+ --kalendly-picker-bg: #fff;
846
+ --kalendly-today-outline: #f7db04;
847
+ --kalendly-event-indicator: #1890ff;
848
+ --kalendly-input-invalid: #ef4444;
849
+ --kalendly-link: #2563eb;
850
+ --kalendly-skeleton-base: #f0f0f0;
851
+ --kalendly-skeleton-highlight: #e8e8e8;
808
852
 
809
853
  /* Availability */
810
- --calendar-open-bg: #dcfce7;
811
- --calendar-open-fg: #16a34a;
812
- --calendar-conditional-bg: #fef3c7;
813
- --calendar-conditional-fg: #d97706;
814
- --calendar-blocked-bg: #fee2e2;
815
- --calendar-blocked-fg: #dc2626;
816
- --calendar-range-bg: #16a34a;
817
- --calendar-range-outline: #15803d;
818
- --calendar-in-range-bg: #bbf7d0;
819
- --calendar-in-range-outline: #86efac;
854
+ --kalendly-open-bg: #dcfce7;
855
+ --kalendly-open-fg: #16a34a;
856
+ --kalendly-conditional-bg: #fef3c7;
857
+ --kalendly-conditional-fg: #d97706;
858
+ --kalendly-blocked-bg: #fee2e2;
859
+ --kalendly-blocked-fg: #dc2626;
860
+ --kalendly-range-bg: #16a34a;
861
+ --kalendly-range-outline: #15803d;
862
+ --kalendly-in-range-bg: #bbf7d0;
863
+ --kalendly-in-range-outline: #86efac;
820
864
 
821
865
  /* Badges — bg/text is the fallback for caller-defined values */
822
- --calendar-badge-bg: #f3f4f6;
823
- --calendar-badge-text: #4b5563;
824
- --calendar-badge-success-bg: #d1fae5;
825
- --calendar-badge-success-text: #059669;
826
- --calendar-badge-info-bg: #dbeafe;
827
- --calendar-badge-info-text: #2563eb;
828
- --calendar-badge-warning-bg: #fef3c7;
829
- --calendar-badge-warning-text: #d97706;
830
- --calendar-badge-danger-bg: #fee2e2;
831
- --calendar-badge-danger-text: #dc2626;
832
- --calendar-badge-neutral-bg: #f3f4f6;
833
- --calendar-badge-neutral-text: #6b7280;
834
- --calendar-badge-positive-bg: #dcfce7;
835
- --calendar-badge-positive-text: #16a34a;
836
- --calendar-badge-tentative-bg: #e0e7ff;
837
- --calendar-badge-tentative-text: #4f46e5;
866
+ --kalendly-badge-bg: #f3f4f6;
867
+ --kalendly-badge-text: #4b5563;
868
+ --kalendly-badge-success-bg: #d1fae5;
869
+ --kalendly-badge-success-text: #059669;
870
+ --kalendly-badge-info-bg: #dbeafe;
871
+ --kalendly-badge-info-text: #2563eb;
872
+ --kalendly-badge-warning-bg: #fef3c7;
873
+ --kalendly-badge-warning-text: #d97706;
874
+ --kalendly-badge-danger-bg: #fee2e2;
875
+ --kalendly-badge-danger-text: #dc2626;
876
+ --kalendly-badge-neutral-bg: #f3f4f6;
877
+ --kalendly-badge-neutral-text: #6b7280;
878
+ --kalendly-badge-positive-bg: #dcfce7;
879
+ --kalendly-badge-positive-text: #16a34a;
880
+ --kalendly-badge-tentative-bg: #e0e7ff;
881
+ --kalendly-badge-tentative-text: #4f46e5;
838
882
  }
839
883
  ```
840
884
 
841
885
  Type, radius, elevation and spacing scales are exposed the same way —
842
- `--calendar-font-*`, `--calendar-radius-*`, `--calendar-shadow-*` and
843
- `--calendar-space-*`. See `dist/styles/calendar.css` for the full set.
886
+ `--kalendly-font-*`, `--kalendly-radius-*`, `--kalendly-shadow-*` and
887
+ `--kalendly-space-*`. See `dist/styles/calendar.css` for the full set.
888
+
889
+ ### Where you set a token decides what it colours
890
+
891
+ The same token means different things depending on where you declare it.
892
+
893
+ | Set on | Colours |
894
+ | ---------------------------- | ----------------------------------------- |
895
+ | `:root` or a stylesheet | every `<kal-calendar>` on the page |
896
+ | the `<kal-calendar>` element | that calendar only |
897
+ | the `theme` property | **every** calendar — it writes to `:root` |
898
+
899
+ To theme one calendar, set the custom properties on the element. There is no
900
+ shadow DOM, so they inherit straight through:
901
+
902
+ ```html
903
+ <kal-calendar
904
+ style="
905
+ --kalendly-primary-color: #4f46e5;
906
+ --kalendly-on-accent: #fff;
907
+ "
908
+ ></kal-calendar>
909
+ ```
910
+
911
+ Or from your own stylesheet, which is usually tidier:
912
+
913
+ ```css
914
+ #booking-calendar {
915
+ --kalendly-primary-color: #4f46e5;
916
+ --kalendly-on-accent: #fff;
917
+ }
918
+ ```
919
+
920
+ It is only an attribute, so every framework does it its own way:
921
+
922
+ ```jsx
923
+ /* React — cast because CSS custom properties are not in CSSProperties */
924
+ <kal-calendar
925
+ style={{
926
+ '--kalendly-primary-color': 'var(--primary)',
927
+ '--kalendly-on-accent': 'var(--primary-foreground)',
928
+ } as React.CSSProperties}
929
+ />
930
+ ```
931
+
932
+ ```vue
933
+ <kal-calendar :style="{ '--kalendly-primary-color': brand }" />
934
+ ```
935
+
936
+ ```svelte
937
+ <kal-calendar style="--kalendly-primary-color: {brand}" />
938
+ ```
939
+
940
+ ```html
941
+ <!-- Angular -->
942
+ <kal-calendar [style.--kalendly-primary-color]="brand"></kal-calendar>
943
+ ```
944
+
945
+ Pointing a token at one of your own design-system variables works, since it
946
+ resolves in the element's scope:
947
+
948
+ ```html
949
+ <kal-calendar style="--kalendly-primary-color: var(--primary)"></kal-calendar>
950
+ ```
951
+
952
+ > **One token is enough.** Translucent fills — cell hover, the picker shadow —
953
+ > are built with `color-mix()`, so they follow `--kalendly-primary-color`
954
+ > whatever format it holds: hex, `rgb()`, `hsl()`, `oklch()`, or a `var()`
955
+ > pointing at your own design system.
956
+
957
+ Every demo under `docs/examples/` has a **Brand Colour** control that does
958
+ exactly this, so you can see which parts of the calendar follow the base token.
844
959
 
845
960
  ### JS theme property (full reference)
846
961
 
847
- Every `--calendar-*` colour token has a matching camelCase theme key.
962
+ Every `--kalendly-*` colour token has a matching camelCase theme key.
963
+
964
+ > `theme` writes its values to `:root`, so it colours **every** `<kal-calendar>`
965
+ > on the page, not the element you assign it to. With one calendar that is
966
+ > harmless; with two, the last assignment wins for both. Use the element-scoped
967
+ > custom properties above to theme them separately.
848
968
 
849
969
  ```js
850
970
  cal.theme = {
@@ -966,12 +1086,3 @@ MIT © Callis Ezenwaka
966
1086
  ## Changelog
967
1087
 
968
1088
  See [CHANGELOG.md](CHANGELOG.md).
969
-
970
- ### Recent Updates
971
-
972
- - **v0.2.1**: Add availability mode (day/time views), selectable range, lazy event fetching with skeleton loading
973
- - **v0.2.0**: Migrated to a single `<kal-calendar>` web component — works natively in React, Vue, Angular, Svelte, Solid.js, and plain HTML with no framework dependency
974
- - **v0.1.7**: Vanilla calendar performance optimization with event delegation
975
- - **v0.1.6**: Navigation enhancements — Today button, month/year picker, optional `title` prop
976
- - **v0.1.5**: Universal theming system, TypeScript improvements
977
- - **v0.1.0**: Initial release with React, Vue, React Native, and Vanilla JavaScript support
@@ -244,13 +244,13 @@ function generateCalendarDates(year, month, events = [], weekStartsOn = 0) {
244
244
  function getCellClasses(calendarDate) {
245
245
  const classes = [];
246
246
  if (!calendarDate.isCurrentMonth) {
247
- classes.push("calendar-cell-other-month");
247
+ classes.push("kalendly-cell-other-month");
248
248
  }
249
249
  if (calendarDate.isToday) {
250
- classes.push("calendar-cell-today");
250
+ classes.push("kalendly-cell-today");
251
251
  }
252
252
  if (calendarDate.hasEvents) {
253
- classes.push("calendar-cell-has-event");
253
+ classes.push("kalendly-cell-has-event");
254
254
  }
255
255
  return classes;
256
256
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/index.ts","../../src/core/utils.ts","../../src/core/calendar-engine.ts"],"sourcesContent":["export * from './types';\nexport * from './utils';\nexport { CalendarEngine } from './calendar-engine';\n\n// Re-export commonly used utilities\nexport {\n MONTHS,\n MONTHS_FULL,\n DAYS,\n normalizeDate,\n isSameDay,\n isToday,\n generateYears,\n getEventsForDate,\n hasEvents,\n generateCalendarDates,\n getCellClasses,\n formatDateForDisplay,\n getMonthYearText,\n} from './utils';\n","import { CalendarEvent, CalendarDate, CategoryColorMap } from './types';\n\nexport const MONTHS = [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec',\n];\n\nexport const MONTHS_FULL = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\nexport const DAYS = [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n];\n\nexport function normalizeDate(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);\n}\n\nexport function isSameDay(date1: Date, date2: Date): boolean {\n return normalizeDate(date1).getTime() === normalizeDate(date2).getTime();\n}\n\nexport function isToday(date: Date): boolean {\n return isSameDay(date, new Date());\n}\n\nexport function generateYears(minYear?: number, maxYear?: number): number[] {\n const currentYear = new Date().getFullYear();\n const min = minYear ?? currentYear - 30;\n const max = maxYear ?? currentYear + 10;\n\n return Array.from({ length: max - min + 1 }, (_, i) => min + i);\n}\n\n// endDate is inclusive, matching the endDate cal-availability-select emits, so\n// a selection can be handed straight back as one event.\n// \"09:00-12:00,13:00-17:00\" to half-open [start, end) minute intervals.\n// Throws rather than dropping a bad range: a vendor who mistypes their opening\n// hours must hear about it, not quietly stop selling the afternoon.\nexport function parseHourRanges(\n value: string,\n slotDuration: number\n): Array<[number, number]> {\n const parts = value\n .split(',')\n .map(part => part.trim())\n .filter(Boolean);\n\n if (parts.length === 0) {\n throw new Error(\n `<kal-calendar> available-hours is empty. Omit the attribute to allow ` +\n `every hour, or name at least one HH:MM-HH:MM range.`\n );\n }\n\n const ranges = parts.map((part): [number, number] => {\n const halves = part.split('-');\n if (halves.length !== 2) {\n throw new Error(\n `<kal-calendar> available-hours range \"${part}\" is not HH:MM-HH:MM.`\n );\n }\n\n const [start, end] = halves.map(half => parseTimeToMinutes(half.trim()));\n if (start === null || end === null) {\n throw new Error(\n `<kal-calendar> available-hours range \"${part}\" has an unreadable ` +\n `time. Use 24-hour HH:MM.`\n );\n }\n if (start >= end) {\n throw new Error(\n `<kal-calendar> available-hours range \"${part}\" starts at or after ` +\n `it ends.`\n );\n }\n if (start % slotDuration !== 0 || end % slotDuration !== 0) {\n throw new Error(\n `<kal-calendar> available-hours range \"${part}\" does not land on a ` +\n `${slotDuration}-minute slot boundary.`\n );\n }\n\n return [start, end];\n });\n\n if (mergeIntervals(ranges).length !== ranges.length) {\n throw new Error(\n `<kal-calendar> available-hours ranges overlap or touch: \"${value}\". ` +\n `Write each bookable window once.`\n );\n }\n\n return ranges;\n}\n\n// Both bounds inclusive; either may be null to leave that end unbounded.\nexport function isDateWithinWindow(\n date: Date,\n min: Date | null,\n max: Date | null\n): boolean {\n const target = normalizeDate(date).getTime();\n\n if (min && target < normalizeDate(min).getTime()) return false;\n if (max && target > normalizeDate(max).getTime()) return false;\n\n return true;\n}\n\n// `days` holds getDay() values, 0 = Sunday. Null means every day is allowed.\nexport function isDayAllowed(date: Date, days: number[] | null): boolean {\n return days === null || days.includes(date.getDay());\n}\n\nexport function eventCoversDate(event: CalendarEvent, date: Date): boolean {\n const start = normalizeDate(new Date(event.date)).getTime();\n const target = normalizeDate(date).getTime();\n if (Number.isNaN(start)) return false;\n\n if (event.endDate === undefined || event.endDate === null) {\n return start === target;\n }\n\n const end = normalizeDate(new Date(event.endDate)).getTime();\n if (Number.isNaN(end)) {\n throw new Error(\n `<kal-calendar> event ${event.id} has an unreadable endDate: ` +\n `${String(event.endDate)}.`\n );\n }\n if (end < start) {\n throw new Error(\n `<kal-calendar> event ${event.id} has an endDate before its date: ` +\n `${String(event.endDate)} < ${String(event.date)}.`\n );\n }\n\n return target >= start && target <= end;\n}\n\nexport function getEventsForDate(\n events: CalendarEvent[],\n date: Date\n): CalendarEvent[] {\n return events.filter(event => eventCoversDate(event, date));\n}\n\nexport function hasEvents(events: CalendarEvent[], date: Date): boolean {\n return getEventsForDate(events, date).length > 0;\n}\n\nexport function generateCalendarDates(\n year: number,\n month: number,\n events: CalendarEvent[] = [],\n weekStartsOn: 0 | 1 = 0\n): CalendarDate[][] {\n const firstDay = new Date(year, month, 1);\n const lastDay = new Date(year, month + 1, 0);\n const daysInMonth = lastDay.getDate();\n const prevMonthLastDay = new Date(year, month, 0).getDate();\n\n let firstDayOfWeek = firstDay.getDay();\n if (weekStartsOn === 1) {\n firstDayOfWeek = firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1;\n }\n\n const dates: CalendarDate[][] = [];\n let day = 1;\n let nextMonthDay = 1;\n\n for (let week = 0; week < 6; week++) {\n const weekDates: CalendarDate[] = [];\n\n for (let dayOfWeek = 0; dayOfWeek < 7; dayOfWeek++) {\n if (week === 0 && dayOfWeek < firstDayOfWeek) {\n // Previous month days\n const prevDay = prevMonthLastDay - firstDayOfWeek + dayOfWeek + 1;\n const prevDate = new Date(year, month - 1, prevDay);\n const dateEvents = getEventsForDate(events, prevDate);\n weekDates.push({\n date: prevDate,\n isCurrentMonth: false,\n isToday: isToday(prevDate),\n hasEvents: dateEvents.length > 0,\n events: dateEvents,\n });\n } else if (day > daysInMonth) {\n // Next month days\n const nextDate = new Date(year, month + 1, nextMonthDay);\n const dateEvents = getEventsForDate(events, nextDate);\n weekDates.push({\n date: nextDate,\n isCurrentMonth: false,\n isToday: isToday(nextDate),\n hasEvents: dateEvents.length > 0,\n events: dateEvents,\n });\n nextMonthDay++;\n } else {\n // Current month days\n const currentDate = new Date(year, month, day);\n const dateEvents = getEventsForDate(events, currentDate);\n weekDates.push({\n date: currentDate,\n isCurrentMonth: true,\n isToday: isToday(currentDate),\n hasEvents: dateEvents.length > 0,\n events: dateEvents,\n });\n day++;\n }\n }\n\n dates.push(weekDates);\n }\n\n return dates;\n}\n\nexport function getCellClasses(calendarDate: CalendarDate): string[] {\n const classes: string[] = [];\n\n if (!calendarDate.isCurrentMonth) {\n classes.push('calendar-cell-other-month');\n }\n\n if (calendarDate.isToday) {\n classes.push('calendar-cell-today');\n }\n\n if (calendarDate.hasEvents) {\n classes.push('calendar-cell-has-event');\n }\n\n return classes;\n}\n\nexport function formatDateForDisplay(date: Date): string {\n return `${DAYS[date.getDay()]} ${date.getDate()}`;\n}\n\nexport function getMonthYearText(year: number, month: number): string {\n return `${MONTHS_FULL[month]} ${year}`;\n}\n\nexport function formatTimeRange(event: CalendarEvent): string {\n if (event.allDay || (!event.startTime && !event.endTime)) {\n return 'All day';\n }\n\n if (event.startTime && event.endTime) {\n return `${event.startTime} - ${event.endTime}`;\n }\n\n if (event.startTime) {\n return `${event.startTime}`;\n }\n\n return '';\n}\n\nexport function formatAttendees(attendees?: string[]): string {\n if (!attendees || attendees.length === 0) return '';\n\n if (attendees.length === 1) return attendees[0];\n if (attendees.length === 2) return attendees.join(' and ');\n\n return `${attendees.slice(0, -1).join(', ')}, and ${attendees[attendees.length - 1]}`;\n}\n\nexport function sortEventsByTime(events: CalendarEvent[]): CalendarEvent[] {\n return [...events].sort((a, b) => {\n const aAllDay = a.allDay || (!a.startTime && !a.endTime);\n const bAllDay = b.allDay || (!b.startTime && !b.endTime);\n\n if (aAllDay && !bAllDay) return -1;\n if (!aAllDay && bAllDay) return 1;\n\n if (!a.startTime || !b.startTime) return 0;\n return a.startTime.localeCompare(b.startTime);\n });\n}\n\nexport const DEFAULT_CATEGORY_COLORS: CategoryColorMap = {\n work: '#3b82f6',\n personal: '#8b5cf6',\n meeting: '#10b981',\n deadline: '#ef4444',\n appointment: '#f59e0b',\n other: '#6b7280',\n};\n\n// Dynamic function that accepts custom colors\nexport function getDefaultEventColor(\n category?: string,\n customColors?: CategoryColorMap\n): string {\n const colorMap = customColors || DEFAULT_CATEGORY_COLORS;\n\n if (category && colorMap[category]) {\n return colorMap[category];\n }\n\n // Default fallback color\n return '#fc8917';\n}\n\n// Helper to merge custom colors with defaults\nexport function mergeCategoryColors(\n customColors?: CategoryColorMap\n): CategoryColorMap {\n return {\n ...DEFAULT_CATEGORY_COLORS,\n ...customColors,\n };\n}\n\n// Validate if a color is a valid hex color\nexport function isValidHexColor(color: string): boolean {\n return /^#([0-9A-F]{3}){1,2}$/i.test(color);\n}\n\n// Get color for a category with validation\nexport function getCategoryColor(\n category: string,\n customColors?: CategoryColorMap\n): string {\n const colorMap = mergeCategoryColors(customColors);\n const color = colorMap[category] || colorMap.other || '#fc8917';\n\n return isValidHexColor(color) ? color : '#fc8917';\n}\n\nconst HTML_ESCAPES: Record<string, string> = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#39;',\n};\n\n// Escape a value for interpolation into HTML text or a quoted attribute\nexport function escapeHtml(value: unknown): string {\n if (value === null || value === undefined) return '';\n\n return String(value).replace(/[&<>\"']/g, char => HTML_ESCAPES[char]);\n}\n\n// Reduce a caller-supplied value to a single safe CSS class token\nexport function slugifyToken(value: string): string {\n return String(value)\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n\n// Allow http(s), mailto and relative URLs; anything else (javascript:, data:,\n// vbscript:) collapses to a harmless anchor\nexport function safeUrl(value: string): string {\n // Browsers ignore control characters when resolving a scheme, so\n // `java\\0script:` and `java\\tscript:` both navigate. Strip them before\n // testing rather than after.\n const normalized = String(value)\n .split('')\n .filter(char => char.charCodeAt(0) > 0x20)\n .join('');\n\n if (/^(?:https?:|mailto:)/i.test(normalized)) return normalized;\n\n // Relative URLs have no scheme at all — a colon before the first slash,\n // question mark or hash means someone is naming one\n const schemeless = !/^[^/?#]*:/.test(normalized);\n\n return schemeless ? normalized : '#';\n}\n\n// Accept hex colors and bare CSS color keywords; reject anything that could\n// terminate the declaration or escape the style attribute\nexport function safeColor(value: string): string {\n const trimmed = String(value).trim();\n\n return isValidHexColor(trimmed) || /^[a-z]+$/i.test(trimmed)\n ? trimmed\n : '#3b82f6';\n}\n\nexport const MINUTES_PER_DAY = 1440;\nexport const DEFAULT_SLOT_DURATION = 60;\n\nexport function parseTimeToMinutes(time: unknown): number | null {\n if (typeof time !== 'string') return null;\n\n const match = /^(\\d{1,2}):(\\d{2})$/.exec(time.trim());\n if (!match) return null;\n\n const hours = Number(match[1]);\n const mins = Number(match[2]);\n if (hours > 24 || mins > 59 || (hours === 24 && mins > 0)) return null;\n\n return hours * 60 + mins;\n}\n\nexport function formatMinutes(total: number): string {\n const hours = Math.floor(total / 60);\n const mins = total % 60;\n return `${String(hours).padStart(2, '0')}:${String(mins).padStart(2, '0')}`;\n}\n\n// Absolute [start, end) in minutes. An end at or before the start is on the\n// following day, so a booking that crosses midnight is one interval rather than\n// two half-days. An unreadable time occupies the whole day — a booking surface\n// that cannot parse a time must not offer the slot.\nexport function eventInterval(\n event: CalendarEvent,\n slotDuration: number,\n onDay: Date\n): [number, number] | null {\n const day = normalizeDate(onDay).getTime();\n if (Number.isNaN(day)) return null;\n\n const base = day / 60000;\n const wholeDay: [number, number] = [base, base + MINUTES_PER_DAY];\n\n if (event.allDay || !event.startTime) return wholeDay;\n\n const from = parseTimeToMinutes(event.startTime);\n if (from === null) return wholeDay;\n\n if (event.endTime === undefined || event.endTime === null) {\n return [base + from, base + from + slotDuration];\n }\n\n const to = parseTimeToMinutes(event.endTime);\n if (to === null) return wholeDay;\n\n return [base + from, base + (to <= from ? to + MINUTES_PER_DAY : to)];\n}\n\nexport function mergeIntervals(\n intervals: Array<[number, number]>\n): Array<[number, number]> {\n const sorted = [...intervals].sort((a, b) => a[0] - b[0]);\n\n return sorted.reduce<Array<[number, number]>>((merged, [start, end]) => {\n const last = merged[merged.length - 1];\n if (last && start <= last[1]) last[1] = Math.max(last[1], end);\n else merged.push([start, end]);\n return merged;\n }, []);\n}\n\n// Which of the day's slots any booking overlaps. Events from the previous day\n// belong in `events` so a booking crossing midnight marks the morning it runs into.\nexport function bookedSlots(\n events: CalendarEvent[],\n date: Date,\n slotDuration: number = DEFAULT_SLOT_DURATION\n): boolean[] {\n const base = normalizeDate(date).getTime() / 60000;\n\n const previousDay = new Date(date);\n previousDay.setDate(previousDay.getDate() - 1);\n\n // A span's times repeat on each day it covers, so the window is anchored to\n // the day being drawn rather than the day the span began\n const intervals: Array<[number, number]> = [];\n for (const event of new Set(events)) {\n for (const day of [previousDay, date]) {\n if (!eventCoversDate(event, day)) continue;\n const interval = eventInterval(event, slotDuration, day);\n if (interval) intervals.push(interval);\n }\n }\n\n const merged = mergeIntervals(intervals);\n\n return Array.from(\n { length: Math.floor(MINUTES_PER_DAY / slotDuration) },\n (_, index) => {\n const start = base + index * slotDuration;\n const end = start + slotDuration;\n return merged.some(([from, to]) => start < to && end > from);\n }\n );\n}\n","import {\n CalendarEvent,\n CalendarState,\n CalendarConfig,\n CalendarActions,\n CalendarViewModel,\n CalendarPane,\n CategoryColorMap,\n} from './types';\nimport {\n generateCalendarDates,\n getEventsForDate,\n generateYears,\n getMonthYearText,\n formatDateForDisplay,\n mergeCategoryColors,\n getCategoryColor,\n MONTHS,\n DAYS,\n} from './utils';\n\nexport class CalendarEngine {\n private state: CalendarState;\n private config: CalendarConfig;\n private listeners: Set<() => void> = new Set();\n private categoryColors: CategoryColorMap;\n\n constructor(config: CalendarConfig) {\n this.config = config;\n this.categoryColors = mergeCategoryColors(config.categoryColors);\n\n const initialDate = config.initialDate || new Date();\n this.state = {\n currentYear: initialDate.getFullYear(),\n currentMonth: initialDate.getMonth(),\n currentDate: initialDate.getDate(),\n selectedDate: null,\n selectedDayIndex: null,\n tasks: [],\n };\n }\n\n /**\n * Subscribe to state changes\n */\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n /**\n * Notify all listeners of state changes\n */\n private notify(): void {\n this.listeners.forEach(listener => listener());\n }\n\n /**\n * Get current state\n */\n getState(): CalendarState {\n return { ...this.state };\n }\n\n /**\n * Get view model with computed properties\n */\n getViewModel(): CalendarViewModel {\n const panes: CalendarPane[] = Array.from(\n { length: Math.max(1, this.config.monthCount ?? 1) },\n (_, offset) => {\n const anchor = new Date(\n this.state.currentYear,\n this.state.currentMonth + offset,\n 1\n );\n const year = anchor.getFullYear();\n const month = anchor.getMonth();\n\n return {\n year,\n month,\n monthAndYearText: getMonthYearText(year, month),\n calendarDates: generateCalendarDates(\n year,\n month,\n this.config.events,\n this.config.weekStartsOn\n ),\n };\n }\n );\n\n return {\n ...this.state,\n months: MONTHS,\n days: DAYS,\n years: generateYears(this.config.minYear, this.config.maxYear),\n monthAndYearText: panes[0].monthAndYearText,\n scheduleDay: this.state.selectedDate\n ? formatDateForDisplay(this.state.selectedDate)\n : '',\n panes,\n calendarDates: panes[0].calendarDates,\n };\n }\n\n /**\n * Get actions object\n */\n getActions(): CalendarActions {\n return {\n next: this.next.bind(this),\n previous: this.previous.bind(this),\n jump: this.jump.bind(this),\n goToToday: this.goToToday.bind(this),\n isCurrentMonth: this.isCurrentMonth.bind(this),\n selectDate: this.selectDate.bind(this),\n updateTasks: this.updateTasks.bind(this),\n };\n }\n\n /**\n * Navigate to next month\n */\n private next(): void {\n if (this.state.currentMonth === 11) {\n this.state.currentMonth = 0;\n this.state.currentYear++;\n } else {\n this.state.currentMonth++;\n }\n\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Navigate to previous month\n */\n private previous(): void {\n if (this.state.currentMonth === 0) {\n this.state.currentMonth = 11;\n this.state.currentYear--;\n } else {\n this.state.currentMonth--;\n }\n\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Jump to specific month and year\n */\n private jump(year: number, month: number): void {\n this.state.currentYear = year;\n this.state.currentMonth = month;\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Navigate to current month (today)\n */\n private goToToday(): void {\n const today = new Date();\n this.state.currentYear = today.getFullYear();\n this.state.currentMonth = today.getMonth();\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Check if currently viewing today's month\n */\n private isCurrentMonth(): boolean {\n const today = new Date();\n return (\n this.state.currentYear === today.getFullYear() &&\n this.state.currentMonth === today.getMonth()\n );\n }\n\n /**\n * Select a specific date\n */\n private selectDate(date: Date, dayIndex?: number, navigate = true): void {\n this.state.selectedDate = date;\n this.state.selectedDayIndex = dayIndex ?? null;\n this.state.currentDate = date.getDate();\n if (navigate) {\n this.state.currentMonth = date.getMonth();\n this.state.currentYear = date.getFullYear();\n }\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Update tasks for the currently selected date\n */\n private updateTasks(): void {\n if (!this.state.selectedDate) {\n this.state.tasks = [];\n return;\n }\n\n this.state.tasks = getEventsForDate(\n this.config.events,\n this.state.selectedDate\n );\n }\n\n /**\n * Update events configuration\n */\n updateEvents(events: CalendarEvent[]): void {\n this.config.events = events;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Handle date cell click\n */\n handleDateClick(\n date: Date,\n dayIndex?: number,\n options?: { navigate?: boolean }\n ): void {\n this.selectDate(date, dayIndex, options?.navigate !== false);\n }\n\n /**\n * Check if date has events\n */\n hasEventsForDate(date: Date): boolean {\n return getEventsForDate(this.config.events, date).length > 0;\n }\n\n /**\n * Get events for a specific date\n */\n getEventsForDate(date: Date): CalendarEvent[] {\n return getEventsForDate(this.config.events, date);\n }\n\n /**\n * Clear selected date\n */\n clearSelection(): void {\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.state.tasks = [];\n this.notify();\n }\n\n /**\n * Get category color (with custom colors support)\n */\n getCategoryColor(category?: string): string {\n if (!category) return '#fc8917';\n return getCategoryColor(category, this.categoryColors);\n }\n\n /**\n * Update category colors dynamically\n */\n updateCategoryColors(colors: CategoryColorMap): void {\n this.categoryColors = mergeCategoryColors(colors);\n this.notify();\n }\n\n /**\n * Get all category colors\n */\n getCategoryColors(): CategoryColorMap {\n return { ...this.categoryColors };\n }\n\n /**\n * Register a new category with color\n */\n registerCategory(name: string, color: string): void {\n this.categoryColors[name] = color;\n this.notify();\n }\n\n /**\n * Destroy the engine and cleanup listeners\n */\n destroy(): void {\n this.listeners.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,SAAS;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,cAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,OAAO;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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AiB,UAA2B;AAC1C,QAAI,CAAC,SAAU,QAAO;AACtB,WAAO,iBAAiB,UAAU,KAAK,cAAc;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA,EAKA,qBAAqB,QAAgC;AACnD,SAAK,iBAAiB,oBAAoB,MAAM;AAChD,SAAK,OAAO;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,oBAAsC;AACpC,WAAO,EAAE,GAAG,KAAK,eAAe;AAAA,EAClC;AAAA;AAAA;AAAA;AAAA,EAKA,iBAAiB,MAAc,OAAqB;AAClD,SAAK,eAAe,IAAI,IAAI;AAC5B,SAAK,OAAO;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,UAAgB;AACd,SAAK,UAAU,MAAM;AAAA,EACvB;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/core/index.ts","../../src/core/utils.ts","../../src/core/calendar-engine.ts"],"sourcesContent":["export * from './types';\nexport * from './utils';\nexport { CalendarEngine } from './calendar-engine';\n\n// Re-export commonly used utilities\nexport {\n MONTHS,\n MONTHS_FULL,\n DAYS,\n normalizeDate,\n isSameDay,\n isToday,\n generateYears,\n getEventsForDate,\n hasEvents,\n generateCalendarDates,\n getCellClasses,\n formatDateForDisplay,\n getMonthYearText,\n} from './utils';\n","import { CalendarEvent, CalendarDate, CategoryColorMap } from './types';\n\nexport const MONTHS = [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec',\n];\n\nexport const MONTHS_FULL = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\nexport const DAYS = [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n];\n\nexport function normalizeDate(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);\n}\n\nexport function isSameDay(date1: Date, date2: Date): boolean {\n return normalizeDate(date1).getTime() === normalizeDate(date2).getTime();\n}\n\nexport function isToday(date: Date): boolean {\n return isSameDay(date, new Date());\n}\n\nexport function generateYears(minYear?: number, maxYear?: number): number[] {\n const currentYear = new Date().getFullYear();\n const min = minYear ?? currentYear - 30;\n const max = maxYear ?? currentYear + 10;\n\n return Array.from({ length: max - min + 1 }, (_, i) => min + i);\n}\n\n// endDate is inclusive, matching the endDate cal-availability-select emits, so\n// a selection can be handed straight back as one event.\n// \"09:00-12:00,13:00-17:00\" to half-open [start, end) minute intervals.\n// Throws rather than dropping a bad range: a vendor who mistypes their opening\n// hours must hear about it, not quietly stop selling the afternoon.\nexport function parseHourRanges(\n value: string,\n slotDuration: number\n): Array<[number, number]> {\n const parts = value\n .split(',')\n .map(part => part.trim())\n .filter(Boolean);\n\n if (parts.length === 0) {\n throw new Error(\n `<kal-calendar> available-hours is empty. Omit the attribute to allow ` +\n `every hour, or name at least one HH:MM-HH:MM range.`\n );\n }\n\n const ranges = parts.map((part): [number, number] => {\n const halves = part.split('-');\n if (halves.length !== 2) {\n throw new Error(\n `<kal-calendar> available-hours range \"${part}\" is not HH:MM-HH:MM.`\n );\n }\n\n const [start, end] = halves.map(half => parseTimeToMinutes(half.trim()));\n if (start === null || end === null) {\n throw new Error(\n `<kal-calendar> available-hours range \"${part}\" has an unreadable ` +\n `time. Use 24-hour HH:MM.`\n );\n }\n if (start >= end) {\n throw new Error(\n `<kal-calendar> available-hours range \"${part}\" starts at or after ` +\n `it ends.`\n );\n }\n if (start % slotDuration !== 0 || end % slotDuration !== 0) {\n throw new Error(\n `<kal-calendar> available-hours range \"${part}\" does not land on a ` +\n `${slotDuration}-minute slot boundary.`\n );\n }\n\n return [start, end];\n });\n\n if (mergeIntervals(ranges).length !== ranges.length) {\n throw new Error(\n `<kal-calendar> available-hours ranges overlap or touch: \"${value}\". ` +\n `Write each bookable window once.`\n );\n }\n\n return ranges;\n}\n\n// Both bounds inclusive; either may be null to leave that end unbounded.\nexport function isDateWithinWindow(\n date: Date,\n min: Date | null,\n max: Date | null\n): boolean {\n const target = normalizeDate(date).getTime();\n\n if (min && target < normalizeDate(min).getTime()) return false;\n if (max && target > normalizeDate(max).getTime()) return false;\n\n return true;\n}\n\n// `days` holds getDay() values, 0 = Sunday. Null means every day is allowed.\nexport function isDayAllowed(date: Date, days: number[] | null): boolean {\n return days === null || days.includes(date.getDay());\n}\n\nexport function eventCoversDate(event: CalendarEvent, date: Date): boolean {\n const start = normalizeDate(new Date(event.date)).getTime();\n const target = normalizeDate(date).getTime();\n if (Number.isNaN(start)) return false;\n\n if (event.endDate === undefined || event.endDate === null) {\n return start === target;\n }\n\n const end = normalizeDate(new Date(event.endDate)).getTime();\n if (Number.isNaN(end)) {\n throw new Error(\n `<kal-calendar> event ${event.id} has an unreadable endDate: ` +\n `${String(event.endDate)}.`\n );\n }\n if (end < start) {\n throw new Error(\n `<kal-calendar> event ${event.id} has an endDate before its date: ` +\n `${String(event.endDate)} < ${String(event.date)}.`\n );\n }\n\n return target >= start && target <= end;\n}\n\nexport function getEventsForDate(\n events: CalendarEvent[],\n date: Date\n): CalendarEvent[] {\n return events.filter(event => eventCoversDate(event, date));\n}\n\nexport function hasEvents(events: CalendarEvent[], date: Date): boolean {\n return getEventsForDate(events, date).length > 0;\n}\n\nexport function generateCalendarDates(\n year: number,\n month: number,\n events: CalendarEvent[] = [],\n weekStartsOn: 0 | 1 = 0\n): CalendarDate[][] {\n const firstDay = new Date(year, month, 1);\n const lastDay = new Date(year, month + 1, 0);\n const daysInMonth = lastDay.getDate();\n const prevMonthLastDay = new Date(year, month, 0).getDate();\n\n let firstDayOfWeek = firstDay.getDay();\n if (weekStartsOn === 1) {\n firstDayOfWeek = firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1;\n }\n\n const dates: CalendarDate[][] = [];\n let day = 1;\n let nextMonthDay = 1;\n\n for (let week = 0; week < 6; week++) {\n const weekDates: CalendarDate[] = [];\n\n for (let dayOfWeek = 0; dayOfWeek < 7; dayOfWeek++) {\n if (week === 0 && dayOfWeek < firstDayOfWeek) {\n // Previous month days\n const prevDay = prevMonthLastDay - firstDayOfWeek + dayOfWeek + 1;\n const prevDate = new Date(year, month - 1, prevDay);\n const dateEvents = getEventsForDate(events, prevDate);\n weekDates.push({\n date: prevDate,\n isCurrentMonth: false,\n isToday: isToday(prevDate),\n hasEvents: dateEvents.length > 0,\n events: dateEvents,\n });\n } else if (day > daysInMonth) {\n // Next month days\n const nextDate = new Date(year, month + 1, nextMonthDay);\n const dateEvents = getEventsForDate(events, nextDate);\n weekDates.push({\n date: nextDate,\n isCurrentMonth: false,\n isToday: isToday(nextDate),\n hasEvents: dateEvents.length > 0,\n events: dateEvents,\n });\n nextMonthDay++;\n } else {\n // Current month days\n const currentDate = new Date(year, month, day);\n const dateEvents = getEventsForDate(events, currentDate);\n weekDates.push({\n date: currentDate,\n isCurrentMonth: true,\n isToday: isToday(currentDate),\n hasEvents: dateEvents.length > 0,\n events: dateEvents,\n });\n day++;\n }\n }\n\n dates.push(weekDates);\n }\n\n return dates;\n}\n\nexport function getCellClasses(calendarDate: CalendarDate): string[] {\n const classes: string[] = [];\n\n if (!calendarDate.isCurrentMonth) {\n classes.push('kalendly-cell-other-month');\n }\n\n if (calendarDate.isToday) {\n classes.push('kalendly-cell-today');\n }\n\n if (calendarDate.hasEvents) {\n classes.push('kalendly-cell-has-event');\n }\n\n return classes;\n}\n\nexport function formatDateForDisplay(date: Date): string {\n return `${DAYS[date.getDay()]} ${date.getDate()}`;\n}\n\nexport function getMonthYearText(year: number, month: number): string {\n return `${MONTHS_FULL[month]} ${year}`;\n}\n\nexport function formatTimeRange(event: CalendarEvent): string {\n if (event.allDay || (!event.startTime && !event.endTime)) {\n return 'All day';\n }\n\n if (event.startTime && event.endTime) {\n return `${event.startTime} - ${event.endTime}`;\n }\n\n if (event.startTime) {\n return `${event.startTime}`;\n }\n\n return '';\n}\n\nexport function formatAttendees(attendees?: string[]): string {\n if (!attendees || attendees.length === 0) return '';\n\n if (attendees.length === 1) return attendees[0];\n if (attendees.length === 2) return attendees.join(' and ');\n\n return `${attendees.slice(0, -1).join(', ')}, and ${attendees[attendees.length - 1]}`;\n}\n\nexport function sortEventsByTime(events: CalendarEvent[]): CalendarEvent[] {\n return [...events].sort((a, b) => {\n const aAllDay = a.allDay || (!a.startTime && !a.endTime);\n const bAllDay = b.allDay || (!b.startTime && !b.endTime);\n\n if (aAllDay && !bAllDay) return -1;\n if (!aAllDay && bAllDay) return 1;\n\n if (!a.startTime || !b.startTime) return 0;\n return a.startTime.localeCompare(b.startTime);\n });\n}\n\nexport const DEFAULT_CATEGORY_COLORS: CategoryColorMap = {\n work: '#3b82f6',\n personal: '#8b5cf6',\n meeting: '#10b981',\n deadline: '#ef4444',\n appointment: '#f59e0b',\n other: '#6b7280',\n};\n\n// Dynamic function that accepts custom colors\nexport function getDefaultEventColor(\n category?: string,\n customColors?: CategoryColorMap\n): string {\n const colorMap = customColors || DEFAULT_CATEGORY_COLORS;\n\n if (category && colorMap[category]) {\n return colorMap[category];\n }\n\n // Default fallback color\n return '#fc8917';\n}\n\n// Helper to merge custom colors with defaults\nexport function mergeCategoryColors(\n customColors?: CategoryColorMap\n): CategoryColorMap {\n return {\n ...DEFAULT_CATEGORY_COLORS,\n ...customColors,\n };\n}\n\n// Validate if a color is a valid hex color\nexport function isValidHexColor(color: string): boolean {\n return /^#([0-9A-F]{3}){1,2}$/i.test(color);\n}\n\n// Get color for a category with validation\nexport function getCategoryColor(\n category: string,\n customColors?: CategoryColorMap\n): string {\n const colorMap = mergeCategoryColors(customColors);\n const color = colorMap[category] || colorMap.other || '#fc8917';\n\n return isValidHexColor(color) ? color : '#fc8917';\n}\n\nconst HTML_ESCAPES: Record<string, string> = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#39;',\n};\n\n// Escape a value for interpolation into HTML text or a quoted attribute\nexport function escapeHtml(value: unknown): string {\n if (value === null || value === undefined) return '';\n\n return String(value).replace(/[&<>\"']/g, char => HTML_ESCAPES[char]);\n}\n\n// Reduce a caller-supplied value to a single safe CSS class token\nexport function slugifyToken(value: string): string {\n return String(value)\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n\n// Allow http(s), mailto and relative URLs; anything else (javascript:, data:,\n// vbscript:) collapses to a harmless anchor\nexport function safeUrl(value: string): string {\n // Browsers ignore control characters when resolving a scheme, so\n // `java\\0script:` and `java\\tscript:` both navigate. Strip them before\n // testing rather than after.\n const normalized = String(value)\n .split('')\n .filter(char => char.charCodeAt(0) > 0x20)\n .join('');\n\n if (/^(?:https?:|mailto:)/i.test(normalized)) return normalized;\n\n // Relative URLs have no scheme at all — a colon before the first slash,\n // question mark or hash means someone is naming one\n const schemeless = !/^[^/?#]*:/.test(normalized);\n\n return schemeless ? normalized : '#';\n}\n\n// Accept hex colors and bare CSS color keywords; reject anything that could\n// terminate the declaration or escape the style attribute\nexport function safeColor(value: string): string {\n const trimmed = String(value).trim();\n\n return isValidHexColor(trimmed) || /^[a-z]+$/i.test(trimmed)\n ? trimmed\n : '#3b82f6';\n}\n\nexport const MINUTES_PER_DAY = 1440;\nexport const DEFAULT_SLOT_DURATION = 60;\n\nexport function parseTimeToMinutes(time: unknown): number | null {\n if (typeof time !== 'string') return null;\n\n const match = /^(\\d{1,2}):(\\d{2})$/.exec(time.trim());\n if (!match) return null;\n\n const hours = Number(match[1]);\n const mins = Number(match[2]);\n if (hours > 24 || mins > 59 || (hours === 24 && mins > 0)) return null;\n\n return hours * 60 + mins;\n}\n\nexport function formatMinutes(total: number): string {\n const hours = Math.floor(total / 60);\n const mins = total % 60;\n return `${String(hours).padStart(2, '0')}:${String(mins).padStart(2, '0')}`;\n}\n\n// Absolute [start, end) in minutes. An end at or before the start is on the\n// following day, so a booking that crosses midnight is one interval rather than\n// two half-days. An unreadable time occupies the whole day — a booking surface\n// that cannot parse a time must not offer the slot.\nexport function eventInterval(\n event: CalendarEvent,\n slotDuration: number,\n onDay: Date\n): [number, number] | null {\n const day = normalizeDate(onDay).getTime();\n if (Number.isNaN(day)) return null;\n\n const base = day / 60000;\n const wholeDay: [number, number] = [base, base + MINUTES_PER_DAY];\n\n if (event.allDay || !event.startTime) return wholeDay;\n\n const from = parseTimeToMinutes(event.startTime);\n if (from === null) return wholeDay;\n\n if (event.endTime === undefined || event.endTime === null) {\n return [base + from, base + from + slotDuration];\n }\n\n const to = parseTimeToMinutes(event.endTime);\n if (to === null) return wholeDay;\n\n return [base + from, base + (to <= from ? to + MINUTES_PER_DAY : to)];\n}\n\nexport function mergeIntervals(\n intervals: Array<[number, number]>\n): Array<[number, number]> {\n const sorted = [...intervals].sort((a, b) => a[0] - b[0]);\n\n return sorted.reduce<Array<[number, number]>>((merged, [start, end]) => {\n const last = merged[merged.length - 1];\n if (last && start <= last[1]) last[1] = Math.max(last[1], end);\n else merged.push([start, end]);\n return merged;\n }, []);\n}\n\n// Which of the day's slots any booking overlaps. Events from the previous day\n// belong in `events` so a booking crossing midnight marks the morning it runs into.\nexport function bookedSlots(\n events: CalendarEvent[],\n date: Date,\n slotDuration: number = DEFAULT_SLOT_DURATION\n): boolean[] {\n const base = normalizeDate(date).getTime() / 60000;\n\n const previousDay = new Date(date);\n previousDay.setDate(previousDay.getDate() - 1);\n\n // A span's times repeat on each day it covers, so the window is anchored to\n // the day being drawn rather than the day the span began\n const intervals: Array<[number, number]> = [];\n for (const event of new Set(events)) {\n for (const day of [previousDay, date]) {\n if (!eventCoversDate(event, day)) continue;\n const interval = eventInterval(event, slotDuration, day);\n if (interval) intervals.push(interval);\n }\n }\n\n const merged = mergeIntervals(intervals);\n\n return Array.from(\n { length: Math.floor(MINUTES_PER_DAY / slotDuration) },\n (_, index) => {\n const start = base + index * slotDuration;\n const end = start + slotDuration;\n return merged.some(([from, to]) => start < to && end > from);\n }\n );\n}\n","import {\n CalendarEvent,\n CalendarState,\n CalendarConfig,\n CalendarActions,\n CalendarViewModel,\n CalendarPane,\n CategoryColorMap,\n} from './types';\nimport {\n generateCalendarDates,\n getEventsForDate,\n generateYears,\n getMonthYearText,\n formatDateForDisplay,\n mergeCategoryColors,\n getCategoryColor,\n MONTHS,\n DAYS,\n} from './utils';\n\nexport class CalendarEngine {\n private state: CalendarState;\n private config: CalendarConfig;\n private listeners: Set<() => void> = new Set();\n private categoryColors: CategoryColorMap;\n\n constructor(config: CalendarConfig) {\n this.config = config;\n this.categoryColors = mergeCategoryColors(config.categoryColors);\n\n const initialDate = config.initialDate || new Date();\n this.state = {\n currentYear: initialDate.getFullYear(),\n currentMonth: initialDate.getMonth(),\n currentDate: initialDate.getDate(),\n selectedDate: null,\n selectedDayIndex: null,\n tasks: [],\n };\n }\n\n /**\n * Subscribe to state changes\n */\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n /**\n * Notify all listeners of state changes\n */\n private notify(): void {\n this.listeners.forEach(listener => listener());\n }\n\n /**\n * Get current state\n */\n getState(): CalendarState {\n return { ...this.state };\n }\n\n /**\n * Get view model with computed properties\n */\n getViewModel(): CalendarViewModel {\n const panes: CalendarPane[] = Array.from(\n { length: Math.max(1, this.config.monthCount ?? 1) },\n (_, offset) => {\n const anchor = new Date(\n this.state.currentYear,\n this.state.currentMonth + offset,\n 1\n );\n const year = anchor.getFullYear();\n const month = anchor.getMonth();\n\n return {\n year,\n month,\n monthAndYearText: getMonthYearText(year, month),\n calendarDates: generateCalendarDates(\n year,\n month,\n this.config.events,\n this.config.weekStartsOn\n ),\n };\n }\n );\n\n return {\n ...this.state,\n months: MONTHS,\n days: DAYS,\n years: generateYears(this.config.minYear, this.config.maxYear),\n monthAndYearText: panes[0].monthAndYearText,\n scheduleDay: this.state.selectedDate\n ? formatDateForDisplay(this.state.selectedDate)\n : '',\n panes,\n calendarDates: panes[0].calendarDates,\n };\n }\n\n /**\n * Get actions object\n */\n getActions(): CalendarActions {\n return {\n next: this.next.bind(this),\n previous: this.previous.bind(this),\n jump: this.jump.bind(this),\n goToToday: this.goToToday.bind(this),\n isCurrentMonth: this.isCurrentMonth.bind(this),\n selectDate: this.selectDate.bind(this),\n updateTasks: this.updateTasks.bind(this),\n };\n }\n\n /**\n * Navigate to next month\n */\n private next(): void {\n if (this.state.currentMonth === 11) {\n this.state.currentMonth = 0;\n this.state.currentYear++;\n } else {\n this.state.currentMonth++;\n }\n\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Navigate to previous month\n */\n private previous(): void {\n if (this.state.currentMonth === 0) {\n this.state.currentMonth = 11;\n this.state.currentYear--;\n } else {\n this.state.currentMonth--;\n }\n\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Jump to specific month and year\n */\n private jump(year: number, month: number): void {\n this.state.currentYear = year;\n this.state.currentMonth = month;\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Navigate to current month (today)\n */\n private goToToday(): void {\n const today = new Date();\n this.state.currentYear = today.getFullYear();\n this.state.currentMonth = today.getMonth();\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Check if currently viewing today's month\n */\n private isCurrentMonth(): boolean {\n const today = new Date();\n return (\n this.state.currentYear === today.getFullYear() &&\n this.state.currentMonth === today.getMonth()\n );\n }\n\n /**\n * Select a specific date\n */\n private selectDate(date: Date, dayIndex?: number, navigate = true): void {\n this.state.selectedDate = date;\n this.state.selectedDayIndex = dayIndex ?? null;\n this.state.currentDate = date.getDate();\n if (navigate) {\n this.state.currentMonth = date.getMonth();\n this.state.currentYear = date.getFullYear();\n }\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Update tasks for the currently selected date\n */\n private updateTasks(): void {\n if (!this.state.selectedDate) {\n this.state.tasks = [];\n return;\n }\n\n this.state.tasks = getEventsForDate(\n this.config.events,\n this.state.selectedDate\n );\n }\n\n /**\n * Update events configuration\n */\n updateEvents(events: CalendarEvent[]): void {\n this.config.events = events;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Handle date cell click\n */\n handleDateClick(\n date: Date,\n dayIndex?: number,\n options?: { navigate?: boolean }\n ): void {\n this.selectDate(date, dayIndex, options?.navigate !== false);\n }\n\n /**\n * Check if date has events\n */\n hasEventsForDate(date: Date): boolean {\n return getEventsForDate(this.config.events, date).length > 0;\n }\n\n /**\n * Get events for a specific date\n */\n getEventsForDate(date: Date): CalendarEvent[] {\n return getEventsForDate(this.config.events, date);\n }\n\n /**\n * Clear selected date\n */\n clearSelection(): void {\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.state.tasks = [];\n this.notify();\n }\n\n /**\n * Get category color (with custom colors support)\n */\n getCategoryColor(category?: string): string {\n if (!category) return '#fc8917';\n return getCategoryColor(category, this.categoryColors);\n }\n\n /**\n * Update category colors dynamically\n */\n updateCategoryColors(colors: CategoryColorMap): void {\n this.categoryColors = mergeCategoryColors(colors);\n this.notify();\n }\n\n /**\n * Get all category colors\n */\n getCategoryColors(): CategoryColorMap {\n return { ...this.categoryColors };\n }\n\n /**\n * Register a new category with color\n */\n registerCategory(name: string, color: string): void {\n this.categoryColors[name] = color;\n this.notify();\n }\n\n /**\n * Destroy the engine and cleanup listeners\n */\n destroy(): void {\n this.listeners.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,SAAS;AAAA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AqB;AACpC,WAAO,iBAAiB,KAAK,OAAO,QAAQ,IAAI,EAAE,SAAS;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA,EAKA,iBAAiB,MAA6B;AAC5C,WAAO,iBAAiB,KAAK,OAAO,QAAQ,IAAI;AAAA,EAClD;AAAA;AAAA;AAAA;AAAA,EAKA,iBAAuB;AACrB,SAAK,MAAM,eAAe;AAC1B,SAAK,MAAM,mBAAmB;AAC9B,SAAK,MAAM,QAAQ,CAAC;AACpB,SAAK,OAAO;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,iBAAiB,UAA2B;AAC1C,QAAI,CAAC,SAAU,QAAO;AACtB,WAAO,iBAAiB,UAAU,KAAK,cAAc;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA,EAKA,qBAAqB,QAAgC;AACnD,SAAK,iBAAiB,oBAAoB,MAAM;AAChD,SAAK,OAAO;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,oBAAsC;AACpC,WAAO,EAAE,GAAG,KAAK,eAAe;AAAA,EAClC;AAAA;AAAA;AAAA;AAAA,EAKA,iBAAiB,MAAc,OAAqB;AAClD,SAAK,eAAe,IAAI,IAAI;AAC5B,SAAK,OAAO;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,UAAgB;AACd,SAAK,UAAU,MAAM;AAAA,EACvB;AACF;","names":[]}
@@ -182,13 +182,13 @@ function generateCalendarDates(year, month, events = [], weekStartsOn = 0) {
182
182
  function getCellClasses(calendarDate) {
183
183
  const classes = [];
184
184
  if (!calendarDate.isCurrentMonth) {
185
- classes.push("calendar-cell-other-month");
185
+ classes.push("kalendly-cell-other-month");
186
186
  }
187
187
  if (calendarDate.isToday) {
188
- classes.push("calendar-cell-today");
188
+ classes.push("kalendly-cell-today");
189
189
  }
190
190
  if (calendarDate.hasEvents) {
191
- classes.push("calendar-cell-has-event");
191
+ classes.push("kalendly-cell-has-event");
192
192
  }
193
193
  return classes;
194
194
  }