@nylas/react 2.1.0 → 2.2.1

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 (148) hide show
  1. package/dist/cjs/connect.js +1 -0
  2. package/dist/cjs/elements.js +1 -0
  3. package/dist/cjs/index.js +1 -0
  4. package/dist/cjs/notetaker.js +62 -0
  5. package/dist/cjs/utils.js +11 -0
  6. package/dist/connect.d.ts +1 -0
  7. package/dist/elements.d.ts +1 -0
  8. package/dist/es/connect.js +279 -0
  9. package/dist/es/elements.js +1319 -0
  10. package/dist/es/index.js +281 -0
  11. package/dist/es/notetaker.js +5784 -0
  12. package/dist/es/utils.js +12396 -0
  13. package/dist/lib/connect/types.d.ts +1 -1
  14. package/dist/lib/connect/useNylasConnect.d.ts +2 -2
  15. package/dist/lib/connect.d.ts +1 -0
  16. package/dist/lib/elements/components.d.ts +975 -0
  17. package/dist/lib/elements.d.ts +1 -0
  18. package/dist/lib/index.d.ts +3 -6
  19. package/dist/lib/notetaker.d.ts +1 -0
  20. package/dist/lib/utils.d.ts +2 -0
  21. package/dist/notetaker.d.ts +1 -0
  22. package/dist/utils.d.ts +1 -0
  23. package/package.json +36 -16
  24. package/dist/add-circle-icon_2.entry-8c3bb0bb.cjs +0 -1
  25. package/dist/add-circle-icon_2.entry-a3daf6c4.js +0 -28
  26. package/dist/archive-icon.entry-46ad0ff3.cjs +0 -1
  27. package/dist/archive-icon.entry-d5141486.js +0 -18
  28. package/dist/arrow-icon.entry-1b89ce78.js +0 -18
  29. package/dist/arrow-icon.entry-f696de4f.cjs +0 -1
  30. package/dist/bold-icon.entry-7827cd4e.cjs +0 -1
  31. package/dist/bold-icon.entry-c117b4cf.js +0 -18
  32. package/dist/button-component_2.entry-8cd4c5f3.cjs +0 -1
  33. package/dist/button-component_2.entry-e68caa9b.js +0 -29
  34. package/dist/calendar-agenda-fill-icon_37.entry-52bdc8b3.js +0 -5234
  35. package/dist/calendar-agenda-fill-icon_37.entry-8c592cfa.cjs +0 -6
  36. package/dist/calendar-cancel-icon.entry-7facfa05.cjs +0 -1
  37. package/dist/calendar-cancel-icon.entry-f5f1d499.js +0 -18
  38. package/dist/calendar-check-icon.entry-55320137.js +0 -18
  39. package/dist/calendar-check-icon.entry-72108702.cjs +0 -1
  40. package/dist/calendar-icon.entry-afea361e.js +0 -18
  41. package/dist/calendar-icon.entry-f5c6730f.cjs +0 -1
  42. package/dist/checkbox-component.entry-5722d263.cjs +0 -1
  43. package/dist/checkbox-component.entry-89fa6edd.js +0 -54
  44. package/dist/checkbox-group_4.entry-30e8af17.cjs +0 -28
  45. package/dist/checkbox-group_4.entry-51f03009.js +0 -10014
  46. package/dist/checkmark-circle-icon.entry-ae11049d.cjs +0 -1
  47. package/dist/checkmark-circle-icon.entry-dfe67e22.js +0 -18
  48. package/dist/checkmark-icon_15.entry-4c3979db.js +0 -1415
  49. package/dist/checkmark-icon_15.entry-e59c0f53.cjs +0 -5
  50. package/dist/chevron-icon_3.entry-1f3c3ca6.js +0 -159
  51. package/dist/chevron-icon_3.entry-ea791750.cjs +0 -1
  52. package/dist/clock-icon_4.entry-172fed74.cjs +0 -1
  53. package/dist/clock-icon_4.entry-78878cb8.js +0 -48
  54. package/dist/constants-f51538ef-cd2a67c4.cjs +0 -1
  55. package/dist/constants-f51538ef-e0a5f026.js +0 -876
  56. package/dist/customParseFormat-b5d95b34-a6b6fcba.cjs +0 -1
  57. package/dist/customParseFormat-b5d95b34-ce80820c.js +0 -135
  58. package/dist/delete-icon.entry-a8c0bf03.cjs +0 -1
  59. package/dist/delete-icon.entry-cebdc90f.js +0 -18
  60. package/dist/document-refresh-icon.entry-2d9a529d.cjs +0 -1
  61. package/dist/document-refresh-icon.entry-8780a2b8.js +0 -18
  62. package/dist/feedbackSync-92220b42-fbebe1f9.cjs +0 -448
  63. package/dist/feedbackSync-92220b42-fd5f5610.js +0 -6048
  64. package/dist/folder-icon.entry-3e61ccca.cjs +0 -1
  65. package/dist/folder-icon.entry-6ffd5191.js +0 -18
  66. package/dist/forward-icon.entry-c7d88db8.cjs +0 -1
  67. package/dist/forward-icon.entry-c9c4bf5b.js +0 -18
  68. package/dist/globe-icon.entry-0b93cab8.cjs +0 -1
  69. package/dist/globe-icon.entry-7c0dca7b.js +0 -18
  70. package/dist/google-logo-icon_6.entry-deef91ee.js +0 -1765
  71. package/dist/google-logo-icon_6.entry-e25ce3e7.cjs +0 -2
  72. package/dist/google-meet-icon_5.entry-214347f0.cjs +0 -1
  73. package/dist/google-meet-icon_5.entry-f8b5a92a.js +0 -58
  74. package/dist/inbox-icon.entry-873062c3.js +0 -18
  75. package/dist/inbox-icon.entry-f08f2fd5.cjs +0 -1
  76. package/dist/index-025be398.js +0 -7187
  77. package/dist/index-c510313d-1318f67a.js +0 -289
  78. package/dist/index-c510313d-b0508eee.cjs +0 -1
  79. package/dist/index-f42fe591.cjs +0 -65
  80. package/dist/index.es-488bc919-d02dd50a.cjs +0 -7
  81. package/dist/index.es-488bc919-ea63a7e9.js +0 -2724
  82. package/dist/info-icon_2.entry-442b9097.cjs +0 -1
  83. package/dist/info-icon_2.entry-60fb8648.js +0 -37
  84. package/dist/input-component.entry-5898a52e.js +0 -96
  85. package/dist/input-component.entry-7274fd28.cjs +0 -1
  86. package/dist/input-dropdown_2.entry-4534436c.js +0 -255
  87. package/dist/input-dropdown_2.entry-9b72f637.cjs +0 -1
  88. package/dist/italic-icon.entry-62052cd8.js +0 -18
  89. package/dist/italic-icon.entry-9bdbbd37.cjs +0 -1
  90. package/dist/lib/elements/index.d.ts +0 -133
  91. package/dist/lib/elements/react-component-lib/createComponent.d.ts +0 -10
  92. package/dist/lib/elements/react-component-lib/createOverlayComponent.d.ts +0 -21
  93. package/dist/lib/elements/react-component-lib/index.d.ts +0 -2
  94. package/dist/lib/elements/react-component-lib/interfaces.d.ts +0 -29
  95. package/dist/lib/elements/react-component-lib/utils/attachProps.d.ts +0 -9
  96. package/dist/lib/elements/react-component-lib/utils/case.d.ts +0 -2
  97. package/dist/lib/elements/react-component-lib/utils/dev.d.ts +0 -2
  98. package/dist/lib/elements/react-component-lib/utils/index.d.ts +0 -10
  99. package/dist/multi-select-dropdown.entry-77752d46.cjs +0 -1
  100. package/dist/multi-select-dropdown.entry-9c9d05c1.js +0 -133
  101. package/dist/nylas-booked-event-card_11.entry-32b2e9f1.js +0 -1410
  102. package/dist/nylas-booked-event-card_11.entry-4aba5146.cjs +0 -1
  103. package/dist/nylas-date-component_2.entry-6b058796.cjs +0 -1
  104. package/dist/nylas-date-component_2.entry-a869519f.js +0 -310
  105. package/dist/nylas-form-card.entry-5390459f.js +0 -75
  106. package/dist/nylas-form-card.entry-c2f34d73.cjs +0 -1
  107. package/dist/nylas-notification_2.entry-054392cf.cjs +0 -1
  108. package/dist/nylas-notification_2.entry-f46e88e5.js +0 -88
  109. package/dist/nylas-scheduler-editor.entry-40a48f47.js +0 -1854
  110. package/dist/nylas-scheduler-editor.entry-e29fdf07.cjs +0 -2
  111. package/dist/nylas-scheduling.entry-115b1752.js +0 -1002
  112. package/dist/nylas-scheduling.entry-79cb1d9c.cjs +0 -1
  113. package/dist/person-icon.entry-2cae306c.cjs +0 -1
  114. package/dist/person-icon.entry-fd668b89.js +0 -18
  115. package/dist/play-icon.entry-7fc3c0fd.js +0 -18
  116. package/dist/play-icon.entry-9989a520.cjs +0 -1
  117. package/dist/radio-button-group.entry-03385b5f.cjs +0 -1
  118. package/dist/radio-button-group.entry-9df82cd0.js +0 -58
  119. package/dist/react.cjs +0 -1
  120. package/dist/react.js +0 -164
  121. package/dist/refresh-icon.entry-310954ba.cjs +0 -1
  122. package/dist/refresh-icon.entry-c56e5623.js +0 -18
  123. package/dist/register-component-3acd57e7-5a79a90a.cjs +0 -1
  124. package/dist/register-component-3acd57e7-cb09c05e.js +0 -110
  125. package/dist/reply-all-icon.entry-32e0e000.js +0 -18
  126. package/dist/reply-all-icon.entry-68388f97.cjs +0 -1
  127. package/dist/reply-icon.entry-3ac2e736.js +0 -18
  128. package/dist/reply-icon.entry-e616a9a4.cjs +0 -1
  129. package/dist/sent-icon.entry-0622ed04.js +0 -18
  130. package/dist/sent-icon.entry-543eb3c4.cjs +0 -1
  131. package/dist/spam-icon.entry-74bcfd4f.js +0 -18
  132. package/dist/spam-icon.entry-e341ee3e.cjs +0 -1
  133. package/dist/star-icon.entry-864d2bf9.js +0 -18
  134. package/dist/star-icon.entry-c90d40f6.cjs +0 -1
  135. package/dist/stop-icon.entry-835908c5.js +0 -18
  136. package/dist/stop-icon.entry-ffc46b42.cjs +0 -1
  137. package/dist/textarea-component.entry-6adcf6a6.js +0 -58
  138. package/dist/textarea-component.entry-dae8eb5c.cjs +0 -1
  139. package/dist/toggle-switch.entry-5ee29867.cjs +0 -1
  140. package/dist/toggle-switch.entry-ff2ccb75.js +0 -51
  141. package/dist/translate-icon.entry-372dd808.js +0 -18
  142. package/dist/translate-icon.entry-5606067d.cjs +0 -1
  143. package/dist/trash-fill-icon.entry-01b4379e.js +0 -18
  144. package/dist/trash-fill-icon.entry-daed6c0a.cjs +0 -1
  145. package/dist/underline-icon.entry-2020ee64.cjs +0 -1
  146. package/dist/underline-icon.entry-464b900d.js +0 -18
  147. package/dist/utils-31933f5d-15041585.js +0 -17878
  148. package/dist/utils-31933f5d-1d4c81ab.cjs +0 -54
@@ -1,1410 +0,0 @@
1
- import { r as w, c as f, h as o, H as k, g as E } from "./index-025be398.js";
2
- import { R as L } from "./register-component-3acd57e7-cb09c05e.js";
3
- import { i, b as d, h as we, o as xe, s as ve, q as Fe, a as ae, u as Oe, t as Me, f as Ce, r as F, v as He, w as $e, x as O, y as Ne, z as qe, A as Ae, C as N } from "./utils-31933f5d-15041585.js";
4
- import { c as S, T as j, a as _e } from "./constants-f51538ef-e0a5f026.js";
5
- import "@nylas/web-elements";
6
- import "react";
7
- import "@nylas/connect";
8
- import "react/jsx-runtime";
9
- import "react-dom";
10
- const Ze = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-booked-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 0;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:16px;font-weight:400;border-bottom:1px solid var(--nylas-base-200);width:inherit;padding:0 0 1.5rem}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booked-event-header .card-description{text-align:center}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:16px;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.button-container{width:inherit}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);border-top:1px solid var(--nylas-base-200);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}', Ge = Ze;
11
- var We = function(e, a, n, r) {
12
- var l = arguments.length, t = l < 3 ? a : r === null ? r = Object.getOwnPropertyDescriptor(a, n) : r, s;
13
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
14
- t = Reflect.decorate(e, a, n, r);
15
- else
16
- for (var c = e.length - 1; c >= 0; c--)
17
- (s = e[c]) && (t = (l < 3 ? s(t) : l > 3 ? s(a, n, t) : s(a, n)) || t);
18
- return l > 3 && t && Object.defineProperty(a, n, t), t;
19
- }, q = function(e, a) {
20
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
21
- return Reflect.metadata(e, a);
22
- };
23
- const Te = class {
24
- constructor(e) {
25
- w(this, e), this.cancelBookingButtonClicked = f(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = f(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = f(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = f(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
26
- var l, t;
27
- const a = new Date(this.selectedTimeslot.start_time), n = (t = (l = this.configSettings) == null ? void 0 : l.scheduler) == null ? void 0 : t.min_cancellation_notice;
28
- if (!n) {
29
- this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
30
- return;
31
- }
32
- a.getTime() - n * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime() ? this.cancelBookedEventValidationError.emit({
33
- error: {
34
- title: "Cancellation Error",
35
- message: `You cannot cancel the booking within ${n} minutes of the event.`
36
- }
37
- }) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
38
- }, this.handleRescheduleButtonClicked = () => {
39
- const a = (n) => {
40
- this.rescheduleBookedEventError.emit(n);
41
- };
42
- this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: a });
43
- }, this.getPaticipantType = (a) => {
44
- switch (a) {
45
- case "host":
46
- return "Host";
47
- case "you":
48
- return "You";
49
- default:
50
- return "";
51
- }
52
- }, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.configSettings = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.selectedLanguage = navigator.language, this.hour12 = void 0, this.startTime = "", this.endTime = "";
53
- }
54
- themeConfigChanged(e) {
55
- this.applyThemeConfig(e);
56
- }
57
- selectedLanguageChangedHandler(e, a) {
58
- e !== a && i.changeLanguage(e);
59
- }
60
- connectedCallback() {
61
- }
62
- disconnectedCallback() {
63
- }
64
- async componentWillLoad() {
65
- d("[nylas-booked-event-card] Component will load");
66
- }
67
- async componentDidLoad() {
68
- var n, r;
69
- d("[nylas-booked-event-card] Component did load"), this.eventInfo || console.warn('[nylas-booked-event-card] "eventInfo" prop missing. Please provide the event info to display the event details in the booked event card component.'), this.bookingInfo || console.warn('[nylas-booked-event-card] "bookingInfo" prop missing. Please provide the booking info to display the guest details in the booked event card component.'), this.applyThemeConfig(this.themeConfig);
70
- const e = S[this.selectedLanguage || "en"], a = new Intl.DateTimeFormat(e, {
71
- hour: "2-digit",
72
- minute: "2-digit",
73
- timeZone: this.selectedTimezone,
74
- hour12: this.hour12
75
- });
76
- this.startTime = a.format((n = this.selectedTimeslot) == null ? void 0 : n.start_time), this.endTime = a.format((r = this.selectedTimeslot) == null ? void 0 : r.end_time);
77
- }
78
- applyThemeConfig(e) {
79
- if (e)
80
- for (const [a, n] of Object.entries(e))
81
- this.host.style.setProperty(`${a}`, n);
82
- }
83
- render() {
84
- var n, r, l, t, s, c, m, g, C, x, B, D, u, p, T, R;
85
- const e = (n = this.configSettings) == null ? void 0 : n.booking_type, a = e && e !== "booking";
86
- return o(k, { key: "0762e32091a5674187788413717366b6213a28fd", part: "nbec" }, o("div", { key: "9cb934481989459e30f9fc718e20855f0f186027", class: "nylas-booked-event-card" }, o("div", { key: "e7b810785f800f82f0c73eaa665cd56bb9406c85", class: "booked-event-timezone" }, o("globe-icon", { key: "3c29fd04b4fc90e0a6583285cbf872ec840ec0d6" }), j[this.selectedTimezone]), o("div", { key: "e7f4406d8c3b110d84cb1d99e5ab8db89954e2f4", class: "event-card-wrapper", part: "nbec__card" }, o("div", { key: "c656687daf9b51190341d35db6c338a9a61df3a2", class: "calendar-icon" }, o("calendar-check-icon", { key: "e1f5cdfa288db54a537f4250d65e2ab0279fb84e" })), o("div", { key: "50e125630023b8dd19d537d20374f9a5464a1547", class: "booked-event-header" }, o("h2", { key: "24e6e52952321065ee1e63c34d55cd1891edeafc", slot: "card-title", part: "nbec__title" }, this.rescheduleBookingId && !this.isLoading ? `${i.t("bookingRescheduled")}` : a && !this.isLoading ? `${i.t("bookingSent")}` : `${i.t("bookingConfirmed")}`, "!"), o("div", { key: "cb07bf7f3685624f2b50bcba569399ba084ab00d", class: "card-description", part: "nbec__description" }, a ? i.t("bookingSentDescription") : o("span", null, i.t("bookingConfirmedDescription")))), o("div", { key: "bceb86109e1a9ae6f2c1d98e0267e7f73d763aae", class: "booking-date-time" }, o("checkmark-circle-icon", { key: "0e6fdd3cb183e4d00c6c31fe368eefb01d0465d8" }), o("h3", { key: "c7561d2be55109d69650aa41bb6d356018e1973b" }, i.t("bookingDateAndTimeHeader")), o("p", { key: "31818a7c4a89014438b7af5e722f49728918cc27" }, (r = this.selectedTimeslot) != null && r.start_time ? we(xe((l = this.selectedTimeslot) == null ? void 0 : l.start_time, this.selectedTimezone, S[this.selectedLanguage])) : "-", " ", o("br", { key: "7fcd531af1cea5464ab08f9043aabb4cde0a91db" }), this.startTime, " - ", this.endTime)), o("div", { key: "8d2d827677bf300ad2b0f4dc2c28ac3777971af1", class: "booking-participants" }), !a && o("div", { class: "button-container" }, o("div", { class: {
87
- footer: !0,
88
- "no-footer": ((s = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : s.hide_cancellation_options) && ((m = (c = this.configSettings) == null ? void 0 : c.scheduler) == null ? void 0 : m.hide_rescheduling_options) || ((g = this.configSettings) == null ? void 0 : g.booking_type) === "organizer-confirmation",
89
- "no-template-cols": !!((x = (C = this.configSettings) == null ? void 0 : C.scheduler) != null && x.hide_cancellation_options) || !!((D = (B = this.configSettings) == null ? void 0 : B.scheduler) != null && D.hide_rescheduling_options)
90
- } }, !((p = (u = this.configSettings) == null ? void 0 : u.scheduler) != null && p.hide_cancellation_options) && o("button-component", { variant: "destructive", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, `${i.t("cancelBookingButton")}`), !((R = (T = this.configSettings) == null ? void 0 : T.scheduler) != null && R.hide_rescheduling_options) && o("button-component", { variant: "basic", onClick: this.handleRescheduleButtonClicked, disabled: this.isLoading, part: "nbec__button-outline nbec__reschedule-cta" }, `${i.t("rescheduleBookingButton")}`))))));
91
- }
92
- get host() {
93
- return E(this);
94
- }
95
- static get watchers() {
96
- return {
97
- themeConfig: ["themeConfigChanged"],
98
- selectedLanguage: ["selectedLanguageChangedHandler"]
99
- };
100
- }
101
- };
102
- We([
103
- L({
104
- name: "nylas-booked-event-card",
105
- stateToProps: /* @__PURE__ */ new Map([
106
- ["scheduler.bookingInfo", "bookingInfo"],
107
- ["scheduler.rescheduleBookingId", "rescheduleBookingId"],
108
- ["scheduler.selectedTimezone", "selectedTimezone"],
109
- ["scheduler.selectedTimeslot", "selectedTimeslot"],
110
- ["scheduler.isLoading", "isLoading"],
111
- ["scheduler.selectedLanguage", "selectedLanguage"],
112
- ["scheduler.configSettings", "configSettings"],
113
- ["scheduler.themeConfig", "themeConfig"],
114
- ["scheduler.hour12", "hour12"]
115
- ]),
116
- eventToProps: {
117
- cancelBookingButtonClicked: async (e, a) => {
118
- a.scheduler.setCancel(e.detail.bookingId);
119
- },
120
- rescheduleButtonClicked: async (e, a) => {
121
- const n = await a.scheduler.setReschedule(e.detail.bookingId), { errorHandler: r } = e.detail;
122
- r && (!n || "error" in n) && r(n);
123
- },
124
- rescheduleBookedEventError: async (e, a) => {
125
- d("nylas-booked-event-card", "rescheduleBookedEventError", e.detail);
126
- },
127
- cancelBookedEventValidationError: async (e, a) => {
128
- d("nylas-booked-event-card", "cancelBookedEventValidationError", e.detail);
129
- }
130
- },
131
- fireRegisterEvent: !0
132
- }),
133
- q("design:type", Function),
134
- q("design:paramtypes", []),
135
- q("design:returntype", void 0)
136
- ], Te.prototype, "render", null);
137
- Te.style = Ge;
138
- const Ue = ':host{display:block;height:100%;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}.cta{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{grid-template-columns:1fr}}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family);font-size:16px}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}.button-content{display:flex;gap:4px;align-items:center}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%}input[type=text]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}button-component.remove-guest{position:absolute;height:51px;right:0}button-component.remove-guest.error button{border-color:var(--nylas-error)}button-component.remove-guest button{height:inherit;border-top-left-radius:initial;border-bottom-left-radius:initial;border:none !important;border-left:1px solid var(--nylas-base-300) !important}button-component.remove-guest button:hover,button-component.remove-guest button:focus{outline:1px solid var(--nylas-primary) !important;color:var(--nylas-primary)}button-component.back button{--dot-color:var(--nylas-base-800)}.guest-email-input{position:relative;display:flex;width:100%}multi-select-dropdown::part(msd_dropdown-label){margin-bottom:4px}multi-select-dropdown::part(msd_dropdown_error){font-size:16px}multi-select-dropdown::part(msd_dropdown-button){height:52px;border-color:var(--nylas-base-300)}multi-select-dropdown::part(msd_dropdown-button--error){border-width:2px;border-color:var(--nylas-error)}', Ye = Ue;
139
- var Xe = function(e, a, n, r) {
140
- var l = arguments.length, t = l < 3 ? a : r === null ? r = Object.getOwnPropertyDescriptor(a, n) : r, s;
141
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
142
- t = Reflect.decorate(e, a, n, r);
143
- else
144
- for (var c = e.length - 1; c >= 0; c--)
145
- (s = e[c]) && (t = (l < 3 ? s(t) : l > 3 ? s(a, n, t) : s(a, n)) || t);
146
- return l > 3 && t && Object.defineProperty(a, n, t), t;
147
- }, A = function(e, a) {
148
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
149
- return Reflect.metadata(e, a);
150
- };
151
- const M = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, Ee = class {
152
- constructor(e) {
153
- w(this, e), this.nameChanged = f(this, "nameChanged", 7), this.emailChanged = f(this, "emailChanged", 7), this.backButtonClicked = f(this, "backButtonClicked", 7), this.detailsConfirmed = f(this, "detailsConfirmed", 7), this.bookingFormError = f(this, "bookingFormError", 7), this.bookingFormSubmitted = f(this, "bookingFormSubmitted", 7), this.handleGuestChange = (a, n) => {
154
- this.resetGuestEmailError(a);
155
- const r = [...this.guestEmails];
156
- r[a] = ve(n), this.guestEmails = [...r];
157
- }, this.handleGuestBlur = (a, n) => {
158
- if (this.resetGuestEmailError(a), n === "") {
159
- this.guestEmailErrors[a] = i.t("fieldRequired", { field: i.t("email") });
160
- return;
161
- }
162
- if (!M.test(n)) {
163
- this.guestEmailErrors[a] = i.t("invalidInputFormat", { field: i.t("email") });
164
- return;
165
- }
166
- this.handleGuestChange(a, n);
167
- }, this.addGuestButtonClickedHandler = (a) => {
168
- a.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
169
- }, this.removeGuestButtonClickHandler = (a, n) => {
170
- a.preventDefault(), this.resetGuestEmailError(n);
171
- const r = [...this.guestEmails];
172
- r.splice(n, 1), this.guestEmails = [...r];
173
- }, this.handleBackButtonClicked = (a) => {
174
- a.preventDefault(), this.backButtonLoading = !0, this.backButtonClicked.emit();
175
- }, this.bookButtonClickedHandler = async (a) => {
176
- var g, C, x, B, D;
177
- if (a.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
178
- return;
179
- d("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
180
- const r = this.name, l = this.email;
181
- if (!r || r === "") {
182
- this.isNameValid = !1, this.validationError.name = i.t("fieldRequired", { field: i.t("name") }) || "Name is required", this.bookingFormError.emit({
183
- title: "Booking form error",
184
- description: "Name is required"
185
- });
186
- return;
187
- }
188
- if (!l || l === "") {
189
- this.isEmailValid = !1, this.validationError.email = i.t("fieldRequired", { field: i.t("email") }) || "Email is required", this.bookingFormError.emit({
190
- title: "Booking form error",
191
- description: "Email is required"
192
- });
193
- return;
194
- }
195
- if (!M.test(l)) {
196
- this.isEmailValid = !1, this.validationError.email = i.t("invalidInputFormat", { field: i.t("email") }), this.bookingFormError.emit({
197
- title: "Booking form error",
198
- description: i.t("invalidInputFormat", { field: i.t("email") }) || "Invalid email"
199
- });
200
- return;
201
- }
202
- let t = [];
203
- if (this.guestEmails.length > 0) {
204
- let u = !1;
205
- if (this.guestEmails.forEach((p, T) => {
206
- p === "" ? (u = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [T]: i.t("fieldRequired", { field: i.t("email") }) }) : M.test(p) || (u = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [T]: i.t("invalidInputFormat", { field: i.t("email") }) });
207
- }), u) {
208
- this.bookingFormError.emit({
209
- title: "Booking form error",
210
- description: i.t("invalidInputFormat", { field: i.t("guestEmail") }) || "Invalid guest email"
211
- });
212
- return;
213
- }
214
- t = this.guestEmails.map((p) => ({ name: p.trim(), email: p.trim() }));
215
- }
216
- const s = {}, c = ((C = (g = this.configSettings) == null ? void 0 : g.scheduler) == null ? void 0 : C.additional_fields) || {}, m = ((B = (x = this.configSettings) == null ? void 0 : x.booking) == null ? void 0 : B.additional_fields) || {};
217
- (D = this.bookingInfo) != null && D.additionalFields && Object.entries(this.bookingInfo.additionalFields).forEach(([u, p]) => {
218
- u in c && typeof p.value < "u" && (s[u] = p.value);
219
- }), Object.entries(c).forEach(([u, p]) => {
220
- if (!(u in s)) {
221
- const T = m[u] || p.default || "";
222
- s[u] = T;
223
- }
224
- }), this.detailsConfirmed.emit({
225
- primaryParticipant: {
226
- name: r,
227
- email: l
228
- },
229
- guests: t,
230
- additionalFields: { ...s, ...this.additionalFields }
231
- });
232
- }, this.updateAdditionalFields = (a, n) => {
233
- this.additionalFields && (this.additionalFields[a] = n);
234
- }, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.selectedTimeslot = void 0, this.selectedLanguage = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.additionalFields = {}, this.namePatternError = "", this.nameRequiredError = "", this.emailPatternError = "", this.emailRequiredError = "", this.validationError = { name: "", email: "" }, this.backButtonLoading = !1, this.firstRender = !0;
235
- }
236
- connectedCallback() {
237
- }
238
- disconnectedCallback() {
239
- }
240
- componentWillLoad() {
241
- d("nylas-booking-form", "componentWillLoad", this.bookingInfo);
242
- }
243
- componentDidLoad() {
244
- var e;
245
- d("nylas-booking-form", "componentDidLoad", this.bookingInfo), (e = this.configSettings) != null && e.booking ? this.configSettingsChangedHandler(this.configSettings) : this.bookingInfo && this.bookingInfoChangedHandler(this.bookingInfo), this.applyThemeConfig(this.themeConfig);
246
- }
247
- componentDidRender() {
248
- this.firstRender && this.applyThemeConfig(this.themeConfig);
249
- }
250
- bookingInfoChangedHandler(e) {
251
- e && e.primaryParticipant && (this.name = e.primaryParticipant.name || this.name, this.email = e.primaryParticipant.email || this.email), e != null && e.guests && Array.isArray(e.guests) && (this.guestEmails = e.guests.map((a) => a.email));
252
- }
253
- configSettingsChangedHandler(e) {
254
- var a, n, r, l, t, s, c, m, g, C;
255
- !((n = (a = this.bookingInfo) == null ? void 0 : a.primaryParticipant) != null && n.name) && e && ((l = (r = e.booking) == null ? void 0 : r.guest) != null && l.name) && (this.name = e.booking.guest.name || this.name), !((s = (t = this.bookingInfo) == null ? void 0 : t.primaryParticipant) != null && s.email) && e && ((m = (c = e.booking) == null ? void 0 : c.guest) != null && m.email) && (this.email = e.booking.guest.email || this.email), !((g = this.bookingInfo) != null && g.guests) && ((C = e == null ? void 0 : e.booking) != null && C.additional_guests) && Array.isArray(e.booking.additional_guests) && (this.guestEmails = e.booking.additional_guests.map((x) => x.email));
256
- }
257
- themeConfigChanged(e) {
258
- this.applyThemeConfig(e);
259
- }
260
- selectedLanguageChangedHandler(e, a) {
261
- e !== a && (i.changeLanguage(e), this.namePatternError = i.t("invalidInputFormat", { field: i.t("name") }), this.nameRequiredError = i.t("fieldRequired", { field: i.t("name") }), this.emailPatternError = i.t("invalidInputFormat", { field: i.t("email") }), this.emailRequiredError = i.t("fieldRequired", { field: i.t("email") }));
262
- }
263
- iterateFormComponents() {
264
- const e = this.formRef, a = [
265
- "input-component",
266
- "button-component",
267
- "select-dropdown",
268
- "checkbox-component",
269
- "radio-button-group",
270
- "textarea-component",
271
- "nylas-date-component",
272
- "multi-select-dropdown"
273
- ], n = [];
274
- if (e) {
275
- const r = (l) => {
276
- Array.from(l.children).forEach((t) => {
277
- const s = t.tagName.toLowerCase();
278
- a.includes(s) && n.push(t), r(t);
279
- });
280
- };
281
- r(e);
282
- }
283
- return n;
284
- }
285
- applyThemeConfig(e) {
286
- if (e)
287
- for (const [a, n] of Object.entries(e))
288
- this.host.style.setProperty(`${a}`, n), this.iterateFormComponents().forEach((l) => {
289
- var t;
290
- l.style.setProperty(`${a}`, n), (t = l.shadowRoot) == null || t.host.style.setProperty(`${a}`, n);
291
- });
292
- }
293
- changeName(e) {
294
- this.isNameValid = !0, this.validationError.name = "", this.name = Fe(e), this.nameChanged.emit(e);
295
- }
296
- changeEmail(e) {
297
- this.isEmailValid = !0, this.validationError.email = "", this.email = ve(e), this.emailChanged.emit(e);
298
- }
299
- resetGuestEmailError(e) {
300
- const a = { ...this.guestEmailErrors };
301
- delete a[e], this.guestEmailErrors = { ...a };
302
- }
303
- nylasFormInputChangedHandler(e) {
304
- switch (e.detail.name) {
305
- case "name":
306
- this.changeName(e.detail.value);
307
- break;
308
- case "email":
309
- this.changeEmail(e.detail.value);
310
- break;
311
- default:
312
- if (e.detail.error) {
313
- this.bookingFormError.emit({
314
- title: "Booking form error",
315
- description: e.detail.error
316
- });
317
- return;
318
- }
319
- this.updateAdditionalFields(e.detail.name, e.detail.value);
320
- break;
321
- }
322
- }
323
- selectOptionChangedHandler(e) {
324
- if (e.detail.error) {
325
- this.bookingFormError.emit({
326
- title: "Booking form error",
327
- description: e.detail.error
328
- });
329
- return;
330
- }
331
- this.updateAdditionalFields(e.detail.name, e.detail.value);
332
- }
333
- selecedOptionsChangedHandler(e) {
334
- if (e.detail.error) {
335
- this.bookingFormError.emit({
336
- title: "Booking form error",
337
- description: e.detail.error
338
- });
339
- return;
340
- }
341
- const a = e.detail.value.toString();
342
- this.updateAdditionalFields(e.detail.name, a);
343
- }
344
- switchToggledHandler(e) {
345
- this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
346
- }
347
- checkboxToggledHandler(e) {
348
- this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
349
- }
350
- radioChangedHandler(e) {
351
- this.updateAdditionalFields(e.detail.name, e.detail.value);
352
- }
353
- dropdownDefaultSelectedHandler(e) {
354
- this.updateAdditionalFields(e.detail.name, e.detail.value);
355
- }
356
- render() {
357
- var a, n, r, l, t, s, c, m, g, C, x, B, D, u, p, T, R, ne, te, oe, re;
358
- const e = !!((a = this.selectedTimeslot) != null && a.event_id) && !!((n = this.selectedTimeslot) != null && n.capacity);
359
- return o(k, { key: "6659bdd250a39e69ecd8a4468b4f5bf5f3ced414" }, o("form", { key: "ee7e0b97a449cdb18fa474bb5950ebc34922265d", onSubmit: (_) => this.bookButtonClickedHandler(_), ref: (_) => this.formRef = _, noValidate: !0 }, o("div", { key: "b59b81ef1c13449b1e49608ef6faeebbce3fef4d", class: "nylas-booking-form", part: "nbf" }, o("div", { key: "cf75db4476ff5f8b013cbd349038a5945b9aecb0", class: "input-wrapper", part: "nbf__input-wrapper" }, o("input-component", { key: "63959a4c6c06cef6dc5d8990ddfbe89965433f28", label: i.t("name"), name: "name", id: "name", defaultValue: ((l = (r = this.bookingInfo) == null ? void 0 : r.primaryParticipant) == null ? void 0 : l.name) || ((c = (s = (t = this.configSettings) == null ? void 0 : t.booking) == null ? void 0 : s.guest) == null ? void 0 : c.name) || this.name, placeholder: i.t("namePlaceholder"), type: "text", readOnly: ((g = (m = this.bookingInfo) == null ? void 0 : m.primaryParticipant) == null ? void 0 : g.nameReadOnly) || !1, required: !0, requiredError: this.nameRequiredError, patternError: this.namePatternError, themeConfig: this.themeConfig, part: "nbf__input-textfield" })), o("div", { key: "191fc64123d86e5e9e54b53749cdc35e334f21e2", class: "input-wrapper", part: "nbf__input-wrapper" }, o("input-component", { key: "8ef51518ac8ddee866148a6654463143a00a466e", label: i.t("email"), name: "email", id: "email", pattern: M, defaultValue: ((x = (C = this.bookingInfo) == null ? void 0 : C.primaryParticipant) == null ? void 0 : x.email) || ((u = (D = (B = this.configSettings) == null ? void 0 : B.booking) == null ? void 0 : D.guest) == null ? void 0 : u.email) || this.email, placeholder: i.t("emailPlaceholder"), type: "email", readOnly: ((T = (p = this.bookingInfo) == null ? void 0 : p.primaryParticipant) == null ? void 0 : T.emailReadOnly) || !1, required: !0, requiredError: this.emailRequiredError, patternError: this.emailPatternError, themeConfig: this.themeConfig, part: "nbf__input-textfield" })), ((ne = (R = this.configSettings) == null ? void 0 : R.scheduler) == null ? void 0 : ne.hide_additional_guests) !== !0 && o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, this.guestEmails.map((_, y) => o("div", { class: "input-wrapper button-wrapper" }, o("label", { class: {
360
- error: !!this.guestEmailErrors[y]
361
- } }, i.t("guestEmail")), o("div", { class: "guest-email-input" }, o("input", { type: "email", id: `guest-email-${y}`, maxLength: 100, class: {
362
- "guest-email": !0,
363
- error: !!this.guestEmailErrors[y]
364
- }, placeholder: i.t("guestEmailPlaceholder"), value: _, "data-index": y, part: "nbf__input-textfield", onBlur: (h) => {
365
- var b;
366
- return this.handleGuestBlur(y, (b = h.target) == null ? void 0 : b.value);
367
- }, onInput: (h) => {
368
- var b;
369
- return this.handleGuestChange(y, (b = h.target) == null ? void 0 : b.value);
370
- } }), o("button-component", { variant: "basic", tooltip: "Remove guest", onClick: (h) => this.removeGuestButtonClickHandler(h, y), class: {
371
- "remove-guest": !0,
372
- error: !!this.guestEmailErrors[y]
373
- } }, o("close-icon", null))), o("p", { class: "help-text" }, this.guestEmailErrors[y]))), !e && o("button-component", { class: "add-guest", variant: "invisible", part: "nbf__button-ghost", onClick: (_) => this.addGuestButtonClickedHandler(_) }, o("div", { class: "button-content" }, o("add-circle-icon", { slot: "icon" }), this.guestEmails.length > 0 ? `${i.t("addAnotherGuest")}` : `${i.t("addGuest")}`))), (re = Object.entries(((oe = (te = this.configSettings) == null ? void 0 : te.scheduler) == null ? void 0 : oe.additional_fields) || {})) == null ? void 0 : re.sort((_, y) => _[1].order - y[1].order).map((_) => {
374
- var le, se, ie, ce, de, fe, ye, be, he, ge, me, ue, pe, ke;
375
- const y = _[1], h = y.label, b = _[0], v = ((ie = (se = (le = this.bookingInfo) == null ? void 0 : le.additionalFields) == null ? void 0 : se[b]) == null ? void 0 : ie.value) || ((fe = (de = (ce = this.configSettings) == null ? void 0 : ce.booking) == null ? void 0 : de.additional_fields) == null ? void 0 : fe[b]) || y.default || "", z = ((he = (be = (ye = this.bookingInfo) == null ? void 0 : ye.additionalFields) == null ? void 0 : be[b]) == null ? void 0 : he.readOnly) || !1;
376
- switch (y.type) {
377
- case "dropdown":
378
- return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("select-dropdown", { label: h, name: b, id: b, readOnly: z, withSearch: !1, emptyValue: i.t("nylasBookingCalendarPicker.selectOptionLabel"), defaultSelectedOption: v ? { value: v, label: v } : void 0, options: [
379
- { value: "", label: i.t("nylasBookingCalendarPicker.selectOptionLabel") },
380
- ...((ge = y.options) == null ? void 0 : ge.map((I) => ({ value: I, label: I }))) || []
381
- ], required: y.required, themeConfig: this.themeConfig, errorMessage: i.t("fieldRequired", { field: h }), exportparts: "sd_dropdown: nbf__dropdown, sd_dropdown-button: nbf__dropdown-button, sd_dropdown-content: nbf__dropdown-content" }));
382
- case "checkbox":
383
- return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("checkbox-component", { readOnly: z, label: h, name: b, id: b, checked: v === "true", required: y.required, themeConfig: this.themeConfig, errorMessage: i.t("fieldRequired", { field: h }), part: "nbf__checkbox-component" }));
384
- case "radio_button":
385
- return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("radio-button-group", { label: h, name: b, id: b, readOnly: z, defaultSelectedValue: v && ((me = y.options) != null && me.includes(v)) ? v : ((ue = y.options) == null ? void 0 : ue[0]) || "", options: (pe = y.options) == null ? void 0 : pe.map((I) => ({ value: I, label: I })), required: y.required, themeConfig: this.themeConfig, errorMessage: i.t("fieldRequired", { field: h }), part: "nbf__radio-button-group" }));
386
- case "multi_line_text":
387
- return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("textarea-component", { readOnly: z, label: h, defaultValue: v, name: b, id: b, required: y.required, themeConfig: this.themeConfig, errorMessage: i.t("fieldRequired", { field: h }), part: "nbf__textarea-component" }));
388
- case "date":
389
- return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("nylas-date-component", { readOnly: z, label: h, defaultValue: v, name: b, id: b, required: y.required, themeConfig: this.themeConfig, errorMessage: i.t("invalidDate"), patternError: i.t("invalidInputFormat", { field: h }), requiredError: i.t("fieldRequired", { field: h }), part: "nbf__date-component" }));
390
- case "multi_select": {
391
- const I = (v == null ? void 0 : v.split(",").map((P) => P.trim())) || [];
392
- return o("div", null, o("multi-select-dropdown", { label: h, name: b, id: b, readOnly: z, selectAtLeastOneOptionLabel: i.t("selectOneOrMoreOptions"), multipleOptionsSelectedLabel: i.t("multipleOptionsSelected"), options: (ke = y.options) == null ? void 0 : ke.map((P) => ({ value: P, label: P, selected: I.includes(P) })), required: y.required, themeConfig: this.themeConfig, errorMessage: i.t("selectAtLeastOneOption"), exportparts: "msd_dropdown: nbf__ms_dropdown, msd_dropdown-label: nbf__ms_dropdown-label, msd_dropdown-button: nbf__ms_dropdown-button, msd_dropdown-content: nbf__ms_dropdown-content, msd_dropdown_error: nbf__ms_dropdown_error, msd_dropdown-button--error: nbf__ms_dropdown-button--error" }));
393
- }
394
- case "metadata":
395
- return null;
396
- default:
397
- return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("input-component", { label: h, name: b, id: b, type: y.type, readOnly: z, defaultValue: v || "", requiredError: i.t("fieldRequired", { field: h }), patternError: i.t("invalidInputFormat", { field: h }), required: y.required, part: "nbf__input-textfield", themeConfig: this.themeConfig }));
398
- }
399
- })), o("div", { key: "85adf1a2d5868610b7d4f0d597553b5ec98772ef", class: "cta" }, o("button-component", { key: "a622fcc6240b1119dbc56ddf55fdc8b00e462787", variant: "basic", class: "back", part: "nbf__button-outline", isLoading: this.backButtonLoading && this.isLoading, onClick: this.handleBackButtonClicked }, o("slot", { key: "9c2cc61227918ebc7ac6d8aff80f40c51db00b11", name: "booking-form-back-label" }, `${i.t("backButton")}`)), o("button-component", { key: "abebcf397d96c21398f9f61ac5aeb45d75c8ad87", variant: "primary", isLoading: !this.backButtonLoading && this.isLoading, disabled: this.isLoading, part: "nbf__button-primary", type: "submit" }, o("slot", { key: "cecc83e97ea18b0766b37d9fd729d9ed4d4f06d6", name: "booking-form-book-label" }, `${i.t("bookNowButton")}`)))));
400
- }
401
- get host() {
402
- return E(this);
403
- }
404
- static get watchers() {
405
- return {
406
- bookingInfo: ["bookingInfoChangedHandler"],
407
- configSettings: ["configSettingsChangedHandler"],
408
- themeConfig: ["themeConfigChanged"],
409
- selectedLanguage: ["selectedLanguageChangedHandler"]
410
- };
411
- }
412
- };
413
- Xe([
414
- L({
415
- name: "nylas-booking-form",
416
- stateToProps: /* @__PURE__ */ new Map([
417
- ["scheduler.isLoading", "isLoading"],
418
- ["scheduler.bookingInfo", "bookingInfo"],
419
- ["scheduler.eventInfo", "eventInfo"],
420
- ["scheduler.configSettings", "configSettings"],
421
- ["scheduler.themeConfig", "themeConfig"],
422
- ["scheduler.selectedTimeslot", "selectedTimeslot"],
423
- ["scheduler.selectedLanguage", "selectedLanguage"]
424
- ]),
425
- eventToProps: {
426
- backButtonClicked: async (e, a) => {
427
- a.scheduler.toggleAdditionalData(!1);
428
- },
429
- nameChanged: async (e, a) => {
430
- a.scheduler.setParticipantName(e.detail);
431
- },
432
- emailChanged: async (e, a) => {
433
- a.scheduler.setParticipantEmail(e.detail);
434
- },
435
- detailsConfirmed: async (e, a) => {
436
- d("nylas-booking-form", "detailsConfirmed", e.detail);
437
- },
438
- bookingFormSubmitted: async (e, a) => {
439
- d("nylas-booking-form", "bookingFormSubmitted", e.detail);
440
- },
441
- bookingFormError: async (e, a) => {
442
- d("nylas-booking-form", "bookingFormError", e.detail);
443
- }
444
- },
445
- fireRegisterEvent: !0
446
- }),
447
- A("design:type", Function),
448
- A("design:paramtypes", []),
449
- A("design:returntype", void 0)
450
- ], Ee.prototype, "render", null);
451
- Ee.style = Ye;
452
- const Je = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;display:block;width:400px;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form form{width:100%}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:16px;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600);padding-bottom:1.25rem}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}.footer{display:grid;grid-template-columns:1fr 1fr;width:100%;padding-top:1.25rem;gap:1rem;border-top:1px solid var(--nylas-base-200);margin-top:1.25rem}', Ke = Je;
453
- var Qe = function(e, a, n, r) {
454
- var l = arguments.length, t = l < 3 ? a : r === null ? r = Object.getOwnPropertyDescriptor(a, n) : r, s;
455
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
456
- t = Reflect.decorate(e, a, n, r);
457
- else
458
- for (var c = e.length - 1; c >= 0; c--)
459
- (s = e[c]) && (t = (l < 3 ? s(t) : l > 3 ? s(a, n, t) : s(a, n)) || t);
460
- return l > 3 && t && Object.defineProperty(a, n, t), t;
461
- }, Z = function(e, a) {
462
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
463
- return Reflect.metadata(e, a);
464
- };
465
- const Le = class {
466
- constructor(e) {
467
- var a, n;
468
- w(this, e), this.goBackButtonClicked = f(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = f(this, "cancelBookingFormSubmitted", 7), this.triggerValidation = f(this, "triggerValidation", 7), this.cancelBookedEventError = f(this, "cancelBookedEventError", 7), this.cancelBookingFormError = f(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
469
- this.goBackButtonClicked.emit();
470
- }, this.handleSubmitCancelBooking = (r) => {
471
- var s, c, m;
472
- if (this.triggerValidation.emit({}), r.preventDefault(), !this.cancellationReason) {
473
- this.cancellationError = i.t("cancellationErrorMessage"), this.cancelBookingFormError.emit({ title: i.t("cancelBokingFormError"), description: i.t("cancellationErrorMessage") });
474
- return;
475
- }
476
- const l = (c = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : c.min_cancellation_notice;
477
- if (this.selectedTimeslot && l && new Date((m = this.selectedTimeslot) == null ? void 0 : m.start_time).getTime() - l * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime()) {
478
- this.cancelBookedEventError.emit({
479
- error: {
480
- title: i.t("cancellationErrorTitle"),
481
- message: i.t("minimumCancellationNoticeErrorMessage", { minCancellationNotice: l })
482
- }
483
- });
484
- return;
485
- }
486
- d(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
487
- const t = (g) => {
488
- this.cancelBookedEventError.emit(g);
489
- };
490
- this.cancelBookingId ? this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, action: "cancel", reason: this.cancellationReason, errorHandler: t }) : this.rejectBookingId && this.cancelBookingFormSubmitted.emit({ bookingId: this.rejectBookingId, action: "reject", reason: this.cancellationReason, errorHandler: t });
491
- }, this.cancelBookingId = void 0, this.rejectBookingId = void 0, this.selectedTimeslot = void 0, this.configSettings = void 0, this.eventInfo = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedLanguage = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((n = (a = this.configSettings) == null ? void 0 : a.scheduler) == null ? void 0 : n.cancellation_policy) || "Your current timeslot will become available to others.";
492
- }
493
- configSettingsChangedHandler(e) {
494
- var a;
495
- this.cancellationPolicy = ((a = e == null ? void 0 : e.scheduler) == null ? void 0 : a.cancellation_policy) || "Your current timeslot will become available to others.";
496
- }
497
- themeConfigChanged(e) {
498
- this.applyThemeConfig(e);
499
- }
500
- selectedLanguageChangedHandler(e, a) {
501
- e !== a && i.changeLanguage(e);
502
- }
503
- connectedCallback() {
504
- d("[nylas-cancel-booking-form] Component connected");
505
- }
506
- async componentWillLoad() {
507
- d("[nylas-cancel-booking-form] Component will load");
508
- }
509
- async componentDidLoad() {
510
- d("[nylas-cancel-booking-form] Component did load"), this.cancelBookingId || console.warn('[nylas-cancel-booking-form] No booking ID provided, "cancelBookingId" prop is required.'), this.applyThemeConfig(this.themeConfig);
511
- }
512
- disconnectedCallback() {
513
- d("[nylas-cancel-booking-form] Component disconnected");
514
- }
515
- applyThemeConfig(e) {
516
- var a;
517
- if (e)
518
- for (const [n, r] of Object.entries(e))
519
- this.host.style.setProperty(`${n}`, r), (a = this.textareaRef) == null || a.style.setProperty(`${n}`, r);
520
- }
521
- handleNylasFormInputChanged(e) {
522
- this.triggerValidation.emit({}), e.detail.name === "cancel-reason" && (this.cancellationReason = e.detail.value, this.cancellationError = e.detail.error);
523
- }
524
- render() {
525
- var e, a;
526
- return o(k, { key: "3b22e6567ab54d6f2cb568d75fee896a643da4c8", part: "ncbf" }, o("div", { key: "f046c04a7e3960a64e7da64c9a65a76566224f7d", class: "nylas-cancel-booking-form", part: "ncbf__card" }, o("div", { key: "a979e7bea8d4ec498f52d06843d81f48720a0c8c", class: "nylas-cancel-booking-form__calendar-icon", part: "ncbf__icon" }, o("calendar-cancel-icon", { key: "85015b6f8078d9159f348ddf323f31dec8f705d4" })), o("h3", { key: "78ecd8321eb0a3c12abef90033d8244ffbfee674", class: "nylas-cancel-booking-form__title", part: "ncbf__title" }, i.t("cancelBookingTitle")), o("div", { key: "524ca54afd1054d39d732fc17af3d75ce7586eae", class: "nylas-cancel-booking-form__description", part: "ncbf__description" }, (a = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && a.cancellation_policy ? this.cancellationPolicy : `${i.t("cancelBookingMessage")}`), o("form", { key: "997e3b3723ac23316214682b8f03714d22c73271", onSubmit: this.handleSubmitCancelBooking }, o("textarea-component", { key: "dd909a7998a66404c9ca4a0a880c65b8f38274d6", id: "cancel-reason", name: "cancel-reason", ref: (n) => this.textareaRef = n, required: !0, label: i.t("reasonForCancellation"), class: this.cancellationError ? "error" : "", part: "ncbf__reason-textarea", defaultValue: this.cancellationReason }), o("div", { key: "8a2331c8d00f1c6df904c3758fd5adcbb0a7095f", class: "footer" }, o("button-component", { key: "dd16407657ac2e6e181a213d172364d66466d2ad", variant: "destructive", class: "cancel", type: "submit", part: "ncbf__button-cta", disabled: this.isLoading }, i.t("cancelBookingButton")), !!this.eventInfo && o("button-component", { variant: "basic", class: "back", part: "ncbf__button-outline", onClick: this.handleGoBackClicked }, i.t("goBackButton"))))));
527
- }
528
- get host() {
529
- return E(this);
530
- }
531
- static get watchers() {
532
- return {
533
- configSettings: ["configSettingsChangedHandler"],
534
- themeConfig: ["themeConfigChanged"],
535
- selectedLanguage: ["selectedLanguageChangedHandler"]
536
- };
537
- }
538
- };
539
- Qe([
540
- L({
541
- name: "nylas-cancel-booking-form",
542
- stateToProps: /* @__PURE__ */ new Map([
543
- ["scheduler.configSettings", "configSettings"],
544
- ["scheduler.selectedTimeslot", "selectedTimeslot"],
545
- ["scheduler.eventInfo", "eventInfo"],
546
- ["scheduler.isLoading", "isLoading"],
547
- ["scheduler.cancelBookingId", "cancelBookingId"],
548
- ["scheduler.rejectBookingId", "rejectBookingId"],
549
- ["scheduler.themeConfig", "themeConfig"],
550
- ["scheduler.selectedLanguage", "selectedLanguage"]
551
- ]),
552
- eventToProps: {
553
- cancelBookingFormSubmitted: async (e, a) => {
554
- const { action: n, errorHandler: r } = e.detail;
555
- if (n === "cancel") {
556
- const l = await a.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason);
557
- r && (!l || "error" in l) && r(l);
558
- } else if (n === "reject") {
559
- const l = await a.scheduler.updateBooking({
560
- bookingId: e.detail.bookingId,
561
- status: "cancelled",
562
- reason: e.detail.reason
563
- });
564
- r && (!l || "error" in l) && r(l);
565
- }
566
- },
567
- goBackButtonClicked: async (e, a) => {
568
- d("nylas-cancel-booking-form", "goBackButtonClicked", e.detail), a.scheduler.goBack();
569
- },
570
- cancelBookedEventError: async (e, a) => {
571
- d("nylas-cancel-booking-form", "cancelBookedEventError", e.detail);
572
- },
573
- cancelBookingFormError: async (e, a) => {
574
- d("nylas-cancel-booking-form", "cancelBookingFormError", e.detail);
575
- }
576
- },
577
- fireRegisterEvent: !0
578
- }),
579
- Z("design:type", Function),
580
- Z("design:paramtypes", []),
581
- Z("design:returntype", void 0)
582
- ], Le.prototype, "render", null);
583
- Le.style = Ke;
584
- const Ve = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-cancelled-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{width:100%}', ea = Ve;
585
- var aa = function(e, a, n, r) {
586
- var l = arguments.length, t = l < 3 ? a : r === null ? r = Object.getOwnPropertyDescriptor(a, n) : r, s;
587
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
588
- t = Reflect.decorate(e, a, n, r);
589
- else
590
- for (var c = e.length - 1; c >= 0; c--)
591
- (s = e[c]) && (t = (l < 3 ? s(t) : l > 3 ? s(a, n, t) : s(a, n)) || t);
592
- return l > 3 && t && Object.defineProperty(a, n, t), t;
593
- }, G = function(e, a) {
594
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
595
- return Reflect.metadata(e, a);
596
- };
597
- const Be = class {
598
- constructor(e) {
599
- w(this, e), this.closeCancelEventCardClicked = f(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = f(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
600
- this.isClosing = !0;
601
- const a = (n) => {
602
- this.cancelledEventCardError.emit(n), this.isClosing = !1;
603
- };
604
- this.closeCancelEventCardClicked.emit({ errorHandler: a });
605
- }, this.configSettings = void 0, this.themeConfig = void 0, this.selectedLanguage = void 0, this.cancelledEventInfo = void 0, this.isClosing = !1;
606
- }
607
- selectedLanguageChangedHandler(e, a) {
608
- e !== a && i.changeLanguage(e);
609
- }
610
- themeConfigChanged(e) {
611
- this.applyThemeConfig(e);
612
- }
613
- connectedCallback() {
614
- d("[nylas-cancelled-event-card] Component connected");
615
- }
616
- async componentWillLoad() {
617
- d("[nylas-cancelled-event-card] Component will load");
618
- }
619
- async componentDidLoad() {
620
- d("[nylas-cancelled-event-card] Component did load"), this.cancelledEventInfo || console.warn('[nylas-cancelled-event-card] No cancelled event info provided, "cancelledEventInfo" prop is required.'), this.applyThemeConfig(this.themeConfig);
621
- }
622
- disconnectedCallback() {
623
- d("[nylas-cancelled-event-card] Component disconnected");
624
- }
625
- applyThemeConfig(e) {
626
- if (e)
627
- for (const [a, n] of Object.entries(e))
628
- this.host.style.setProperty(`${a}`, n);
629
- }
630
- render() {
631
- var e, a;
632
- return o(k, { key: "bde7d46555a6f6033089f6d49f853df1a7cd0dab", part: "ncec" }, o("div", { key: "a1be2ed4bead0b89572565d00ace39f9a3c0a50d", class: "nylas-cancelled-event-card", part: "ncec__card" }, o("div", { key: "e963d4ab8e599fac8809b3d264602cfc2954064a", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, o("calendar-cancel-icon", { key: "5cccb2a26d77253b99ed377366e312f114406d03" })), o("h3", { key: "9fed1c485eafff15e04d5a36c58488cc337de9e9", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, i.t("bookingCancelledTitle"), "!"), o("div", { key: "081f5d0b0615663c0e79aea7b70ea602375f9547", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, i.t("bookingCancelledMessage"), " ", ((a = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : a.name) || i.t("bookingCancelledMessage_theParticipants"), "."), o("div", { key: "697fbb9cccb9c665d35769f44ae16ff7a2a8ad36", class: "nylas-cancelled-event-card__cta" }, o("button-component", { key: "e4f77128ff98787aca19549e51406d5d88b6fe1a", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${i.t("closingButton")}...` : `${i.t("closeButton")}`))));
633
- }
634
- get host() {
635
- return E(this);
636
- }
637
- static get watchers() {
638
- return {
639
- selectedLanguage: ["selectedLanguageChangedHandler"],
640
- themeConfig: ["themeConfigChanged"]
641
- };
642
- }
643
- };
644
- aa([
645
- L({
646
- name: "nylas-cancelled-event-card",
647
- stateToProps: /* @__PURE__ */ new Map([
648
- ["scheduler.configSettings", "configSettings"],
649
- ["scheduler.themeConfig", "themeConfig"],
650
- ["scheduler.selectedLanguage", "selectedLanguage"]
651
- ]),
652
- eventToProps: {
653
- closeCancelEventCardClicked: async (e, a) => {
654
- const n = await a.scheduler.resetCancel(), { errorHandler: r } = e.detail;
655
- r && (!n || "error" in n) && r(n);
656
- },
657
- cancelledEventCardError: async (e, a) => {
658
- d("nylas-cancelled-event-card", "cancelledEventCardError", e.detail);
659
- }
660
- },
661
- fireRegisterEvent: !0
662
- }),
663
- G("design:type", Function),
664
- G("design:paramtypes", []),
665
- G("design:returntype", void 0)
666
- ], Be.prototype, "render", null);
667
- Be.style = ea;
668
- const na = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-confirmed-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-confirmed-event-card{width:inherit}}.nylas-confirmed-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-confirmed-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-confirmed-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-confirmed-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{width:100%}', ta = na;
669
- var oa = function(e, a, n, r) {
670
- var l = arguments.length, t = l < 3 ? a : r === null ? r = Object.getOwnPropertyDescriptor(a, n) : r, s;
671
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
672
- t = Reflect.decorate(e, a, n, r);
673
- else
674
- for (var c = e.length - 1; c >= 0; c--)
675
- (s = e[c]) && (t = (l < 3 ? s(t) : l > 3 ? s(a, n, t) : s(a, n)) || t);
676
- return l > 3 && t && Object.defineProperty(a, n, t), t;
677
- }, W = function(e, a) {
678
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
679
- return Reflect.metadata(e, a);
680
- };
681
- const De = class {
682
- constructor(e) {
683
- w(this, e), this.closeConfirmEventCardClicked = f(this, "closeConfirmEventCardClicked", 7), this.confirmedEventCardError = f(this, "confirmedEventCardError", 7), this.handleCloseClicked = () => {
684
- this.isClosing = !0;
685
- const a = (n) => {
686
- this.confirmedEventCardError.emit(n), this.isClosing = !1;
687
- };
688
- this.closeConfirmEventCardClicked.emit({ errorHandler: a });
689
- }, this.configSettings = void 0, this.themeConfig = void 0, this.selectedLanguage = void 0, this.confirmedEventInfo = void 0, this.isClosing = !1;
690
- }
691
- themeConfigChanged(e) {
692
- this.applyThemeConfig(e);
693
- }
694
- selectedLanguageChangedHandler(e, a) {
695
- e !== a && i.changeLanguage(e);
696
- }
697
- connectedCallback() {
698
- d("[nylas-confirmed-event-card] Component connected");
699
- }
700
- async componentWillLoad() {
701
- d("[nylas-confirmed-event-card] Component will load");
702
- }
703
- async componentDidLoad() {
704
- d("[nylas-confirmed-event-card] Component did load"), this.confirmedEventInfo || console.warn('[nylas-confirmed-event-card] No confirmed event info provided, "confirmedEventInfo" prop is required.'), this.applyThemeConfig(this.themeConfig);
705
- }
706
- disconnectedCallback() {
707
- d("[nylas-confirmed-event-card] Component disconnected");
708
- }
709
- applyThemeConfig(e) {
710
- if (e)
711
- for (const [a, n] of Object.entries(e))
712
- this.host.style.setProperty(`${a}`, n);
713
- }
714
- render() {
715
- var e, a;
716
- return o(k, { key: "196444e0b93a298fd4107589a7ffbba19895fe05", part: "ncec" }, o("div", { key: "a421437ec16e3354d51a0eed4e31c7c0de557278", class: "nylas-confirmed-event-card", part: "ncec__card" }, o("div", { key: "0da3ba5fcff4b46951adf128d4d4e6493860d56c", class: "nylas-confirmed-event-card__calendar-icon", part: "ncec__icon" }, o("calendar-check-icon", { key: "a02d08a2367f962607651557eaa5fb7b9d8b75cf" })), o("h3", { key: "0494ca0a842a597bbc40cd3c720d2faf10d6b103", class: "nylas-confirmed-event-card__title", part: "ncec__title" }, i.t("confirmedEventCardTitle"), "!"), o("div", { key: "4473fce54b8ad6176286f84cbd5554c8323312f0", class: "nylas-confirmed-event-card__description", part: "ncec__description" }, i.t("confirmedEventCardDescription"), " ", ((a = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : a.name) || "the participants", "."), o("div", { key: "c0c17c8bccb4bc4b017a4a6aba62cdd48ebeea5a", class: "nylas-confirmed-event-card__cta" }, o("button-component", { key: "1dcb13cff4958b4549125c5457c9ab1e05078316", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${i.t("closingButton")}...` : `${i.t("closeButton")}`))));
717
- }
718
- get host() {
719
- return E(this);
720
- }
721
- static get watchers() {
722
- return {
723
- themeConfig: ["themeConfigChanged"],
724
- selectedLanguage: ["selectedLanguageChangedHandler"]
725
- };
726
- }
727
- };
728
- oa([
729
- L({
730
- name: "nylas-confirmed-event-card",
731
- stateToProps: /* @__PURE__ */ new Map([
732
- ["scheduler.configSettings", "configSettings"],
733
- ["scheduler.themeConfig", "themeConfig"],
734
- ["scheduler.selectedLanguage", "selectedLanguage"]
735
- ]),
736
- eventToProps: {
737
- closeConfirmEventCardClicked: async (e, a) => {
738
- const n = await a.scheduler.resetConfirm(), { errorHandler: r } = e.detail;
739
- r && (!n || "error" in n) && r(n);
740
- }
741
- },
742
- fireRegisterEvent: !0
743
- }),
744
- W("design:type", Function),
745
- W("design:paramtypes", []),
746
- W("design:returntype", void 0)
747
- ], De.prototype, "render", null);
748
- De.style = ta;
749
- const U = /* @__PURE__ */ new Date(), Y = /* @__PURE__ */ new Date();
750
- function $(e, a, n, r) {
751
- function l(t) {
752
- return e(t = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+t)), t;
753
- }
754
- return l.floor = (t) => (e(t = /* @__PURE__ */ new Date(+t)), t), l.ceil = (t) => (e(t = new Date(t - 1)), a(t, 1), e(t), t), l.round = (t) => {
755
- const s = l(t), c = l.ceil(t);
756
- return t - s < c - t ? s : c;
757
- }, l.offset = (t, s) => (a(t = /* @__PURE__ */ new Date(+t), s == null ? 1 : Math.floor(s)), t), l.range = (t, s, c) => {
758
- const m = [];
759
- if (t = l.ceil(t), c = c == null ? 1 : Math.floor(c), !(t < s) || !(c > 0))
760
- return m;
761
- let g;
762
- do
763
- m.push(g = /* @__PURE__ */ new Date(+t)), a(t, c), e(t);
764
- while (g < t && t < s);
765
- return m;
766
- }, l.filter = (t) => $((s) => {
767
- if (s >= s)
768
- for (; e(s), !t(s); )
769
- s.setTime(s - 1);
770
- }, (s, c) => {
771
- if (s >= s)
772
- if (c < 0)
773
- for (; ++c <= 0; )
774
- for (; a(s, -1), !t(s); )
775
- ;
776
- else
777
- for (; --c >= 0; )
778
- for (; a(s, 1), !t(s); )
779
- ;
780
- }), n && (l.count = (t, s) => (U.setTime(+t), Y.setTime(+s), e(U), e(Y), Math.floor(n(U, Y))), l.every = (t) => (t = Math.floor(t), !isFinite(t) || !(t > 0) ? null : t > 1 ? l.filter(r ? (s) => r(s) % t === 0 : (s) => l.count(0, s) % t === 0) : l)), l;
781
- }
782
- const ra = 1e3, ze = ra * 60, la = ze * 60, H = la * 24, X = $(
783
- (e) => e.setHours(0, 0, 0, 0),
784
- (e, a) => e.setDate(e.getDate() + a),
785
- (e, a) => (a - e - (a.getTimezoneOffset() - e.getTimezoneOffset()) * ze) / H,
786
- (e) => e.getDate() - 1
787
- );
788
- $((e) => {
789
- e.setUTCHours(0, 0, 0, 0);
790
- }, (e, a) => {
791
- e.setUTCDate(e.getUTCDate() + a);
792
- }, (e, a) => (a - e) / H, (e) => e.getUTCDate() - 1);
793
- $((e) => {
794
- e.setUTCHours(0, 0, 0, 0);
795
- }, (e, a) => {
796
- e.setUTCDate(e.getUTCDate() + a);
797
- }, (e, a) => (a - e) / H, (e) => Math.floor(e / H));
798
- const sa = ':host{display:block;min-height:444px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}.title{margin:0 -1.25rem;display:flex;flex-direction:column;padding:0 1.5rem;gap:0.5rem;border-bottom:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);color:var(--nylas-base-800)}.title h1{max-width:376px;margin-bottom:0;font-size:18px;line-height:20px;font-weight:600;display:flex;gap:0.5rem;align-items:center}.title p{margin-top:0;font-size:16px;display:flex;gap:0.5rem;align-items:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:24px}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 768px){.dates .date{width:-webkit-fill-available;width:-moz-available;width:fill-available}}@media screen and (max-width: 412px){.dates .date{height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}', ia = sa;
799
- var ca = function(e, a, n, r) {
800
- var l = arguments.length, t = l < 3 ? a : r === null ? r = Object.getOwnPropertyDescriptor(a, n) : r, s;
801
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
802
- t = Reflect.decorate(e, a, n, r);
803
- else
804
- for (var c = e.length - 1; c >= 0; c--)
805
- (s = e[c]) && (t = (l < 3 ? s(t) : l > 3 ? s(a, n, t) : s(a, n)) || t);
806
- return l > 3 && t && Object.defineProperty(a, n, t), t;
807
- }, J = function(e, a) {
808
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
809
- return Reflect.metadata(e, a);
810
- };
811
- ae.extend(Oe);
812
- ae.extend(Me);
813
- const Ie = class {
814
- constructor(e) {
815
- w(this, e), this.dateSelected = f(this, "dateSelected", 7), this.monthChanged = f(this, "monthChanged", 7), this.selectableDates = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedDate = void 0, this.selectedLanguage = void 0, this.isLoading = void 0, this.eventDuration = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.disableNextMonthButton = !1, this.selectableDatesTimezone = [];
816
- }
817
- configSettingsChanged(e) {
818
- var l;
819
- const a = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), n = (l = e == null ? void 0 : e.scheduler) == null ? void 0 : l.available_days_in_future;
820
- if (n === void 0)
821
- return;
822
- Ce(/* @__PURE__ */ new Date(), n).getTime() < a.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
823
- }
824
- selectedLanguageChanged(e) {
825
- i.changeLanguage(e);
826
- }
827
- themeConfigChanged(e) {
828
- this.applyThemeConfig(e);
829
- }
830
- selectedDateChanged(e) {
831
- (!e || !F(e, this.month)) && (this.month = e || /* @__PURE__ */ new Date()), this.dates = this.getDates();
832
- }
833
- convertDatesToTimezone(e, a) {
834
- return !e || e.length === 0 ? [] : e.map((n) => {
835
- const r = ae(n).tz(a);
836
- return new Date(r.year(), r.month(), r.date());
837
- });
838
- }
839
- selectedTimezoneChanged(e) {
840
- this.selectableDatesTimezone = this.convertDatesToTimezone(this.selectableDates, e);
841
- }
842
- selectableDatesChanged(e) {
843
- this.selectableDatesTimezone = this.convertDatesToTimezone(e, this.selectedTimezone);
844
- }
845
- connectedCallback() {
846
- }
847
- disconnectedCallback() {
848
- }
849
- componentWillLoad() {
850
- }
851
- componentDidLoad() {
852
- d("[nylas-date-picker] Component did load"), this.applyThemeConfig(this.themeConfig), this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.selectableDatesTimezone = this.convertDatesToTimezone(this.selectableDates, this.selectedTimezone);
853
- }
854
- applyThemeConfig(e) {
855
- if (e)
856
- for (const [a, n] of Object.entries(e))
857
- this.host.style.setProperty(`${a}`, n);
858
- }
859
- getDates() {
860
- const e = He(this.month), a = $e(this.month);
861
- return X.range(X.offset(a, -a.getDay()), X.offset(e, 7 - e.getDay()));
862
- }
863
- selectDate(e) {
864
- this.dateSelected.emit(e);
865
- }
866
- changeMonth(e) {
867
- var l, t;
868
- this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
869
- const a = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), n = (t = (l = this.configSettings) == null ? void 0 : l.scheduler) == null ? void 0 : t.available_days_in_future;
870
- Ce(/* @__PURE__ */ new Date(), n).getTime() < a.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month);
871
- }
872
- isSelected(e, a, n) {
873
- return e && a && O(e, a) && n && (n == null ? void 0 : n.length) > 0;
874
- }
875
- isDisabled(e) {
876
- return !e || !this.selectableDatesTimezone || this.selectableDatesTimezone.length === 0 ? !0 : !this.selectableDatesTimezone.some((a) => e.getFullYear() === a.getFullYear() && e.getMonth() === a.getMonth() && e.getDate() === a.getDate());
877
- }
878
- render() {
879
- var e, a, n, r, l, t;
880
- return o(k, { key: "ecd613f2fec98a00bbb10ac6363097ebede0185d", part: "ndp" }, o("div", { key: "33bb461fca297b69b85ab9f8d17cddb51593dde8", class: "nylas-date-picker" }, o("div", { key: "4da1d51d7bb36838923263563c2f6b1331542fda", class: "title", part: "ndp__title" }, (e = this.configSettings) != null && e.name ? o("h1", null, (a = this.configSettings) == null ? void 0 : a.name) : ((r = (n = this.configSettings) == null ? void 0 : n.organizer) == null ? void 0 : r.name) && o("h1", null, o("person-icon", null), ((t = (l = this.configSettings) == null ? void 0 : l.organizer) == null ? void 0 : t.name) || "Organizer"), o("p", { key: "8ad906a6b34220b4d35f8dcd1c642d14c3f7293a" }, o("clock-icon", { key: "11d2b21b9ba5fb9a31f9694fc2eaa417b6743957" }), this.eventDuration ? Ne(this.eventDuration) : `- ${i.t("time.minutes")}`)), o("div", { key: "676de20b5616fdbb439567ca27f972040a086b70", class: "header flex-row" }, o("h2", { key: "aa60c555eb8bd7b3ef1ee033b8fc1b74f5a78cdb", part: "ndp__month-header" }, o("strong", { key: "7661ad8cf3c91063617a953aba02c74202910803" }, qe(this.month.toLocaleDateString("en-US", { month: "long" }).toLowerCase())), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), o("div", { key: "dc4087fff602efe458a75b542cf845e6c1599532", class: "pagination" }, o("button", { key: "34754cf95f2645641597a82b66805e1d92e8122d", title: "Previous month", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, o("chevron-icon", { key: "376aba646a4910ab430ec239f6ccab083df41334" })), o("button", { key: "01e5e39d56246416bc9270f6a0c2d32202db339a", title: "Next month", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, o("chevron-icon", { key: "492223b45186485d55e403a16d75e08c25a070f5" })))), o("div", { key: "c506414f7ae93d4b995054afa18a313ce02c2ca6", class: "dates" }, [
881
- i.t("days.sunday"),
882
- i.t("days.monday"),
883
- i.t("days.tuesday"),
884
- i.t("days.wednesday"),
885
- i.t("days.thursday"),
886
- i.t("days.friday"),
887
- i.t("days.saturday")
888
- ].map((s) => o("div", { class: "day", part: "ndp__day" }, s)), this.dates.map((s, c) => {
889
- var g;
890
- const m = this.isDisabled(s);
891
- return this.isLoading ? o("button", { disabled: !0, class: {
892
- "date day-skeleton": !0,
893
- "current-month": F(s, this.month)
894
- }, style: { animationDelay: `${c * 20}ms` }, part: "ndp__date ndp__date--disabled" }, s.getDate()) : o("button", { class: {
895
- date: !0,
896
- selected: !!(this.selectedDate && O(s, this.selectedDate) && this.selectableDates && ((g = this.selectableDates) == null ? void 0 : g.length) > 0),
897
- "current-day": O(s, /* @__PURE__ */ new Date()),
898
- "current-month": F(s, this.month)
899
- }, "aria-label": s.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: m, onClick: () => this.selectDate(s), part: `ndp__date ${this.isSelected(s, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${O(s, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${F(s, this.month) ? "ndp__date--current-month" : ""}` }, s.getDate());
900
- }))));
901
- }
902
- get host() {
903
- return E(this);
904
- }
905
- static get watchers() {
906
- return {
907
- configSettings: ["configSettingsChanged"],
908
- selectedLanguage: ["selectedLanguageChanged"],
909
- themeConfig: ["themeConfigChanged"],
910
- selectedDate: ["selectedDateChanged"],
911
- selectedTimezone: ["selectedTimezoneChanged"],
912
- selectableDates: ["selectableDatesChanged"]
913
- };
914
- }
915
- };
916
- ca([
917
- L({
918
- name: "nylas-date-picker",
919
- stateToProps: /* @__PURE__ */ new Map([
920
- ["scheduler.selectableDates", "selectableDates"],
921
- ["scheduler.selectedDate", "selectedDate"],
922
- ["scheduler.isLoading", "isLoading"],
923
- ["scheduler.configSettings", "configSettings"],
924
- ["scheduler.eventDuration", "eventDuration"],
925
- ["scheduler.selectedLanguage", "selectedLanguage"],
926
- ["scheduler.themeConfig", "themeConfig"],
927
- ["scheduler.selectedTimezone", "selectedTimezone"]
928
- ]),
929
- eventToProps: {
930
- dateSelected: async (e, a) => {
931
- d("nylas-date-picker", "dateSelected", e.detail), a.scheduler.selectDate(e.detail);
932
- },
933
- monthChanged: async (e, a) => {
934
- d("nylas-date-picker", "monthChanged", e.detail);
935
- }
936
- },
937
- fireRegisterEvent: !0
938
- }),
939
- J("design:type", Function),
940
- J("design:paramtypes", []),
941
- J("design:returntype", void 0)
942
- ], Ie.prototype, "render", null);
943
- Ie.style = ia;
944
- const da = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){border:none;padding:10px}select-dropdown::part(sd_dropdown-content){max-width:306px}@media screen and (max-width: 768px){select-dropdown::part(sd_dropdown-button-selected-label){max-width:80px}select-dropdown::part(sd_dropdown-content){width:100%;max-width:none}}', fa = da;
945
- var ya = function(e, a, n, r) {
946
- var l = arguments.length, t = l < 3 ? a : r === null ? r = Object.getOwnPropertyDescriptor(a, n) : r, s;
947
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
948
- t = Reflect.decorate(e, a, n, r);
949
- else
950
- for (var c = e.length - 1; c >= 0; c--)
951
- (s = e[c]) && (t = (l < 3 ? s(t) : l > 3 ? s(a, n, t) : s(a, n)) || t);
952
- return l > 3 && t && Object.defineProperty(a, n, t), t;
953
- }, K = function(e, a) {
954
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
955
- return Reflect.metadata(e, a);
956
- };
957
- const Se = class {
958
- constructor(e) {
959
- var a, n;
960
- w(this, e), this.timezoneChanged = f(this, "timezoneChanged", 7), this.languageChanged = f(this, "languageChanged", 7), this.themeConfig = void 0, this.bookingInfo = void 0, this.selectedTimezone = ((a = this.bookingInfo) == null ? void 0 : a.timezone) || Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = ((n = this.bookingInfo) == null ? void 0 : n.language) || navigator.language, this.searchPlaceholder = i.t("search");
961
- }
962
- themeConfigChanged(e) {
963
- this.applyThemeConfig(e);
964
- }
965
- bookingInfoChangedHandler(e) {
966
- e && (e != null && e.timezone) && this.changeTimezone(e.timezone), e && (e != null && e.language) && this.changeLanguage(e.language);
967
- }
968
- connectedCallback() {
969
- }
970
- disconnectedCallback() {
971
- }
972
- componentWillLoad() {
973
- }
974
- componentDidLoad() {
975
- var e, a;
976
- d("[nylas-locale-switch] Component did load"), this.applyThemeConfig(this.themeConfig), this.bookingInfo && ((e = this.bookingInfo) != null && e.timezone) && this.changeTimezone(this.bookingInfo.timezone), this.bookingInfo && ((a = this.bookingInfo) != null && a.language) && this.changeLanguage(this.bookingInfo.language);
977
- }
978
- applyThemeConfig(e) {
979
- var a, n;
980
- if (e)
981
- for (const [r, l] of Object.entries(e))
982
- this.host.style.setProperty(`${r}`, l), (a = this.timezoneRef) == null || a.style.setProperty(`${r}`, l), (n = this.languageRef) == null || n.style.setProperty(`${r}`, l);
983
- }
984
- changeTimezone(e) {
985
- this.selectedTimezone = e, this.timezoneChanged.emit(e);
986
- }
987
- changeLanguage(e) {
988
- this.selectedLanguage = e, i.changeLanguage(e), this.searchPlaceholder = i.t("search"), this.languageChanged.emit(e);
989
- }
990
- nylasFormDropdownChangedHandler(e) {
991
- const { name: a, value: n } = e.detail;
992
- a === "timezone" ? this.changeTimezone(n) : a === "language" && this.changeLanguage(n);
993
- }
994
- getTimezoneLabelHTML(e) {
995
- const a = Ae(e);
996
- return o("span", { class: "timezone-label", style: {
997
- display: "flex",
998
- alignItems: "center",
999
- justifyContent: "space-between",
1000
- width: "-webkit-fill-available"
1001
- } }, j[e], " ", o("span", { class: "timezone-offset", style: {
1002
- fontSize: "14px",
1003
- fontWeight: "400",
1004
- color: "var(--nylas-base-500)"
1005
- } }, a));
1006
- }
1007
- render() {
1008
- const e = Object.keys(j).map((n) => ({
1009
- labelHTML: this.getTimezoneLabelHTML(n),
1010
- label: j[n],
1011
- value: n
1012
- })), a = Object.keys(_e).map((n) => ({
1013
- label: _e[n],
1014
- value: n
1015
- }));
1016
- return o(k, { key: "db7685f65c4d6311437f51b90c8ff2d6f2bfdefb" }, o("div", { key: "41fe4d870125fec3f1b92de2f3b37a0c53e79541", class: "nylas-locale-switch", part: "nls" }, o("div", { key: "f3613e5625ce5755ed4c9a52ff74430c5065277a", class: {
1017
- "select-wrapper": !0,
1018
- timezone: !0
1019
- }, part: "nls__timezone" }, o("select-dropdown", { key: "65a17c585133197a0832f2f67165439aefaf0b78", name: "timezone", searchPlaceholder: this.searchPlaceholder, options: e, ref: (n) => this.timezoneRef = n, defaultSelectedOption: e.find((n) => n.value == this.selectedTimezone), exportparts: "sd_dropdown: nls__timezone-dropdown, sd_dropdown-button: nls__timezone-drop-button, sd_dropdown-button-selected-label: nls__timezone-drop-button-selected-label, sd_dropdown-content: nls__timezone-drop-content, sd_dropdown_label: nls__timezone-drop-label" }, o("span", { key: "4dcc3bb5f4e2f67d3ded45fc0501dc4cf14b32b4", slot: "select-icon" }, o("globe-icon", { key: "3e1d39db5640d61cb60259228dad1790fc4dc06a", width: "20", height: "20" })))), o("div", { key: "56808c49426922453fbae3393fdf2a1866c6e517", class: {
1020
- "select-wrapper": !0,
1021
- language: !0
1022
- }, part: "nls__language" }, o("select-dropdown", { key: "fde4a71e21e8f252c764dc3b7feee0092ba0d47e", name: "language", searchPlaceholder: this.searchPlaceholder, options: a, ref: (n) => this.languageRef = n, defaultSelectedOption: a.find((n) => n.value == this.selectedLanguage), exportparts: "sd_dropdown: nls__language-dropdown, sd_dropdown-button: nls__language-drop-button, sd_dropdown-content: nls__language-drop-content, sd_dropdown_label: nls__language-drop-label" }, o("span", { key: "b3b824079c7a7c9d82b8e6f12b7f8c765a502e85", slot: "select-icon" }, o("translate-icon", { key: "eda7d67fb6e01b93d000f2c4fe44ec86c5afb113", width: "20", height: "20" }))))));
1023
- }
1024
- get host() {
1025
- return E(this);
1026
- }
1027
- static get watchers() {
1028
- return {
1029
- themeConfig: ["themeConfigChanged"],
1030
- bookingInfo: ["bookingInfoChangedHandler"]
1031
- };
1032
- }
1033
- };
1034
- ya([
1035
- L({
1036
- name: "nylas-locale-switch",
1037
- stateToProps: /* @__PURE__ */ new Map([
1038
- ["scheduler.selectedLanguage", "selectedLanguage"],
1039
- ["scheduler.selectedTimezone", "selectedTimezone"],
1040
- ["scheduler.bookingInfo", "bookingInfo"],
1041
- ["scheduler.themeConfig", "themeConfig"]
1042
- ]),
1043
- eventToProps: {
1044
- timezoneChanged: async (e, a) => {
1045
- d("nylas-locale-switch", "timezoneChanged", e.detail), a.scheduler.selectTimezone(e.detail);
1046
- },
1047
- languageChanged: async (e, a) => {
1048
- d("nylas-locale-switch", "languageChanged", e.detail), a.scheduler.selectLanguage(e.detail);
1049
- }
1050
- },
1051
- fireRegisterEvent: !0
1052
- }),
1053
- K("design:type", Function),
1054
- K("design:paramtypes", []),
1055
- K("design:returntype", void 0)
1056
- ], Se.prototype, "render", null);
1057
- Se.style = fa;
1058
- const ba = ".sc-nylas-logo-h{display:flex}", ha = ba, ga = class {
1059
- constructor(e) {
1060
- w(this, e), this.width = "69", this.height = "24";
1061
- }
1062
- render() {
1063
- return o("svg", { key: "f7f75a001b5803b86e20a4182f698c8e2cc78626", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, o("g", { key: "598ddfe99d47a94219dc69eba23eb27ba52d804f", "clip-path": "url(#clip0_455_3543)" }, o("path", { key: "e0147cab60318decf95d8c1972745cc937308ca2", d: "M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z", fill: "currentColor" }), o("path", { key: "4091ae464be62a143707e179d6dfdff33707b08b", d: "M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z", fill: "currentColor" }), o("path", { key: "baa5b2f692ddca4ca6aa2f5ad0fabee82202236d", d: "M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z", fill: "currentColor" }), o("path", { key: "cb6bedcc0d1d177a041261cd9ce12c1164e15ee1", d: "M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z", fill: "currentColor" }), o("path", { key: "a4144622dceefb0721da599e0b6f76c832d0d28f", d: "M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z", fill: "currentColor" }), o("path", { key: "da90a0efd8801f8a856da4f96d49b3eebef08e23", d: "M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z", fill: "currentColor" }), o("path", { key: "470f66bd945477a677417aa3ace2811c5b73439f", d: "M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z", fill: "currentColor" }), o("path", { key: "3c88e8c71a3cf3c0f77e9373a1734e14cf9d98ba", d: "M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z", fill: "currentColor" })), o("defs", { key: "de5f6196af8d363ed1b681443bd7364bc9325de9" }, o("clipPath", { key: "0ee3553f8c66417f8cd13dac5af6d61057a0ef0a", id: "clip0_455_3543" }, o("rect", { key: "ca1b98034d9b17db1e1cf47e980c72a0a0b8ae29", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
1064
- }
1065
- };
1066
- ga.style = ha;
1067
- const ma = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.event-card-wrapper{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 4rem;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:16px;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.manage-booking-description{border-top:1px solid var(--nylas-base-200)}.manage-booking-description p{font-size:16px;margin:1rem;padding:0.5rem 1rem;font-weight:400;color:var(--nylas-base-800)}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{--dot-color:var(--nylas-base-700)}', ua = ma;
1068
- var pa = function(e, a, n, r) {
1069
- var l = arguments.length, t = l < 3 ? a : r === null ? r = Object.getOwnPropertyDescriptor(a, n) : r, s;
1070
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1071
- t = Reflect.decorate(e, a, n, r);
1072
- else
1073
- for (var c = e.length - 1; c >= 0; c--)
1074
- (s = e[c]) && (t = (l < 3 ? s(t) : l > 3 ? s(a, n, t) : s(a, n)) || t);
1075
- return l > 3 && t && Object.defineProperty(a, n, t), t;
1076
- }, Q = function(e, a) {
1077
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1078
- return Reflect.metadata(e, a);
1079
- };
1080
- const Re = class {
1081
- constructor(e) {
1082
- w(this, e), this.rejectBookingButtonClicked = f(this, "rejectBookingButtonClicked", 7), this.confirmBookingButtonClicked = f(this, "confirmBookingButtonClicked", 7), this.confirmBookingError = f(this, "confirmBookingError", 7), this.handleConfirmBookingButtonClicked = () => {
1083
- this.action = "confirm";
1084
- const a = (n) => {
1085
- this.confirmBookingError.emit(n);
1086
- };
1087
- this.organizerConfirmationBookingId && !this.isLoading && this.confirmBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host, errorHandler: a });
1088
- }, this.handleRejectBookingButtonClicked = () => {
1089
- this.action = "reject", this.organizerConfirmationBookingId && !this.isLoading && this.rejectBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host });
1090
- }, this.configSettings = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.organizerConfirmationBookingId = void 0, this.selectedLanguage = navigator.language, this.action = null;
1091
- }
1092
- themeConfigChanged(e) {
1093
- this.applyThemeConfig(e);
1094
- }
1095
- selectedLanguageChangedHandler(e, a) {
1096
- e !== a && i.changeLanguage(e);
1097
- }
1098
- connectedCallback() {
1099
- }
1100
- disconnectedCallback() {
1101
- }
1102
- async componentWillLoad() {
1103
- d("[nylas-organizer-confirmation-card] Component will load");
1104
- }
1105
- async componentDidLoad() {
1106
- d("[nylas-organizer-confirmation-card] Component did load"), this.applyThemeConfig(this.themeConfig);
1107
- }
1108
- applyThemeConfig(e) {
1109
- if (e)
1110
- for (const [a, n] of Object.entries(e))
1111
- this.host.style.setProperty(`${a}`, n);
1112
- }
1113
- async resetAction() {
1114
- this.action = null;
1115
- }
1116
- render() {
1117
- return o(k, { key: "685c64fd73ed2cd97647ddabb84201e0f79ea8cf", part: "nmcc" }, o("div", { key: "70e4b4ae0a3b4df1ced7f0629baf088786e10da7", class: "event-card-wrapper", part: "nmccc__card" }, o("div", { key: "4bab8a23c09d2c73fd57c3fd320ddc60bcd4ad3f", class: "calendar-icon" }, o("calendar-check-icon", { key: "20a288c36cdf0532b4fb8520e25057e05bbb9c67" })), o("div", { key: "23fd0069fe2805be74da6b1fb9c0b2a90a41f004", class: "booked-event-header" }, o("h2", { key: "ebf3b7a83f62844fc7afcb34d80b7a19162424bf", slot: "card-title", part: "nmcc__title" }, !!this.organizerConfirmationBookingId && `${i.t("bookingPendingTitle")}!`)), o("div", { key: "5b1736ec457c881496302a1e62cd8ebe6695c1dc", class: "manage-booking-description" }, o("p", { key: "97199b19d7bc741afe565733fa112fbc66308c75" }, i.t("bookingPendingnDescription"))), o("div", { key: "e305f35b16ec685bb9af4cb9f66d5e43db4edf9b", class: {
1118
- footer: !0
1119
- } }, o("button-component", { key: "a25bdb447e29fc415f0381a8ba73a36937fd9435", variant: "destructive", onClick: this.handleRejectBookingButtonClicked, isLoading: this.isLoading && this.action === "reject", part: "nmcc__button-outline nmcc__cancel-cta" }, `${i.t("rejectBookingButton")}`), o("button-component", { key: "ac814b5239c359decd43506b7981ac8d975d5416", variant: "basic", onClick: this.handleConfirmBookingButtonClicked, isLoading: this.isLoading && this.action === "confirm", part: "nmcc__button-outline nmcc__reschedule-cta" }, `${i.t("confirmBookingButton")}`))));
1120
- }
1121
- get host() {
1122
- return E(this);
1123
- }
1124
- static get watchers() {
1125
- return {
1126
- themeConfig: ["themeConfigChanged"],
1127
- selectedLanguage: ["selectedLanguageChangedHandler"]
1128
- };
1129
- }
1130
- };
1131
- pa([
1132
- L({
1133
- name: "nylas-organizer-confirmation-card",
1134
- stateToProps: /* @__PURE__ */ new Map([
1135
- ["scheduler.organizerConfirmationBookingId", "organizerConfirmationBookingId"],
1136
- ["scheduler.configSettings", "configSettings"],
1137
- ["scheduler.isLoading", "isLoading"],
1138
- ["scheduler.selectedLanguage", "selectedLanguage"],
1139
- ["scheduler.themeConfig", "themeConfig"]
1140
- ]),
1141
- eventToProps: {
1142
- rejectBookingButtonClicked: async (e, a) => {
1143
- a.scheduler.setReject(e.detail.bookingId);
1144
- },
1145
- confirmBookingButtonClicked: async (e, a) => {
1146
- const { host: n } = e.detail, r = await a.scheduler.updateBooking({
1147
- bookingId: e.detail.bookingId,
1148
- status: "confirmed"
1149
- }), { errorHandler: l } = e.detail;
1150
- l && (!r || "error" in r) && l(r), await n.resetAction();
1151
- }
1152
- },
1153
- fireRegisterEvent: !0
1154
- }),
1155
- Q("design:type", Function),
1156
- Q("design:paramtypes", []),
1157
- Q("design:returntype", void 0)
1158
- ], Re.prototype, "render", null);
1159
- Re.style = ua;
1160
- const ka = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;display:block;position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;gap:4px;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:16px;font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}', va = ka;
1161
- var Ca = function(e, a, n, r) {
1162
- var l = arguments.length, t = l < 3 ? a : r === null ? r = Object.getOwnPropertyDescriptor(a, n) : r, s;
1163
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1164
- t = Reflect.decorate(e, a, n, r);
1165
- else
1166
- for (var c = e.length - 1; c >= 0; c--)
1167
- (s = e[c]) && (t = (l < 3 ? s(t) : l > 3 ? s(a, n, t) : s(a, n)) || t);
1168
- return l > 3 && t && Object.defineProperty(a, n, t), t;
1169
- }, V = function(e, a) {
1170
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1171
- return Reflect.metadata(e, a);
1172
- };
1173
- const Pe = class {
1174
- constructor(e) {
1175
- w(this, e), this.themeConfig = void 0, this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.hour12 = void 0, this.startTime = "", this.endTime = "";
1176
- }
1177
- themeConfigChanged(e) {
1178
- this.applyThemeConfig(e);
1179
- }
1180
- selectedLanguageChangedHandler(e, a) {
1181
- e !== a && i.changeLanguage(e);
1182
- }
1183
- connectedCallback() {
1184
- }
1185
- disconnectedCallback() {
1186
- }
1187
- async componentWillLoad() {
1188
- d("[nylas-selected-event-card] Component will load");
1189
- }
1190
- async componentDidLoad() {
1191
- var n, r;
1192
- d("[nylas-selected-event-card] Component did load"), this.selectedDate || console.warn('[nylas-selected-event-card] "selectedDate" prop is not provided.'), this.selectedTimeslot || console.warn('[nylas-selected-event-card] "selectedTimeslot" prop is not provided.'), this.applyThemeConfig(this.themeConfig);
1193
- const e = S[this.selectedLanguage || "en"], a = new Intl.DateTimeFormat(e, {
1194
- hour: "2-digit",
1195
- minute: "2-digit",
1196
- timeZone: this.selectedTimezone,
1197
- hour12: this.hour12
1198
- });
1199
- this.startTime = a.format(new Date((n = this.selectedTimeslot) == null ? void 0 : n.start_time)), this.endTime = a.format(new Date((r = this.selectedTimeslot) == null ? void 0 : r.end_time));
1200
- }
1201
- applyThemeConfig(e) {
1202
- if (e)
1203
- for (const [a, n] of Object.entries(e))
1204
- this.host.style.setProperty(`${a}`, n);
1205
- }
1206
- render() {
1207
- var e;
1208
- return o(k, { key: "94fd07366e885e81fb62049c5a44fe6679897aba", part: "nsec" }, o("div", { key: "8ca223250ff59a898eae64b4eaf1ad24e690d3a7", class: "event-card", part: "nsec__card" }, o("div", { key: "77c0fbd4495f0811e5bb05ea95f59d4b2bad90af", class: "calendar-icon", part: "nsec__icon" }, o("calendar-icon", { key: "3c1a395ec15145153c3d0d4b4986aea9a7943ddf" })), o("div", { key: "1c5ed82612ce165f89bd240b21482c916dbf166b", class: "nylas-selected-event-card__date", part: "nsec__date" }, this.selectedDate ? we(xe((e = this.selectedTimeslot) == null ? void 0 : e.start_time, this.selectedTimezone, S[this.selectedLanguage || "en"])) : "-"), o("div", { key: "e62af1aba1c260d178f1cc95f3405e94448cdf29", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), o("div", { key: "6eea1eca90bde0bb49a747ad8ed3a5ca57971db4", class: "event-timezone", part: "nsec__timezone" }, o("globe-icon", { key: "feac1b95d2177a39f84648ec0e8356026ebc9ef7" }), j[this.selectedTimezone]));
1209
- }
1210
- get host() {
1211
- return E(this);
1212
- }
1213
- static get watchers() {
1214
- return {
1215
- themeConfig: ["themeConfigChanged"],
1216
- selectedLanguage: ["selectedLanguageChangedHandler"]
1217
- };
1218
- }
1219
- };
1220
- Ca([
1221
- L({
1222
- name: "nylas-selected-event-card",
1223
- stateToProps: /* @__PURE__ */ new Map([
1224
- ["scheduler.selectedDate", "selectedDate"],
1225
- ["scheduler.selectedTimeslot", "selectedTimeslot"],
1226
- ["scheduler.selectedTimezone", "selectedTimezone"],
1227
- ["scheduler.selectedLanguage", "selectedLanguage"],
1228
- ["scheduler.themeConfig", "themeConfig"],
1229
- ["scheduler.hour12", "hour12"]
1230
- ]),
1231
- eventToProps: {},
1232
- fireRegisterEvent: !0
1233
- }),
1234
- V("design:type", Function),
1235
- V("design:paramtypes", []),
1236
- V("design:returntype", void 0)
1237
- ], Pe.prototype, "render", null);
1238
- Pe.style = va;
1239
- const _a = ':host{display:block;height:calc(100% - 48px);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.timeslots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.time .time-label{display:flex;flex-direction:column;align-items:center;gap:4px}.time .time-label span.spots{font-size:14px;font-family:var(--nylas-font-family);font-weight:400;color:var(--nylas-base-600)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .timeslot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}', wa = _a;
1240
- var xa = function(e, a, n, r) {
1241
- var l = arguments.length, t = l < 3 ? a : r === null ? r = Object.getOwnPropertyDescriptor(a, n) : r, s;
1242
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1243
- t = Reflect.decorate(e, a, n, r);
1244
- else
1245
- for (var c = e.length - 1; c >= 0; c--)
1246
- (s = e[c]) && (t = (l < 3 ? s(t) : l > 3 ? s(a, n, t) : s(a, n)) || t);
1247
- return l > 3 && t && Object.defineProperty(a, n, t), t;
1248
- }, ee = function(e, a) {
1249
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1250
- return Reflect.metadata(e, a);
1251
- };
1252
- const je = class {
1253
- constructor(e) {
1254
- w(this, e), this.timeslotSelected = f(this, "timeslotSelected", 7), this.timeslotConfirmed = f(this, "timeslotConfirmed", 7), this.validateTimeslotError = f(this, "validateTimeslotError", 7), this.handleConfirmedTimeslot = async (a, n) => {
1255
- a.preventDefault(), d("[nylas-timeslot-picker] Confirm timeslot", n), n && this.timeslotConfirmed.emit({ timeslot: n, host: this.host });
1256
- }, this.handleMouseEnter = (a) => {
1257
- this.hoveredTimeslotIndex = a;
1258
- }, this.handleMouseLeave = () => {
1259
- this.hoveredTimeslotIndex = -1;
1260
- }, this.availability = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedDate = /* @__PURE__ */ new Date(), this.selectedLanguage = void 0, this.hour12 = void 0, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
1261
- }
1262
- selectedLanguageChanged(e) {
1263
- i.changeLanguage(e);
1264
- }
1265
- selectedDateChanged(e) {
1266
- var a;
1267
- if (d("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
1268
- const n = (a = this.availability) == null ? void 0 : a.filter((r) => N(r.start_time, e, this.selectedTimezone)).map((r) => r);
1269
- this.times = n || [];
1270
- }
1271
- }
1272
- availabilityChanged(e) {
1273
- if (d("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
1274
- const a = e == null ? void 0 : e.filter((n) => this.selectedDate && N(n.start_time, this.selectedDate, this.selectedTimezone)).map((n) => n);
1275
- this.times = a || [];
1276
- }
1277
- }
1278
- themeConfigChanged(e) {
1279
- this.applyThemeConfig(e);
1280
- }
1281
- connectedCallback() {
1282
- }
1283
- disconnectedCallback() {
1284
- }
1285
- async componentWillLoad() {
1286
- d("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
1287
- }
1288
- async componentDidLoad() {
1289
- var a;
1290
- d("[nylas-timeslot-picker] Component did load");
1291
- const e = (a = this.availability) == null ? void 0 : a.filter((n) => this.selectedDate && N(n.start_time, this.selectedDate, this.selectedTimezone)).map((n) => n);
1292
- this.times = e || [], this.applyThemeConfig(this.themeConfig);
1293
- }
1294
- applyThemeConfig(e) {
1295
- if (e)
1296
- for (const [a, n] of Object.entries(e))
1297
- this.host.style.setProperty(`${a}`, n);
1298
- }
1299
- getTimeslotId(e, a) {
1300
- const n = new Date(e.start_time), r = e.event_id;
1301
- return `${n.toLocaleDateString()}-${a}${r ? `-${r}` : ""}`;
1302
- }
1303
- onClickSelectTime(e, a) {
1304
- d("[nylas-timeslot-picker] Time selected", e, a), this.selectedTimeslotIndex = this.getTimeslotId(e, a), this.timeslotSelected.emit({
1305
- start_time: e.start_time,
1306
- end_time: e.end_time,
1307
- emails: e.emails,
1308
- capacity: e == null ? void 0 : e.capacity,
1309
- event_id: e == null ? void 0 : e.event_id,
1310
- master_id: e == null ? void 0 : e.master_id,
1311
- calendar_id: e == null ? void 0 : e.calendar_id
1312
- });
1313
- }
1314
- async emitValidateTimeslotError(e, a) {
1315
- this.validateTimeslotError.emit({ error: e, type: a });
1316
- }
1317
- getTimeSlotLabel(e) {
1318
- const a = S[this.selectedLanguage || "en"], n = new Intl.DateTimeFormat(a, {
1319
- hour: "2-digit",
1320
- minute: "2-digit",
1321
- timeZone: this.selectedTimezone,
1322
- hour12: this.hour12
1323
- });
1324
- return `${n.format(e.start_time)} - ${n.format(e.end_time)}`;
1325
- }
1326
- render() {
1327
- const e = S[this.selectedLanguage || "en"];
1328
- if (this.isLoading)
1329
- return o(k, null, o("div", { class: "loading" }, new Array(6).fill(0).map((n, r) => o("div", { class: "timeslot-skeleton", style: { animationDelay: `${r * 20}ms` } }))));
1330
- if (this.availability && this.availability.length === 0)
1331
- return o(k, null, o("div", { class: "empty" }, o("span", null, "No dates available")));
1332
- const a = this.times.filter((n) => {
1333
- const r = (n == null ? void 0 : n.event_id) || (n == null ? void 0 : n.master_id), l = typeof (n == null ? void 0 : n.capacity) == "number" && (n == null ? void 0 : n.capacity) > 0;
1334
- return !(r && !l);
1335
- });
1336
- return (!this.times || this.times.length === 0 || a.length === 0) && this.selectedDate ? o(k, null, o("div", { class: "empty" }, o("span", null, "No time slots available for selected date"))) : this.selectedDate ? o(k, { part: "ntp" }, o("div", { class: "time-picker-wrapper", part: "ntp__time-picker-wrapper" }, o("div", { class: "timeslots", part: "ntp__timeslots" }, a.map((n, r) => {
1337
- var s, c;
1338
- const l = typeof (n == null ? void 0 : n.capacity) == "number" && (n == null ? void 0 : n.capacity) > 0, t = this.selectedTimeslotIndex == this.getTimeslotId(n, r);
1339
- return o("button", { part: `ntp__timeslot ${((c = (s = this.selectedTimeslot) == null ? void 0 : s.start_time) == null ? void 0 : c.getTime()) === n.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, class: {
1340
- time: !0,
1341
- selected: typeof this.selectedTimeslot < "u" && t
1342
- }, onClick: () => this.onClickSelectTime(n, r), onMouseEnter: () => this.handleMouseEnter(r), onMouseLeave: () => this.handleMouseLeave() }, o("div", { class: "time-label", part: "ntp__time-label" }, this.hoveredTimeslotIndex == r || t ? this.getTimeSlotLabel(n) : n.start_time.toLocaleTimeString(e, { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone, hour12: this.hour12 }), o("span", { class: "spots" }, l ? i.t("spotsLeft", { count: n == null ? void 0 : n.capacity }) : null)));
1343
- })), this.selectedTimeslot && o("div", { class: "footer" }, o("button-component", { variant: "primary", onClick: (n) => this.handleConfirmedTimeslot(n, this.selectedTimeslot), part: "ntp__button-primary" }, o("slot", { name: "timeslot-picker-cta-label" }, i.t("nextButton")))))) : o(k, null);
1344
- }
1345
- get host() {
1346
- return E(this);
1347
- }
1348
- static get watchers() {
1349
- return {
1350
- selectedLanguage: ["selectedLanguageChanged"],
1351
- selectedDate: ["selectedDateChanged"],
1352
- availability: ["availabilityChanged"],
1353
- themeConfig: ["themeConfigChanged"]
1354
- };
1355
- }
1356
- };
1357
- xa([
1358
- L({
1359
- name: "nylas-timeslot-picker",
1360
- stateToProps: /* @__PURE__ */ new Map([
1361
- ["scheduler.selectedDate", "selectedDate"],
1362
- ["scheduler.availability", "availability"],
1363
- ["scheduler.selectedTimeslot", "selectedTimeslot"],
1364
- ["scheduler.selectedTimezone", "selectedTimezone"],
1365
- ["scheduler.selectedLanguage", "selectedLanguage"],
1366
- ["scheduler.isLoading", "isLoading"],
1367
- ["scheduler.themeConfig", "themeConfig"],
1368
- ["scheduler.hour12", "hour12"]
1369
- ]),
1370
- eventToProps: {
1371
- timeslotSelected: async (e, a) => {
1372
- d("nylas-timeslot-picker", "timeslotSelected", e.detail), a.scheduler.selectTime(e.detail);
1373
- },
1374
- timeslotConfirmed: async (e, a) => {
1375
- var l;
1376
- d("nylas-timeslot-picker", "timeslotConfirmed", e.detail);
1377
- const { timeslot: n, host: r } = e.detail;
1378
- if (n && (n != null && n.event_id) && (n != null && n.capacity)) {
1379
- const t = await a.scheduler.validateGroupEventTimeslot(n);
1380
- if (t && "error" in t) {
1381
- const s = ((l = t.error) == null ? void 0 : l.message) || "An error occurred while validating the timeslot";
1382
- s === "Event is full" ? r.emitValidateTimeslotError(s, "info") : r.emitValidateTimeslotError(s, "error");
1383
- }
1384
- } else
1385
- a.scheduler.toggleAdditionalData(!0);
1386
- },
1387
- validateTimeslotError: async (e, a) => {
1388
- d("nylas-timeslot-picker", "validateTimeslotError", e.detail);
1389
- }
1390
- },
1391
- fireRegisterEvent: !0
1392
- }),
1393
- ee("design:type", Function),
1394
- ee("design:paramtypes", []),
1395
- ee("design:returntype", void 0)
1396
- ], je.prototype, "render", null);
1397
- je.style = wa;
1398
- export {
1399
- Te as nylas_booked_event_card,
1400
- Ee as nylas_booking_form,
1401
- Le as nylas_cancel_booking_form,
1402
- Be as nylas_cancelled_event_card,
1403
- De as nylas_confirmed_event_card,
1404
- Ie as nylas_date_picker,
1405
- Se as nylas_locale_switch,
1406
- ga as nylas_logo,
1407
- Re as nylas_organizer_confirmation_card,
1408
- Pe as nylas_selected_event_card,
1409
- je as nylas_timeslot_picker
1410
- };