@nylas/react 1.1.0-canary.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README.md +110 -2
  2. package/dist/add-circle-icon_2.entry-7165bd0e.js +25 -0
  3. package/dist/add-circle-icon_2.entry-f1ddca18.cjs +1 -0
  4. package/dist/{archive-icon_7.entry-e2954750.js → archive-icon_7.entry-7411c224.js} +16 -16
  5. package/dist/archive-icon_7.entry-e3df60ed.cjs +1 -0
  6. package/dist/{arrow-icon.entry-548b027e.cjs → arrow-icon.entry-280e18b0.cjs} +1 -1
  7. package/dist/{arrow-icon.entry-03a85113.js → arrow-icon.entry-38949317.js} +4 -4
  8. package/dist/{bold-icon_3.entry-70ffa7f0.js → bold-icon_3.entry-5963945c.js} +4 -4
  9. package/dist/{bold-icon_3.entry-9a7b1869.cjs → bold-icon_3.entry-5dffbedd.cjs} +1 -1
  10. package/dist/button-component_2.entry-237733b4.js +26 -0
  11. package/dist/button-component_2.entry-b29d2873.cjs +1 -0
  12. package/dist/calendar-agenda-fill-icon_48.entry-9afba869.js +5105 -0
  13. package/dist/calendar-agenda-fill-icon_48.entry-d3830dbb.cjs +7 -0
  14. package/dist/{calendar-cancel-icon.entry-45388fdc.cjs → calendar-cancel-icon.entry-77ccf227.cjs} +1 -1
  15. package/dist/{calendar-cancel-icon.entry-6bbc119f.js → calendar-cancel-icon.entry-780723a6.js} +5 -5
  16. package/dist/{calendar-check-icon_2.entry-f633f7a6.js → calendar-check-icon_2.entry-2c89c230.js} +7 -7
  17. package/dist/{calendar-check-icon_2.entry-6628456c.cjs → calendar-check-icon_2.entry-b37ac7f0.cjs} +1 -1
  18. package/dist/{calendar-icon.entry-62b82c27.js → calendar-icon.entry-02dd3990.js} +4 -4
  19. package/dist/{calendar-icon.entry-379b1fa1.cjs → calendar-icon.entry-ffc93569.cjs} +1 -1
  20. package/dist/checkbox-component_2.entry-00b6a1e9.cjs +1 -0
  21. package/dist/checkbox-component_2.entry-ee9d0e6c.js +56 -0
  22. package/dist/chevron-icon_3.entry-468abc26.cjs +1 -0
  23. package/dist/chevron-icon_3.entry-f62e9ef1.js +129 -0
  24. package/dist/clock-icon_4.entry-766a1b23.js +45 -0
  25. package/dist/clock-icon_4.entry-7dc2cc4a.cjs +1 -0
  26. package/dist/{constants-f34b9c6e-95a17764.js → constants-50c3e067-8a40a5fe.js} +885 -751
  27. package/dist/{constants-f34b9c6e-e7137e51.cjs → constants-50c3e067-9f2a6372.cjs} +5 -5
  28. package/dist/copy-icon.entry-2a841508.js +15 -0
  29. package/dist/copy-icon.entry-e5251410.cjs +1 -0
  30. package/dist/delete-icon_2.entry-1a5c39dc.cjs +1 -0
  31. package/dist/delete-icon_2.entry-64555a2f.js +25 -0
  32. package/dist/{document-refresh-icon.entry-32c75418.js → document-refresh-icon.entry-4bf6398b.js} +4 -4
  33. package/dist/document-refresh-icon.entry-fdc7ddda.cjs +1 -0
  34. package/dist/elements/index.d.ts +47 -1
  35. package/dist/{elements-dc5b338e-62fe1cf3.js → elements-dc5b338e-2da1fe61.js} +1 -1
  36. package/dist/{elements-dc5b338e-1f23530f.cjs → elements-dc5b338e-c8016c3d.cjs} +1 -1
  37. package/dist/{focus-visible-e8093c16-f0f05815.cjs → focus-visible-e8093c16-0a38a184.cjs} +1 -1
  38. package/dist/{focus-visible-e8093c16-1f664070.js → focus-visible-e8093c16-9d0c98c0.js} +1 -1
  39. package/dist/{forward-icon_6.entry-7fab04d7.js → forward-icon_6.entry-390ef70a.js} +9 -9
  40. package/dist/{forward-icon_6.entry-ef5e2e0f.cjs → forward-icon_6.entry-7238ef38.cjs} +3 -3
  41. package/dist/{globe-icon.entry-398a9826.cjs → globe-icon.entry-81f42f89.cjs} +1 -1
  42. package/dist/{globe-icon.entry-b8e1efae.js → globe-icon.entry-8d106260.js} +5 -5
  43. package/dist/google-logo-icon_4.entry-aabd3886.js +680 -0
  44. package/dist/google-logo-icon_4.entry-fa2b8999.cjs +1 -0
  45. package/dist/index-53420959-5fc8ad2b.js +5 -0
  46. package/dist/index-53420959-fcf45780.cjs +1 -0
  47. package/dist/index-5ccfd9df.js +7859 -0
  48. package/dist/index-6d9eeb53-58c8980a.js +4971 -0
  49. package/dist/index-6d9eeb53-b2a6d09f.cjs +41 -0
  50. package/dist/index-eb33703c.cjs +42 -0
  51. package/dist/{index.es-df564f87-b773d34f.js → index.es-c9454237-00ccd1e6.js} +6 -8
  52. package/dist/{index.es-df564f87-e4a4092a.cjs → index.es-c9454237-b64161d1.cjs} +6 -6
  53. package/dist/{info-icon_2.entry-2eb70f49.cjs → info-icon_2.entry-b2e11336.cjs} +1 -1
  54. package/dist/{info-icon_2.entry-6bbfa6dc.js → info-icon_2.entry-bb8ed71c.js} +3 -3
  55. package/dist/input-component.entry-378b1ccc.cjs +1 -0
  56. package/dist/input-component.entry-cb86170f.js +65 -0
  57. package/dist/input-dropdown.entry-98954c93.cjs +1 -0
  58. package/dist/input-dropdown.entry-a76c339e.js +134 -0
  59. package/dist/{mailbox-store-69c5c5f6-631eddb5.cjs → mailbox-store-edc386fc-156b7236.cjs} +1 -1
  60. package/dist/{mailbox-store-69c5c5f6-8ab4670b.js → mailbox-store-edc386fc-8bc7558b.js} +2 -2
  61. package/dist/multi-select-dropdown.entry-40b855e1.cjs +1 -0
  62. package/dist/multi-select-dropdown.entry-6b686695.js +91 -0
  63. package/dist/nylas-booked-event-card_12.entry-9d693125.cjs +1 -0
  64. package/dist/nylas-booked-event-card_12.entry-e861bb16.js +1134 -0
  65. package/dist/nylas-form-card.entry-b158d789.js +57 -0
  66. package/dist/nylas-form-card.entry-ca4a8746.cjs +1 -0
  67. package/dist/{nylas-if-state.entry-f8abd025.js → nylas-if-state.entry-8e4d922c.js} +8 -8
  68. package/dist/{nylas-if-state.entry-276d61ad.cjs → nylas-if-state.entry-95fac42d.cjs} +1 -1
  69. package/dist/{nylas-list-folders.entry-78cc680e.js → nylas-list-folders.entry-83c39684.js} +8 -8
  70. package/dist/{nylas-list-folders.entry-afe02f0e.cjs → nylas-list-folders.entry-8a22e0c8.cjs} +1 -1
  71. package/dist/{nylas-list-threads.entry-6395c12f.cjs → nylas-list-threads.entry-54c582af.cjs} +1 -1
  72. package/dist/{nylas-list-threads.entry-217088de.js → nylas-list-threads.entry-7ea370e1.js} +4 -4
  73. package/dist/{nylas-login.entry-e4d57589.js → nylas-login.entry-9115fd81.js} +7 -7
  74. package/dist/{nylas-login.entry-ec81e21b.cjs → nylas-login.entry-fb627e40.cjs} +1 -1
  75. package/dist/{nylas-mailbox-pagination.entry-d4d929f1.cjs → nylas-mailbox-pagination.entry-04626d27.cjs} +1 -1
  76. package/dist/{nylas-mailbox-pagination.entry-069673aa.js → nylas-mailbox-pagination.entry-3ff02cf9.js} +2 -2
  77. package/dist/{nylas-mailbox-toolbar-button.entry-2b9e4431.cjs → nylas-mailbox-toolbar-button.entry-8d00c789.cjs} +1 -1
  78. package/dist/{nylas-mailbox-toolbar-button.entry-03c5f5c8.js → nylas-mailbox-toolbar-button.entry-f752e925.js} +4 -4
  79. package/dist/{nylas-mailbox.entry-7e6b4791.js → nylas-mailbox.entry-99c27b6c.js} +4 -4
  80. package/dist/{nylas-mailbox.entry-1342178d.cjs → nylas-mailbox.entry-b3974f4e.cjs} +1 -1
  81. package/dist/{nylas-provider.entry-0ae8e70a.cjs → nylas-provider.entry-a3ad02a5.cjs} +1 -1
  82. package/dist/{nylas-provider.entry-498a7be9.js → nylas-provider.entry-c206aa32.js} +39 -39
  83. package/dist/nylas-reminder-emails.entry-414ce6fe.js +129 -0
  84. package/dist/nylas-reminder-emails.entry-59c07bfe.cjs +4 -0
  85. package/dist/nylas-reminder-time_2.entry-197d83a0.js +105 -0
  86. package/dist/nylas-reminder-time_2.entry-d79dcd85.cjs +1 -0
  87. package/dist/nylas-scheduler-editor.entry-7f389982.js +1447 -0
  88. package/dist/nylas-scheduler-editor.entry-f1c6964a.cjs +2 -0
  89. package/dist/nylas-scheduling.entry-1a8bd6fc.cjs +1 -0
  90. package/dist/nylas-scheduling.entry-4fa5381d.js +345 -0
  91. package/dist/{nylas-threads-refresh.entry-fc2d8028.js → nylas-threads-refresh.entry-20602e7b.js} +4 -4
  92. package/dist/{nylas-threads-refresh.entry-d020c89e.cjs → nylas-threads-refresh.entry-56b53449.cjs} +1 -1
  93. package/dist/{nylas-threads-search.entry-f92f7e30.js → nylas-threads-search.entry-8872473c.js} +12 -12
  94. package/dist/{nylas-threads-search.entry-0abcbc10.cjs → nylas-threads-search.entry-8e0ec3ae.cjs} +1 -1
  95. package/dist/nylas-time-window-picker.entry-9ac542b7.js +316 -0
  96. package/dist/nylas-time-window-picker.entry-ca47f721.cjs +1 -0
  97. package/dist/{nylas-view-thread.entry-56080c89.cjs → nylas-view-thread.entry-1f758e43.cjs} +1 -1
  98. package/dist/{nylas-view-thread.entry-2f1474cf.js → nylas-view-thread.entry-dcd3d5be.js} +6 -6
  99. package/dist/person-icon.entry-63b28ace.cjs +1 -0
  100. package/dist/person-icon.entry-93130c05.js +15 -0
  101. package/dist/{play-icon_2.entry-24ffa01f.js → play-icon_2.entry-6a99c32d.js} +6 -6
  102. package/dist/play-icon_2.entry-b67fb649.cjs +1 -0
  103. package/dist/react.cjs +1 -1
  104. package/dist/react.js +136 -90
  105. package/dist/{refresh-icon.entry-8395104b.js → refresh-icon.entry-84783c91.js} +4 -4
  106. package/dist/{refresh-icon.entry-cf4416b8.cjs → refresh-icon.entry-b49792fc.cjs} +1 -1
  107. package/dist/{register-component-b9cfcbaf-d40e1f3c.cjs → register-component-887199a9-003f96c5.cjs} +1 -1
  108. package/dist/{register-component-b9cfcbaf-c0147194.js → register-component-887199a9-b41dfa7a.js} +1 -1
  109. package/dist/scheduler-config-store-2a3b403d-73610089.js +27 -0
  110. package/dist/scheduler-config-store-2a3b403d-a5e3433a.cjs +1 -0
  111. package/dist/scheduler-store-fe281404-bddb1b6a.js +469 -0
  112. package/dist/scheduler-store-fe281404-c3e477f6.cjs +1 -0
  113. package/dist/textarea-component.entry-28c4bc05.cjs +1 -0
  114. package/dist/textarea-component.entry-40e959e5.js +36 -0
  115. package/dist/time-period-selector.entry-af71523a.cjs +1 -0
  116. package/dist/time-period-selector.entry-da5d8652.js +93 -0
  117. package/dist/{translate-icon.entry-d847f706.js → translate-icon.entry-92b83635.js} +5 -5
  118. package/dist/{translate-icon.entry-66533238.cjs → translate-icon.entry-a2ed4f76.cjs} +1 -1
  119. package/dist/warning-icon.entry-19f721c3.js +15 -0
  120. package/dist/warning-icon.entry-3ab9a59e.cjs +1 -0
  121. package/package.json +3 -3
  122. package/dist/add-circle-icon_22.entry-080abc71.cjs +0 -1
  123. package/dist/add-circle-icon_22.entry-bda9be31.js +0 -1818
  124. package/dist/archive-icon_7.entry-ca20da59.cjs +0 -1
  125. package/dist/chevron-icon_3.entry-74425e1f.js +0 -117
  126. package/dist/chevron-icon_3.entry-7ff803ad.cjs +0 -1
  127. package/dist/close-icon.entry-18e140ed.cjs +0 -1
  128. package/dist/close-icon.entry-6a8ea4a7.js +0 -15
  129. package/dist/document-refresh-icon.entry-f15f795a.cjs +0 -1
  130. package/dist/google-logo-icon_4.entry-38d5c2f2.cjs +0 -1
  131. package/dist/google-logo-icon_4.entry-5eca9538.js +0 -381
  132. package/dist/index-93c50de4.cjs +0 -37
  133. package/dist/index-f93f6948.js +0 -4006
  134. package/dist/loading-icon.entry-b563b2e6.js +0 -15
  135. package/dist/loading-icon.entry-fb04b893.cjs +0 -1
  136. package/dist/nylas-additional-participants.entry-33a45477.cjs +0 -1
  137. package/dist/nylas-additional-participants.entry-4b214308.js +0 -81
  138. package/dist/nylas-booked-event-card_10.entry-3e225025.cjs +0 -1
  139. package/dist/nylas-booked-event-card_10.entry-e93bc290.js +0 -782
  140. package/dist/nylas-form-card.entry-0748fdd5.js +0 -54
  141. package/dist/nylas-form-card.entry-eb3607bc.cjs +0 -1
  142. package/dist/nylas-scheduler-editor.entry-4de2bb97.js +0 -2275
  143. package/dist/nylas-scheduler-editor.entry-72c91b7d.cjs +0 -7
  144. package/dist/nylas-scheduling.entry-1a004916.cjs +0 -1
  145. package/dist/nylas-scheduling.entry-4e18ab43.js +0 -235
  146. package/dist/people-icon.entry-431e5044.cjs +0 -1
  147. package/dist/people-icon.entry-b4778e15.js +0 -15
  148. package/dist/play-icon_2.entry-f97db395.cjs +0 -1
  149. package/dist/scheduler-config-store-07d98279-0610e42f.cjs +0 -1
  150. package/dist/scheduler-config-store-07d98279-3b70606c.js +0 -24
  151. package/dist/scheduler-store-24fd0e91-2dba20c2.cjs +0 -1
  152. package/dist/scheduler-store-24fd0e91-47098841.js +0 -302
  153. package/dist/time-period-selector.entry-1e849c2e.js +0 -76
  154. package/dist/time-period-selector.entry-d8f3462f.cjs +0 -1
  155. package/dist/warning-icon.entry-1f0f00ed.cjs +0 -1
  156. package/dist/warning-icon.entry-b5db0151.js +0 -15
@@ -1,782 +0,0 @@
1
- import { r as f, c as d, d as c, h as t, H as b, g as q, v as X, w as Y, x as m, y as C, F as J } from "./index-f93f6948.js";
2
- import { R as h } from "./register-component-b9cfcbaf-c0147194.js";
3
- import { T as u, g as K, L as F } from "./constants-f34b9c6e-95a17764.js";
4
- import "react";
5
- import "react-dom";
6
- const Q = ':host{display:block;--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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 0;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:1rem;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;padding:8px;font-family:var(--nylas-font-family);font-weight:600;height:48px;line-height:24px}sp-button.cancel{color:var(--nylas-error)}sp-button.cancel:hover,sp-button.cancel:focus{border-color:var(--nylas-error)}sp-button.cancel:active{color:var(--nylas-error-pressed);border-color:var(--nylas-error-pressed)}sp-button.reschedule:hover,sp-button.reschedule:focus{border-color:var(--nylas-primary)}sp-button.reschedule:active{border-color:var(--nylas-base-600)}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}', ee = Q;
7
- var ae = function(e, a, n, s) {
8
- var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
9
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
10
- i = Reflect.decorate(e, a, n, s);
11
- else
12
- for (var l = e.length - 1; l >= 0; l--)
13
- (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
14
- return o > 3 && i && Object.defineProperty(a, n, i), i;
15
- }, w = function(e, a) {
16
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
17
- return Reflect.metadata(e, a);
18
- };
19
- const M = class {
20
- constructor(e) {
21
- f(this, e), this.cancelBookingButtonClicked = d(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = d(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = d(this, "rescheduleBookedEventError", 7), this.handleCancelBookingButtonClicked = () => {
22
- this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
23
- }, this.handleRescheduleButtonClicked = () => {
24
- const a = (n) => {
25
- this.rescheduleBookedEventError.emit(n);
26
- };
27
- this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: a });
28
- }, this.getOrganizer = (a) => a == null ? void 0 : a.organizer, this.getPaticipantType = (a) => {
29
- switch (a) {
30
- case "host":
31
- return "Host";
32
- case "you":
33
- return "You";
34
- default:
35
- return "";
36
- }
37
- }, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0;
38
- }
39
- connectedCallback() {
40
- }
41
- disconnectedCallback() {
42
- }
43
- async componentWillLoad() {
44
- c("[nylas-booked-event-card] Component will load");
45
- }
46
- async componentDidLoad() {
47
- c("[nylas-booked-event-card] Component did load");
48
- }
49
- render() {
50
- var e, a, n, s, o, i;
51
- return t(b, { key: "1585329ee957e66c757861d989d29a9c1bb1451f", part: "nbec" }, t("sp-theme", { key: "113da8c82dd485188d40f1dea9f814be0c408ca2", theme: "spectrum", color: "dark", scale: "medium" }, t("div", { key: "af6b0a085e582f2d7bdb5503b9d5b6d3c7042fd3", class: "booked-event-timezone" }, t("globe-icon", { key: "0c3fbff398a24c97d82bb74434d9da574349919f" }), u[this.selectedTimezone]), t("div", { key: "136d5341ef1d252b525359418e8df0a43f4160a0", class: "event-card-wrapper", part: "nbec__card" }, t("div", { key: "767bcbb50f4ae8c294f3ab3733fe99cd7c4c78e1", class: "calendar-icon" }, t("calendar-check-icon", { key: "e6fd3ec502795fbcaaf9d34b5b5c4cee2d732d4f" })), t("div", { key: "7dfa8cc7719760d396716ec81ab0022c01bbe22f", class: "booked-event-header" }, t("h2", { key: "34a452c275a3880f64575735a9e67db5a8cdea45", slot: "card-title", part: "nbec__title" }, "Booking ", this.rescheduleBookingId ? "rescheduled" : "confirmed", "!"), t("div", { key: "a081b1a3791e2e80dd651d1f9dbf5de2f2057f9a", part: "nbec__description" }, ((e = this.getOrganizer(this.eventInfo)) == null ? void 0 : e.name) || ((a = this.getOrganizer(this.eventInfo)) == null ? void 0 : a.email), " & ", ((s = (n = this.bookingInfo) == null ? void 0 : n.primaryParticipant) == null ? void 0 : s.name) || ((i = (o = this.bookingInfo) == null ? void 0 : o.primaryParticipant) == null ? void 0 : i.email))), t("sp-divider", { key: "0744f0fa4f3fff8f2dc0dec978632496d26bfae6" }), t("div", { key: "38460fbfbe5d19b4f0d48cb0df02e6d12c2f2740", class: "booking-date-time" }, t("checkmark-circle-icon", { key: "1e282c329489e4def089d8fca1bd532557f91b92" }), t("h3", { key: "34bebd074562352d54628f763c339ccd4c44918a" }, "Booking date and time"), t("p", { key: "d897859d30e6dd6651c0d4b0079bf0eab1df0356" }, new Date(this.selectedTimeslot.start_time).toLocaleDateString(void 0, { dateStyle: "full" }), " ", t("br", { key: "2aa56898e654721616459102329cbe498232d3e8" }), new Date(this.selectedTimeslot.start_time).toLocaleTimeString(void 0, { timeStyle: "short" }), " -", " ", new Date(this.selectedTimeslot.end_time).toLocaleTimeString(void 0, { timeStyle: "short" }))), t("div", { key: "5009ca55f795c2fd1240ed8bbc50216c4e66be87", class: "booking-participants" }), t("sp-divider", { key: "4b5b4325dda3f935387218429823b850d2a12f0e" }), t("div", { key: "d25cc602a134085c19f0acea006db0707ceae7e5", class: "footer" }, t("sp-button", { key: "4625e515f2f79d6ecb0bb37813efe100c03cdaf2", variant: "secondary", treatment: "outline", class: "cancel", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, "Cancel booking"), t("sp-button", { key: "9cbdc95cd53aa2d536751984b91ef5974e71179d", variant: "secondary", treatment: "outline", class: "reschedule", onClick: this.handleRescheduleButtonClicked, part: "nbec__button-outline nbec__reschedule-cta" }, "Reschedule")))));
52
- }
53
- };
54
- ae([
55
- h({
56
- name: "nylas-booked-event-card",
57
- stateToProps: /* @__PURE__ */ new Map([
58
- ["scheduler.bookingInfo", "bookingInfo"],
59
- ["scheduler.rescheduleBookingId", "rescheduleBookingId"],
60
- ["scheduler.selectedTimezone", "selectedTimezone"],
61
- ["scheduler.selectedTimeslot", "selectedTimeslot"]
62
- ]),
63
- eventToProps: {
64
- cancelBookingButtonClicked: async (e, a) => {
65
- a.scheduler.setCancel(e.detail.bookingId);
66
- },
67
- rescheduleButtonClicked: async (e, a) => {
68
- const n = await a.scheduler.setReschedule(e.detail.bookingId), { errorHandler: s } = e.detail;
69
- s && (!n || "error" in n) && s(n);
70
- }
71
- },
72
- fireRegisterEvent: !0
73
- }),
74
- w("design:type", Function),
75
- w("design:paramtypes", []),
76
- w("design:returntype", void 0)
77
- ], M.prototype, "render", null);
78
- M.style = ee;
79
- const te = ':host{display:block;height:100%;--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}.nylas-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}sp-textfield{--spectrum-corner-radius-100:var(--nylas-border-radius-2x);--spectrum-textfield-border-color:var(--nylas-base-300);position:relative;width:100%;height:48px;margin-bottom:16px;color:var(--nylas-base-500)}.cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{flex-direction:column-reverse}}sp-button{background-color:transparent;color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);--button-width:50%;font-family:var(--nylas-font-family);font-size:16px;font-weight:600;border:none;height:48px;padding:14px}@media screen and (max-width: 768px){sp-button{--button-width:100%}}sp-button:hover,sp-button:focus{background-color:var(--nylas-base-100);color:var(--nylas-primary);border-radius:var(--nylas-border-radius-2x)}sp-button:active{background-color:var(--nylas-base-200);color:var(--nylas-base-800)}sp-button.back{width:var(--button-width);background-color:transparent;color:var(--nylas-base-700);outline:1px solid var(--nylas-base-300)}sp-button.back:hover,sp-button.back:focus{outline-color:var(--nylas-primary)}sp-button.back:active{outline:2px solid var(--nylas-base-600)}sp-button.book{width:var(--button-width);background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.book:hover,sp-button.book:focus{background-color:var(--nylas-base-600)}sp-button.book:active{background-color:var(--nylas-base-800)}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family)}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}sp-infield-button{--spectrum-infield-button-background-color:transparent;--spectrum-infield-button-background-color-hover:transparent;--spectrum-infield-button-background-color-active:transparent;--spectrum-infield-button-border-color:transparent;--spectrum-infield-button-border-width:1px;--spectrum-infield-button-border-radius:0;color:var(--nylas-base-600);background:transparent;border:none;outline:1px solid var(--nylas-base-300);border-radius:0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x) 0;height:52px;width:52px;display:flex;position:absolute;right:0;align-items:center;justify-content:center;cursor:pointer}sp-infield-button sp-icon-cross300{color:var(--nylas-base-600)}sp-infield-button.error{border-width:2px;border-color:var(--nylas-error)}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}', ne = te;
80
- var ie = function(e, a, n, s) {
81
- var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
82
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
83
- i = Reflect.decorate(e, a, n, s);
84
- else
85
- for (var l = e.length - 1; l >= 0; l--)
86
- (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
87
- return o > 3 && i && Object.defineProperty(a, n, i), i;
88
- }, _ = function(e, a) {
89
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
90
- return Reflect.metadata(e, a);
91
- };
92
- const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, $ = class {
93
- constructor(e) {
94
- f(this, e), this.nameChanged = d(this, "nameChanged", 7), this.emailChanged = d(this, "emailChanged", 7), this.backButtonClicked = d(this, "backButtonClicked", 7), this.detailsConfirmed = d(this, "detailsConfirmed", 7), this.bookingFormError = d(this, "bookingFormError", 7), this.handleGuestChange = (a, n) => {
95
- this.resetGuestEmailError(a);
96
- const s = [...this.guestEmails];
97
- s[a] = n, this.guestEmails = [...s];
98
- }, this.handleGuestBlur = (a, n) => {
99
- if (this.resetGuestEmailError(a), n === "") {
100
- this.guestEmailErrors[a] = "Email is required";
101
- return;
102
- }
103
- if (!E.test(n)) {
104
- this.guestEmailErrors[a] = "Enter a valid email address";
105
- return;
106
- }
107
- this.handleGuestChange(a, n);
108
- }, this.addGuestButtonClickedHandler = () => {
109
- this.guestEmails = [...this.guestEmails, ""];
110
- }, this.removeGuestButtonClickHandler = (a, n) => {
111
- a.preventDefault(), this.resetGuestEmailError(n);
112
- const s = [...this.guestEmails];
113
- s.splice(n, 1), this.guestEmails = [...s];
114
- }, this.handleBackButtonClicked = () => {
115
- this.backButtonClicked.emit();
116
- }, this.bookButtonClickedHandler = async (a) => {
117
- var i, r, l, p, y, P, O;
118
- a.preventDefault(), c("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
119
- const n = this.name || ((r = (i = this.bookingInfo) == null ? void 0 : i.primaryParticipant) == null ? void 0 : r.name), s = this.email || ((p = (l = this.bookingInfo) == null ? void 0 : l.primaryParticipant) == null ? void 0 : p.email);
120
- if (!n || n === "") {
121
- this.isNameValid = !1, this.validationError.name = "Name is required", this.bookingFormError.emit({
122
- title: "Booking form error",
123
- description: "Name is required"
124
- });
125
- return;
126
- }
127
- if (!s || s === "") {
128
- this.isEmailValid = !1, this.validationError.email = "Email is required", this.bookingFormError.emit({
129
- title: "Booking form error",
130
- description: "Email is required"
131
- });
132
- return;
133
- }
134
- if (!E.test(s)) {
135
- this.isEmailValid = !1, this.validationError.email = "Enter a valid email address", this.bookingFormError.emit({
136
- title: "Booking form error",
137
- description: "Invalid email"
138
- });
139
- return;
140
- }
141
- let o = [];
142
- if (this.guestEmails.length > 0) {
143
- let x = !1;
144
- if (this.guestEmails.forEach((g, N) => {
145
- g === "" ? (x = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [N]: "Email is required" }) : E.test(g) || (x = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [N]: "Enter a valid email address" });
146
- }), x) {
147
- this.bookingFormError.emit({
148
- title: "Booking form error",
149
- description: "Invalid guest email"
150
- });
151
- return;
152
- }
153
- o = this.guestEmails.map((g) => ({ name: "", email: g.trim() }));
154
- } else
155
- (y = this.bookingInfo) != null && y.guests && (o = (P = this.bookingInfo) == null ? void 0 : P.guests);
156
- this.detailsConfirmed.emit({
157
- primaryParticipant: {
158
- name: n,
159
- email: s
160
- },
161
- guests: o,
162
- additionalFields: {
163
- ...(O = this.bookingInfo) == null ? void 0 : O.additionalFields
164
- }
165
- });
166
- }, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.validationError = { name: "", email: "" };
167
- }
168
- connectedCallback() {
169
- }
170
- disconnectedCallback() {
171
- }
172
- componentWillLoad() {
173
- var e, a;
174
- c("nylas-booking-form", "componentWillLoad", this.bookingInfo), this.bookingInfo && (this.name = (e = this.bookingInfo.primaryParticipant) == null ? void 0 : e.name, this.email = (a = this.bookingInfo.primaryParticipant) == null ? void 0 : a.email);
175
- }
176
- bookingInfoChangedHandler(e) {
177
- e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
178
- }
179
- changeName(e) {
180
- this.isNameValid = !0, this.validationError.name = "", this.name = e, this.nameChanged.emit(e);
181
- }
182
- changeEmail(e) {
183
- this.isEmailValid = !0, this.validationError.email = "", this.email = e, this.emailChanged.emit(e);
184
- }
185
- resetGuestEmailError(e) {
186
- const a = { ...this.guestEmailErrors };
187
- delete a[e], this.guestEmailErrors = { ...a };
188
- }
189
- render() {
190
- return t(b, { key: "5a255277a21fa84d100bb53d13bb9dce0ce58e24" }, t("form", { key: "19b7aecb9223557f0ff9d4c062968c3242026f0c", onSubmit: (e) => this.bookButtonClickedHandler(e), noValidate: !0 }, t("div", { key: "49276b2a59934eeaeb38c06db6968f957b7b9bee", class: "nylas-booking-form" }, t("slot", { key: "ee0a8c29c1fb6b7273d6a2d3c8cb88180f0e9dbf", name: "custom-booking-form" }, t("div", { key: "662e46f3a7925282f824547a069f52584b94d564", class: "input-wrapper" }, t("label", { key: "a01c1903ee983e1555006ad14e75cd1b2c3036ff", htmlFor: "name", class: { "input-label": !0, error: !this.isNameValid }, part: "nbf__input-label" }, "Name ", t("span", { key: "4729d580bbf9d851c2ac8b686dc826c4e3e4616f", class: "required" }, "*")), t("input", { key: "51754a63345f1d0332a38f646dde6a8a998c8dee", id: "name", type: "text", placeholder: "Enter your name", value: this.name, class: {
191
- input: !0,
192
- error: !this.isNameValid
193
- }, part: "nbf__input-textfield", onInput: (e) => {
194
- var a;
195
- return this.changeName((a = e.target) == null ? void 0 : a.value);
196
- } }), t("p", { key: "b8a6660e959a877421bdfffdb87279d8f09123b8", class: "help-text" }, this.validationError.name)), t("div", { key: "e78a74e67abde7e61c1d3c555c234817770a4040", class: "input-wrapper" }, t("label", { key: "d5507037f5c668f58e14031dba4276900ef5ed09", htmlFor: "email", class: { "input-label": !0, error: !this.isEmailValid }, part: "nbf__input-label" }, "Email ", t("span", { key: "514f00587069ac1cfc6d16bfd30750d6d501817d", class: "required" }, "*")), t("input", { key: "0b80ded98b2174f783fa9e7c951a47661aa894f6", id: "email", type: "email", placeholder: "Enter your email", value: this.email, class: {
197
- input: !0,
198
- error: !this.isEmailValid
199
- }, part: "nbf__input-textfield", onInput: (e) => {
200
- var a;
201
- return this.changeEmail((a = e.target) == null ? void 0 : a.value);
202
- } }), t("p", { key: "ba185ccb2bec87049e94d8c5f8d211a838de0025", class: "help-text" }, this.validationError.email)))), t("div", { key: "56e2cce79371533ad66cccad95a79dd8935fe3eb", class: "cta" }, t("sp-button", { key: "2b6410b3cf2b7634737aa858396290ad065dfcfc", treatment: "outline", variant: "secondary", class: "back", part: "nbf__button-outline", onClick: this.handleBackButtonClicked }, t("slot", { key: "4ba60a2fb3542434ede16ea382ec4ca80cb8d422", name: "booking-form-back-label" }, "Back")), t("sp-button", { key: "49dd32531d7b55529bb73bc82eb0b91820c6ea33", variant: "primary", class: "book", part: "nbf__button-primary", type: "submit" }, this.isLoading && t("loading-icon", { slot: "icon" }), t("slot", { key: "a57ae44c1c3a1b020a110f0156435f27897410c6", name: "booking-form-book-label" }, "Book now")))));
203
- }
204
- get host() {
205
- return q(this);
206
- }
207
- static get watchers() {
208
- return {
209
- bookingInfo: ["bookingInfoChangedHandler"]
210
- };
211
- }
212
- };
213
- ie([
214
- h({
215
- name: "nylas-booking-form",
216
- stateToProps: /* @__PURE__ */ new Map([
217
- ["scheduler.isLoading", "isLoading"],
218
- ["scheduler.bookingInfo", "bookingInfo"],
219
- ["scheduler.eventInfo", "eventInfo"]
220
- ]),
221
- eventToProps: {
222
- backButtonClicked: async (e, a) => {
223
- a.scheduler.toggleAdditionalData(!1);
224
- },
225
- nameChanged: async (e, a) => {
226
- a.scheduler.setParticipantName(e.detail);
227
- },
228
- emailChanged: async (e, a) => {
229
- a.scheduler.setParticipantEmail(e.detail);
230
- }
231
- },
232
- fireRegisterEvent: !0
233
- }),
234
- _("design:type", Function),
235
- _("design:paramtypes", []),
236
- _("design:returntype", void 0)
237
- ], $.prototype, "render", null);
238
- $.style = ne;
239
- const se = ':host{display:block;width:400px;--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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:1rem;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600)}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;width:100%;height:48px;padding:8px;line-height:24px;font-family:var(--nylas-font-family)}sp-button.cancel{margin-top:1.25rem;background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.cancel:hover,sp-button.cancel:focus{background-color:var(--nylas-base-600)}sp-button.cancel:active{background-color:var(--nylas-base-800)}sp-button.back{margin-top:0.5rem}sp-button.back:hover,sp-button.back:focus{border-color:var(--nylas-primary)}sp-button.back:active{border-color:var(--nylas-base-600)}sp-field-label{margin-top:1rem;display:flex;color:var(--nylas-base-800);font-size:14px}sp-field-label.error{color:var(--nylas-error)}sp-field-label span.required{color:var(--nylas-error)}sp-textfield{--spectrum-textfield-border-color:var(--nylas-base-300);--spectrum-textfield-icon-color-invalid:var(--nylas-error);position:relative;width:100%;height:48px;margin-bottom:16px;background-color:var(--nylas-base-0);color:var(--nylas-base-500)}sp-textfield.error{--spectrum-textfield-border-color:var(--nylas-error)}sp-help-text{margin:0.25rem 0 1rem 0;color:var(--nylas-error)}', re = se;
240
- var oe = function(e, a, n, s) {
241
- var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
242
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
243
- i = Reflect.decorate(e, a, n, s);
244
- else
245
- for (var l = e.length - 1; l >= 0; l--)
246
- (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
247
- return o > 3 && i && Object.defineProperty(a, n, i), i;
248
- }, T = function(e, a) {
249
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
250
- return Reflect.metadata(e, a);
251
- };
252
- const H = class {
253
- constructor(e) {
254
- f(this, e), this.goBackButtonClicked = d(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = d(this, "cancelBookingFormSubmitted", 7), this.cancelBookedEventError = d(this, "cancelBookedEventError", 7), this.cancelBookingFormError = d(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
255
- this.goBackButtonClicked.emit();
256
- }, this.handleSubmitCancelBooking = (a) => {
257
- if (a.preventDefault(), !this.cancellationReason) {
258
- this.cancellationError = "Please provide a reason for cancellation.", this.cancelBookingFormError.emit({ title: "Cancel booking form error", description: "Please provide a reason for cancellation." });
259
- return;
260
- }
261
- c(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
262
- const n = (s) => {
263
- this.cancelBookedEventError.emit(s);
264
- };
265
- this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, reason: this.cancellationReason, errorHandler: n });
266
- }, this.handleOnChangeCancellationReason = (a) => {
267
- this.cancellationError = "", this.cancellationReason = a.target.value;
268
- }, this.cancelBookingId = void 0, this.cancellationReason = "", this.cancellationError = "";
269
- }
270
- connectedCallback() {
271
- c("[nylas-cancel-booking-form] Component connected");
272
- }
273
- async componentWillLoad() {
274
- c("[nylas-cancel-booking-form] Component will load");
275
- }
276
- async componentDidLoad() {
277
- c("[nylas-cancel-booking-form] Component did load");
278
- }
279
- disconnectedCallback() {
280
- c("[nylas-cancel-booking-form] Component disconnected");
281
- }
282
- render() {
283
- return t(b, { key: "98dc29d53d8a05beb16dea271cab5c574df4dfd0", part: "ncec" }, t("sp-theme", { key: "04feb774090fb57270a3d3c05576687ec78c230d", theme: "spectrum", scale: "medium" }, t("div", { key: "024a947c805b9f2ab6204a8548e9c775078fa969", class: "nylas-cancel-booking-form", part: "ncec__card" }, t("div", { key: "93295919797719199fbbe6eccdef4e42045c330d", class: "nylas-cancel-booking-form__calendar-icon", part: "ncec__icon" }, t("calendar-cancel-icon", { key: "b8da092aa626ebdef64dd3f2f54ca2df5082d1f3" })), t("h3", { key: "8e33cc23c5bc26aa8e5c979814fa5a398c798237", class: "nylas-cancel-booking-form__title", part: "ncec__title" }, "Cancel booking?"), t("div", { key: "2c8cd37241e6cfe38bb012be4d700ae03c33876e", class: "nylas-cancel-booking-form__description", part: "ncec__description" }, "Your current timeslot will become available to others."), t("form", { key: "be720382bd84086cd8a25279dd4ec58dbfc113e6", onSubmit: this.handleSubmitCancelBooking }, t("sp-field-label", { key: "fadd2793a898975b8ba8da0549bcbb37879a68bf", for: "cancel-reason", class: this.cancellationError ? "error" : "" }, "Reason for cancellation ", t("span", { key: "0748781625ea7ec8332b4ca20eae8986ad9e8efb", class: "required" }, "*")), t("sp-textfield", { key: "e8daf40a5c26b1e6b9b59ab42bbe613da72c987a", id: "cancel-reason", class: this.cancellationError ? "error" : "", part: "ncec__reason-textarea", multiline: !0, value: this.cancellationReason, onInput: this.handleOnChangeCancellationReason, onFocus: this.handleOnChangeCancellationReason, invalid: !!this.cancellationError }, t("sp-help-text", { key: "f876e2f41098845a235fe2b563e85891843d5351", slot: "negative-help-text" }, this.cancellationError)), t("sp-button", { key: "a05211715fda7fa75935c974bd20ce6c6ef4206a", variant: "primary", class: "cancel", type: "submit", part: "ncec__button-cta" }, "Cancel booking"), t("sp-button", { key: "3dd7832e698181eaca4df52835d64c09b664f5f9", variant: "secondary", class: "back", treatment: "outline", part: "ncec__button-outline", onClick: this.handleGoBackClicked }, "Go back")))));
284
- }
285
- };
286
- oe([
287
- h({
288
- name: "nylas-cancel-booking-form",
289
- eventToProps: {
290
- cancelBookingFormSubmitted: async (e, a) => {
291
- const n = await a.scheduler.cancelBooking(e.detail.bookingId), { errorHandler: s } = e.detail;
292
- s && (!n || "error" in n) && s(n);
293
- }
294
- },
295
- fireRegisterEvent: !0
296
- }),
297
- T("design:type", Function),
298
- T("design:paramtypes", []),
299
- T("design:returntype", void 0)
300
- ], H.prototype, "render", null);
301
- H.style = re;
302
- const le = ':host{display:block;--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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancelled-event-card{display:flex;align-items:center;flex-direction:column;width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:1rem;height:48px;padding:8px;line-height:24px;width:100%}sp-button:hover,sp-button:focus{border-color:var(--nylas-primary)}sp-button:active{border-color:var(--nylas-base-600)}', ce = le;
303
- var de = function(e, a, n, s) {
304
- var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
305
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
306
- i = Reflect.decorate(e, a, n, s);
307
- else
308
- for (var l = e.length - 1; l >= 0; l--)
309
- (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
310
- return o > 3 && i && Object.defineProperty(a, n, i), i;
311
- }, D = function(e, a) {
312
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
313
- return Reflect.metadata(e, a);
314
- };
315
- const Z = class {
316
- constructor(e) {
317
- f(this, e), this.closeCancelEventCardClicked = d(this, "closeCancelEventCardClicked", 7), this.handleCloseClicked = () => {
318
- this.closeCancelEventCardClicked.emit();
319
- }, this.cancelledEventInfo = void 0;
320
- }
321
- connectedCallback() {
322
- c("[nylas-cancelled-event-card] Component connected");
323
- }
324
- async componentWillLoad() {
325
- c("[nylas-cancelled-event-card] Component will load");
326
- }
327
- async componentDidLoad() {
328
- c("[nylas-cancelled-event-card] Component did load");
329
- }
330
- disconnectedCallback() {
331
- c("[nylas-cancelled-event-card] Component disconnected");
332
- }
333
- render() {
334
- return t(b, { key: "656dd5537bf436780d779e06362974295b6cf552", part: "ncec" }, t("sp-theme", { key: "e6aa25eb233fd0bca7006fd9bf63c9fb54738a66", theme: "spectrum", color: "dark", scale: "medium" }, t("div", { key: "005da251e2cad861ca1cb2bc276b01990618995f", class: "nylas-cancelled-event-card", part: "ncec__card" }, t("div", { key: "b30f8abc7dede57b909d69beb11a7da0015bf044", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, t("calendar-cancel-icon", { key: "9cc6e10a041979ff5a2a76c9d3e04446fdbfa27f" })), t("h3", { key: "0419fbe2aad08be631618146b77869307832f752", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, "Your booking has been cancelled successfully!"), t("div", { key: "c3fb84c05112e0a4055f6eaaf878ad7afda8726e", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, "A cancellation email has been sent to the participants."), t("div", { key: "0409b5465346ffea4c43789fa027f9b5a853d263", class: "nylas-cancelled-event-card__cta" }, t("sp-button", { key: "1d2efade3b5cd5ff48f3924c6b1e8248d2e478a3", variant: "secondary", treatment: "outline", part: "ncec__button-outline", onClick: this.handleCloseClicked }, "Close")))));
335
- }
336
- };
337
- de([
338
- h({
339
- name: "nylas-cancelled-event-card",
340
- eventToProps: {},
341
- fireRegisterEvent: !0
342
- }),
343
- D("design:type", Function),
344
- D("design:paramtypes", []),
345
- D("design:returntype", void 0)
346
- ], Z.prototype, "render", null);
347
- Z.style = ce;
348
- const z = /* @__PURE__ */ new Date(), L = /* @__PURE__ */ new Date();
349
- function k(e, a, n, s) {
350
- function o(i) {
351
- return e(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i;
352
- }
353
- return o.floor = (i) => (e(i = /* @__PURE__ */ new Date(+i)), i), o.ceil = (i) => (e(i = new Date(i - 1)), a(i, 1), e(i), i), o.round = (i) => {
354
- const r = o(i), l = o.ceil(i);
355
- return i - r < l - i ? r : l;
356
- }, o.offset = (i, r) => (a(i = /* @__PURE__ */ new Date(+i), r == null ? 1 : Math.floor(r)), i), o.range = (i, r, l) => {
357
- const p = [];
358
- if (i = o.ceil(i), l = l == null ? 1 : Math.floor(l), !(i < r) || !(l > 0))
359
- return p;
360
- let y;
361
- do
362
- p.push(y = /* @__PURE__ */ new Date(+i)), a(i, l), e(i);
363
- while (y < i && i < r);
364
- return p;
365
- }, o.filter = (i) => k((r) => {
366
- if (r >= r)
367
- for (; e(r), !i(r); )
368
- r.setTime(r - 1);
369
- }, (r, l) => {
370
- if (r >= r)
371
- if (l < 0)
372
- for (; ++l <= 0; )
373
- for (; a(r, -1), !i(r); )
374
- ;
375
- else
376
- for (; --l >= 0; )
377
- for (; a(r, 1), !i(r); )
378
- ;
379
- }), n && (o.count = (i, r) => (z.setTime(+i), L.setTime(+r), e(z), e(L), Math.floor(n(z, L))), o.every = (i) => (i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? o.filter(s ? (r) => s(r) % i === 0 : (r) => o.count(0, r) % i === 0) : o)), o;
380
- }
381
- const be = 1e3, A = be * 60, fe = A * 60, v = fe * 24, B = k(
382
- (e) => e.setHours(0, 0, 0, 0),
383
- (e, a) => e.setDate(e.getDate() + a),
384
- (e, a) => (a - e - (a.getTimezoneOffset() - e.getTimezoneOffset()) * A) / v,
385
- (e) => e.getDate() - 1
386
- );
387
- k((e) => {
388
- e.setUTCHours(0, 0, 0, 0);
389
- }, (e, a) => {
390
- e.setUTCDate(e.getUTCDate() + a);
391
- }, (e, a) => (a - e) / v, (e) => e.getUTCDate() - 1);
392
- k((e) => {
393
- e.setUTCHours(0, 0, 0, 0);
394
- }, (e, a) => {
395
- e.setUTCDate(e.getUTCDate() + a);
396
- }, (e, a) => (a - e) / v, (e) => Math.floor(e / v));
397
- const me = ':host{display:block;min-height:444px;--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}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:1rem}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 412px){.dates .date{width:38px;height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}', he = me;
398
- var pe = function(e, a, n, s) {
399
- var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
400
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
401
- i = Reflect.decorate(e, a, n, s);
402
- else
403
- for (var l = e.length - 1; l >= 0; l--)
404
- (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
405
- return o > 3 && i && Object.defineProperty(a, n, i), i;
406
- }, R = function(e, a) {
407
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
408
- return Reflect.metadata(e, a);
409
- };
410
- const V = class {
411
- constructor(e) {
412
- f(this, e), this.dateSelected = d(this, "dateSelected", 7), this.monthChanged = d(this, "monthChanged", 7), this.selectableDates = void 0, this.selectedDate = void 0, this.isLoading = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates();
413
- }
414
- connectedCallback() {
415
- }
416
- disconnectedCallback() {
417
- }
418
- componentWillLoad() {
419
- }
420
- getDates() {
421
- const e = X(this.month), a = Y(this.month);
422
- return B.range(B.offset(a, -a.getDay()), B.offset(e, 7 - e.getDay()));
423
- }
424
- selectDate(e) {
425
- this.dateSelected.emit(e);
426
- }
427
- changeMonth(e) {
428
- this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1), this.dates = this.getDates(), this.monthChanged.emit(this.month), this.selectDate();
429
- }
430
- isSelected(e, a, n) {
431
- return e && a && m(e, a) && n && (n == null ? void 0 : n.length) > 0;
432
- }
433
- isDisabled(e, a) {
434
- return e && (a == null ? void 0 : a.find((n) => m(n, e))) === void 0;
435
- }
436
- render() {
437
- var e, a;
438
- return t(b, { key: "da3c7e290b60613575379d559e03d5e1dca04535", part: "ndp" }, t("div", { key: "4bb1b14f4f609f601b27f7ad2eb4baeed6cc4d55", class: "nylas-date-picker" }, t("div", { key: "5d6c68298c5e9606bae9e45a99f0c59da3d36854", class: "header flex-row" }, t("h2", { key: "2504a779961e1e07a881f2eb2f5ffa5d8329e627", part: "ndp__month-header" }, t("strong", { key: "433fdd38ccf5b49144bafd3b284acd26b94d19c4" }, this.month.toLocaleDateString(void 0, { month: "long" })), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), t("div", { key: "ffaa3276b249a85dc197828625835ad1f2278179", class: "pagination" }, t("button", { key: "451c9d09fc01e4c7ae35742d7c6b4b2f3da4d3ee", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: !((e = this.selectableDates) != null && e.length) || this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, t("chevron-icon", { key: "3a23fa0fb325feab4b56477602f122b800dce5ce" })), t("button", { key: "56b81156d02525a70c6c567e5facb1d9995ea2de", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: !((a = this.selectableDates) != null && a.length), part: "ndp__month-button" }, t("chevron-icon", { key: "1329d513678bffec6bc21d579b240e7af29ec530" })))), t("div", { key: "14eb94fe04ca2797f3377057a87825689b818719", class: "dates" }, ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"].map((n) => t("div", { class: "day", part: "ndp__day" }, n)), this.dates.map((n, s) => {
439
- var i;
440
- const o = this.isDisabled(n, this.selectableDates);
441
- return this.isLoading ? t("button", { disabled: !0, class: {
442
- "date day-skeleton": !0,
443
- "current-month": C(n, this.month)
444
- }, style: { animationDelay: `${s * 20}ms` }, part: "ndp__date" }, n.getDate()) : t("button", { class: {
445
- date: !0,
446
- selected: !!(this.selectedDate && m(n, this.selectedDate) && this.selectableDates && ((i = this.selectableDates) == null ? void 0 : i.length) > 0),
447
- "current-day": m(n, /* @__PURE__ */ new Date()),
448
- "current-month": C(n, this.month)
449
- }, "aria-lang": n.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: o, onClick: () => this.selectDate(n), part: `ndp__date ${this.isSelected(n, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${m(n, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${C(n, this.month) ? "ndp__date--current-month" : ""}` }, n.getDate());
450
- }))));
451
- }
452
- };
453
- pe([
454
- h({
455
- name: "nylas-date-picker",
456
- stateToProps: /* @__PURE__ */ new Map([
457
- ["scheduler.selectableDates", "selectableDates"],
458
- ["scheduler.selectedDate", "selectedDate"],
459
- ["scheduler.isLoading", "isLoading"]
460
- ]),
461
- eventToProps: {
462
- dateSelected: async (e, a) => {
463
- a.scheduler.selectDate(e.detail);
464
- }
465
- },
466
- fireRegisterEvent: !0
467
- }),
468
- R("design:type", Function),
469
- R("design:paramtypes", []),
470
- R("design:returntype", void 0)
471
- ], V.prototype, "render", null);
472
- V.style = he;
473
- const ye = ':host{display:block;--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}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:68px;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}', ue = ye;
474
- var ge = function(e, a, n, s) {
475
- var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
476
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
477
- i = Reflect.decorate(e, a, n, s);
478
- else
479
- for (var l = e.length - 1; l >= 0; l--)
480
- (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
481
- return o > 3 && i && Object.defineProperty(a, n, i), i;
482
- }, S = function(e, a) {
483
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
484
- return Reflect.metadata(e, a);
485
- };
486
- const G = class {
487
- constructor(e) {
488
- f(this, e), this.timezoneChanged = d(this, "timezoneChanged", 7), this.languageChanged = d(this, "languageChanged", 7), this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = navigator.language;
489
- }
490
- connectedCallback() {
491
- }
492
- disconnectedCallback() {
493
- }
494
- componentWillLoad() {
495
- }
496
- changeTimezone(e) {
497
- this.selectedTimezone = e, this.timezoneChanged.emit(e);
498
- }
499
- changeLanguage(e) {
500
- this.selectedLanguage = e, this.languageChanged.emit(e);
501
- }
502
- selectedOptionChangedHandler(e) {
503
- const { name: a, value: n } = e.detail;
504
- a === "timezone" ? this.changeTimezone(n) : a === "language" && this.changeLanguage(n);
505
- }
506
- getTimezoneLabelHTML(e) {
507
- const a = K(e);
508
- return t("span", { class: "timezone-label", style: {
509
- display: "flex",
510
- alignItems: "center",
511
- justifyContent: "space-between",
512
- width: "-webkit-fill-available"
513
- } }, u[e], " ", t("span", { class: "timezone-offset", style: {
514
- fontSize: "14px",
515
- fontWeight: "400",
516
- color: "var(--nylas-base-500)"
517
- } }, a));
518
- }
519
- render() {
520
- const e = Object.keys(u).map((n) => ({
521
- labelHTML: this.getTimezoneLabelHTML(n),
522
- label: u[n],
523
- value: n
524
- })), a = Object.keys(F).map((n) => ({
525
- label: F[n],
526
- value: n
527
- }));
528
- return t(b, { key: "688b90cbd1410a8025a8becfd3f979fc854c60a2" }, t("div", { key: "a4f485ce6204d89e16336c93809dbcf5ebf862ef", class: "nylas-locale-switch" }, t("div", { key: "5525e493d2f8e3258a2fe8b4c739db49d7ef1a35", class: {
529
- "select-wrapper": !0,
530
- timezone: !0
531
- } }, t("select-dropdown", { key: "68f7f48a2cada4cc0c7327431f15384d17ebc261", name: "timezone", options: e, defaultSelectedOption: e.find((n) => n.value == this.selectedTimezone) }, t("span", { key: "d1213a8cba28b2163997cdb4bce7e13d7485e869", slot: "select-icon" }, t("globe-icon", { key: "f11285b20c93a42a0f195f89966bc7ff7b2d7322", width: "20", height: "20" })))), t("div", { key: "0287627954a80ef5092ded694e61ec2a19606667", class: {
532
- "select-wrapper": !0,
533
- language: !0
534
- } }, t("select-dropdown", { key: "1bd58884de605b22cb6a5631b8e9f960cfa058d4", name: "language", options: a, defaultSelectedOption: a.find((n) => n.value == this.selectedLanguage) }, t("span", { key: "0681b6c8296d60c258c2df3bcb60d895c0e0c533", slot: "select-icon" }, t("translate-icon", { key: "bd3f346f56da2a139c5050799c9e2774d311d72c", width: "20", height: "20" }))))));
535
- }
536
- };
537
- ge([
538
- h({
539
- name: "nylas-locale-switch",
540
- stateToProps: /* @__PURE__ */ new Map([
541
- ["scheduler.selectedLanguage", "selectedLanguage"],
542
- ["scheduler.selectedTimezone", "selectedTimezone"]
543
- ]),
544
- eventToProps: {
545
- timezoneChanged: async (e, a) => {
546
- a.scheduler.selectTimezone(e.detail);
547
- }
548
- },
549
- fireRegisterEvent: !0
550
- }),
551
- S("design:type", Function),
552
- S("design:paramtypes", []),
553
- S("design:returntype", void 0)
554
- ], G.prototype, "render", null);
555
- G.style = ue;
556
- const ve = ".sc-nylas-logo-h{display:flex}", ke = ve, xe = class {
557
- constructor(e) {
558
- f(this, e), this.width = "69", this.height = "24";
559
- }
560
- render() {
561
- return t("svg", { key: "5aea87a70e3fd0d4db9231f986662a0e51d5225e", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, t("g", { key: "635ee7b2cff95d3949dc8a7aba5d7897ac42bec8", "clip-path": "url(#clip0_455_3543)" }, t("path", { key: "818b4ab1d5087f3dbd4b65ec92c46da729b7b034", d: "M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z", fill: "currentColor" }), t("path", { key: "0519037016d40d4c264b929f042bffde6fcb4095", d: "M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z", fill: "currentColor" }), t("path", { key: "10efd16fe4864b407bed8c54611001c6a0f5098f", d: "M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z", fill: "currentColor" }), t("path", { key: "0282ae1035c07bd0f8af5c3530ce7ce799dc2dc1", d: "M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z", fill: "currentColor" }), t("path", { key: "16e1d732c5e6eee5f772d45085103b099c3130bf", d: "M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z", fill: "currentColor" }), t("path", { key: "495550fe08ebeba1c89726b7009112e89088472a", d: "M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z", fill: "currentColor" }), t("path", { key: "effe06423b66ff0a533bfb8ec6d9a0cbbf19f765", d: "M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z", fill: "currentColor" }), t("path", { key: "785098f3a2ac3a19e79056e355365fd8ccc81cd9", d: "M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z", fill: "currentColor" })), t("defs", { key: "9466fc6ad025006936d16136c6f4be4b79282759" }, t("clipPath", { key: "901a3ef6048680de4ddbdd8e3fd8edfbb7afc0f3", id: "clip0_455_3543" }, t("rect", { key: "aee5f90208b83c446e4ac3877ce788d0dcad0de3", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
562
- }
563
- };
564
- xe.style = ke;
565
- const Ce = ':host{display:block;margin-bottom:-12px;width:100%;z-index: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}.notif{display:flex;padding:17px;align-items:flex-start;justify-content:space-between;gap:16px;border-radius:var(--nylas-border-radius-2x);border:1.5px solid var(--nylas-error);background:var(--nylas-base-0)}@media screen and (max-width: 768px){.notif{width:auto}}.notif .content{display:flex;flex-direction:row;gap:8px}.notif .content .message{font-size:14px;font-weight:400;color:var(--nylas-base-800)}.notif .content .message .title{font-size:16px;font-weight:600;color:var(--nylas-base-950);display:block}.notif .content .message .description{font-size:14px;font-weight:400;color:var(--nylas-base-800);display:block}.notif .content .icon.error{color:var(--nylas-error)}.notif.error{border-color:var(--nylas-error)}.notif.warning{border-color:var(--nylas-warning)}.notif.info{border-color:var(--nylas-info)}.notif.success{border-color:var(--nylas-success)}.notif .dismiss-btn{background:none;border:none;color:var(--nylas-base-950);cursor:pointer}', we = Ce, _e = class {
566
- constructor(e) {
567
- f(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
568
- }
569
- onError(e) {
570
- c(`[nylas-notification] Error: ${e.detail.title}`), this.handleNotification(e);
571
- }
572
- onWarning(e) {
573
- c(`[nylas-notification] Warning: ${e.detail.title}`), this.handleNotification(e);
574
- }
575
- onInfo(e) {
576
- c(`[nylas-notification] Info: ${e.detail.title}`), this.handleNotification(e);
577
- }
578
- onSuccess(e) {
579
- c(`[nylas-notification] Success: ${e.detail.title}`), this.handleNotification(e);
580
- }
581
- handleNotification(e) {
582
- if (e.defaultPrevented) {
583
- c("[nylas-notification] Event default prevented");
584
- return;
585
- }
586
- if (this.ttl === 0) {
587
- c("[nylas-notification] TTL is 0");
588
- return;
589
- }
590
- if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.category)) {
591
- c("[nylas-notification] Category not allowed");
592
- return;
593
- }
594
- if (this.notifications = [...this.notifications, { ...e.detail }], e.detail.ttl !== "none") {
595
- const a = e.detail.ttl ? e.detail.ttl : this.ttl;
596
- window.setTimeout(() => {
597
- this.notifications = this.notifications.filter((n) => n.id !== e.detail.id);
598
- }, a);
599
- }
600
- }
601
- dismissNotification(e) {
602
- this.notifications = this.notifications.filter((a) => a.id !== e);
603
- }
604
- render() {
605
- return t(b, { key: "16bd673245819e3ed76ba5689c3292be510e3cd7" }, t(J, { key: "d88e8ea863d00a8c982c7e26007c975526c7457f" }, this.notifications.map((e) => t("div", { class: `notif ${e.type}`, key: e.id }, t("div", { class: "content" }, t("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && t("warning-icon", null)), t("span", { class: "message" }, t("span", { class: "title" }, e.title), e.description && t("span", { class: "description" }, e.description))), t("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, t("close-icon", null)))), t("slot", { key: "c40cb61ce0a1dbd3416824b7c26e08e3aea01eae" })));
606
- }
607
- };
608
- _e.style = we;
609
- const Ee = ":host{display:block}sp-theme{position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:min(max(14px, 3vw), 16px);font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}", Te = Ee;
610
- var De = function(e, a, n, s) {
611
- var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
612
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
613
- i = Reflect.decorate(e, a, n, s);
614
- else
615
- for (var l = e.length - 1; l >= 0; l--)
616
- (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
617
- return o > 3 && i && Object.defineProperty(a, n, i), i;
618
- }, I = function(e, a) {
619
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
620
- return Reflect.metadata(e, a);
621
- };
622
- const W = class {
623
- constructor(e) {
624
- f(this, e), this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.startTime = "", this.endTime = "";
625
- }
626
- connectedCallback() {
627
- }
628
- disconnectedCallback() {
629
- }
630
- async componentWillLoad() {
631
- c("[nylas-selected-event-card] Component will load");
632
- }
633
- async componentDidLoad() {
634
- c("[nylas-selected-event-card] Component did load");
635
- }
636
- handleSelectedTimeslotChange(e) {
637
- this.startTime = new Date(e == null ? void 0 : e.start_time).toLocaleString(void 0, { timeStyle: "short" }), this.endTime = new Date(e == null ? void 0 : e.end_time).toLocaleString(void 0, { timeStyle: "short" });
638
- }
639
- render() {
640
- var e;
641
- return t(b, { key: "1104fd2969ab03bb794c17bbf08f1600a200448c", part: "nsec" }, t("sp-theme", { key: "674934ecb54519d9e8c227a9946b9725518b77e5", theme: "spectrum", color: "dark", scale: "medium" }, t("div", { key: "4d492e825e93b93ff96af4970812178656de4ab8", class: "event-card", part: "nsec__card" }, t("div", { key: "239131412dab45da5b1f7bfe3b4a2eda45a2978b", class: "calendar-icon", part: "nsec__icon" }, t("calendar-icon", { key: "a2fa2f47b94a2c331d4cac88ef736faef3e30dae" })), t("div", { key: "81c873d5c2019b6ae1d8b746685dbe5efc2d7d0b", class: "nylas-selected-event-card__date", part: "nsec__date" }, (e = this.selectedDate) == null ? void 0 : e.toLocaleDateString(void 0, { dateStyle: "full" })), t("div", { key: "67348e66fd879ead10594b216a2d66cf7da272aa", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), t("div", { key: "0fc6452dae7c5998a70d116c9bdfe25ab109661c", class: "event-timezone", part: "nsec__timezone" }, t("globe-icon", { key: "86c4a1e2728a30e34805a7c286378fe9adef110e" }), u[this.selectedTimezone])));
642
- }
643
- static get watchers() {
644
- return {
645
- selectedTimeslot: ["handleSelectedTimeslotChange"]
646
- };
647
- }
648
- };
649
- De([
650
- h({
651
- name: "nylas-selected-event-card",
652
- stateToProps: /* @__PURE__ */ new Map([
653
- ["scheduler.selectedDate", "selectedDate"],
654
- ["scheduler.selectedTimeslot", "selectedTimeslot"],
655
- ["scheduler.selectedTimezone", "selectedTimezone"]
656
- ]),
657
- eventToProps: {},
658
- fireRegisterEvent: !0
659
- }),
660
- I("design:type", Function),
661
- I("design:paramtypes", []),
662
- I("design:returntype", void 0)
663
- ], W.prototype, "render", null);
664
- W.style = Te;
665
- const ze = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.time-slots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .time-slot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}.footer sp-button{padding:14px;color:var(--nylas-base-100);border-radius:var(--nylas-border-radius-2x);width:100%;height:48px;font-weight:600;font-size:16px;background-color:var(--nylas-primary);border:none}.footer sp-button:hover,.footer sp-button:focus{background-color:var(--nylas-base-600)}.footer sp-button:active{background-color:var(--nylas-base-800)}", Le = ze;
666
- var Be = function(e, a, n, s) {
667
- var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
668
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
669
- i = Reflect.decorate(e, a, n, s);
670
- else
671
- for (var l = e.length - 1; l >= 0; l--)
672
- (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(a, n, i) : r(a, n)) || i);
673
- return o > 3 && i && Object.defineProperty(a, n, i), i;
674
- }, j = function(e, a) {
675
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
676
- return Reflect.metadata(e, a);
677
- };
678
- const U = class {
679
- constructor(e) {
680
- f(this, e), this.timeslotSelected = d(this, "timeslotSelected", 7), this.timeslotConfirmed = d(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (a, n) => {
681
- a.preventDefault(), c("[nylas-timeslot-picker] Confirm timeslot", n), this.timeslotConfirmed.emit(n);
682
- }, this.handleMouseEnter = (a) => {
683
- this.hoveredTimeslotIndex = a;
684
- }, this.handleMouseLeave = () => {
685
- this.hoveredTimeslotIndex = -1;
686
- }, this.selectedDate = /* @__PURE__ */ new Date(), this.availability = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
687
- }
688
- connectedCallback() {
689
- }
690
- disconnectedCallback() {
691
- }
692
- async componentWillLoad() {
693
- var a;
694
- const e = (a = this.availability) == null ? void 0 : a.filter((n) => this.selectedDate && m(n.start_time, this.selectedDate)).map((n) => n);
695
- this.times = e || [], c("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
696
- }
697
- async componentDidLoad() {
698
- c("[nylas-timeslot-picker] Component did load");
699
- }
700
- getTimeslotId(e, a) {
701
- return `${e.toLocaleDateString()}-${a}`;
702
- }
703
- onClickSelectTime(e, a) {
704
- c("[nylas-timeslot-picker] Time selected", e, a), this.selectedTimeslotIndex = this.getTimeslotId(e.start_time, a), this.timeslotSelected.emit({
705
- start_time: e.start_time,
706
- end_time: e.end_time
707
- });
708
- }
709
- getTimeSlotLabel(e) {
710
- const a = new Intl.DateTimeFormat("en-US", {
711
- hour: "numeric",
712
- minute: "numeric",
713
- timeZone: this.selectedTimezone
714
- });
715
- return `${a.format(e.start_time)} - ${a.format(e.end_time)}`;
716
- }
717
- selectedDateChanged(e) {
718
- var a;
719
- if (c("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
720
- const n = (a = this.availability) == null ? void 0 : a.filter((s) => m(s.start_time, e)).map((s) => s);
721
- this.times = n || [];
722
- }
723
- }
724
- availabilityChanged(e) {
725
- if (c("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
726
- const a = e == null ? void 0 : e.filter((n) => this.selectedDate && m(n.start_time, this.selectedDate)).map((n) => n);
727
- this.times = a || [];
728
- }
729
- }
730
- render() {
731
- return this.isLoading ? t(b, null, t("div", { class: "loading" }, new Array(6).fill(0).map((e, a) => t("div", { class: "time-slot-skeleton", style: { animationDelay: `${a * 20}ms` } })))) : this.availability && this.availability.length === 0 ? t(b, null, t("div", { class: "empty" }, t("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? t(b, null, t("div", { class: "empty" }, t("span", null, "No time slots available for selected date"))) : this.selectedDate ? t(b, { part: "ntp" }, t("div", { class: "time-picker-wrapper" }, t("div", { class: "time-slots" }, this.times.map((e, a) => {
732
- var n, s, o, i;
733
- return t("button", { part: `ntp__timeslot ${((s = (n = this.selectedTimeslot) == null ? void 0 : n.start_time) == null ? void 0 : s.getTime()) === e.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, "aria-role": "button", class: {
734
- time: !0,
735
- selected: typeof this.selectedTimeslot < "u" && ((i = (o = this.selectedTimeslot) == null ? void 0 : o.start_time) == null ? void 0 : i.getTime()) === e.start_time.getTime()
736
- }, onClick: () => this.onClickSelectTime(e, a), onMouseEnter: () => this.handleMouseEnter(a), onMouseLeave: () => this.handleMouseLeave() }, this.hoveredTimeslotIndex == a || this.selectedTimeslotIndex == this.getTimeslotId(e.start_time, a) ? this.getTimeSlotLabel(e) : e.start_time.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone }));
737
- })), this.selectedTimeslot && t("div", { class: "footer" }, t("sp-button", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, t("slot", { name: "timeslot-picker-cta-label" }, "Next"))))) : t(b, null);
738
- }
739
- static get watchers() {
740
- return {
741
- selectedDate: ["selectedDateChanged"],
742
- availability: ["availabilityChanged"]
743
- };
744
- }
745
- };
746
- Be([
747
- h({
748
- name: "nylas-timeslot-picker",
749
- stateToProps: /* @__PURE__ */ new Map([
750
- ["scheduler.selectedDate", "selectedDate"],
751
- ["scheduler.availability", "availability"],
752
- ["scheduler.selectedTimeslot", "selectedTimeslot"],
753
- ["scheduler.selectedTimezone", "selectedTimezone"],
754
- ["scheduler.isLoading", "isLoading"]
755
- ]),
756
- eventToProps: {
757
- timeslotSelected: async (e, a) => {
758
- a.scheduler.selectTime(e.detail);
759
- },
760
- timeslotConfirmed: async (e, a) => {
761
- e.detail && a.scheduler.toggleAdditionalData(!0);
762
- }
763
- },
764
- fireRegisterEvent: !0
765
- }),
766
- j("design:type", Function),
767
- j("design:paramtypes", []),
768
- j("design:returntype", void 0)
769
- ], U.prototype, "render", null);
770
- U.style = Le;
771
- export {
772
- M as nylas_booked_event_card,
773
- $ as nylas_booking_form,
774
- H as nylas_cancel_booking_form,
775
- Z as nylas_cancelled_event_card,
776
- V as nylas_date_picker,
777
- G as nylas_locale_switch,
778
- xe as nylas_logo,
779
- _e as nylas_notification,
780
- W as nylas_selected_event_card,
781
- U as nylas_timeslot_picker
782
- };