@nylas/react 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/add-circle-icon_2.entry-1e899552.js +25 -0
  2. package/dist/add-circle-icon_2.entry-31acee1d.cjs +1 -0
  3. package/dist/archive-icon.entry-b5f307e8.js +15 -0
  4. package/dist/archive-icon.entry-e932c9e6.cjs +1 -0
  5. package/dist/{arrow-icon.entry-20b50784.js → arrow-icon.entry-aae2e22d.js} +2 -2
  6. package/dist/{arrow-icon.entry-83c3105b.cjs → arrow-icon.entry-e35a6cad.cjs} +1 -1
  7. package/dist/{bold-icon.entry-0e3d84e1.cjs → bold-icon.entry-1e3c9b1f.cjs} +1 -1
  8. package/dist/{bold-icon.entry-34b18d0d.js → bold-icon.entry-d5d86b3f.js} +2 -2
  9. package/dist/{button-component_2.entry-8a5e99da.js → button-component_2.entry-5284316e.js} +6 -6
  10. package/dist/{button-component_2.entry-54101987.cjs → button-component_2.entry-a86f8dca.cjs} +1 -1
  11. package/dist/{calendar-agenda-fill-icon_51.entry-a351dca5.js → calendar-agenda-fill-icon_54.entry-5672c589.js} +1943 -1638
  12. package/dist/calendar-agenda-fill-icon_54.entry-702b29cc.cjs +10 -0
  13. package/dist/{calendar-cancel-icon.entry-f83e9b41.js → calendar-cancel-icon.entry-7f81de9d.js} +4 -4
  14. package/dist/{calendar-cancel-icon.entry-00756264.cjs → calendar-cancel-icon.entry-e9792eaa.cjs} +1 -1
  15. package/dist/{calendar-check-icon_2.entry-1817540c.js → calendar-check-icon_2.entry-84db1700.js} +7 -7
  16. package/dist/{calendar-check-icon_2.entry-6ac948fc.cjs → calendar-check-icon_2.entry-ad055b37.cjs} +1 -1
  17. package/dist/{calendar-icon.entry-68e53f52.cjs → calendar-icon.entry-019f7feb.cjs} +1 -1
  18. package/dist/{calendar-icon.entry-362428bf.js → calendar-icon.entry-45db1630.js} +2 -2
  19. package/dist/{checkbox-component_2.entry-5ce9807d.cjs → checkbox-component_2.entry-8325ff88.cjs} +1 -1
  20. package/dist/{checkbox-component_2.entry-0d7c1916.js → checkbox-component_2.entry-84a053ff.js} +3 -3
  21. package/dist/{chevron-icon_3.entry-89c52603.cjs → chevron-icon_3.entry-0edde2a6.cjs} +1 -1
  22. package/dist/{chevron-icon_3.entry-37c087a7.js → chevron-icon_3.entry-ec894a13.js} +6 -6
  23. package/dist/{clock-icon_4.entry-2e78febe.js → clock-icon_4.entry-8ec9c29b.js} +8 -8
  24. package/dist/{clock-icon_4.entry-496058ef.cjs → clock-icon_4.entry-935fe48d.cjs} +1 -1
  25. package/dist/constants-c549b12b-7ea4c7f5.js +763 -0
  26. package/dist/constants-c549b12b-c85413b1.cjs +1 -0
  27. package/dist/copy-icon.entry-5a2030da.cjs +1 -0
  28. package/dist/{copy-icon.entry-6d4e05b0.js → copy-icon.entry-d9405510.js} +7 -7
  29. package/dist/{delete-icon.entry-ea06b42a.js → delete-icon.entry-1b0a3ba4.js} +7 -7
  30. package/dist/{delete-icon.entry-e98b336e.cjs → delete-icon.entry-3f3d1ffb.cjs} +1 -1
  31. package/dist/document-refresh-icon.entry-59a18097.cjs +1 -0
  32. package/dist/document-refresh-icon.entry-fab58d33.js +15 -0
  33. package/dist/{feedbackSync-ab657d65-e8b7c001.js → feedbackSync-b56b29ed-7a1f1f75.js} +1 -1
  34. package/dist/{feedbackSync-ab657d65-e650e46d.cjs → feedbackSync-b56b29ed-b6f352f3.cjs} +1 -1
  35. package/dist/{folder-icon.entry-6096fbf4.js → folder-icon.entry-b5a123d0.js} +2 -2
  36. package/dist/{folder-icon.entry-5c3f4e8f.cjs → folder-icon.entry-e85383b6.cjs} +1 -1
  37. package/dist/{forward-icon.entry-4089e3bb.cjs → forward-icon.entry-7c8ed4c3.cjs} +1 -1
  38. package/dist/forward-icon.entry-88ab1a85.js +15 -0
  39. package/dist/{globe-icon.entry-59f4c2f9.js → globe-icon.entry-6fb414ca.js} +4 -4
  40. package/dist/{globe-icon.entry-e8ca972e.cjs → globe-icon.entry-b1253516.cjs} +1 -1
  41. package/dist/google-logo-icon_4.entry-ae09d065.cjs +1 -0
  42. package/dist/{google-logo-icon_4.entry-d4b8926f.js → google-logo-icon_4.entry-fe627741.js} +213 -199
  43. package/dist/inbox-icon.entry-7dce836e.cjs +1 -0
  44. package/dist/{inbox-icon.entry-70dae5ec.js → inbox-icon.entry-cec35da1.js} +2 -2
  45. package/dist/{index-e475e0c0.js → index-3fd31877.js} +3236 -3090
  46. package/dist/index-bd6fdc8c.cjs +81 -0
  47. package/dist/{index.es-b475d61f-68a74a28.cjs → index.es-c7ca1bad-0a324dca.cjs} +1 -1
  48. package/dist/{index.es-b475d61f-bfa2cba2.js → index.es-c7ca1bad-b895d84b.js} +1 -1
  49. package/dist/{info-icon_2.entry-f1b1dfba.cjs → info-icon_2.entry-1dab6311.cjs} +1 -1
  50. package/dist/{info-icon_2.entry-2bb60213.js → info-icon_2.entry-f7e6b4aa.js} +5 -5
  51. package/dist/{input-color-picker.entry-5ae45a9e.js → input-color-picker.entry-30cda4e2.js} +3 -3
  52. package/dist/{input-color-picker.entry-b669f7fb.cjs → input-color-picker.entry-b6e53c29.cjs} +1 -1
  53. package/dist/{input-component.entry-eeb95361.cjs → input-component.entry-1f1f8e00.cjs} +1 -1
  54. package/dist/{input-component.entry-cb958501.js → input-component.entry-7a04bc8b.js} +3 -3
  55. package/dist/{input-dropdown.entry-0b458f68.cjs → input-dropdown.entry-5e5b67be.cjs} +1 -1
  56. package/dist/{input-dropdown.entry-962605f8.js → input-dropdown.entry-abf134a8.js} +4 -4
  57. package/dist/italic-icon.entry-4631c594.js +15 -0
  58. package/dist/italic-icon.entry-c793243b.cjs +1 -0
  59. package/dist/{multi-select-dropdown.entry-a66408a2.cjs → multi-select-dropdown.entry-2b8728d5.cjs} +1 -1
  60. package/dist/{multi-select-dropdown.entry-3084e1fc.js → multi-select-dropdown.entry-9a93da56.js} +2 -2
  61. package/dist/nylas-booked-event-card_12.entry-8d502a3c.cjs +1 -0
  62. package/dist/{nylas-booked-event-card_12.entry-29e2a4b1.js → nylas-booked-event-card_12.entry-f13f3f54.js} +299 -294
  63. package/dist/{nylas-form-card.entry-33b4c295.js → nylas-form-card.entry-862519b4.js} +16 -16
  64. package/dist/{nylas-form-card.entry-8465eccf.cjs → nylas-form-card.entry-af179b96.cjs} +1 -1
  65. package/dist/{nylas-if-state.entry-9d96fc87.js → nylas-if-state.entry-8803a762.js} +3 -3
  66. package/dist/{nylas-if-state.entry-adb6103a.cjs → nylas-if-state.entry-c1c1282d.cjs} +1 -1
  67. package/dist/{nylas-login.entry-3f7c195e.js → nylas-login.entry-3e12f747.js} +7 -7
  68. package/dist/{nylas-login.entry-78b968d1.cjs → nylas-login.entry-65f8f046.cjs} +1 -1
  69. package/dist/{nylas-provider.entry-b918d0f6.cjs → nylas-provider.entry-9626b113.cjs} +1 -1
  70. package/dist/{nylas-provider.entry-19635620.js → nylas-provider.entry-e3501bd1.js} +5 -5
  71. package/dist/{nylas-scheduler-editor.entry-cfed7ae2.cjs → nylas-scheduler-editor.entry-17cd1514.cjs} +2 -2
  72. package/dist/{nylas-scheduler-editor.entry-e848771f.js → nylas-scheduler-editor.entry-6df45b05.js} +25 -25
  73. package/dist/{nylas-scheduling.entry-da987c02.js → nylas-scheduling.entry-08051ba3.js} +138 -126
  74. package/dist/nylas-scheduling.entry-b1fafd91.cjs +1 -0
  75. package/dist/{nylas-time-window-picker.entry-1f76b577.cjs → nylas-time-window-picker.entry-4989d421.cjs} +1 -1
  76. package/dist/{nylas-time-window-picker.entry-3c6b29d9.js → nylas-time-window-picker.entry-bdc8c6ea.js} +13 -13
  77. package/dist/{person-icon.entry-79fcd9fb.js → person-icon.entry-d62a16b4.js} +2 -2
  78. package/dist/{person-icon.entry-82bbb87c.cjs → person-icon.entry-fb7efa8f.cjs} +1 -1
  79. package/dist/play-icon.entry-01b95392.js +15 -0
  80. package/dist/{play-icon.entry-3f357ea4.cjs → play-icon.entry-f485a2c8.cjs} +1 -1
  81. package/dist/react.cjs +1 -1
  82. package/dist/react.js +9 -9
  83. package/dist/{refresh-icon.entry-1427a5e6.js → refresh-icon.entry-1ff4b39f.js} +2 -2
  84. package/dist/{refresh-icon.entry-7ce5ec90.cjs → refresh-icon.entry-5f997e86.cjs} +1 -1
  85. package/dist/{register-component-679c1308-de697ecb.js → register-component-3444af44-854971ad.js} +1 -1
  86. package/dist/{register-component-679c1308-b5a96acf.cjs → register-component-3444af44-9053e8c3.cjs} +1 -1
  87. package/dist/{reply-all-icon.entry-cf8114db.cjs → reply-all-icon.entry-1dad6514.cjs} +1 -1
  88. package/dist/{reply-all-icon.entry-f1165660.js → reply-all-icon.entry-cbafb8a0.js} +2 -2
  89. package/dist/reply-icon.entry-162d9945.cjs +1 -0
  90. package/dist/reply-icon.entry-a43bc252.js +15 -0
  91. package/dist/{scheduler-config-store-2a3b403d-e5210f72.js → scheduler-config-store-ed4a8dfd-22db9285.js} +1 -2
  92. package/dist/scheduler-config-store-ed4a8dfd-eeaeaa50.cjs +1 -0
  93. package/dist/{scheduler-store-908886c8-b0f43cb9.js → scheduler-store-d4784b24-9a5f5734.js} +134 -126
  94. package/dist/scheduler-store-d4784b24-aed474e8.cjs +1 -0
  95. package/dist/sent-icon.entry-a05486d5.js +15 -0
  96. package/dist/sent-icon.entry-a1aec7e9.cjs +1 -0
  97. package/dist/spam-icon.entry-473f11af.js +15 -0
  98. package/dist/spam-icon.entry-b481a04b.cjs +1 -0
  99. package/dist/{star-icon.entry-b15601ca.js → star-icon.entry-12fdc345.js} +5 -5
  100. package/dist/{star-icon.entry-88501c8b.cjs → star-icon.entry-6b1fe3cf.cjs} +1 -1
  101. package/dist/stop-icon.entry-4bd609f7.js +15 -0
  102. package/dist/{stop-icon.entry-3475e257.cjs → stop-icon.entry-72481153.cjs} +1 -1
  103. package/dist/{textarea-component.entry-d1f4dd9a.js → textarea-component.entry-47e1b2e6.js} +2 -2
  104. package/dist/{textarea-component.entry-683c2959.cjs → textarea-component.entry-f330a755.cjs} +1 -1
  105. package/dist/{time-period-selector.entry-e97f86fd.js → time-period-selector.entry-a4899368.js} +2 -2
  106. package/dist/{time-period-selector.entry-8cfdf750.cjs → time-period-selector.entry-c7611563.cjs} +1 -1
  107. package/dist/{translate-icon.entry-5757c37c.cjs → translate-icon.entry-40dfa8c9.cjs} +1 -1
  108. package/dist/{translate-icon.entry-09c5574f.js → translate-icon.entry-4517838d.js} +4 -4
  109. package/dist/trash-fill-icon.entry-86ca3055.cjs +1 -0
  110. package/dist/{trash-fill-icon.entry-470ec1ff.js → trash-fill-icon.entry-d7e960eb.js} +3 -3
  111. package/dist/{underline-icon.entry-9fe74ba7.js → underline-icon.entry-352970f5.js} +2 -2
  112. package/dist/{underline-icon.entry-6d729068.cjs → underline-icon.entry-f16d4943.cjs} +1 -1
  113. package/dist/{warning-icon.entry-d924f8f9.js → warning-icon.entry-63987dad.js} +5 -5
  114. package/dist/{warning-icon.entry-c1d48318.cjs → warning-icon.entry-79ef75b2.cjs} +1 -1
  115. package/package.json +3 -3
  116. package/dist/add-circle-icon_2.entry-6753bd65.js +0 -25
  117. package/dist/add-circle-icon_2.entry-cd9a7f37.cjs +0 -1
  118. package/dist/archive-icon.entry-434d1696.js +0 -15
  119. package/dist/archive-icon.entry-7cb1c265.cjs +0 -1
  120. package/dist/calendar-agenda-fill-icon_51.entry-1920adc2.cjs +0 -7
  121. package/dist/constants-c31dccfe-04b9cd8a.js +0 -3883
  122. package/dist/constants-c31dccfe-1a739653.cjs +0 -15
  123. package/dist/copy-icon.entry-a1baee33.cjs +0 -1
  124. package/dist/document-refresh-icon.entry-09750b52.cjs +0 -1
  125. package/dist/document-refresh-icon.entry-afae6621.js +0 -15
  126. package/dist/forward-icon.entry-da319c05.js +0 -15
  127. package/dist/google-logo-icon_4.entry-e2001f83.cjs +0 -1
  128. package/dist/inbox-icon.entry-80ee9082.cjs +0 -1
  129. package/dist/index-6b9d4b01.cjs +0 -81
  130. package/dist/italic-icon.entry-4a89e289.cjs +0 -1
  131. package/dist/italic-icon.entry-5be07509.js +0 -15
  132. package/dist/nylas-booked-event-card_12.entry-227ccf31.cjs +0 -1
  133. package/dist/nylas-reminder-emails.entry-ec79b757.js +0 -168
  134. package/dist/nylas-reminder-emails.entry-ee76db24.cjs +0 -4
  135. package/dist/nylas-reminder-time_2.entry-105de2d0.js +0 -108
  136. package/dist/nylas-reminder-time_2.entry-83ecc1d4.cjs +0 -1
  137. package/dist/nylas-scheduling.entry-e989cf9e.cjs +0 -1
  138. package/dist/play-icon.entry-97b40470.js +0 -15
  139. package/dist/reply-icon.entry-3a601cff.js +0 -15
  140. package/dist/reply-icon.entry-3db337c9.cjs +0 -1
  141. package/dist/scheduler-config-store-2a3b403d-e6f5bcab.cjs +0 -1
  142. package/dist/scheduler-store-908886c8-62d14677.cjs +0 -1
  143. package/dist/sent-icon.entry-2c7bd48e.js +0 -15
  144. package/dist/sent-icon.entry-708b9a2b.cjs +0 -1
  145. package/dist/spam-icon.entry-3106ed3d.js +0 -15
  146. package/dist/spam-icon.entry-fa8b80c6.cjs +0 -1
  147. package/dist/stop-icon.entry-f926a8db.js +0 -15
  148. package/dist/trash-fill-icon.entry-4bbfabcc.cjs +0 -1
@@ -1,28 +1,28 @@
1
- import { i as u, r as G, c as x, d as F, f as D, j as Y, k as J, h as n, H as C, g as K, F as H } from "./index-e475e0c0.js";
2
- import { n as L, N as Q } from "./index.es-b475d61f-bfa2cba2.js";
3
- import { E as z, C as X, N as Z } from "./scheduler-store-908886c8-b0f43cb9.js";
4
- import { L as V, a as ee } from "./constants-c31dccfe-04b9cd8a.js";
5
- import { i as te, a as ne, c as ie, b as oe, f as se } from "./feedbackSync-ab657d65-e8b7c001.js";
1
+ import { i as g, r as Y, c as C, d as O, f as E, j as J, k as K, h as n, H as w, g as Q, F as W } from "./index-3fd31877.js";
2
+ import { n as z, N as X } from "./index.es-c7ca1bad-b895d84b.js";
3
+ import { E as S, C as Z, N as V } from "./scheduler-store-d4784b24-9a5f5734.js";
4
+ import { L as ee, a as te } from "./constants-c549b12b-7ea4c7f5.js";
5
+ import { i as ne, a as ie, c as oe, b as se, f as ae } from "./feedbackSync-b56b29ed-7a1f1f75.js";
6
6
  import "react";
7
7
  import "react-dom";
8
- class ae {
9
- constructor({ schedulerAPIURL: e, nylasSchedulerStore: i, sessionId: a, configId: s, slug: d, clientId: r }) {
8
+ class re {
9
+ constructor({ schedulerAPIURL: e, nylasSchedulerStore: i, sessionId: a, configId: o, slug: r, clientId: d }) {
10
10
  if (!e)
11
11
  throw new Error("schedulerAPIURL is required");
12
12
  if (!i)
13
13
  throw new Error("nylasSchedulerStore is required");
14
- if (!a && !s && !(d || r))
14
+ if (!a && !o && !(r || d))
15
15
  throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.");
16
- e === "/" && (e = new URL(window.location.href).origin), this.configId = s, this.sessionId = a, this.schedulerAPIURL = e, this.nylasSchedulerStore = i, this.slug = d, this.clientId = r;
16
+ e === "/" && (e = new URL(window.location.href).origin), this.configId = o, this.sessionId = a, this.schedulerAPIURL = e, this.nylasSchedulerStore = i, this.slug = r, this.clientId = d;
17
17
  }
18
18
  init() {
19
- F("NylasConnector init");
19
+ O("NylasConnector init");
20
20
  }
21
21
  get schedulerStore() {
22
22
  return this.nylasSchedulerStore;
23
23
  }
24
24
  get scheduler() {
25
- return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new Z({
25
+ return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new V({
26
26
  schedulerAPIURL: this.schedulerAPIURL,
27
27
  schedulerStore: this.schedulerStore,
28
28
  sessionId: this.sessionId,
@@ -35,10 +35,10 @@ class ae {
35
35
  this.nylasSchedulerStore.reset();
36
36
  }
37
37
  }
38
- const E = (t, e) => {
39
- const i = t.isLoading, a = t.showNotification, s = t.nylasBranding;
38
+ const x = (t, e) => {
39
+ const i = t.isLoading, a = t.showNotification, o = t.nylasBranding;
40
40
  return n(
41
- H,
41
+ W,
42
42
  null,
43
43
  a && n("nylas-notification", null),
44
44
  i && n(
@@ -60,28 +60,28 @@ const E = (t, e) => {
60
60
  )
61
61
  ),
62
62
  !i && e,
63
- n("div", { class: "footer" }, s && n(
64
- H,
63
+ n("div", { class: "footer" }, o && n(
64
+ W,
65
65
  null,
66
66
  "Powered by ",
67
67
  n("nylas-logo", null)
68
68
  ))
69
69
  );
70
- }, W = (t, e) => n("div", { class: "message-banner" }, e), re = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0;height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer svg{fill:var(--nylas-base-500)}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}button-component#report-issue{width:auto;position:absolute;bottom:4px;left:16px}nylas-feedback-form{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}', de = re, $ = { title: u.t("genericErrorTitle"), type: L.Error, category: z.Component }, le = class {
70
+ }, $ = (t, e) => n("div", { class: "message-banner" }, e), de = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0;height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer svg{fill:var(--nylas-base-500)}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}button-component#report-issue{width:auto;position:absolute;bottom:4px;left:16px}nylas-feedback-form{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}', le = de, q = { title: g.t("genericErrorTitle"), type: z.Error, category: S.Component }, ce = class {
71
71
  constructor(t) {
72
- G(this, t), this.init = x(this, "init", 7), this.schedulerWillLoad = x(this, "schedulerWillLoad", 7), this.schedulerDidLoad = x(this, "schedulerDidLoad", 7), this.nylasSchedulerError = x(this, "nylasSchedulerError", 7), this.configSettingsLoaded = x(this, "configSettingsLoaded", 7), this.bookingRefExtracted = x(this, "bookingRefExtracted", 7), this.bookedEventInfo = x(this, "bookedEventInfo", 7), this.mode = "app", this.defaultSchedulerState = void 0, this.sessionId = void 0, this.schedulerApiUrl = "https://api.us.nylas.com", this.bookingInfo = void 0, this.rescheduleBookingRef = void 0, this.cancelBookingRef = void 0, this.organizerConfirmationBookingRef = void 0, this.configurationId = void 0, this.slug = void 0, this.clientId = void 0, this.nylasBranding = !0, this.eventOverrides = {}, this.isLoading = void 0, this.themeConfig = void 0, this.localization = void 0, this.showNotification = !0, this.enableUserFeedback = !0, this.automaticComponentRegistration = !0, this.selectedDateLabel = (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, { dateStyle: "full" }) || `${u.t("noDateSelected")}`, this.refConfigId = void 0, this.language = navigator.language, this.showFeedbackModal = !1;
72
+ Y(this, t), this.init = C(this, "init", 7), this.schedulerWillLoad = C(this, "schedulerWillLoad", 7), this.schedulerDidLoad = C(this, "schedulerDidLoad", 7), this.nylasSchedulerError = C(this, "nylasSchedulerError", 7), this.configSettingsLoaded = C(this, "configSettingsLoaded", 7), this.bookingRefExtracted = C(this, "bookingRefExtracted", 7), this.bookedEventInfo = C(this, "bookedEventInfo", 7), this.mode = "app", this.defaultSchedulerState = void 0, this.sessionId = void 0, this.schedulerApiUrl = "https://api.us.nylas.com", this.bookingInfo = void 0, this.rescheduleBookingRef = void 0, this.cancelBookingRef = void 0, this.organizerConfirmationBookingRef = void 0, this.configurationId = void 0, this.slug = void 0, this.clientId = void 0, this.nylasBranding = !0, this.eventOverrides = {}, this.isLoading = void 0, this.themeConfig = void 0, this.localization = void 0, this.showNotification = !0, this.enableUserFeedback = !0, this.automaticComponentRegistration = !0, this.selectedDateLabel = (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, { dateStyle: "full" }) || `${g.t("noDateSelected")}`, this.refConfigId = void 0, this.language = navigator.language, this.showFeedbackModal = !1, this.bookingInfoConfirmed = null;
73
73
  }
74
74
  connectedCallback() {
75
- F("[nylas-scheduler] connectedCallback");
75
+ O("[nylas-scheduler] connectedCallback");
76
76
  }
77
77
  async componentWillLoad() {
78
- var s, d;
79
- F("[nylas-scheduler] Component will load"), this.enableUserFeedback && !te() && ne({
78
+ var o, r;
79
+ O("[nylas-scheduler] Component will load"), this.enableUserFeedback && !ne() && ie({
80
80
  dsn: "https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",
81
- release: "1.1.4",
82
- integrations: (r) => [
83
- ...r.filter((o) => !1),
84
- se({
81
+ release: "1.1.5",
82
+ integrations: (d) => [
83
+ ...d.filter((s) => !1),
84
+ ae({
85
85
  colorScheme: "system",
86
86
  autoInject: !1
87
87
  })
@@ -93,27 +93,27 @@ const E = (t, e) => {
93
93
  if ("schedulerWillLoad" in this.eventOverrides && (await this.eventOverrides.schedulerWillLoad(t, this.nylasSchedulerConnector), t.defaultPrevented))
94
94
  return;
95
95
  this.stores = {
96
- scheduler: X({
96
+ scheduler: Z({
97
97
  bookingInfo: this.bookingInfo,
98
98
  nylasBranding: this.nylasBranding,
99
99
  ...this.defaultSchedulerState
100
100
  })
101
- }, this.baseProvider = new Q(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.refConfigId = this.configurationId;
101
+ }, this.baseProvider = new X(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.refConfigId = this.configurationId;
102
102
  let e;
103
103
  if (this.rescheduleBookingRef) {
104
- const [r, o, c] = D(this.rescheduleBookingRef);
105
- this.refConfigId = r, this.stores.scheduler.set("rescheduleBookingId", o), e = this.bookingRefExtracted.emit({ configurationId: r, bookingId: o });
104
+ const [d, s, l] = E(this.rescheduleBookingRef);
105
+ this.refConfigId = d, this.stores.scheduler.set("rescheduleBookingId", s), e = this.bookingRefExtracted.emit({ configurationId: d, bookingId: s });
106
106
  } else if (this.cancelBookingRef) {
107
- const [r, o, c] = D(this.cancelBookingRef);
108
- this.refConfigId = r, this.stores.scheduler.set("cancelBookingId", o), e = this.bookingRefExtracted.emit({ configurationId: r, bookingId: o });
107
+ const [d, s, l] = E(this.cancelBookingRef);
108
+ this.refConfigId = d, this.stores.scheduler.set("cancelBookingId", s), e = this.bookingRefExtracted.emit({ configurationId: d, bookingId: s });
109
109
  } else if (this.organizerConfirmationBookingRef) {
110
- const [r, o, c] = D(this.organizerConfirmationBookingRef);
111
- this.refConfigId = r, this.stores.scheduler.set("organizerConfirmationBookingId", o), this.stores.scheduler.set("organizerConfirmationSalt", c), e = this.bookingRefExtracted.emit({ configurationId: r, bookingId: o, salt: c });
110
+ const [d, s, l] = E(this.organizerConfirmationBookingRef);
111
+ this.refConfigId = d, this.stores.scheduler.set("organizerConfirmationBookingId", s), this.stores.scheduler.set("organizerConfirmationSalt", l), e = this.bookingRefExtracted.emit({ configurationId: d, bookingId: s, salt: l });
112
112
  }
113
113
  if ("bookingRefExtracted" in this.eventOverrides && (await this.eventOverrides.bookingRefExtracted(e, this.nylasSchedulerConnector), e.defaultPrevented) || !this.checkIfSessionIdOrConfigIdExists())
114
114
  return;
115
- const i = (s = this.baseProvider) == null ? void 0 : s.getStore("scheduler");
116
- this.nylasSchedulerConnector = new ae({
115
+ const i = (o = this.baseProvider) == null ? void 0 : o.getStore("scheduler");
116
+ this.nylasSchedulerConnector = new re({
117
117
  schedulerAPIURL: this.schedulerApiUrl,
118
118
  sessionId: this.sessionId,
119
119
  configId: this.refConfigId,
@@ -122,48 +122,48 @@ const E = (t, e) => {
122
122
  nylasSchedulerStore: i
123
123
  });
124
124
  const a = this.init.emit(this.host);
125
- "init" in this.eventOverrides && (await this.eventOverrides.init(a, this.nylasSchedulerConnector), a.defaultPrevented) || ((d = this.baseProvider) == null || d.componentWillLoad(this.nylasSchedulerConnector), this.applyThemeConfig(this.themeConfig));
125
+ "init" in this.eventOverrides && (await this.eventOverrides.init(a, this.nylasSchedulerConnector), a.defaultPrevented) || ((r = this.baseProvider) == null || r.componentWillLoad(this.nylasSchedulerConnector), this.applyThemeConfig(this.themeConfig));
126
126
  }
127
127
  async componentDidLoad() {
128
- var c, y, m, g, p, f, b, I;
129
- (c = this.baseProvider) == null || c.componentDidLoad();
128
+ var l, b, m, h, c, f, p, D;
129
+ (l = this.baseProvider) == null || l.componentDidLoad();
130
130
  const t = this.schedulerDidLoad.emit(this.host);
131
131
  if ("schedulerDidLoad" in this.eventOverrides && (await this.eventOverrides.schedulerDidLoad(t, this.nylasSchedulerConnector), t.defaultPrevented) || !this.checkIfSessionIdOrConfigIdExists())
132
132
  return;
133
133
  this.localizationChanged(this.localization);
134
- const e = await ((y = this.nylasSchedulerConnector) == null ? void 0 : y.scheduler.getUISettings());
134
+ const e = await ((b = this.nylasSchedulerConnector) == null ? void 0 : b.scheduler.getUISettings());
135
135
  if (!e || "error" in e) {
136
136
  this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(e == null ? void 0 : e.error) }, host: this.host });
137
137
  return;
138
138
  } else {
139
139
  "data" in e && ((m = e.data) != null && m.appearance) && console.info("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.");
140
- const h = this.configSettingsLoaded.emit({ settings: e });
141
- if ("configSettingsLoaded" in this.eventOverrides && (await this.eventOverrides.configSettingsLoaded(h, this.nylasSchedulerConnector), h.defaultPrevented))
140
+ const u = this.configSettingsLoaded.emit({ settings: e });
141
+ if ("configSettingsLoaded" in this.eventOverrides && (await this.eventOverrides.configSettingsLoaded(u, this.nylasSchedulerConnector), u.defaultPrevented))
142
142
  return;
143
143
  }
144
- const i = (g = this.baseProvider) == null ? void 0 : g.getStore("scheduler"), a = (f = (p = i == null ? void 0 : i.get("configSettings")) == null ? void 0 : p.scheduler) == null ? void 0 : f.available_days_in_future, s = i == null ? void 0 : i.get("selectedTimeslot");
145
- if (s && (s != null && s.start_time)) {
146
- if (!this.isTimeslotValid(s))
144
+ const i = (h = this.baseProvider) == null ? void 0 : h.getStore("scheduler"), a = (f = (c = i == null ? void 0 : i.get("configSettings")) == null ? void 0 : c.scheduler) == null ? void 0 : f.available_days_in_future, o = i == null ? void 0 : i.get("selectedTimeslot");
145
+ if (o && (o != null && o.start_time)) {
146
+ if (!this.isTimeslotValid(o))
147
147
  return;
148
148
  if (i != null && i.get("showBookingForm")) {
149
- i == null || i.set("selectedDate", s.start_time);
149
+ i == null || i.set("selectedDate", o.start_time);
150
150
  return;
151
151
  }
152
152
  }
153
- const d = i == null ? void 0 : i.get("selectedDate"), r = i == null ? void 0 : i.get("availability");
154
- let o;
155
- if (!(r && r.length > 0)) {
156
- if (d) {
157
- const { startTime: h, endTime: l, endTimeForAvailableDaysInFuture: v } = this.validateAvailableDaysInFuture(d, a || 30);
158
- d.getTime() < v * 1e3 && (o = await ((I = this.nylasSchedulerConnector) == null ? void 0 : I.scheduler.getAvailability(h, l)));
153
+ const r = i == null ? void 0 : i.get("selectedDate"), d = i == null ? void 0 : i.get("availability");
154
+ let s;
155
+ if (!(d && d.length > 0)) {
156
+ if (r) {
157
+ const { startTime: u, endTime: y, endTimeForAvailableDaysInFuture: _ } = this.validateAvailableDaysInFuture(r, a || 30);
158
+ r.getTime() < _ * 1e3 && (s = await ((D = this.nylasSchedulerConnector) == null ? void 0 : D.scheduler.getAvailability(u, y)));
159
159
  } else {
160
- const h = /* @__PURE__ */ new Date(), { startTime: l, endTime: v, endTimeForAvailableDaysInFuture: B } = this.validateAvailableDaysInFuture(h, a || 30);
161
- h.getTime() < B * 1e3 && (o = await ((b = this.nylasSchedulerConnector) == null ? void 0 : b.scheduler.getAvailability(l, v)));
160
+ const u = /* @__PURE__ */ new Date(), { startTime: y, endTime: _, endTimeForAvailableDaysInFuture: T } = this.validateAvailableDaysInFuture(u, a || 30);
161
+ u.getTime() < T * 1e3 && (s = await ((p = this.nylasSchedulerConnector) == null ? void 0 : p.scheduler.getAvailability(y, _)));
162
162
  }
163
- if ((!o || "error" in o) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(o == null ? void 0 : o.error) }, host: this.host }), !d) {
164
- let h = /* @__PURE__ */ new Date();
165
- const l = i == null ? void 0 : i.get("availability").find((v) => new Date(v.start_time) > /* @__PURE__ */ new Date());
166
- l && (h = l.start_time), i == null || i.set("selectedDate", h);
163
+ if ((!s || "error" in s) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(s == null ? void 0 : s.error) }, host: this.host }), !r) {
164
+ let u = /* @__PURE__ */ new Date();
165
+ const y = i == null ? void 0 : i.get("availability").find((_) => new Date(_.start_time) > /* @__PURE__ */ new Date());
166
+ y && (u = y.start_time), i == null || i.set("selectedDate", u);
167
167
  }
168
168
  }
169
169
  }
@@ -178,27 +178,27 @@ const E = (t, e) => {
178
178
  rescheduleBookingRefChanged(t) {
179
179
  var e, i;
180
180
  if (t) {
181
- const [a, s] = D(t);
182
- (e = this.stores) == null || e.scheduler.set("rescheduleBookingId", s), this.refConfigId = a, (i = this.nylasSchedulerConnector) == null || i.scheduler.setConfigId(a);
181
+ const [a, o] = E(t);
182
+ (e = this.stores) == null || e.scheduler.set("rescheduleBookingId", o), this.refConfigId = a, (i = this.nylasSchedulerConnector) == null || i.scheduler.setConfigId(a);
183
183
  }
184
184
  }
185
185
  cancelBookingRefChanged(t) {
186
186
  var e, i;
187
187
  if (t) {
188
- const [a, s] = D(t);
189
- (e = this.stores) == null || e.scheduler.set("cancelBookingId", s), this.refConfigId = a, (i = this.nylasSchedulerConnector) == null || i.scheduler.setConfigId(a);
188
+ const [a, o] = E(t);
189
+ (e = this.stores) == null || e.scheduler.set("cancelBookingId", o), this.refConfigId = a, (i = this.nylasSchedulerConnector) == null || i.scheduler.setConfigId(a);
190
190
  }
191
191
  }
192
192
  organizerConfirmationBookingRefChanged(t) {
193
193
  var e, i;
194
194
  if (t) {
195
- const [a, s] = D(t);
196
- (e = this.stores) == null || e.scheduler.set("organizerConfirmationBookingId", s), this.refConfigId = a, (i = this.nylasSchedulerConnector) == null || i.scheduler.setConfigId(a);
195
+ const [a, o] = E(t);
196
+ (e = this.stores) == null || e.scheduler.set("organizerConfirmationBookingId", o), this.refConfigId = a, (i = this.nylasSchedulerConnector) == null || i.scheduler.setConfigId(a);
197
197
  }
198
198
  }
199
199
  localizationChanged(t) {
200
200
  t && Object.keys(t).forEach((e) => {
201
- e in V && (u.addResourceBundle(e, "translation", t[e], !1, !0), this.language = this.language);
201
+ e in ee && (g.addResourceBundle(e, "translation", t[e], !1, !0), this.language = this.language);
202
202
  });
203
203
  }
204
204
  themeConfigChanged(t) {
@@ -206,7 +206,7 @@ const E = (t, e) => {
206
206
  }
207
207
  languageChanged(t) {
208
208
  const e = t.detail;
209
- this.language = e, u.changeLanguage(e);
209
+ this.language = e, g.changeLanguage(e);
210
210
  }
211
211
  async registerComponentHandler(t) {
212
212
  var e;
@@ -217,48 +217,50 @@ const E = (t, e) => {
217
217
  (e = this.baseProvider) == null || e.unregisterComponent(t.detail);
218
218
  }
219
219
  async monthChangedHandler(t) {
220
- var r, o, c, y, m, g, p;
221
- const e = t.detail, i = (y = (c = (o = (r = this.nylasSchedulerConnector) == null ? void 0 : r.schedulerStore) == null ? void 0 : o.get("configSettings")) == null ? void 0 : c.scheduler) == null ? void 0 : y.available_days_in_future, { startTime: a, endTime: s, endTimeForAvailableDaysInFuture: d } = this.validateAvailableDaysInFuture(e, i || 30);
222
- if (a < d && e.getTime() < d * 1e3) {
223
- const f = await ((m = this.nylasSchedulerConnector) == null ? void 0 : m.scheduler.getAvailability(a, s));
220
+ var d, s, l, b, m, h, c;
221
+ const e = t.detail, i = (b = (l = (s = (d = this.nylasSchedulerConnector) == null ? void 0 : d.schedulerStore) == null ? void 0 : s.get("configSettings")) == null ? void 0 : l.scheduler) == null ? void 0 : b.available_days_in_future, { startTime: a, endTime: o, endTimeForAvailableDaysInFuture: r } = this.validateAvailableDaysInFuture(e, i || 30);
222
+ if (a < r && e.getTime() < r * 1e3) {
223
+ const f = await ((m = this.nylasSchedulerConnector) == null ? void 0 : m.scheduler.getAvailability(a, o));
224
224
  (!f || "error" in f) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(f == null ? void 0 : f.error) }, host: this.host });
225
- const b = (g = this.stores) == null ? void 0 : g.scheduler.get("selectableDates");
226
- b && b.length > 0 && ((p = this.stores) == null || p.scheduler.set("selectedDate", b[0]));
225
+ const p = (h = this.stores) == null ? void 0 : h.scheduler.get("selectableDates");
226
+ p && p.length > 0 && ((c = this.stores) == null || c.scheduler.set("selectedDate", p[0]));
227
227
  }
228
228
  }
229
229
  mapToBookingData(t) {
230
- var r, o, c;
231
- const e = (r = this.stores) == null ? void 0 : r.scheduler.get("selectedTimeslot"), i = (o = this.stores) == null ? void 0 : o.scheduler.get("selectedLanguage"), a = (c = this.stores) == null ? void 0 : c.scheduler.get("selectedTimezone"), s = e != null && e.start_time ? new Date(e == null ? void 0 : e.start_time).getTime() / 1e3 : "", d = e != null && e.end_time ? new Date(e == null ? void 0 : e.end_time).getTime() / 1e3 : "";
230
+ var d, s, l;
231
+ const e = (d = this.stores) == null ? void 0 : d.scheduler.get("selectedTimeslot"), i = (s = this.stores) == null ? void 0 : s.scheduler.get("selectedLanguage"), a = (l = this.stores) == null ? void 0 : l.scheduler.get("selectedTimezone"), o = e != null && e.start_time ? new Date(e == null ? void 0 : e.start_time).getTime() / 1e3 : "", r = e != null && e.end_time ? new Date(e == null ? void 0 : e.end_time).getTime() / 1e3 : "";
232
232
  return {
233
233
  additional_guests: t.guests,
234
- guest: t.primaryParticipant,
235
- additional_fields: t.additionalFields,
236
- start_time: s,
237
- end_time: d,
234
+ guest: { ...t.primaryParticipant },
235
+ additional_fields: { ...t.additionalFields },
236
+ start_time: o,
237
+ end_time: r,
238
238
  email_language: i,
239
239
  timezone: a
240
240
  };
241
241
  }
242
242
  async bookButtonClickedHandler(t) {
243
- var m, g, p, f, b, I, h;
244
- const e = t.detail, i = this.mapToBookingData(e), s = { ...(g = (m = this.nylasSchedulerConnector) == null ? void 0 : m.schedulerStore) == null ? void 0 : g.get("bookingInfo"), ...e };
245
- (p = this.stores) == null || p.scheduler.set("bookingInfo", s);
246
- const r = (b = (f = this.nylasSchedulerConnector) == null ? void 0 : f.schedulerStore) == null ? void 0 : b.get("rescheduleBookingId");
247
- if (r) {
248
- const l = await ((I = this.nylasSchedulerConnector) == null ? void 0 : I.scheduler.rescheduleBooking(r, e));
249
- (!l || "error" in l) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(l == null ? void 0 : l.error) }, host: this.host });
250
- const v = l == null ? void 0 : l.data, B = this.bookedEventInfo.emit({ ...l, data: { ...v, ...i } });
251
- "bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(B, this.nylasSchedulerConnector);
243
+ var l, b, m, h;
244
+ if (t.defaultPrevented)
245
+ return;
246
+ const e = t.detail, i = this.mapToBookingData(e);
247
+ this.bookingInfoConfirmed = e;
248
+ const o = (b = (l = this.nylasSchedulerConnector) == null ? void 0 : l.schedulerStore) == null ? void 0 : b.get("rescheduleBookingId");
249
+ if (o) {
250
+ const c = await ((m = this.nylasSchedulerConnector) == null ? void 0 : m.scheduler.rescheduleBooking(o, e));
251
+ (!c || "error" in c) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(c == null ? void 0 : c.error) }, host: this.host });
252
+ const f = c == null ? void 0 : c.data, p = this.bookedEventInfo.emit({ ...c, data: { ...f, ...i } });
253
+ "bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(p, this.nylasSchedulerConnector);
252
254
  return;
253
255
  }
254
- const o = await ((h = this.nylasSchedulerConnector) == null ? void 0 : h.scheduler.bookTimeslot(e));
255
- (!o || "error" in o) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(o == null ? void 0 : o.error) }, host: this.host });
256
- const c = o == null ? void 0 : o.data, y = this.bookedEventInfo.emit({ ...o, data: { ...c, ...i } });
257
- "bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(y, this.nylasSchedulerConnector);
256
+ const r = await ((h = this.nylasSchedulerConnector) == null ? void 0 : h.scheduler.bookTimeslot(e));
257
+ (!r || "error" in r) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(r == null ? void 0 : r.error) }, host: this.host });
258
+ const d = r == null ? void 0 : r.data, s = this.bookedEventInfo.emit({ ...r, data: { ...d, ...i } });
259
+ "bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(s, this.nylasSchedulerConnector);
258
260
  }
259
261
  dateSelectedHandler(t) {
260
262
  const e = t.detail;
261
- this.selectedDateLabel = e ? e.toLocaleDateString(void 0, { dateStyle: "full" }) : `${u.t("noDateSelected")}`;
263
+ this.selectedDateLabel = e ? e.toLocaleDateString(void 0, { dateStyle: "full" }) : `${g.t("noDateSelected")}`;
262
264
  }
263
265
  cancelBookedEventErrorHandler(t) {
264
266
  this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(t.detail.error) }, host: this.host });
@@ -277,15 +279,15 @@ const E = (t, e) => {
277
279
  }
278
280
  feedbackSubmittedHandler(t) {
279
281
  const i = {
280
- eventId: ie("Scheduling Page User Feedback"),
282
+ eventId: oe("Scheduling Page User Feedback"),
281
283
  message: t.detail.feedback
282
284
  };
283
- oe(i, {
285
+ se(i, {
284
286
  includeReplay: !0,
285
287
  captureContext: {
286
288
  tags: {
287
289
  "nylas-web-element": "nylas-schduling",
288
- "nylas-web-element-version": "1.1.4"
290
+ "nylas-web-element-version": "1.1.5"
289
291
  },
290
292
  extra: {
291
293
  configId: this.configurationId,
@@ -306,9 +308,9 @@ const E = (t, e) => {
306
308
  }
307
309
  getErrorObject(t) {
308
310
  return {
309
- title: (t == null ? void 0 : t.title) || $.title,
310
- category: (t == null ? void 0 : t.category) || $.category,
311
- type: L.Error,
311
+ title: (t == null ? void 0 : t.title) || q.title,
312
+ category: (t == null ? void 0 : t.category) || q.category,
313
+ type: z.Error,
312
314
  description: (t == null ? void 0 : t.message) || "",
313
315
  id: (/* @__PURE__ */ new Date()).getTime().toString(),
314
316
  ttl: "none"
@@ -317,11 +319,11 @@ const E = (t, e) => {
317
319
  checkIfSessionIdOrConfigIdExists() {
318
320
  if (!this.sessionId && !this.refConfigId && !(this.slug && this.clientId)) {
319
321
  let t = "";
320
- return this.sessionId || (t += u.t("sessionIdRequiredErrorMessage")), !this.sessionId && !this.refConfigId && !(this.slug && this.clientId) && (t = u.t("sessionIdRequiredErrorMessage") + " " + u.t("publicConfigErrorMessage")), this.nylasSchedulerError.emit({
322
+ return this.sessionId || (t += g.t("sessionIdRequiredErrorMessage")), !this.sessionId && !this.refConfigId && !(this.slug && this.clientId) && (t = g.t("sessionIdRequiredErrorMessage") + " " + g.t("publicConfigErrorMessage")), this.nylasSchedulerError.emit({
321
323
  notification: {
322
- title: u.t("schedulingComponentErrorTitle"),
323
- category: z.Component,
324
- type: L.Error,
324
+ title: g.t("schedulingComponentErrorTitle"),
325
+ category: S.Component,
326
+ type: z.Error,
325
327
  description: t,
326
328
  id: (/* @__PURE__ */ new Date()).getTime().toString(),
327
329
  ttl: "none"
@@ -334,10 +336,10 @@ const E = (t, e) => {
334
336
  isTimeslotValid(t) {
335
337
  return new Date(t.start_time) < /* @__PURE__ */ new Date() ? (this.nylasSchedulerError.emit({
336
338
  notification: {
337
- title: u.t("invalidTimeslotErrorTitle"),
338
- category: z.Component,
339
- type: L.Error,
340
- description: u.t("invalidTimeslotErrorMessage"),
339
+ title: g.t("invalidTimeslotErrorTitle"),
340
+ category: S.Component,
341
+ type: z.Error,
342
+ description: g.t("invalidTimeslotErrorMessage"),
341
343
  id: (/* @__PURE__ */ new Date()).getTime().toString(),
342
344
  ttl: "none"
343
345
  },
@@ -345,8 +347,8 @@ const E = (t, e) => {
345
347
  }), !1) : !0;
346
348
  }
347
349
  validateAvailableDaysInFuture(t, e) {
348
- const i = /* @__PURE__ */ new Date(), a = new Date(t.getFullYear(), t.getMonth(), 1).getTime() / 1e3, s = new Date(t.getFullYear(), t.getMonth() + 1, 1).getTime() / 1e3, d = Math.floor(Y(i, e).getTime() / 1e3), r = Math.min(d, s);
349
- return { startTime: a < i.getTime() / 1e3 ? Math.floor(i.getTime() / 1e3) : a, endTime: r, endTimeForAvailableDaysInFuture: d };
350
+ const i = /* @__PURE__ */ new Date(), a = new Date(t.getFullYear(), t.getMonth(), 1).getTime() / 1e3, o = new Date(t.getFullYear(), t.getMonth() + 1, 1).getTime() / 1e3, r = Math.floor(J(i, e).getTime() / 1e3), d = Math.min(r, o);
351
+ return { startTime: a < i.getTime() / 1e3 ? Math.floor(i.getTime() / 1e3) : a, endTime: d, endTimeForAvailableDaysInFuture: r };
350
352
  }
351
353
  applyThemeConfig(t) {
352
354
  if (t)
@@ -356,32 +358,42 @@ const E = (t, e) => {
356
358
  onFeedbackClick() {
357
359
  this.showFeedbackModal = !0;
358
360
  }
361
+ redirectToCustomUrl(t) {
362
+ window.location.assign(t);
363
+ }
359
364
  render() {
360
- var b, I, h, l, v, B, R, S, O, P, A;
361
- const t = this.mode === "app", e = (b = this.baseProvider) == null ? void 0 : b.getStore("scheduler"), i = e == null ? void 0 : e.get("eventInfo"), a = e == null ? void 0 : e.get("showBookingForm"), s = e == null ? void 0 : e.get("cancelledEventInfo"), d = e == null ? void 0 : e.get("cancelBookingId"), r = e == null ? void 0 : e.get("selectedTimeslot"), o = e == null ? void 0 : e.get("rescheduleBookingId"), c = e == null ? void 0 : e.get("organizerConfirmationBookingId"), y = e == null ? void 0 : e.get("rejectBookingId"), m = e == null ? void 0 : e.get("confirmedEventInfo"), g = (e == null ? void 0 : e.get("nylasBranding")) || this.nylasBranding, p = e == null ? void 0 : e.get("selectedDate"), f = (h = (I = e == null ? void 0 : e.get("configSettings")) == null ? void 0 : I.scheduler) == null ? void 0 : h.confirmation_redirect_url;
362
- if (this.selectedDateLabel = p && this.language ? J(p.toLocaleDateString(ee[this.language], { dateStyle: "full" })) : `${u.t("noDateSelected")}`, t && (d || y) && !s)
363
- return n(C, null, n(E, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancel-flow-page", part: "cancel-flow-page" }, n("nylas-cancel-booking-form", { selectedTimeslot: r, cancelBookingId: d, rejectBookingId: y, exportparts: "ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
364
- if (t && c)
365
- return n(C, null, n(E, null, n("div", { class: "manual-confirmation-page", part: "manual-confirmation-page" }, n("nylas-organizer-confirmation-card", { organizerConfirmationBookingId: c, exportparts: "nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
366
- if (t && s)
367
- return n(C, null, n(E, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancelled-event-page", part: "cancelled-event-page" }, n("nylas-cancelled-event-card", { cancelledEventInfo: s, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
365
+ var p, D, u, y, _, T, P, N, A, M;
366
+ const t = this.mode === "app", e = (p = this.baseProvider) == null ? void 0 : p.getStore("scheduler"), i = e == null ? void 0 : e.get("eventInfo"), a = e == null ? void 0 : e.get("showBookingForm"), o = e == null ? void 0 : e.get("cancelledEventInfo"), r = e == null ? void 0 : e.get("cancelBookingId"), d = e == null ? void 0 : e.get("selectedTimeslot"), s = e == null ? void 0 : e.get("rescheduleBookingId"), l = e == null ? void 0 : e.get("organizerConfirmationBookingId"), b = e == null ? void 0 : e.get("rejectBookingId"), m = e == null ? void 0 : e.get("confirmedEventInfo"), h = (e == null ? void 0 : e.get("nylasBranding")) || this.nylasBranding, c = e == null ? void 0 : e.get("selectedDate"), f = (u = (D = e == null ? void 0 : e.get("configSettings")) == null ? void 0 : D.scheduler) == null ? void 0 : u.confirmation_redirect_url;
367
+ if (this.selectedDateLabel = c && this.language ? K(c.toLocaleDateString(te[this.language], { dateStyle: "full" })) : `${g.t("noDateSelected")}`, t && (r || b) && !o)
368
+ return n(w, null, n(x, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancel-flow-page", part: "cancel-flow-page" }, n("nylas-cancel-booking-form", { selectedTimeslot: d, cancelBookingId: r, rejectBookingId: b, exportparts: "ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
369
+ if (t && l)
370
+ return n(w, null, n(x, null, n("div", { class: "manual-confirmation-page", part: "manual-confirmation-page" }, n("nylas-organizer-confirmation-card", { organizerConfirmationBookingId: l, exportparts: "nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
371
+ if (t && o)
372
+ return n(w, null, n(x, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancelled-event-page", part: "cancelled-event-page" }, n("nylas-cancelled-event-card", { cancelledEventInfo: o, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
368
373
  if (t && m)
369
- return n(C, null, n(E, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancelled-event-page", part: "confirmed-event-page" }, n("nylas-confirmed-event-card", { confirmedEventInfo: m, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
374
+ return n(w, null, n(x, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancelled-event-page", part: "confirmed-event-page" }, n("nylas-confirmed-event-card", { confirmedEventInfo: m, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
370
375
  if (t && i && f) {
371
- const _ = (v = (l = this.stores) == null ? void 0 : l.scheduler.get("bookingInfo")) == null ? void 0 : v.primaryParticipant, N = (R = (B = this.stores) == null ? void 0 : B.scheduler.get("bookingInfo")) == null ? void 0 : R.additionalFields, w = (S = this.stores) == null ? void 0 : S.scheduler.get("selectedTimeslot"), M = (O = this.stores) == null ? void 0 : O.scheduler.get("selectedTimezone"), U = (P = this.stores) == null ? void 0 : P.scheduler.get("selectedLanguage"), T = (A = this.stores) == null ? void 0 : A.scheduler.get("configSettings"), j = this.configurationId ? this.configurationId : T == null ? void 0 : T.configuration_id, q = window.location.search, k = new URLSearchParams(q);
372
- k.set("booking_id", i.booking_id), _ != null && _.name && k.set("name", _.name), _ != null && _.email && k.set("email", _.email), w != null && w.start_time && k.set("start_time", (new Date(w.start_time).getTime() / 1e3).toString()), w != null && w.end_time && k.set("end_time", (new Date(w.end_time).getTime() / 1e3).toString()), M && k.set("tz", M), U && k.set("language", U), N && k.set("additional_values", JSON.stringify(N)), this.slug && k.set("page_slug", this.slug), j && k.set("config_id", j), window.location.assign(`${f}?${k.toString()}`);
376
+ const v = (y = this.bookingInfoConfirmed) == null ? void 0 : y.primaryParticipant, L = ((_ = this.bookingInfoConfirmed) == null ? void 0 : _.additionalFields) || {};
377
+ if (this.bookingInfo && typeof ((T = this.bookingInfo) == null ? void 0 : T.additionalFields) < "u") {
378
+ const B = this.bookingInfo.additionalFields;
379
+ Object.keys(B).forEach((F) => {
380
+ !L[F] && (B != null && B[F]) && (L[F] = B[F].value);
381
+ });
382
+ }
383
+ const I = (P = this.stores) == null ? void 0 : P.scheduler.get("selectedTimeslot"), U = (N = this.stores) == null ? void 0 : N.scheduler.get("selectedTimezone"), j = (A = this.stores) == null ? void 0 : A.scheduler.get("selectedLanguage"), R = (M = this.stores) == null ? void 0 : M.scheduler.get("configSettings"), H = this.configurationId ? this.configurationId : R == null ? void 0 : R.configuration_id, G = window.location.search, k = new URLSearchParams(G);
384
+ k.set("booking_id", i.booking_id), v != null && v.name && k.set("name", v.name), v != null && v.email && k.set("email", v.email), I != null && I.start_time && k.set("start_time", (new Date(I.start_time).getTime() / 1e3).toString()), I != null && I.end_time && k.set("end_time", (new Date(I.end_time).getTime() / 1e3).toString()), U && k.set("tz", U), j && k.set("language", j), L && k.set("additional_values", JSON.stringify(L)), this.slug && k.set("page_slug", this.slug), H && k.set("config_id", H), this.redirectToCustomUrl(`${f}?${k.toString()}`);
373
385
  return;
374
386
  }
375
387
  if (t && i)
376
- return n(C, null, n(E, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "booked-event-page", part: "booked-event-page" }, n("nylas-booked-event-card", { selectedTimeslot: r, eventInfo: i, exportparts: "nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
377
- if (t && (!i || o) && !a) {
378
- const _ = this.host.querySelector('[slot="timeslot-picker-cta-label"]');
379
- return n(C, null, n(E, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, o && n(W, null, `${u.t("rescheduleTitle")}`), n("div", { class: "select-date-page", part: "select-date-page" }, n("div", { class: "left-panel" }, n("nylas-date-picker", { exportparts: "ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month" }), n("nylas-locale-switch", { exportparts: "nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label" })), n("div", { class: `right-panel ${o ? "reschedule" : ""}` }, n("h2", null, n("calendar-icon", null), n("span", { id: "selectedDate" }, this.selectedDateLabel)), n("nylas-timeslot-picker", { exportparts: "ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary" }, _ && n("span", { slot: "timeslot-picker-cta-label" }, n("slot", { name: "timeslot-picker-cta-label" })))))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
388
+ return n(w, null, n(x, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "booked-event-page", part: "booked-event-page" }, n("nylas-booked-event-card", { selectedTimeslot: d, eventInfo: i, exportparts: "nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
389
+ if (t && (!i || s) && !a) {
390
+ const v = this.host.querySelector('[slot="timeslot-picker-cta-label"]');
391
+ return n(w, null, n(x, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, s && n($, null, `${g.t("rescheduleTitle")}`), n("div", { class: "select-date-page", part: "select-date-page" }, n("div", { class: "left-panel" }, n("nylas-date-picker", { exportparts: "ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month" }), n("nylas-locale-switch", { exportparts: "nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label" })), n("div", { class: `right-panel ${s ? "reschedule" : ""}` }, n("h2", null, n("calendar-icon", null), n("span", { id: "selectedDate" }, this.selectedDateLabel)), n("nylas-timeslot-picker", { exportparts: "ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary" }, v && n("span", { slot: "timeslot-picker-cta-label" }, n("slot", { name: "timeslot-picker-cta-label" })))))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
380
392
  }
381
- return t && !i && a ? n(C, null, n(E, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, o && n(W, null, `${u.t("rescheduleTitle")}`), n("div", { class: "additional-data-page", part: "additional-data-page" }, n("div", { class: "left-panel" }, n("div", { class: "wrapper" }, n("nylas-selected-event-card", { exportparts: "nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone" }))), n("div", { class: `right-panel ${o ? "reschedule" : ""}` }, n("nylas-booking-form", { exportparts: "nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content" })))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null)) : n(C, null, n("slot", null));
393
+ return t && !i && a ? n(w, null, n(x, { nylasBranding: h, isLoading: this.isLoading, showNotification: this.showNotification }, s && n($, null, `${g.t("rescheduleTitle")}`), n("div", { class: "additional-data-page", part: "additional-data-page" }, n("div", { class: "left-panel" }, n("div", { class: "wrapper" }, n("nylas-selected-event-card", { exportparts: "nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone" }))), n("div", { class: `right-panel ${s ? "reschedule" : ""}` }, n("nylas-booking-form", { exportparts: "nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content" })))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: () => this.onFeedbackClick() }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null)) : n(w, null, n("slot", null));
382
394
  }
383
395
  get host() {
384
- return K(this);
396
+ return Q(this);
385
397
  }
386
398
  static get watchers() {
387
399
  return {
@@ -394,7 +406,7 @@ const E = (t, e) => {
394
406
  };
395
407
  }
396
408
  };
397
- le.style = de;
409
+ ce.style = le;
398
410
  export {
399
- le as nylas_scheduling
411
+ ce as nylas_scheduling
400
412
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-bd6fdc8c.cjs"),E=require("./index.es-c7ca1bad-0a324dca.cjs"),D=require("./scheduler-store-d4784b24-aed474e8.cjs"),N=require("./constants-c549b12b-c85413b1.cjs"),x=require("./feedbackSync-b56b29ed-b6f352f3.cjs");require("react");require("react-dom");class W{constructor({schedulerAPIURL:t,nylasSchedulerStore:i,sessionId:a,configId:o,slug:r,clientId:d}){if(!t)throw new Error("schedulerAPIURL is required");if(!i)throw new Error("nylasSchedulerStore is required");if(!a&&!o&&!(r||d))throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.");t==="/"&&(t=new URL(window.location.href).origin),this.configId=o,this.sessionId=a,this.schedulerAPIURL=t,this.nylasSchedulerStore=i,this.slug=r,this.clientId=d}init(){e.debug("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new D.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId,slug:this.slug,clientId:this.clientId}),this._schedulerAPIConnector)}resetStores(){this.nylasSchedulerStore.reset()}}const I=(n,t)=>{const i=n.isLoading,a=n.showNotification,o=n.nylasBranding;return e.h(e.Fragment,null,a&&e.h("nylas-notification",null),i&&e.h("div",{class:"loading"},e.h("div",{class:"left"},e.h("div",{class:"skeleton"})),e.h("div",{class:"right"},e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}))),!i&&t,e.h("div",{class:"footer"},o&&e.h(e.Fragment,null,"Powered by ",e.h("nylas-logo",null))))},M=(n,t)=>e.h("div",{class:"message-banner"},t),$=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0;height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer svg{fill:var(--nylas-base-500)}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}button-component#report-issue{width:auto;position:absolute;bottom:4px;left:16px}nylas-feedback-form{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}',G=$,j={title:e.instance.t("genericErrorTitle"),type:E.nr.Error,category:D.ErrorCategory.Component},H=class{constructor(n){e.registerInstance(this,n),this.init=e.createEvent(this,"init",7),this.schedulerWillLoad=e.createEvent(this,"schedulerWillLoad",7),this.schedulerDidLoad=e.createEvent(this,"schedulerDidLoad",7),this.nylasSchedulerError=e.createEvent(this,"nylasSchedulerError",7),this.configSettingsLoaded=e.createEvent(this,"configSettingsLoaded",7),this.bookingRefExtracted=e.createEvent(this,"bookingRefExtracted",7),this.bookedEventInfo=e.createEvent(this,"bookedEventInfo",7),this.mode="app",this.defaultSchedulerState=void 0,this.sessionId=void 0,this.schedulerApiUrl="https://api.us.nylas.com",this.bookingInfo=void 0,this.rescheduleBookingRef=void 0,this.cancelBookingRef=void 0,this.organizerConfirmationBookingRef=void 0,this.configurationId=void 0,this.slug=void 0,this.clientId=void 0,this.nylasBranding=!0,this.eventOverrides={},this.isLoading=void 0,this.themeConfig=void 0,this.localization=void 0,this.showNotification=!0,this.enableUserFeedback=!0,this.automaticComponentRegistration=!0,this.selectedDateLabel=new Date().toLocaleDateString(void 0,{dateStyle:"full"})||`${e.instance.t("noDateSelected")}`,this.refConfigId=void 0,this.language=navigator.language,this.showFeedbackModal=!1,this.bookingInfoConfirmed=null}connectedCallback(){e.debug("[nylas-scheduler] connectedCallback")}async componentWillLoad(){var o,r;e.debug("[nylas-scheduler] Component will load"),this.enableUserFeedback&&!x.isInitialized()&&x.init({dsn:"https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",release:"1.1.5",integrations:d=>[...d.filter(s=>!1),x.feedbackSyncIntegration({colorScheme:"system",autoInject:!1})],autoSessionTracking:!1,beforeSend:()=>null});const n=this.schedulerWillLoad.emit(this.host);if("schedulerWillLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerWillLoad(n,this.nylasSchedulerConnector),n.defaultPrevented))return;this.stores={scheduler:D.CreateNylasSchedulerStore({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,...this.defaultSchedulerState})},this.baseProvider=new E.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.refConfigId=this.configurationId;let t;if(this.rescheduleBookingRef){const[d,s,l]=e.compactStringToUUIDs(this.rescheduleBookingRef);this.refConfigId=d,this.stores.scheduler.set("rescheduleBookingId",s),t=this.bookingRefExtracted.emit({configurationId:d,bookingId:s})}else if(this.cancelBookingRef){const[d,s,l]=e.compactStringToUUIDs(this.cancelBookingRef);this.refConfigId=d,this.stores.scheduler.set("cancelBookingId",s),t=this.bookingRefExtracted.emit({configurationId:d,bookingId:s})}else if(this.organizerConfirmationBookingRef){const[d,s,l]=e.compactStringToUUIDs(this.organizerConfirmationBookingRef);this.refConfigId=d,this.stores.scheduler.set("organizerConfirmationBookingId",s),this.stores.scheduler.set("organizerConfirmationSalt",l),t=this.bookingRefExtracted.emit({configurationId:d,bookingId:s,salt:l})}if("bookingRefExtracted"in this.eventOverrides&&(await this.eventOverrides.bookingRefExtracted(t,this.nylasSchedulerConnector),t.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;const i=(o=this.baseProvider)==null?void 0:o.getStore("scheduler");this.nylasSchedulerConnector=new W({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:i});const a=this.init.emit(this.host);"init"in this.eventOverrides&&(await this.eventOverrides.init(a,this.nylasSchedulerConnector),a.defaultPrevented)||((r=this.baseProvider)==null||r.componentWillLoad(this.nylasSchedulerConnector),this.applyThemeConfig(this.themeConfig))}async componentDidLoad(){var l,u,b,h,c,g,m,C;(l=this.baseProvider)==null||l.componentDidLoad();const n=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerDidLoad(n,this.nylasSchedulerConnector),n.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;this.localizationChanged(this.localization);const t=await((u=this.nylasSchedulerConnector)==null?void 0:u.scheduler.getUISettings());if(!t||"error"in t){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(t==null?void 0:t.error)},host:this.host});return}else{"data"in t&&((b=t.data)!=null&&b.appearance)&&console.info("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.");const f=this.configSettingsLoaded.emit({settings:t});if("configSettingsLoaded"in this.eventOverrides&&(await this.eventOverrides.configSettingsLoaded(f,this.nylasSchedulerConnector),f.defaultPrevented))return}const i=(h=this.baseProvider)==null?void 0:h.getStore("scheduler"),a=(g=(c=i==null?void 0:i.get("configSettings"))==null?void 0:c.scheduler)==null?void 0:g.available_days_in_future,o=i==null?void 0:i.get("selectedTimeslot");if(o&&(o!=null&&o.start_time)){if(!this.isTimeslotValid(o))return;if(i!=null&&i.get("showBookingForm")){i==null||i.set("selectedDate",o.start_time);return}}const r=i==null?void 0:i.get("selectedDate"),d=i==null?void 0:i.get("availability");let s;if(!(d&&d.length>0)){if(r){const{startTime:f,endTime:v,endTimeForAvailableDaysInFuture:y}=this.validateAvailableDaysInFuture(r,a||30);r.getTime()<y*1e3&&(s=await((C=this.nylasSchedulerConnector)==null?void 0:C.scheduler.getAvailability(f,v)))}else{const f=new Date,{startTime:v,endTime:y,endTimeForAvailableDaysInFuture:B}=this.validateAvailableDaysInFuture(f,a||30);f.getTime()<B*1e3&&(s=await((m=this.nylasSchedulerConnector)==null?void 0:m.scheduler.getAvailability(v,y)))}if((!s||"error"in s)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(s==null?void 0:s.error)},host:this.host}),!r){let f=new Date;const v=i==null?void 0:i.get("availability").find(y=>new Date(y.start_time)>new Date);v&&(f=v.start_time),i==null||i.set("selectedDate",f)}}}componentDisconnected(){var n;(n=this.baseProvider)==null||n.componentDisconnected()}bookingInfoChanged(n){var t;(t=this.stores)==null||t.scheduler.set("bookingInfo",n)}rescheduleBookingRefChanged(n){var t,i;if(n){const[a,o]=e.compactStringToUUIDs(n);(t=this.stores)==null||t.scheduler.set("rescheduleBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}cancelBookingRefChanged(n){var t,i;if(n){const[a,o]=e.compactStringToUUIDs(n);(t=this.stores)==null||t.scheduler.set("cancelBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}organizerConfirmationBookingRefChanged(n){var t,i;if(n){const[a,o]=e.compactStringToUUIDs(n);(t=this.stores)==null||t.scheduler.set("organizerConfirmationBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}localizationChanged(n){n&&Object.keys(n).forEach(t=>{t in N.LANGUAGE_CODE&&(e.instance.addResourceBundle(t,"translation",n[t],!1,!0),this.language=this.language)})}themeConfigChanged(n){this.applyThemeConfig(n)}languageChanged(n){const t=n.detail;this.language=t,e.instance.changeLanguage(t)}async registerComponentHandler(n){var t;(t=this.baseProvider)==null||t.registerComponent(n.detail)}async unregisterComponentHandler(n){var t;(t=this.baseProvider)==null||t.unregisterComponent(n.detail)}async monthChangedHandler(n){var d,s,l,u,b,h,c;const t=n.detail,i=(u=(l=(s=(d=this.nylasSchedulerConnector)==null?void 0:d.schedulerStore)==null?void 0:s.get("configSettings"))==null?void 0:l.scheduler)==null?void 0:u.available_days_in_future,{startTime:a,endTime:o,endTimeForAvailableDaysInFuture:r}=this.validateAvailableDaysInFuture(t,i||30);if(a<r&&t.getTime()<r*1e3){const g=await((b=this.nylasSchedulerConnector)==null?void 0:b.scheduler.getAvailability(a,o));(!g||"error"in g)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(g==null?void 0:g.error)},host:this.host});const m=(h=this.stores)==null?void 0:h.scheduler.get("selectableDates");m&&m.length>0&&((c=this.stores)==null||c.scheduler.set("selectedDate",m[0]))}}mapToBookingData(n){var d,s,l;const t=(d=this.stores)==null?void 0:d.scheduler.get("selectedTimeslot"),i=(s=this.stores)==null?void 0:s.scheduler.get("selectedLanguage"),a=(l=this.stores)==null?void 0:l.scheduler.get("selectedTimezone"),o=t!=null&&t.start_time?new Date(t==null?void 0:t.start_time).getTime()/1e3:"",r=t!=null&&t.end_time?new Date(t==null?void 0:t.end_time).getTime()/1e3:"";return{additional_guests:n.guests,guest:{...n.primaryParticipant},additional_fields:{...n.additionalFields},start_time:o,end_time:r,email_language:i,timezone:a}}async bookButtonClickedHandler(n){var l,u,b,h;if(n.defaultPrevented)return;const t=n.detail,i=this.mapToBookingData(t);this.bookingInfoConfirmed=t;const o=(u=(l=this.nylasSchedulerConnector)==null?void 0:l.schedulerStore)==null?void 0:u.get("rescheduleBookingId");if(o){const c=await((b=this.nylasSchedulerConnector)==null?void 0:b.scheduler.rescheduleBooking(o,t));(!c||"error"in c)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(c==null?void 0:c.error)},host:this.host});const g=c==null?void 0:c.data,m=this.bookedEventInfo.emit({...c,data:{...g,...i}});"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(m,this.nylasSchedulerConnector);return}const r=await((h=this.nylasSchedulerConnector)==null?void 0:h.scheduler.bookTimeslot(t));(!r||"error"in r)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(r==null?void 0:r.error)},host:this.host});const d=r==null?void 0:r.data,s=this.bookedEventInfo.emit({...r,data:{...d,...i}});"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(s,this.nylasSchedulerConnector)}dateSelectedHandler(n){const t=n.detail;this.selectedDateLabel=t?t.toLocaleDateString(void 0,{dateStyle:"full"}):`${e.instance.t("noDateSelected")}`}cancelBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}cancelBookedEventValidationErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}rescheduleBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}confirmBookingErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}feedbackModalClosedHandler(){this.showFeedbackModal=!1}feedbackSubmittedHandler(n){const i={eventId:x.captureMessage("Scheduling Page User Feedback"),message:n.detail.feedback};x.captureFeedback(i,{includeReplay:!0,captureContext:{tags:{"nylas-web-element":"nylas-schduling","nylas-web-element-version":"1.1.5"},extra:{configId:this.configurationId,slug:this.slug}}}),this.showFeedbackModal=!1}async getNylasSchedulerStore(){var n;return(n=this.baseProvider)==null?void 0:n.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(n){return{title:(n==null?void 0:n.title)||j.title,category:(n==null?void 0:n.category)||j.category,type:E.nr.Error,description:(n==null?void 0:n.message)||"",id:new Date().getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){let n="";return this.sessionId||(n+=e.instance.t("sessionIdRequiredErrorMessage")),!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)&&(n=e.instance.t("sessionIdRequiredErrorMessage")+" "+e.instance.t("publicConfigErrorMessage")),this.nylasSchedulerError.emit({notification:{title:e.instance.t("schedulingComponentErrorTitle"),category:D.ErrorCategory.Component,type:E.nr.Error,description:n,id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1}return!0}isTimeslotValid(n){return new Date(n.start_time)<new Date?(this.nylasSchedulerError.emit({notification:{title:e.instance.t("invalidTimeslotErrorTitle"),category:D.ErrorCategory.Component,type:E.nr.Error,description:e.instance.t("invalidTimeslotErrorMessage"),id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1):!0}validateAvailableDaysInFuture(n,t){const i=new Date,a=new Date(n.getFullYear(),n.getMonth(),1).getTime()/1e3,o=new Date(n.getFullYear(),n.getMonth()+1,1).getTime()/1e3,r=Math.floor(e.addDaysToCurrentDate(i,t).getTime()/1e3),d=Math.min(r,o);return{startTime:a<i.getTime()/1e3?Math.floor(i.getTime()/1e3):a,endTime:d,endTimeForAvailableDaysInFuture:r}}applyThemeConfig(n){if(n)for(const[t,i]of Object.entries(n))this.host.style.setProperty(`${t}`,i)}onFeedbackClick(){this.showFeedbackModal=!0}redirectToCustomUrl(n){window.location.assign(n)}render(){var m,C,f,v,y,B,S,z,O,R;const n=this.mode==="app",t=(m=this.baseProvider)==null?void 0:m.getStore("scheduler"),i=t==null?void 0:t.get("eventInfo"),a=t==null?void 0:t.get("showBookingForm"),o=t==null?void 0:t.get("cancelledEventInfo"),r=t==null?void 0:t.get("cancelBookingId"),d=t==null?void 0:t.get("selectedTimeslot"),s=t==null?void 0:t.get("rescheduleBookingId"),l=t==null?void 0:t.get("organizerConfirmationBookingId"),u=t==null?void 0:t.get("rejectBookingId"),b=t==null?void 0:t.get("confirmedEventInfo"),h=(t==null?void 0:t.get("nylasBranding"))||this.nylasBranding,c=t==null?void 0:t.get("selectedDate"),g=(f=(C=t==null?void 0:t.get("configSettings"))==null?void 0:C.scheduler)==null?void 0:f.confirmation_redirect_url;if(this.selectedDateLabel=c&&this.language?e.capitalizeFirstLetter(c.toLocaleDateString(N.LANGUAGE_CODE_MAP[this.language],{dateStyle:"full"})):`${e.instance.t("noDateSelected")}`,n&&(r||u)&&!o)return e.h(e.Host,null,e.h(I,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"cancel-flow-page",part:"cancel-flow-page"},e.h("nylas-cancel-booking-form",{selectedTimeslot:d,cancelBookingId:r,rejectBookingId:u,exportparts:"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&l)return e.h(e.Host,null,e.h(I,null,e.h("div",{class:"manual-confirmation-page",part:"manual-confirmation-page"},e.h("nylas-organizer-confirmation-card",{organizerConfirmationBookingId:l,exportparts:"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&o)return e.h(e.Host,null,e.h(I,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"cancelled-event-page",part:"cancelled-event-page"},e.h("nylas-cancelled-event-card",{cancelledEventInfo:o,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&b)return e.h(e.Host,null,e.h(I,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"cancelled-event-page",part:"confirmed-event-page"},e.h("nylas-confirmed-event-card",{confirmedEventInfo:b,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&i&&g){const k=(v=this.bookingInfoConfirmed)==null?void 0:v.primaryParticipant,T=((y=this.bookingInfoConfirmed)==null?void 0:y.additionalFields)||{};if(this.bookingInfo&&typeof((B=this.bookingInfo)==null?void 0:B.additionalFields)<"u"){const w=this.bookingInfo.additionalFields;Object.keys(w).forEach(L=>{!T[L]&&(w!=null&&w[L])&&(T[L]=w[L].value)})}const _=(S=this.stores)==null?void 0:S.scheduler.get("selectedTimeslot"),P=(z=this.stores)==null?void 0:z.scheduler.get("selectedTimezone"),U=(O=this.stores)==null?void 0:O.scheduler.get("selectedLanguage"),F=(R=this.stores)==null?void 0:R.scheduler.get("configSettings"),A=this.configurationId?this.configurationId:F==null?void 0:F.configuration_id,q=window.location.search,p=new URLSearchParams(q);p.set("booking_id",i.booking_id),k!=null&&k.name&&p.set("name",k.name),k!=null&&k.email&&p.set("email",k.email),_!=null&&_.start_time&&p.set("start_time",(new Date(_.start_time).getTime()/1e3).toString()),_!=null&&_.end_time&&p.set("end_time",(new Date(_.end_time).getTime()/1e3).toString()),P&&p.set("tz",P),U&&p.set("language",U),T&&p.set("additional_values",JSON.stringify(T)),this.slug&&p.set("page_slug",this.slug),A&&p.set("config_id",A),this.redirectToCustomUrl(`${g}?${p.toString()}`);return}if(n&&i)return e.h(e.Host,null,e.h(I,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"booked-event-page",part:"booked-event-page"},e.h("nylas-booked-event-card",{selectedTimeslot:d,eventInfo:i,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&(!i||s)&&!a){const k=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return e.h(e.Host,null,e.h(I,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},s&&e.h(M,null,`${e.instance.t("rescheduleTitle")}`),e.h("div",{class:"select-date-page",part:"select-date-page"},e.h("div",{class:"left-panel"},e.h("nylas-date-picker",{exportparts:"ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),e.h("nylas-locale-switch",{exportparts:"nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label"})),e.h("div",{class:`right-panel ${s?"reschedule":""}`},e.h("h2",null,e.h("calendar-icon",null),e.h("span",{id:"selectedDate"},this.selectedDateLabel)),e.h("nylas-timeslot-picker",{exportparts:"ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},k&&e.h("span",{slot:"timeslot-picker-cta-label"},e.h("slot",{name:"timeslot-picker-cta-label"})))))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null))}return n&&!i&&a?e.h(e.Host,null,e.h(I,{nylasBranding:h,isLoading:this.isLoading,showNotification:this.showNotification},s&&e.h(M,null,`${e.instance.t("rescheduleTitle")}`),e.h("div",{class:"additional-data-page",part:"additional-data-page"},e.h("div",{class:"left-panel"},e.h("div",{class:"wrapper"},e.h("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone"}))),e.h("div",{class:`right-panel ${s?"reschedule":""}`},e.h("nylas-booking-form",{exportparts:"nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content"})))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null)):e.h(e.Host,null,e.h("slot",null))}get host(){return e.getElement(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"],organizerConfirmationBookingRef:["organizerConfirmationBookingRefChanged"],localization:["localizationChanged"],themeConfig:["themeConfigChanged"]}}};H.style=G;exports.nylas_scheduling=H;