@nylas/react 1.3.6 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/add-circle-icon_2.entry-04909861.cjs +1 -0
  2. package/dist/add-circle-icon_2.entry-0d9ba871.js +26 -0
  3. package/dist/archive-icon.entry-3d6d9d3f.js +16 -0
  4. package/dist/archive-icon.entry-88459432.cjs +1 -0
  5. package/dist/{arrow-icon.entry-9cfd86a1.js → arrow-icon.entry-789ee889.js} +3 -2
  6. package/dist/arrow-icon.entry-c35e1933.cjs +1 -0
  7. package/dist/bold-icon.entry-827e95bf.cjs +1 -0
  8. package/dist/{bold-icon.entry-eab3420d.js → bold-icon.entry-fbb382d2.js} +7 -6
  9. package/dist/{button-component_2.entry-7cd5f9c0.js → button-component_2.entry-6c012ee4.js} +10 -9
  10. package/dist/button-component_2.entry-acd13f45.cjs +1 -0
  11. package/dist/calendar-agenda-fill-icon_36.entry-1bb3b1a8.js +4689 -0
  12. package/dist/calendar-agenda-fill-icon_36.entry-fa8121df.cjs +6 -0
  13. package/dist/calendar-cancel-icon.entry-2e97f7d8.cjs +1 -0
  14. package/dist/{calendar-cancel-icon.entry-299d6fba.js → calendar-cancel-icon.entry-a4d040db.js} +6 -5
  15. package/dist/{calendar-check-icon_2.entry-08ef8d2f.js → calendar-check-icon_2.entry-a48a358d.js} +12 -11
  16. package/dist/calendar-check-icon_2.entry-bca4821d.cjs +1 -0
  17. package/dist/{calendar-icon.entry-53b54115.js → calendar-icon.entry-57727659.js} +6 -5
  18. package/dist/calendar-icon.entry-a289313a.cjs +1 -0
  19. package/dist/checkbox-component.entry-af3e7005.cjs +1 -0
  20. package/dist/checkbox-component.entry-f4f98226.js +43 -0
  21. package/dist/checkmark-icon_15.entry-dace1b62.cjs +5 -0
  22. package/dist/checkmark-icon_15.entry-f43549b3.js +1337 -0
  23. package/dist/chevron-icon_3.entry-219b42e6.cjs +1 -0
  24. package/dist/chevron-icon_3.entry-25533d13.js +148 -0
  25. package/dist/clock-icon_4.entry-3917c667.cjs +1 -0
  26. package/dist/{clock-icon_4.entry-0e809dcb.js → clock-icon_4.entry-76f29f7e.js} +9 -8
  27. package/dist/{constants-6da0ede7-49c32ba7.js → constants-3d8016e3-3c080f00.js} +110 -41
  28. package/dist/constants-3d8016e3-fd6c3848.cjs +1 -0
  29. package/dist/customParseFormat-6c652dbb-8a42d5b0.js +135 -0
  30. package/dist/customParseFormat-6c652dbb-ba81ab97.cjs +1 -0
  31. package/dist/{delete-icon.entry-802084f6.js → delete-icon.entry-3b61864e.js} +8 -7
  32. package/dist/delete-icon.entry-96420b21.cjs +1 -0
  33. package/dist/{document-refresh-icon.entry-d1604f53.js → document-refresh-icon.entry-7333b7c9.js} +6 -5
  34. package/dist/document-refresh-icon.entry-8b5c6b9b.cjs +1 -0
  35. package/dist/elements/index.d.ts +10 -0
  36. package/dist/{feedbackSync-c040f483-2b6476c4.js → feedbackSync-352aaf4a-b2b83cfa.js} +1 -1
  37. package/dist/{feedbackSync-c040f483-d6dd0560.cjs → feedbackSync-352aaf4a-ba1bf452.cjs} +1 -1
  38. package/dist/{folder-icon.entry-6c0c09ed.js → folder-icon.entry-bb5e2452.js} +5 -4
  39. package/dist/folder-icon.entry-d2e46d3a.cjs +1 -0
  40. package/dist/forward-icon.entry-1fcf5a6b.cjs +1 -0
  41. package/dist/forward-icon.entry-af8d2147.js +16 -0
  42. package/dist/globe-icon_2.entry-b4b55760.cjs +1 -0
  43. package/dist/globe-icon_2.entry-cc6d9d67.js +200 -0
  44. package/dist/google-logo-icon_6.entry-aa7b5b42.js +1484 -0
  45. package/dist/google-logo-icon_6.entry-eefdec63.cjs +2 -0
  46. package/dist/google-meet-icon_5.entry-9758e527.js +56 -0
  47. package/dist/google-meet-icon_5.entry-c545537a.cjs +1 -0
  48. package/dist/inbox-icon.entry-b9640d5a.cjs +1 -0
  49. package/dist/inbox-icon.entry-c005ebc5.js +16 -0
  50. package/dist/index-05630f15.cjs +57 -0
  51. package/dist/index-78390f2e.js +17607 -0
  52. package/dist/index.d.ts +1 -3
  53. package/dist/{index.es-2b014ec7-72557487.js → index.es-4a203e8e-cf485db5.js} +818 -804
  54. package/dist/{index.es-2b014ec7-0589e68a.cjs → index.es-4a203e8e-f668b8c2.cjs} +6 -6
  55. package/dist/info-icon_2.entry-b17298b6.js +35 -0
  56. package/dist/info-icon_2.entry-ecbc6605.cjs +1 -0
  57. package/dist/input-component.entry-24366ab8.cjs +1 -0
  58. package/dist/input-component.entry-9da5da6c.js +84 -0
  59. package/dist/input-dropdown_2.entry-0109b06c.cjs +1 -0
  60. package/dist/input-dropdown_2.entry-d65f7152.js +231 -0
  61. package/dist/italic-icon.entry-afa4332a.cjs +1 -0
  62. package/dist/{italic-icon.entry-d610e66f.js → italic-icon.entry-d0a536f2.js} +3 -2
  63. package/dist/multi-select-dropdown_2.entry-2c7a1a06.cjs +1 -0
  64. package/dist/multi-select-dropdown_2.entry-c56b5fd2.js +187 -0
  65. package/dist/notebook-store-b61693cd-0877e7a2.js +14 -0
  66. package/dist/notebook-store-b61693cd-a7b8ae37.cjs +5 -0
  67. package/dist/nylas-booked-event-card_12.entry-827c7fb4.cjs +1 -0
  68. package/dist/nylas-booked-event-card_12.entry-960fdfe2.js +1422 -0
  69. package/dist/nylas-call-summary.entry-1cce1446.js +16 -0
  70. package/dist/nylas-call-summary.entry-f10f3c54.cjs +1 -0
  71. package/dist/nylas-event-calendar_3.entry-8bb08ed3.js +9705 -0
  72. package/dist/nylas-event-calendar_3.entry-b656237b.cjs +6 -0
  73. package/dist/nylas-form-card.entry-62578338.cjs +1 -0
  74. package/dist/nylas-form-card.entry-7455b8f1.js +58 -0
  75. package/dist/nylas-if-state.entry-0897dc70.cjs +1 -0
  76. package/dist/{nylas-if-state.entry-ee7d92b0.js → nylas-if-state.entry-7fa6d392.js} +4 -3
  77. package/dist/nylas-key-points.entry-449e1be0.js +29 -0
  78. package/dist/nylas-key-points.entry-693f33a1.cjs +1 -0
  79. package/dist/nylas-login.entry-36544dc8.cjs +1 -0
  80. package/dist/{nylas-login.entry-265f9d0f.js → nylas-login.entry-d7082306.js} +4 -3
  81. package/dist/{nylas-provider.entry-5605a3e0.js → nylas-provider.entry-a0e7ce4d.js} +6 -5
  82. package/dist/nylas-provider.entry-b93d2a62.cjs +1 -0
  83. package/dist/nylas-scheduler-editor.entry-332d27e0.cjs +2 -0
  84. package/dist/{nylas-scheduler-editor.entry-b3e085b3.js → nylas-scheduler-editor.entry-78fe5abf.js} +524 -266
  85. package/dist/nylas-scheduling.entry-1d80c349.cjs +1 -0
  86. package/dist/nylas-scheduling.entry-fa9ff55b.js +439 -0
  87. package/dist/nylas-transcript.entry-570d3abe.cjs +6 -0
  88. package/dist/nylas-transcript.entry-b129565c.js +128 -0
  89. package/dist/nylas-video-player.entry-9c7c9792.cjs +1 -0
  90. package/dist/nylas-video-player.entry-e208d443.js +39 -0
  91. package/dist/nylas-video-preview.entry-a3f542ad.js +16 -0
  92. package/dist/nylas-video-preview.entry-bd9bdda7.cjs +1 -0
  93. package/dist/{person-icon.entry-85660f98.js → person-icon.entry-82fbc43e.js} +8 -7
  94. package/dist/person-icon.entry-e4d11400.cjs +1 -0
  95. package/dist/play-icon.entry-68bc660a.js +16 -0
  96. package/dist/play-icon.entry-9cab598b.cjs +1 -0
  97. package/dist/radio-button-group.entry-6a2adf11.cjs +1 -0
  98. package/dist/radio-button-group.entry-f7679911.js +47 -0
  99. package/dist/react.cjs +1 -1
  100. package/dist/react.js +134 -125
  101. package/dist/refresh-icon.entry-0f1e5f20.cjs +1 -0
  102. package/dist/{refresh-icon.entry-d8644f5d.js → refresh-icon.entry-394b0814.js} +6 -5
  103. package/dist/{register-component-e9c10e19-80bbc4dd.cjs → register-component-1027b769-62812558.cjs} +1 -1
  104. package/dist/{register-component-e9c10e19-099fb50f.js → register-component-1027b769-dd21b16d.js} +1 -1
  105. package/dist/{reply-all-icon.entry-f209daeb.js → reply-all-icon.entry-0fad8f2f.js} +5 -4
  106. package/dist/reply-all-icon.entry-1680f1e5.cjs +1 -0
  107. package/dist/{reply-icon.entry-d37a129b.js → reply-icon.entry-5f4b7837.js} +5 -4
  108. package/dist/reply-icon.entry-77342442.cjs +1 -0
  109. package/dist/scheduler-config-store-d6729d8d-06a3a314.cjs +1 -0
  110. package/dist/{scheduler-config-store-ed4a8dfd-35ec90c6.js → scheduler-config-store-d6729d8d-854b5da8.js} +4 -1
  111. package/dist/scheduler-store-f3e2a26f-7cee436f.cjs +1 -0
  112. package/dist/scheduler-store-f3e2a26f-85df53f7.js +533 -0
  113. package/dist/sent-icon.entry-20a8945d.cjs +1 -0
  114. package/dist/sent-icon.entry-2d122865.js +16 -0
  115. package/dist/spam-icon.entry-86178cc5.cjs +1 -0
  116. package/dist/spam-icon.entry-9e374d44.js +16 -0
  117. package/dist/star-icon.entry-1b94c861.cjs +1 -0
  118. package/dist/{star-icon.entry-9b22bb32.js → star-icon.entry-bb1b517d.js} +7 -6
  119. package/dist/stop-icon.entry-7b21833b.cjs +1 -0
  120. package/dist/{stop-icon.entry-1f7918b2.js → stop-icon.entry-e4d3526d.js} +3 -2
  121. package/dist/textarea-component.entry-ba3c9311.js +39 -0
  122. package/dist/textarea-component.entry-fdba933d.cjs +1 -0
  123. package/dist/toggle-switch.entry-4a980d1d.js +34 -0
  124. package/dist/toggle-switch.entry-9142a3d3.cjs +1 -0
  125. package/dist/{translate-icon.entry-8cffa646.js → translate-icon.entry-1657aa04.js} +5 -4
  126. package/dist/translate-icon.entry-b4908cf3.cjs +1 -0
  127. package/dist/trash-fill-icon.entry-a6791185.cjs +1 -0
  128. package/dist/trash-fill-icon.entry-c9e1769e.js +16 -0
  129. package/dist/{underline-icon.entry-afd9c78b.js → underline-icon.entry-1ba4d923.js} +5 -4
  130. package/dist/underline-icon.entry-d1f91e63.cjs +1 -0
  131. package/dist/warning-icon.entry-b1480f57.cjs +1 -0
  132. package/dist/{warning-icon.entry-53441175.js → warning-icon.entry-fe155c15.js} +5 -4
  133. package/package.json +12 -4
  134. package/dist/add-circle-icon.entry-25aecb13.js +0 -15
  135. package/dist/add-circle-icon.entry-5c49ba96.cjs +0 -1
  136. package/dist/archive-icon.entry-0a9e8ec3.cjs +0 -1
  137. package/dist/archive-icon.entry-89e31121.js +0 -15
  138. package/dist/arrow-icon.entry-19e5237c.cjs +0 -1
  139. package/dist/bold-icon.entry-d591e701.cjs +0 -1
  140. package/dist/button-component_2.entry-ce4314bf.cjs +0 -1
  141. package/dist/calendar-agenda-fill-icon_54.entry-7099138a.js +0 -5865
  142. package/dist/calendar-agenda-fill-icon_54.entry-9228dbe7.cjs +0 -8
  143. package/dist/calendar-cancel-icon.entry-6e3d20f1.cjs +0 -1
  144. package/dist/calendar-check-icon_2.entry-087dd913.cjs +0 -1
  145. package/dist/calendar-icon.entry-73f9d05b.cjs +0 -1
  146. package/dist/checkbox-component_3.entry-bc9768dd.cjs +0 -1
  147. package/dist/checkbox-component_3.entry-d828eb1d.js +0 -149
  148. package/dist/chevron-icon_3.entry-783588a9.js +0 -147
  149. package/dist/chevron-icon_3.entry-e956d78c.cjs +0 -1
  150. package/dist/clock-icon_4.entry-60d41dfd.cjs +0 -1
  151. package/dist/close-icon.entry-1b5d25c5.cjs +0 -1
  152. package/dist/close-icon.entry-fef4f624.js +0 -15
  153. package/dist/constants-6da0ede7-151395ad.cjs +0 -1
  154. package/dist/copy-icon.entry-25699ab8.js +0 -15
  155. package/dist/copy-icon.entry-ab6530e0.cjs +0 -1
  156. package/dist/core-js-38e53e34.cjs +0 -4
  157. package/dist/core-js-a9d3b6e1.js +0 -3297
  158. package/dist/delete-icon.entry-e99e1f82.cjs +0 -1
  159. package/dist/document-refresh-icon.entry-065a59f5.cjs +0 -1
  160. package/dist/dom-68f08be9.cjs +0 -15
  161. package/dist/dom-86e17616.js +0 -664
  162. package/dist/folder-icon.entry-351e61fc.cjs +0 -1
  163. package/dist/forward-icon.entry-0ccfb600.js +0 -15
  164. package/dist/forward-icon.entry-6b7af9cd.cjs +0 -1
  165. package/dist/globe-icon.entry-2b75b66b.cjs +0 -1
  166. package/dist/globe-icon.entry-5ddcd2cb.js +0 -15
  167. package/dist/google-logo-icon_4.entry-04174684.js +0 -790
  168. package/dist/google-logo-icon_4.entry-a685ff91.cjs +0 -1
  169. package/dist/inbox-icon.entry-0ad18b3f.js +0 -15
  170. package/dist/inbox-icon.entry-425d1ded.cjs +0 -1
  171. package/dist/index-7e7c24f1.js +0 -16837
  172. package/dist/index-81719cc6.cjs +0 -81
  173. package/dist/info-icon_2.entry-7ec02802.cjs +0 -1
  174. package/dist/info-icon_2.entry-a6d0e842.js +0 -34
  175. package/dist/input-color-picker.entry-d98d06ca.js +0 -48
  176. package/dist/input-color-picker.entry-ed9a1c07.cjs +0 -1
  177. package/dist/input-component.entry-2e57b00e.cjs +0 -1
  178. package/dist/input-component.entry-f3aa3419.js +0 -70
  179. package/dist/input-dropdown_2.entry-0d9c8475.js +0 -228
  180. package/dist/input-dropdown_2.entry-6fc7df16.cjs +0 -1
  181. package/dist/italic-icon.entry-7a8712f2.cjs +0 -1
  182. package/dist/multi-select-dropdown.entry-b31d9f11.js +0 -116
  183. package/dist/multi-select-dropdown.entry-eaa268b4.cjs +0 -1
  184. package/dist/nylas-booked-event-card_12.entry-45514813.js +0 -1378
  185. package/dist/nylas-booked-event-card_12.entry-498de30a.cjs +0 -1
  186. package/dist/nylas-form-card.entry-67aec298.js +0 -57
  187. package/dist/nylas-form-card.entry-fdb3c114.cjs +0 -1
  188. package/dist/nylas-if-state.entry-76b38c9c.cjs +0 -1
  189. package/dist/nylas-login.entry-589e45d0.cjs +0 -1
  190. package/dist/nylas-provider.entry-cfb9627c.cjs +0 -1
  191. package/dist/nylas-scheduler-editor.entry-6fdfb9b5.cjs +0 -2
  192. package/dist/nylas-scheduling.entry-8cc5c353.cjs +0 -1
  193. package/dist/nylas-scheduling.entry-bc00beba.js +0 -424
  194. package/dist/nylas-time-window-picker.entry-a77c1d67.cjs +0 -1
  195. package/dist/nylas-time-window-picker.entry-c421303e.js +0 -316
  196. package/dist/person-icon.entry-36b21e95.cjs +0 -1
  197. package/dist/play-icon.entry-953b1bc8.js +0 -15
  198. package/dist/play-icon.entry-c35ade8a.cjs +0 -1
  199. package/dist/refresh-icon.entry-038501ca.cjs +0 -1
  200. package/dist/reply-all-icon.entry-ead9d0ba.cjs +0 -1
  201. package/dist/reply-icon.entry-b7f35ecd.cjs +0 -1
  202. package/dist/scheduler-config-store-ed4a8dfd-0d4408cf.cjs +0 -1
  203. package/dist/scheduler-store-dc3a7958-7c73f5e2.js +0 -487
  204. package/dist/scheduler-store-dc3a7958-99c6bdf6.cjs +0 -1
  205. package/dist/sent-icon.entry-b662ef5b.cjs +0 -1
  206. package/dist/sent-icon.entry-ec433cec.js +0 -15
  207. package/dist/spam-icon.entry-3a553ae4.js +0 -15
  208. package/dist/spam-icon.entry-a79819fd.cjs +0 -1
  209. package/dist/star-icon.entry-47ea44e7.cjs +0 -1
  210. package/dist/stop-icon.entry-26e2e633.cjs +0 -1
  211. package/dist/textarea-component.entry-6939d0fc.js +0 -38
  212. package/dist/textarea-component.entry-da0a861e.cjs +0 -1
  213. package/dist/toggle-switch.entry-5ae5ba46.js +0 -33
  214. package/dist/toggle-switch.entry-c5fd3e33.cjs +0 -1
  215. package/dist/translate-icon.entry-72e0369e.cjs +0 -1
  216. package/dist/trash-fill-icon.entry-815859c6.js +0 -15
  217. package/dist/trash-fill-icon.entry-8620c28f.cjs +0 -1
  218. package/dist/underline-icon.entry-ba1a9e87.cjs +0 -1
  219. package/dist/warning-icon.entry-7cbede6b.cjs +0 -1
@@ -0,0 +1,1422 @@
1
+ import { r as w, c as f, d, h as o, i, m as ue, w as ke, H as k, g as T, x as ge, y as ze, l as pe, z as P, A as Se, C as Re, D as O, E as M, G as je, I as Fe, J as Pe, F as Oe } from "./index-78390f2e.js";
2
+ import { R as B } from "./register-component-1027b769-dd21b16d.js";
3
+ import { c as S, T as F, a as me } from "./constants-3d8016e3-3c080f00.js";
4
+ import "react";
5
+ import "react/jsx-runtime";
6
+ import "react-dom";
7
+ const $e = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-booked-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 0;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:16px;font-weight:400;border-bottom:1px solid var(--nylas-base-200);width:inherit;padding:0 0 1.5rem}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booked-event-header .card-description{text-align:center}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:16px;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.button-container{width:inherit}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);border-top:1px solid var(--nylas-base-200);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}', Me = $e;
8
+ var Ne = function(e, n, a, l) {
9
+ var r = arguments.length, t = r < 3 ? n : l === null ? l = Object.getOwnPropertyDescriptor(n, a) : l, s;
10
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
11
+ t = Reflect.decorate(e, n, a, l);
12
+ else
13
+ for (var c = e.length - 1; c >= 0; c--)
14
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(n, a, t) : s(n, a)) || t);
15
+ return r > 3 && t && Object.defineProperty(n, a, t), t;
16
+ }, A = function(e, n) {
17
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
18
+ return Reflect.metadata(e, n);
19
+ };
20
+ const ve = class {
21
+ constructor(e) {
22
+ w(this, e), this.cancelBookingButtonClicked = f(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = f(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = f(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = f(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
23
+ var r, t;
24
+ const n = new Date(this.selectedTimeslot.start_time), a = (t = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : t.min_cancellation_notice;
25
+ if (!a) {
26
+ this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
27
+ return;
28
+ }
29
+ n.getTime() - a * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime() ? this.cancelBookedEventValidationError.emit({
30
+ error: {
31
+ title: "Cancellation Error",
32
+ message: `You cannot cancel the booking within ${a} minutes of the event.`
33
+ }
34
+ }) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
35
+ }, this.handleRescheduleButtonClicked = () => {
36
+ const n = (a) => {
37
+ this.rescheduleBookedEventError.emit(a);
38
+ };
39
+ this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: n });
40
+ }, this.getPaticipantType = (n) => {
41
+ switch (n) {
42
+ case "host":
43
+ return "Host";
44
+ case "you":
45
+ return "You";
46
+ default:
47
+ return "";
48
+ }
49
+ }, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.configSettings = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.selectedLanguage = navigator.language, this.hour12 = void 0, this.startTime = "", this.endTime = "";
50
+ }
51
+ themeConfigChanged(e) {
52
+ this.applyThemeConfig(e);
53
+ }
54
+ connectedCallback() {
55
+ }
56
+ disconnectedCallback() {
57
+ }
58
+ async componentWillLoad() {
59
+ d("[nylas-booked-event-card] Component will load");
60
+ }
61
+ async componentDidLoad() {
62
+ var a, l;
63
+ d("[nylas-booked-event-card] Component did load"), this.eventInfo || console.warn('[nylas-booked-event-card] "eventInfo" prop missing. Please provide the event info to display the event details in the booked event card component.'), this.bookingInfo || console.warn('[nylas-booked-event-card] "bookingInfo" prop missing. Please provide the booking info to display the guest details in the booked event card component.'), this.applyThemeConfig(this.themeConfig);
64
+ const e = S[this.selectedLanguage || "en"], n = new Intl.DateTimeFormat(e, {
65
+ hour: "2-digit",
66
+ minute: "2-digit",
67
+ timeZone: this.selectedTimezone,
68
+ hour12: this.hour12
69
+ });
70
+ this.startTime = n.format((a = this.selectedTimeslot) == null ? void 0 : a.start_time), this.endTime = n.format((l = this.selectedTimeslot) == null ? void 0 : l.end_time);
71
+ }
72
+ applyThemeConfig(e) {
73
+ if (e)
74
+ for (const [n, a] of Object.entries(e))
75
+ this.host.style.setProperty(`${n}`, a);
76
+ }
77
+ render() {
78
+ var a, l, r, t, s, c, b, h, u, C, D, L, p, m, E, R;
79
+ const e = (a = this.configSettings) == null ? void 0 : a.booking_type, n = e && e !== "booking";
80
+ return o(k, { key: "746e23e82adf30da44ac6a160400705251a5cf98", part: "nbec" }, o("div", { key: "aa3e79d294ff41b4a43775763f9e5f1922f955c7", class: "nylas-booked-event-card" }, o("div", { key: "cbb343663633b5ba80875f42af0bb0d091ee1ac8", class: "booked-event-timezone" }, o("globe-icon", { key: "8c94142bd486144efaa251770c87f4ec15481b41" }), F[this.selectedTimezone]), o("div", { key: "e06ef2c5b7a1977ff1953027d6109cb8a1acf493", class: "event-card-wrapper", part: "nbec__card" }, o("div", { key: "5a99626d44f6ef819af2606bf24208e1833e3a54", class: "calendar-icon" }, o("calendar-check-icon", { key: "06c5ec0241535ee0ea82c743653f93442bc9a5fa" })), o("div", { key: "b38fa39209c64394902a0e7607248d0d0c73adf2", class: "booked-event-header" }, o("h2", { key: "1706d065e1f427efcccef18f382702e95da33080", slot: "card-title", part: "nbec__title" }, this.rescheduleBookingId && !this.isLoading ? `${i.t("bookingRescheduled")}` : n && !this.isLoading ? `${i.t("bookingSent")}` : `${i.t("bookingConfirmed")}`, "!"), o("div", { key: "c7bfce355ce08d858862bc7672f20e8a2bb3dce9", class: "card-description", part: "nbec__description" }, n ? i.t("bookingSentDescription") : o("span", null, i.t("bookingConfirmedDescription")))), o("div", { key: "2074c51dfdfd0753fcd3d598b7633520bf70ab63", class: "booking-date-time" }, o("checkmark-circle-icon", { key: "dbfe39fadeeb08186a5214cfb9ca5d3c8da55cb1" }), o("h3", { key: "edb9ed53cb25e9e06ec7b27f8141fa6f422c1511" }, i.t("bookingDateAndTimeHeader")), o("p", { key: "24d8d606ab3e217256152e249ee435d070df0c5b" }, (l = this.selectedTimeslot) != null && l.start_time ? ue(ke((r = this.selectedTimeslot) == null ? void 0 : r.start_time, this.selectedTimezone, S[this.selectedLanguage])) : "-", " ", o("br", { key: "5949a97ff7e7b256e410f591b810332a72e0696c" }), this.startTime, " - ", this.endTime)), o("div", { key: "3450618726c762232151511fd28570834cf07cc4", class: "booking-participants" }), !n && o("div", { class: "button-container" }, o("div", { class: {
81
+ footer: !0,
82
+ "no-footer": ((s = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : s.hide_cancellation_options) && ((b = (c = this.configSettings) == null ? void 0 : c.scheduler) == null ? void 0 : b.hide_rescheduling_options) || ((h = this.configSettings) == null ? void 0 : h.booking_type) === "organizer-confirmation",
83
+ "no-template-cols": !!((C = (u = this.configSettings) == null ? void 0 : u.scheduler) != null && C.hide_cancellation_options) || !!((L = (D = this.configSettings) == null ? void 0 : D.scheduler) != null && L.hide_rescheduling_options)
84
+ } }, !((m = (p = this.configSettings) == null ? void 0 : p.scheduler) != null && m.hide_cancellation_options) && o("button-component", { variant: "destructive", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, `${i.t("cancelBookingButton")}`), !((R = (E = this.configSettings) == null ? void 0 : E.scheduler) != null && R.hide_rescheduling_options) && o("button-component", { variant: "basic", onClick: this.handleRescheduleButtonClicked, disabled: this.isLoading, part: "nbec__button-outline nbec__reschedule-cta" }, `${i.t("rescheduleBookingButton")}`))))));
85
+ }
86
+ get host() {
87
+ return T(this);
88
+ }
89
+ static get watchers() {
90
+ return {
91
+ themeConfig: ["themeConfigChanged"]
92
+ };
93
+ }
94
+ };
95
+ Ne([
96
+ B({
97
+ name: "nylas-booked-event-card",
98
+ stateToProps: /* @__PURE__ */ new Map([
99
+ ["scheduler.bookingInfo", "bookingInfo"],
100
+ ["scheduler.rescheduleBookingId", "rescheduleBookingId"],
101
+ ["scheduler.selectedTimezone", "selectedTimezone"],
102
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
103
+ ["scheduler.isLoading", "isLoading"],
104
+ ["scheduler.selectedLanguage", "selectedLanguage"],
105
+ ["scheduler.configSettings", "configSettings"],
106
+ ["scheduler.themeConfig", "themeConfig"],
107
+ ["scheduler.hour12", "hour12"]
108
+ ]),
109
+ eventToProps: {
110
+ cancelBookingButtonClicked: async (e, n) => {
111
+ n.scheduler.setCancel(e.detail.bookingId);
112
+ },
113
+ rescheduleButtonClicked: async (e, n) => {
114
+ const a = await n.scheduler.setReschedule(e.detail.bookingId), { errorHandler: l } = e.detail;
115
+ l && (!a || "error" in a) && l(a);
116
+ },
117
+ rescheduleBookedEventError: async (e, n) => {
118
+ d("nylas-booked-event-card", "rescheduleBookedEventError", e.detail);
119
+ },
120
+ cancelBookedEventValidationError: async (e, n) => {
121
+ d("nylas-booked-event-card", "cancelBookedEventValidationError", e.detail);
122
+ }
123
+ },
124
+ fireRegisterEvent: !0
125
+ }),
126
+ A("design:type", Function),
127
+ A("design:paramtypes", []),
128
+ A("design:returntype", void 0)
129
+ ], ve.prototype, "render", null);
130
+ ve.style = Me;
131
+ const He = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}.cta{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{grid-template-columns:1fr}}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family);font-size:16px}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}.button-content{display:flex;gap:4px;align-items:center}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%}input[type=text]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}button-component.remove-guest{position:absolute;height:51px;right:0}button-component.remove-guest.error button{border-color:var(--nylas-error)}button-component.remove-guest button{height:inherit;border-top-left-radius:initial;border-bottom-left-radius:initial;border:none !important;border-left:1px solid var(--nylas-base-300) !important}button-component.remove-guest button:hover,button-component.remove-guest button:focus{outline:1px solid var(--nylas-primary) !important;color:var(--nylas-primary)}button-component.back button{--dot-color:var(--nylas-base-800)}.guest-email-input{position:relative;display:flex;width:100%}multi-select-dropdown::part(msd_dropdown-label){margin-bottom:4px}multi-select-dropdown::part(msd_dropdown_error){font-size:16px}multi-select-dropdown::part(msd_dropdown-button){height:52px;border-color:var(--nylas-base-300)}multi-select-dropdown::part(msd_dropdown-button--error){border-width:2px;border-color:var(--nylas-error)}', Ae = He;
132
+ var qe = function(e, n, a, l) {
133
+ var r = arguments.length, t = r < 3 ? n : l === null ? l = Object.getOwnPropertyDescriptor(n, a) : l, s;
134
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
135
+ t = Reflect.decorate(e, n, a, l);
136
+ else
137
+ for (var c = e.length - 1; c >= 0; c--)
138
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(n, a, t) : s(n, a)) || t);
139
+ return r > 3 && t && Object.defineProperty(n, a, t), t;
140
+ }, q = function(e, n) {
141
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
142
+ return Reflect.metadata(e, n);
143
+ };
144
+ const $ = /^[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])?)*$/, Ce = class {
145
+ constructor(e) {
146
+ w(this, e), this.nameChanged = f(this, "nameChanged", 7), this.emailChanged = f(this, "emailChanged", 7), this.backButtonClicked = f(this, "backButtonClicked", 7), this.detailsConfirmed = f(this, "detailsConfirmed", 7), this.bookingFormError = f(this, "bookingFormError", 7), this.bookingFormSubmitted = f(this, "bookingFormSubmitted", 7), this.handleGuestChange = (n, a) => {
147
+ this.resetGuestEmailError(n);
148
+ const l = [...this.guestEmails];
149
+ l[n] = ge(a), this.guestEmails = [...l];
150
+ }, this.handleGuestBlur = (n, a) => {
151
+ if (this.resetGuestEmailError(n), a === "") {
152
+ this.guestEmailErrors[n] = i.t("fieldRequired", { field: i.t("email") });
153
+ return;
154
+ }
155
+ if (!$.test(a)) {
156
+ this.guestEmailErrors[n] = i.t("invalidInputFormat", { field: i.t("email") });
157
+ return;
158
+ }
159
+ this.handleGuestChange(n, a);
160
+ }, this.addGuestButtonClickedHandler = (n) => {
161
+ n.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
162
+ }, this.removeGuestButtonClickHandler = (n, a) => {
163
+ n.preventDefault(), this.resetGuestEmailError(a);
164
+ const l = [...this.guestEmails];
165
+ l.splice(a, 1), this.guestEmails = [...l];
166
+ }, this.handleBackButtonClicked = (n) => {
167
+ n.preventDefault(), this.backButtonLoading = !0, this.backButtonClicked.emit();
168
+ }, this.bookButtonClickedHandler = async (n) => {
169
+ var h, u, C, D, L;
170
+ if (n.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
171
+ return;
172
+ d("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
173
+ const l = this.name, r = this.email;
174
+ if (!l || l === "") {
175
+ this.isNameValid = !1, this.validationError.name = i.t("fieldRequired", { field: i.t("name") }) || "Name is required", this.bookingFormError.emit({
176
+ title: "Booking form error",
177
+ description: "Name is required"
178
+ });
179
+ return;
180
+ }
181
+ if (!r || r === "") {
182
+ this.isEmailValid = !1, this.validationError.email = i.t("fieldRequired", { field: i.t("email") }) || "Email is required", this.bookingFormError.emit({
183
+ title: "Booking form error",
184
+ description: "Email is required"
185
+ });
186
+ return;
187
+ }
188
+ if (!$.test(r)) {
189
+ this.isEmailValid = !1, this.validationError.email = i.t("invalidInputFormat", { field: i.t("email") }), this.bookingFormError.emit({
190
+ title: "Booking form error",
191
+ description: i.t("invalidInputFormat", { field: i.t("email") }) || "Invalid email"
192
+ });
193
+ return;
194
+ }
195
+ let t = [];
196
+ if (this.guestEmails.length > 0) {
197
+ let p = !1;
198
+ if (this.guestEmails.forEach((m, E) => {
199
+ m === "" ? (p = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [E]: i.t("fieldRequired", { field: i.t("email") }) }) : $.test(m) || (p = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [E]: i.t("invalidInputFormat", { field: i.t("email") }) });
200
+ }), p) {
201
+ this.bookingFormError.emit({
202
+ title: "Booking form error",
203
+ description: i.t("invalidInputFormat", { field: i.t("guestEmail") }) || "Invalid guest email"
204
+ });
205
+ return;
206
+ }
207
+ t = this.guestEmails.map((m) => ({ name: m.trim(), email: m.trim() }));
208
+ }
209
+ const s = {}, c = ((u = (h = this.configSettings) == null ? void 0 : h.scheduler) == null ? void 0 : u.additional_fields) || {}, b = ((D = (C = this.configSettings) == null ? void 0 : C.booking) == null ? void 0 : D.additional_fields) || {};
210
+ (L = this.bookingInfo) != null && L.additionalFields && Object.entries(this.bookingInfo.additionalFields).forEach(([p, m]) => {
211
+ p in c && typeof m.value < "u" && (s[p] = m.value);
212
+ }), Object.entries(c).forEach(([p, m]) => {
213
+ if (!(p in s)) {
214
+ const E = b[p] || m.default || "";
215
+ s[p] = E;
216
+ }
217
+ }), this.detailsConfirmed.emit({
218
+ primaryParticipant: {
219
+ name: l,
220
+ email: r
221
+ },
222
+ guests: t,
223
+ additionalFields: { ...s, ...this.additionalFields }
224
+ });
225
+ }, this.updateAdditionalFields = (n, a) => {
226
+ this.additionalFields && (this.additionalFields[n] = a);
227
+ }, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.additionalFields = {}, this.validationError = { name: "", email: "" }, this.backButtonLoading = !1, this.firstRender = !0;
228
+ }
229
+ connectedCallback() {
230
+ }
231
+ disconnectedCallback() {
232
+ }
233
+ componentWillLoad() {
234
+ d("nylas-booking-form", "componentWillLoad", this.bookingInfo);
235
+ }
236
+ componentDidLoad() {
237
+ var e;
238
+ d("nylas-booking-form", "componentDidLoad", this.bookingInfo), (e = this.configSettings) != null && e.booking ? this.configSettingsChangedHandler(this.configSettings) : this.bookingInfo && this.bookingInfoChangedHandler(this.bookingInfo), this.applyThemeConfig(this.themeConfig);
239
+ }
240
+ componentDidRender() {
241
+ this.firstRender && this.applyThemeConfig(this.themeConfig);
242
+ }
243
+ bookingInfoChangedHandler(e) {
244
+ e && e.primaryParticipant && (this.name = e.primaryParticipant.name || this.name, this.email = e.primaryParticipant.email || this.email), e != null && e.guests && Array.isArray(e.guests) && (this.guestEmails = e.guests.map((n) => n.email));
245
+ }
246
+ configSettingsChangedHandler(e) {
247
+ var n, a, l, r, t, s, c, b, h, u;
248
+ !((a = (n = this.bookingInfo) == null ? void 0 : n.primaryParticipant) != null && a.name) && e && ((r = (l = e.booking) == null ? void 0 : l.guest) != null && r.name) && (this.name = e.booking.guest.name || this.name), !((s = (t = this.bookingInfo) == null ? void 0 : t.primaryParticipant) != null && s.email) && e && ((b = (c = e.booking) == null ? void 0 : c.guest) != null && b.email) && (this.email = e.booking.guest.email || this.email), !((h = this.bookingInfo) != null && h.guests) && ((u = e == null ? void 0 : e.booking) != null && u.additional_guests) && Array.isArray(e.booking.additional_guests) && (this.guestEmails = e.booking.additional_guests.map((C) => C.email));
249
+ }
250
+ themeConfigChanged(e) {
251
+ this.applyThemeConfig(e);
252
+ }
253
+ iterateFormComponents() {
254
+ const e = this.formRef, n = [
255
+ "input-component",
256
+ "button-component",
257
+ "select-dropdown",
258
+ "checkbox-component",
259
+ "radio-button-group",
260
+ "textarea-component",
261
+ "nylas-date-component",
262
+ "multi-select-dropdown"
263
+ ], a = [];
264
+ if (e) {
265
+ const l = (r) => {
266
+ Array.from(r.children).forEach((t) => {
267
+ const s = t.tagName.toLowerCase();
268
+ n.includes(s) && a.push(t), l(t);
269
+ });
270
+ };
271
+ l(e);
272
+ }
273
+ return a;
274
+ }
275
+ applyThemeConfig(e) {
276
+ if (e)
277
+ for (const [n, a] of Object.entries(e))
278
+ this.host.style.setProperty(`${n}`, a), this.iterateFormComponents().forEach((r) => {
279
+ var t;
280
+ r.style.setProperty(`${n}`, a), (t = r.shadowRoot) == null || t.host.style.setProperty(`${n}`, a);
281
+ });
282
+ }
283
+ changeName(e) {
284
+ this.isNameValid = !0, this.validationError.name = "", this.name = ze(e), this.nameChanged.emit(e);
285
+ }
286
+ changeEmail(e) {
287
+ this.isEmailValid = !0, this.validationError.email = "", this.email = ge(e), this.emailChanged.emit(e);
288
+ }
289
+ resetGuestEmailError(e) {
290
+ const n = { ...this.guestEmailErrors };
291
+ delete n[e], this.guestEmailErrors = { ...n };
292
+ }
293
+ nylasFormInputChangedHandler(e) {
294
+ switch (e.detail.name) {
295
+ case "name":
296
+ this.changeName(e.detail.value);
297
+ break;
298
+ case "email":
299
+ this.changeEmail(e.detail.value);
300
+ break;
301
+ default:
302
+ if (e.detail.error) {
303
+ this.bookingFormError.emit({
304
+ title: "Booking form error",
305
+ description: e.detail.error
306
+ });
307
+ return;
308
+ }
309
+ this.updateAdditionalFields(e.detail.name, e.detail.value);
310
+ break;
311
+ }
312
+ }
313
+ selectOptionChangedHandler(e) {
314
+ if (e.detail.error) {
315
+ this.bookingFormError.emit({
316
+ title: "Booking form error",
317
+ description: e.detail.error
318
+ });
319
+ return;
320
+ }
321
+ this.updateAdditionalFields(e.detail.name, e.detail.value);
322
+ }
323
+ selecedOptionsChangedHandler(e) {
324
+ if (e.detail.error) {
325
+ this.bookingFormError.emit({
326
+ title: "Booking form error",
327
+ description: e.detail.error
328
+ });
329
+ return;
330
+ }
331
+ const n = e.detail.value.toString();
332
+ this.updateAdditionalFields(e.detail.name, n);
333
+ }
334
+ switchToggledHandler(e) {
335
+ this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
336
+ }
337
+ checkboxToggledHandler(e) {
338
+ this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
339
+ }
340
+ radioChangedHandler(e) {
341
+ this.updateAdditionalFields(e.detail.name, e.detail.value);
342
+ }
343
+ dropdownDefaultSelectedHandler(e) {
344
+ this.updateAdditionalFields(e.detail.name, e.detail.value);
345
+ }
346
+ render() {
347
+ var e, n, a, l, r, t, s, c, b, h, u, C, D, L, p, m, E, R, ne;
348
+ return o(k, { key: "7cc64499522157e62c5703990effe640e032794f" }, o("form", { key: "14b8c18e942c2b30027dd4ab7e9f50be749b6d8a", onSubmit: (_) => this.bookButtonClickedHandler(_), ref: (_) => this.formRef = _, noValidate: !0 }, o("div", { key: "df00121eb4e6491ce7a758690c0bb2fdb3afd2c0", class: "nylas-booking-form", part: "nbf" }, o("div", { key: "f54bdfab54066557fa20defcc90bba5b33211616", class: "input-wrapper", part: "nbf__input-wrapper" }, o("input-component", { key: "b4fb9a672fb708ebc47084c9978fc6c526dda804", label: i.t("name"), name: "name", id: "name", defaultValue: ((n = (e = this.bookingInfo) == null ? void 0 : e.primaryParticipant) == null ? void 0 : n.name) || ((r = (l = (a = this.configSettings) == null ? void 0 : a.booking) == null ? void 0 : l.guest) == null ? void 0 : r.name) || this.name, placeholder: i.t("namePlaceholder"), type: "text", readOnly: ((s = (t = this.bookingInfo) == null ? void 0 : t.primaryParticipant) == null ? void 0 : s.nameReadOnly) || !1, required: !0, requiredError: i.t("fieldRequired", { field: i.t("name") }), patternError: i.t("invalidInputFormat", { field: i.t("name") }), part: "nbf__input-textfield" })), o("div", { key: "44f5979a3aacfaedf6baa124ddf3cae468f71e19", class: "input-wrapper", part: "nbf__input-wrapper" }, o("input-component", { key: "5e72e7aa54a18a6a3b441a6d3d03c8b08246bc07", label: i.t("email"), name: "email", id: "email", pattern: $, defaultValue: ((b = (c = this.bookingInfo) == null ? void 0 : c.primaryParticipant) == null ? void 0 : b.email) || ((C = (u = (h = this.configSettings) == null ? void 0 : h.booking) == null ? void 0 : u.guest) == null ? void 0 : C.email) || this.email, placeholder: i.t("emailPlaceholder"), type: "email", readOnly: ((L = (D = this.bookingInfo) == null ? void 0 : D.primaryParticipant) == null ? void 0 : L.emailReadOnly) || !1, required: !0, requiredError: i.t("fieldRequired", { field: i.t("email") }), patternError: i.t("invalidInputFormat", { field: i.t("email") }), part: "nbf__input-textfield" })), ((m = (p = this.configSettings) == null ? void 0 : p.scheduler) == null ? void 0 : m.hide_additional_guests) !== !0 && o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, this.guestEmails.map((_, y) => o("div", { class: "input-wrapper button-wrapper" }, o("label", { class: {
349
+ error: !!this.guestEmailErrors[y]
350
+ } }, i.t("guestEmail")), o("div", { class: "guest-email-input" }, o("input", { type: "email", id: `guest-email-${y}`, maxLength: 100, class: {
351
+ "guest-email": !0,
352
+ error: !!this.guestEmailErrors[y]
353
+ }, placeholder: i.t("guestEmailPlaceholder"), value: _, "data-index": y, part: "nbf__input-textfield", onBlur: (v) => {
354
+ var g;
355
+ return this.handleGuestBlur(y, (g = v.target) == null ? void 0 : g.value);
356
+ }, onInput: (v) => {
357
+ var g;
358
+ return this.handleGuestChange(y, (g = v.target) == null ? void 0 : g.value);
359
+ } }), o("button-component", { variant: "basic", tooltip: "Remove guest", onClick: (v) => this.removeGuestButtonClickHandler(v, y), class: {
360
+ "remove-guest": !0,
361
+ error: !!this.guestEmailErrors[y]
362
+ } }, o("close-icon", null))), o("p", { class: "help-text" }, this.guestEmailErrors[y]))), o("button-component", { class: "add-guest", variant: "invisible", part: "nbf__button-ghost", onClick: (_) => this.addGuestButtonClickedHandler(_) }, o("div", { class: "button-content" }, o("add-circle-icon", { slot: "icon" }), this.guestEmails.length > 0 ? `${i.t("addAnotherGuest")}` : `${i.t("addGuest")}`))), (ne = Object.entries(((R = (E = this.configSettings) == null ? void 0 : E.scheduler) == null ? void 0 : R.additional_fields) || {})) == null ? void 0 : ne.sort((_, y) => _[1].order - y[1].order).map((_) => {
363
+ var ae, oe, te, le, re, se, ie, ce, de, fe, ye, be, he;
364
+ const y = _[1], v = y.label, g = _[0], x = ((te = (oe = (ae = this.bookingInfo) == null ? void 0 : ae.additionalFields) == null ? void 0 : oe[g]) == null ? void 0 : te.value) || ((se = (re = (le = this.configSettings) == null ? void 0 : le.booking) == null ? void 0 : re.additional_fields) == null ? void 0 : se[g]) || y.default || "", I = ((de = (ce = (ie = this.bookingInfo) == null ? void 0 : ie.additionalFields) == null ? void 0 : ce[g]) == null ? void 0 : de.readOnly) || !1;
365
+ switch (y.type) {
366
+ case "dropdown":
367
+ return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("select-dropdown", { label: v, name: g, id: g, readOnly: I, withSearch: !1, emptyValue: i.t("nylasBookingCalendarPicker.selectOptionLabel"), defaultSelectedOption: x ? { value: x, label: x } : void 0, options: [
368
+ { value: "", label: i.t("nylasBookingCalendarPicker.selectOptionLabel") },
369
+ ...((fe = y.options) == null ? void 0 : fe.map((z) => ({ value: z, label: z }))) || []
370
+ ], required: y.required, exportparts: "sd_dropdown: nbf__dropdown, sd_dropdown-button: nbf__dropdown-button, sd_dropdown-content: nbf__dropdown-content" }));
371
+ case "checkbox":
372
+ return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("checkbox-component", { readOnly: I, label: v, name: g, id: g, checked: x === "true", required: y.required, part: "nbf__checkbox-component" }));
373
+ case "radio_button":
374
+ return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("radio-button-group", { label: v, name: g, id: g, readOnly: I, defaultSelectedValue: x || ((ye = y.options) == null ? void 0 : ye[0]) || "", options: (be = y.options) == null ? void 0 : be.map((z) => ({ value: z, label: z })), required: y.required, part: "nbf__radio-button-group" }));
375
+ case "multi_line_text":
376
+ return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("textarea-component", { readOnly: I, label: v, defaultValue: x, name: g, id: g, required: y.required, part: "nbf__textarea-component" }));
377
+ case "date":
378
+ return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("nylas-date-component", { readOnly: I, label: v, defaultValue: x, name: g, id: g, required: y.required, part: "nbf__date-component" }));
379
+ case "multi_select": {
380
+ const z = (x == null ? void 0 : x.split(",").map((j) => j.trim())) || [];
381
+ return o("div", null, o("multi-select-dropdown", { label: v, name: g, id: g, readOnly: I, multipleOptionsSelectedLabel: i.t("multipleOptionsSelected"), options: (he = y.options) == null ? void 0 : he.map((j) => ({ value: j, label: j, selected: z.includes(j) })), required: y.required, exportparts: "msd_dropdown: nbf__ms_dropdown, msd_dropdown-label: nbf__ms_dropdown-label, msd_dropdown-button: nbf__ms_dropdown-button, msd_dropdown-content: nbf__ms_dropdown-content, msd_dropdown_error: nbf__ms_dropdown_error, msd_dropdown-button--error: nbf__ms_dropdown-button--error" }));
382
+ }
383
+ case "metadata":
384
+ return null;
385
+ default:
386
+ return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("input-component", { label: v, name: g, id: g, type: y.type, readOnly: I, defaultValue: x || "", requiredError: i.t("fieldRequired", { field: v }), required: y.required, part: "nbf__input-textfield" }));
387
+ }
388
+ })), o("div", { key: "ceca163a222c8be615a63d36f15e1dcdad40c08c", class: "cta" }, o("button-component", { key: "300ecbc4bffd1abe7d89684000ea958457392650", variant: "basic", class: "back", part: "nbf__button-outline", isLoading: this.backButtonLoading && this.isLoading, onClick: this.handleBackButtonClicked }, o("slot", { key: "3f3ab4bd1654a53941685961252c57138dbd9cc5", name: "booking-form-back-label" }, `${i.t("backButton")}`)), o("button-component", { key: "f1e3ecf792c87519589b83678d607bf12756f209", variant: "primary", isLoading: !this.backButtonLoading && this.isLoading, disabled: this.isLoading, part: "nbf__button-primary", type: "submit" }, o("slot", { key: "75e9978b761610c37daf981520dc6e372e02fb38", name: "booking-form-book-label" }, `${i.t("bookNowButton")}`)))));
389
+ }
390
+ get host() {
391
+ return T(this);
392
+ }
393
+ static get watchers() {
394
+ return {
395
+ bookingInfo: ["bookingInfoChangedHandler"],
396
+ configSettings: ["configSettingsChangedHandler"],
397
+ themeConfig: ["themeConfigChanged"]
398
+ };
399
+ }
400
+ };
401
+ qe([
402
+ B({
403
+ name: "nylas-booking-form",
404
+ stateToProps: /* @__PURE__ */ new Map([
405
+ ["scheduler.isLoading", "isLoading"],
406
+ ["scheduler.bookingInfo", "bookingInfo"],
407
+ ["scheduler.eventInfo", "eventInfo"],
408
+ ["scheduler.configSettings", "configSettings"],
409
+ ["scheduler.themeConfig", "themeConfig"]
410
+ ]),
411
+ eventToProps: {
412
+ backButtonClicked: async (e, n) => {
413
+ n.scheduler.toggleAdditionalData(!1);
414
+ },
415
+ nameChanged: async (e, n) => {
416
+ n.scheduler.setParticipantName(e.detail);
417
+ },
418
+ emailChanged: async (e, n) => {
419
+ n.scheduler.setParticipantEmail(e.detail);
420
+ },
421
+ detailsConfirmed: async (e, n) => {
422
+ d("nylas-booking-form", "detailsConfirmed", e.detail);
423
+ },
424
+ bookingFormSubmitted: async (e, n) => {
425
+ d("nylas-booking-form", "bookingFormSubmitted", e.detail);
426
+ },
427
+ bookingFormError: async (e, n) => {
428
+ d("nylas-booking-form", "bookingFormError", e.detail);
429
+ }
430
+ },
431
+ fireRegisterEvent: !0
432
+ }),
433
+ q("design:type", Function),
434
+ q("design:paramtypes", []),
435
+ q("design:returntype", void 0)
436
+ ], Ce.prototype, "render", null);
437
+ Ce.style = Ae;
438
+ const Ze = ':host{--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;display:block;width:400px;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form form{width:100%}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:16px;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600);padding-bottom:1.25rem}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}.footer{display:grid;grid-template-columns:1fr 1fr;width:100%;padding-top:1.25rem;gap:1rem;border-top:1px solid var(--nylas-base-200);margin-top:1.25rem}', Ge = Ze;
439
+ var We = function(e, n, a, l) {
440
+ var r = arguments.length, t = r < 3 ? n : l === null ? l = Object.getOwnPropertyDescriptor(n, a) : l, s;
441
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
442
+ t = Reflect.decorate(e, n, a, l);
443
+ else
444
+ for (var c = e.length - 1; c >= 0; c--)
445
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(n, a, t) : s(n, a)) || t);
446
+ return r > 3 && t && Object.defineProperty(n, a, t), t;
447
+ }, Z = function(e, n) {
448
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
449
+ return Reflect.metadata(e, n);
450
+ };
451
+ const _e = class {
452
+ constructor(e) {
453
+ var n, a;
454
+ w(this, e), this.goBackButtonClicked = f(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = f(this, "cancelBookingFormSubmitted", 7), this.triggerValidation = f(this, "triggerValidation", 7), this.cancelBookedEventError = f(this, "cancelBookedEventError", 7), this.cancelBookingFormError = f(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
455
+ this.goBackButtonClicked.emit();
456
+ }, this.handleSubmitCancelBooking = (l) => {
457
+ var s, c, b;
458
+ if (this.triggerValidation.emit({}), l.preventDefault(), !this.cancellationReason) {
459
+ this.cancellationError = i.t("cancellationErrorMessage"), this.cancelBookingFormError.emit({ title: i.t("cancelBokingFormError"), description: i.t("cancellationErrorMessage") });
460
+ return;
461
+ }
462
+ const r = (c = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : c.min_cancellation_notice;
463
+ if (this.selectedTimeslot && r && new Date((b = this.selectedTimeslot) == null ? void 0 : b.start_time).getTime() - r * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime()) {
464
+ this.cancelBookedEventError.emit({
465
+ error: {
466
+ title: i.t("cancellationErrorTitle"),
467
+ message: i.t("minimumCancellationNoticeErrorMessage", { minCancellationNotice: r })
468
+ }
469
+ });
470
+ return;
471
+ }
472
+ d(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
473
+ const t = (h) => {
474
+ this.cancelBookedEventError.emit(h);
475
+ };
476
+ this.cancelBookingId ? this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, action: "cancel", reason: this.cancellationReason, errorHandler: t }) : this.rejectBookingId && this.cancelBookingFormSubmitted.emit({ bookingId: this.rejectBookingId, action: "reject", reason: this.cancellationReason, errorHandler: t });
477
+ }, this.cancelBookingId = void 0, this.rejectBookingId = void 0, this.selectedTimeslot = void 0, this.configSettings = void 0, this.eventInfo = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((a = (n = this.configSettings) == null ? void 0 : n.scheduler) == null ? void 0 : a.cancellation_policy) || "Your current timeslot will become available to others.";
478
+ }
479
+ configSettingsChangedHandler(e) {
480
+ var n;
481
+ this.cancellationPolicy = ((n = e == null ? void 0 : e.scheduler) == null ? void 0 : n.cancellation_policy) || "Your current timeslot will become available to others.";
482
+ }
483
+ themeConfigChanged(e) {
484
+ this.applyThemeConfig(e);
485
+ }
486
+ connectedCallback() {
487
+ d("[nylas-cancel-booking-form] Component connected");
488
+ }
489
+ async componentWillLoad() {
490
+ d("[nylas-cancel-booking-form] Component will load");
491
+ }
492
+ async componentDidLoad() {
493
+ d("[nylas-cancel-booking-form] Component did load"), this.cancelBookingId || console.warn('[nylas-cancel-booking-form] No booking ID provided, "cancelBookingId" prop is required.'), this.applyThemeConfig(this.themeConfig);
494
+ }
495
+ disconnectedCallback() {
496
+ d("[nylas-cancel-booking-form] Component disconnected");
497
+ }
498
+ applyThemeConfig(e) {
499
+ var n;
500
+ if (e)
501
+ for (const [a, l] of Object.entries(e))
502
+ this.host.style.setProperty(`${a}`, l), (n = this.textareaRef) == null || n.style.setProperty(`${a}`, l);
503
+ }
504
+ handleNylasFormInputChanged(e) {
505
+ this.triggerValidation.emit({}), e.detail.name === "cancel-reason" && (this.cancellationReason = e.detail.value, this.cancellationError = e.detail.error);
506
+ }
507
+ render() {
508
+ var e, n;
509
+ return o(k, { key: "733c136e4a80782ac18c8d52e053d26cdcceaa67", part: "ncbf" }, o("div", { key: "108279e83820f644da85d6c89edf09b9bcea3700", class: "nylas-cancel-booking-form", part: "ncbf__card" }, o("div", { key: "ffc95389f08a71b9892eaf27505700ff03331bc9", class: "nylas-cancel-booking-form__calendar-icon", part: "ncbf__icon" }, o("calendar-cancel-icon", { key: "5993111a1f702bc24d15d10e3b1fb40017820e4a" })), o("h3", { key: "24ce0017beeb98abebef2276d2d1b8642cc31a7a", class: "nylas-cancel-booking-form__title", part: "ncbf__title" }, i.t("cancelBookingTitle")), o("div", { key: "8708735caa18b7f16da87d8403dba66f9cccf80f", class: "nylas-cancel-booking-form__description", part: "ncbf__description" }, (n = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && n.cancellation_policy ? this.cancellationPolicy : `${i.t("cancelBookingMessage")}`), o("form", { key: "917b25ea4259080e48d1bca6f889d9749cab8684", onSubmit: this.handleSubmitCancelBooking }, o("textarea-component", { key: "b0242c5184c55413249cc9b3fc834c145725aa58", id: "cancel-reason", name: "cancel-reason", ref: (a) => this.textareaRef = a, required: !0, label: i.t("reasonForCancellation"), class: this.cancellationError ? "error" : "", part: "ncbf__reason-textarea", defaultValue: this.cancellationReason }), o("div", { key: "dbfd4caad12ab130460efaf266a5c8ae52da0f83", class: "footer" }, o("button-component", { key: "6ddab785c067eaa9eed443a14aaf42240a01f4c3", variant: "destructive", class: "cancel", type: "submit", part: "ncbf__button-cta", disabled: this.isLoading }, i.t("cancelBookingButton")), !!this.eventInfo && o("button-component", { variant: "basic", class: "back", part: "ncbf__button-outline", onClick: this.handleGoBackClicked }, i.t("goBackButton"))))));
510
+ }
511
+ get host() {
512
+ return T(this);
513
+ }
514
+ static get watchers() {
515
+ return {
516
+ configSettings: ["configSettingsChangedHandler"],
517
+ themeConfig: ["themeConfigChanged"]
518
+ };
519
+ }
520
+ };
521
+ We([
522
+ B({
523
+ name: "nylas-cancel-booking-form",
524
+ stateToProps: /* @__PURE__ */ new Map([
525
+ ["scheduler.configSettings", "configSettings"],
526
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
527
+ ["scheduler.eventInfo", "eventInfo"],
528
+ ["scheduler.isLoading", "isLoading"],
529
+ ["scheduler.cancelBookingId", "cancelBookingId"],
530
+ ["scheduler.rejectBookingId", "rejectBookingId"],
531
+ ["scheduler.themeConfig", "themeConfig"]
532
+ ]),
533
+ eventToProps: {
534
+ cancelBookingFormSubmitted: async (e, n) => {
535
+ const { action: a, errorHandler: l } = e.detail;
536
+ if (a === "cancel") {
537
+ const r = await n.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason);
538
+ l && (!r || "error" in r) && l(r);
539
+ } else if (a === "reject") {
540
+ const r = await n.scheduler.updateBooking({
541
+ bookingId: e.detail.bookingId,
542
+ status: "cancelled",
543
+ reason: e.detail.reason
544
+ });
545
+ l && (!r || "error" in r) && l(r);
546
+ }
547
+ },
548
+ goBackButtonClicked: async (e, n) => {
549
+ d("nylas-cancel-booking-form", "goBackButtonClicked", e.detail), n.scheduler.goBack();
550
+ },
551
+ cancelBookedEventError: async (e, n) => {
552
+ d("nylas-cancel-booking-form", "cancelBookedEventError", e.detail);
553
+ },
554
+ cancelBookingFormError: async (e, n) => {
555
+ d("nylas-cancel-booking-form", "cancelBookingFormError", e.detail);
556
+ }
557
+ },
558
+ fireRegisterEvent: !0
559
+ }),
560
+ Z("design:type", Function),
561
+ Z("design:paramtypes", []),
562
+ Z("design:returntype", void 0)
563
+ ], _e.prototype, "render", null);
564
+ _e.style = Ge;
565
+ const Ue = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-cancelled-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{width:100%}', Xe = Ue;
566
+ var Ye = function(e, n, a, l) {
567
+ var r = arguments.length, t = r < 3 ? n : l === null ? l = Object.getOwnPropertyDescriptor(n, a) : l, s;
568
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
569
+ t = Reflect.decorate(e, n, a, l);
570
+ else
571
+ for (var c = e.length - 1; c >= 0; c--)
572
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(n, a, t) : s(n, a)) || t);
573
+ return r > 3 && t && Object.defineProperty(n, a, t), t;
574
+ }, G = function(e, n) {
575
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
576
+ return Reflect.metadata(e, n);
577
+ };
578
+ const we = class {
579
+ constructor(e) {
580
+ w(this, e), this.closeCancelEventCardClicked = f(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = f(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
581
+ this.isClosing = !0;
582
+ const n = (a) => {
583
+ this.cancelledEventCardError.emit(a), this.isClosing = !1;
584
+ };
585
+ this.closeCancelEventCardClicked.emit({ errorHandler: n });
586
+ }, this.configSettings = void 0, this.themeConfig = void 0, this.cancelledEventInfo = void 0, this.isClosing = !1;
587
+ }
588
+ themeConfigChanged(e) {
589
+ this.applyThemeConfig(e);
590
+ }
591
+ connectedCallback() {
592
+ d("[nylas-cancelled-event-card] Component connected");
593
+ }
594
+ async componentWillLoad() {
595
+ d("[nylas-cancelled-event-card] Component will load");
596
+ }
597
+ async componentDidLoad() {
598
+ d("[nylas-cancelled-event-card] Component did load"), this.cancelledEventInfo || console.warn('[nylas-cancelled-event-card] No cancelled event info provided, "cancelledEventInfo" prop is required.'), this.applyThemeConfig(this.themeConfig);
599
+ }
600
+ disconnectedCallback() {
601
+ d("[nylas-cancelled-event-card] Component disconnected");
602
+ }
603
+ applyThemeConfig(e) {
604
+ if (e)
605
+ for (const [n, a] of Object.entries(e))
606
+ this.host.style.setProperty(`${n}`, a);
607
+ }
608
+ render() {
609
+ var e, n;
610
+ return o(k, { key: "d835492ddff51ad8cad3fa73b5dc88a82f6cfdd9", part: "ncec" }, o("div", { key: "b1cd60f3aad0acaa5c75e1e3fd83dd227fe20dfc", class: "nylas-cancelled-event-card", part: "ncec__card" }, o("div", { key: "3b9bc0d52e4b34421f76f8daec0ba64704d0c783", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, o("calendar-cancel-icon", { key: "abffc9703f1b417f7da3ed106cf88e917988ff89" })), o("h3", { key: "21d104aa9c67cd040b86fa01d5666e69f9335178", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, i.t("bookingCancelledTitle"), "!"), o("div", { key: "532eb9d62db4ae34c64b3d64c7a003b6842865be", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, i.t("bookingCancelledMessage"), " ", ((n = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : n.name) || "the participants", "."), o("div", { key: "b34aa321c0b1e485153a2dfa2ae38cca504be0b7", class: "nylas-cancelled-event-card__cta" }, o("button-component", { key: "519aa668e2397f1a32637590797aa9052e24a5ff", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${i.t("closingButton")}...` : `${i.t("closeButton")}`))));
611
+ }
612
+ get host() {
613
+ return T(this);
614
+ }
615
+ static get watchers() {
616
+ return {
617
+ themeConfig: ["themeConfigChanged"]
618
+ };
619
+ }
620
+ };
621
+ Ye([
622
+ B({
623
+ name: "nylas-cancelled-event-card",
624
+ stateToProps: /* @__PURE__ */ new Map([
625
+ ["scheduler.configSettings", "configSettings"],
626
+ ["scheduler.themeConfig", "themeConfig"],
627
+ ["scheduler.themeConfig", "themeConfig"]
628
+ ]),
629
+ eventToProps: {
630
+ closeCancelEventCardClicked: async (e, n) => {
631
+ const a = await n.scheduler.resetCancel(), { errorHandler: l } = e.detail;
632
+ l && (!a || "error" in a) && l(a);
633
+ },
634
+ cancelledEventCardError: async (e, n) => {
635
+ d("nylas-cancelled-event-card", "cancelledEventCardError", e.detail);
636
+ }
637
+ },
638
+ fireRegisterEvent: !0
639
+ }),
640
+ G("design:type", Function),
641
+ G("design:paramtypes", []),
642
+ G("design:returntype", void 0)
643
+ ], we.prototype, "render", null);
644
+ we.style = Xe;
645
+ const Je = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-confirmed-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-confirmed-event-card{width:inherit}}.nylas-confirmed-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-confirmed-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-confirmed-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-confirmed-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{width:100%}', Ke = Je;
646
+ var Qe = function(e, n, a, l) {
647
+ var r = arguments.length, t = r < 3 ? n : l === null ? l = Object.getOwnPropertyDescriptor(n, a) : l, s;
648
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
649
+ t = Reflect.decorate(e, n, a, l);
650
+ else
651
+ for (var c = e.length - 1; c >= 0; c--)
652
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(n, a, t) : s(n, a)) || t);
653
+ return r > 3 && t && Object.defineProperty(n, a, t), t;
654
+ }, W = function(e, n) {
655
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
656
+ return Reflect.metadata(e, n);
657
+ };
658
+ const xe = class {
659
+ constructor(e) {
660
+ w(this, e), this.closeConfirmEventCardClicked = f(this, "closeConfirmEventCardClicked", 7), this.confirmedEventCardError = f(this, "confirmedEventCardError", 7), this.handleCloseClicked = () => {
661
+ this.isClosing = !0;
662
+ const n = (a) => {
663
+ this.confirmedEventCardError.emit(a), this.isClosing = !1;
664
+ };
665
+ this.closeConfirmEventCardClicked.emit({ errorHandler: n });
666
+ }, this.configSettings = void 0, this.themeConfig = void 0, this.confirmedEventInfo = void 0, this.isClosing = !1;
667
+ }
668
+ themeConfigChanged(e) {
669
+ this.applyThemeConfig(e);
670
+ }
671
+ connectedCallback() {
672
+ d("[nylas-confirmed-event-card] Component connected");
673
+ }
674
+ async componentWillLoad() {
675
+ d("[nylas-confirmed-event-card] Component will load");
676
+ }
677
+ async componentDidLoad() {
678
+ d("[nylas-confirmed-event-card] Component did load"), this.confirmedEventInfo || console.warn('[nylas-confirmed-event-card] No confirmed event info provided, "confirmedEventInfo" prop is required.'), this.applyThemeConfig(this.themeConfig);
679
+ }
680
+ disconnectedCallback() {
681
+ d("[nylas-confirmed-event-card] Component disconnected");
682
+ }
683
+ applyThemeConfig(e) {
684
+ if (e)
685
+ for (const [n, a] of Object.entries(e))
686
+ this.host.style.setProperty(`${n}`, a);
687
+ }
688
+ render() {
689
+ var e, n;
690
+ return o(k, { key: "7d9b6138eeb5bf8f3e2d9552a609e0e92f4218c9", part: "ncec" }, o("div", { key: "3f310f8e06ce5b069ef9021890e4588adcd856e6", class: "nylas-confirmed-event-card", part: "ncec__card" }, o("div", { key: "0ab27b860a9160d6d6cf8b0e1ff0ba7a866c8102", class: "nylas-confirmed-event-card__calendar-icon", part: "ncec__icon" }, o("calendar-cancel-icon", { key: "f0b93912e1787c2f2d882590e8cae9a05a4ee577" })), o("h3", { key: "33f170e8c6a9db989b7f0b05702743c024bec621", class: "nylas-confirmed-event-card__title", part: "ncec__title" }, i.t("confirmedEventCardTitle"), "!"), o("div", { key: "7c4d191a266c9a2f748707ae1bd176c217a676e9", class: "nylas-confirmed-event-card__description", part: "ncec__description" }, i.t("confirmedEventCardDescription"), " ", ((n = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : n.name) || "the participants", "."), o("div", { key: "fb313a8a7cc9b7eb901e10f3cbc12e5b2faba00d", class: "nylas-confirmed-event-card__cta" }, o("button-component", { key: "c31d8980fdc428bc0c2950397eda010572c0e72f", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${i.t("closingButton")}...` : `${i.t("closeButton")}`))));
691
+ }
692
+ get host() {
693
+ return T(this);
694
+ }
695
+ static get watchers() {
696
+ return {
697
+ themeConfig: ["themeConfigChanged"]
698
+ };
699
+ }
700
+ };
701
+ Qe([
702
+ B({
703
+ name: "nylas-confirmed-event-card",
704
+ stateToProps: /* @__PURE__ */ new Map([
705
+ ["scheduler.configSettings", "configSettings"],
706
+ ["scheduler.themeConfig", "themeConfig"]
707
+ ]),
708
+ eventToProps: {
709
+ closeConfirmEventCardClicked: async (e, n) => {
710
+ const a = await n.scheduler.resetConfirm(), { errorHandler: l } = e.detail;
711
+ l && (!a || "error" in a) && l(a);
712
+ }
713
+ },
714
+ fireRegisterEvent: !0
715
+ }),
716
+ W("design:type", Function),
717
+ W("design:paramtypes", []),
718
+ W("design:returntype", void 0)
719
+ ], xe.prototype, "render", null);
720
+ xe.style = Ke;
721
+ const U = /* @__PURE__ */ new Date(), X = /* @__PURE__ */ new Date();
722
+ function H(e, n, a, l) {
723
+ function r(t) {
724
+ return e(t = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+t)), t;
725
+ }
726
+ return r.floor = (t) => (e(t = /* @__PURE__ */ new Date(+t)), t), r.ceil = (t) => (e(t = new Date(t - 1)), n(t, 1), e(t), t), r.round = (t) => {
727
+ const s = r(t), c = r.ceil(t);
728
+ return t - s < c - t ? s : c;
729
+ }, r.offset = (t, s) => (n(t = /* @__PURE__ */ new Date(+t), s == null ? 1 : Math.floor(s)), t), r.range = (t, s, c) => {
730
+ const b = [];
731
+ if (t = r.ceil(t), c = c == null ? 1 : Math.floor(c), !(t < s) || !(c > 0))
732
+ return b;
733
+ let h;
734
+ do
735
+ b.push(h = /* @__PURE__ */ new Date(+t)), n(t, c), e(t);
736
+ while (h < t && t < s);
737
+ return b;
738
+ }, r.filter = (t) => H((s) => {
739
+ if (s >= s)
740
+ for (; e(s), !t(s); )
741
+ s.setTime(s - 1);
742
+ }, (s, c) => {
743
+ if (s >= s)
744
+ if (c < 0)
745
+ for (; ++c <= 0; )
746
+ for (; n(s, -1), !t(s); )
747
+ ;
748
+ else
749
+ for (; --c >= 0; )
750
+ for (; n(s, 1), !t(s); )
751
+ ;
752
+ }), a && (r.count = (t, s) => (U.setTime(+t), X.setTime(+s), e(U), e(X), Math.floor(a(U, X))), r.every = (t) => (t = Math.floor(t), !isFinite(t) || !(t > 0) ? null : t > 1 ? r.filter(l ? (s) => l(s) % t === 0 : (s) => r.count(0, s) % t === 0) : r)), r;
753
+ }
754
+ const Ve = 1e3, Te = Ve * 60, en = Te * 60, N = en * 24, Y = H(
755
+ (e) => e.setHours(0, 0, 0, 0),
756
+ (e, n) => e.setDate(e.getDate() + n),
757
+ (e, n) => (n - e - (n.getTimezoneOffset() - e.getTimezoneOffset()) * Te) / N,
758
+ (e) => e.getDate() - 1
759
+ );
760
+ H((e) => {
761
+ e.setUTCHours(0, 0, 0, 0);
762
+ }, (e, n) => {
763
+ e.setUTCDate(e.getUTCDate() + n);
764
+ }, (e, n) => (n - e) / N, (e) => e.getUTCDate() - 1);
765
+ H((e) => {
766
+ e.setUTCHours(0, 0, 0, 0);
767
+ }, (e, n) => {
768
+ e.setUTCDate(e.getUTCDate() + n);
769
+ }, (e, n) => (n - e) / N, (e) => Math.floor(e / N));
770
+ const nn = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}.title{margin:0 -1.25rem;display:flex;flex-direction:column;padding:0 1.5rem;gap:0.5rem;border-bottom:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);color:var(--nylas-base-800)}.title h1{max-width:376px;margin-bottom:0;font-size:18px;line-height:20px;font-weight:600;display:flex;gap:0.5rem;align-items:center}.title p{margin-top:0;font-size:16px;display:flex;gap:0.5rem;align-items:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:24px}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 768px){.dates .date{width:-webkit-fill-available;width:-moz-available;width:fill-available}}@media screen and (max-width: 412px){.dates .date{height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}', an = nn;
771
+ var on = function(e, n, a, l) {
772
+ var r = arguments.length, t = r < 3 ? n : l === null ? l = Object.getOwnPropertyDescriptor(n, a) : l, s;
773
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
774
+ t = Reflect.decorate(e, n, a, l);
775
+ else
776
+ for (var c = e.length - 1; c >= 0; c--)
777
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(n, a, t) : s(n, a)) || t);
778
+ return r > 3 && t && Object.defineProperty(n, a, t), t;
779
+ }, J = function(e, n) {
780
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
781
+ return Reflect.metadata(e, n);
782
+ };
783
+ const Ee = class {
784
+ constructor(e) {
785
+ w(this, e), this.dateSelected = f(this, "dateSelected", 7), this.monthChanged = f(this, "monthChanged", 7), this.selectableDates = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedDate = void 0, this.selectedLanguage = void 0, this.isLoading = void 0, this.eventDuration = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.disableNextMonthButton = !1;
786
+ }
787
+ configSettingsChanged(e) {
788
+ var r;
789
+ const n = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), a = (r = e == null ? void 0 : e.scheduler) == null ? void 0 : r.available_days_in_future;
790
+ if (a === void 0)
791
+ return;
792
+ pe(/* @__PURE__ */ new Date(), a).getTime() < n.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
793
+ }
794
+ selectedLanguageChanged(e) {
795
+ i.changeLanguage(e);
796
+ }
797
+ themeConfigChanged(e) {
798
+ this.applyThemeConfig(e);
799
+ }
800
+ selectedDateChanged(e) {
801
+ (!e || !P(e, this.month)) && (this.month = e || /* @__PURE__ */ new Date()), this.dates = this.getDates();
802
+ }
803
+ connectedCallback() {
804
+ }
805
+ disconnectedCallback() {
806
+ }
807
+ componentWillLoad() {
808
+ }
809
+ componentDidLoad() {
810
+ d("[nylas-date-picker] Component did load"), this.applyThemeConfig(this.themeConfig), this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates();
811
+ }
812
+ applyThemeConfig(e) {
813
+ if (e)
814
+ for (const [n, a] of Object.entries(e))
815
+ this.host.style.setProperty(`${n}`, a);
816
+ }
817
+ getDates() {
818
+ const e = Se(this.month), n = Re(this.month);
819
+ return Y.range(Y.offset(n, -n.getDay()), Y.offset(e, 7 - e.getDay()));
820
+ }
821
+ selectDate(e) {
822
+ this.dateSelected.emit(e);
823
+ }
824
+ changeMonth(e) {
825
+ var r, t;
826
+ this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
827
+ const n = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), a = (t = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : t.available_days_in_future;
828
+ pe(/* @__PURE__ */ new Date(), a).getTime() < n.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month);
829
+ }
830
+ isSelected(e, n, a) {
831
+ return e && n && O(e, n) && a && (a == null ? void 0 : a.length) > 0;
832
+ }
833
+ isDisabled(e, n) {
834
+ return e && (n == null ? void 0 : n.find((a) => M(a, e, this.selectedTimezone))) === void 0;
835
+ }
836
+ render() {
837
+ var e, n, a, l, r, t;
838
+ return o(k, { key: "de367c35af66e9f312be6682884062da9e747c9a", part: "ndp" }, o("div", { key: "80c028e4e630fa2a58359a2b8ad8425e24b21cc2", class: "nylas-date-picker" }, o("div", { key: "282dc9ba42e5fb652858d4ff0b49ea069db96175", class: "title", part: "ndp__title" }, (e = this.configSettings) != null && e.name ? o("h1", null, (n = this.configSettings) == null ? void 0 : n.name) : ((l = (a = this.configSettings) == null ? void 0 : a.organizer) == null ? void 0 : l.name) && o("h1", null, o("person-icon", null), ((t = (r = this.configSettings) == null ? void 0 : r.organizer) == null ? void 0 : t.name) || "Organizer"), o("p", { key: "d7f9d6deb57eafcd9b37f6a98e3e9afda74e143e" }, o("clock-icon", { key: "a54f0131170d81b2d8644b2d9d349d30654be393" }), this.eventDuration ? je(this.eventDuration) : `- ${i.t("time.minutes")}`)), o("div", { key: "e8924e6272011e68f6fc605b83f9816b4844e3b1", class: "header flex-row" }, o("h2", { key: "ce9bf342cfd4737f4693956ce62d6a8a2ade388d", part: "ndp__month-header" }, o("strong", { key: "02b93cc055a1445b32008e346ee9dd250f0b2b21" }, Fe(this.month.toLocaleDateString("en-US", { month: "long" }).toLowerCase())), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), o("div", { key: "b9cf990f4d25209e3058769a7903f731bc80fd2c", class: "pagination" }, o("button", { key: "2879994e18001a6fbb96cfd5f2ae4d22b17c4da4", title: "Previous month", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, o("chevron-icon", { key: "313a9663314b2e875ac4146a7d23838ac71a4336" })), o("button", { key: "5f87ad4833c10fa362e93cbbee20861cc6363466", title: "Next month", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, o("chevron-icon", { key: "408cd5ef79316815f929aec270309b3e5d8659b6" })))), o("div", { key: "ee100542f37d246a2cd7a2c27adf4ff0efcade18", class: "dates" }, [
839
+ i.t("days.sunday"),
840
+ i.t("days.monday"),
841
+ i.t("days.tuesday"),
842
+ i.t("days.wednesday"),
843
+ i.t("days.thursday"),
844
+ i.t("days.friday"),
845
+ i.t("days.saturday")
846
+ ].map((s) => o("div", { class: "day", part: "ndp__day" }, s)), this.dates.map((s, c) => {
847
+ var h;
848
+ const b = this.isDisabled(s, this.selectableDates);
849
+ return this.isLoading ? o("button", { disabled: !0, class: {
850
+ "date day-skeleton": !0,
851
+ "current-month": P(s, this.month)
852
+ }, style: { animationDelay: `${c * 20}ms` }, part: "ndp__date ndp__date--disabled" }, s.getDate()) : o("button", { class: {
853
+ date: !0,
854
+ selected: !!(this.selectedDate && O(s, this.selectedDate) && this.selectableDates && ((h = this.selectableDates) == null ? void 0 : h.length) > 0),
855
+ "current-day": O(s, /* @__PURE__ */ new Date()),
856
+ "current-month": P(s, this.month)
857
+ }, "aria-label": s.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: b, onClick: () => this.selectDate(s), part: `ndp__date ${this.isSelected(s, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${O(s, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${P(s, this.month) ? "ndp__date--current-month" : ""}` }, s.getDate());
858
+ }))));
859
+ }
860
+ get host() {
861
+ return T(this);
862
+ }
863
+ static get watchers() {
864
+ return {
865
+ configSettings: ["configSettingsChanged"],
866
+ selectedLanguage: ["selectedLanguageChanged"],
867
+ themeConfig: ["themeConfigChanged"],
868
+ selectedDate: ["selectedDateChanged"]
869
+ };
870
+ }
871
+ };
872
+ on([
873
+ B({
874
+ name: "nylas-date-picker",
875
+ stateToProps: /* @__PURE__ */ new Map([
876
+ ["scheduler.selectableDates", "selectableDates"],
877
+ ["scheduler.selectedDate", "selectedDate"],
878
+ ["scheduler.isLoading", "isLoading"],
879
+ ["scheduler.configSettings", "configSettings"],
880
+ ["scheduler.eventDuration", "eventDuration"],
881
+ ["scheduler.selectedLanguage", "selectedLanguage"],
882
+ ["scheduler.themeConfig", "themeConfig"],
883
+ ["scheduler.selectedTimezone", "selectedTimezone"]
884
+ ]),
885
+ eventToProps: {
886
+ dateSelected: async (e, n) => {
887
+ d("nylas-date-picker", "dateSelected", e.detail), n.scheduler.selectDate(e.detail);
888
+ },
889
+ monthChanged: async (e, n) => {
890
+ d("nylas-date-picker", "monthChanged", e.detail);
891
+ }
892
+ },
893
+ fireRegisterEvent: !0
894
+ }),
895
+ J("design:type", Function),
896
+ J("design:paramtypes", []),
897
+ J("design:returntype", void 0)
898
+ ], Ee.prototype, "render", null);
899
+ Ee.style = an;
900
+ const tn = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){border:none;padding:10px}select-dropdown::part(sd_dropdown-content){max-width:306px}@media screen and (max-width: 768px){select-dropdown::part(sd_dropdown-button-selected-label){max-width:80px}select-dropdown::part(sd_dropdown-content){width:100%;max-width:none}}', ln = tn;
901
+ var rn = function(e, n, a, l) {
902
+ var r = arguments.length, t = r < 3 ? n : l === null ? l = Object.getOwnPropertyDescriptor(n, a) : l, s;
903
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
904
+ t = Reflect.decorate(e, n, a, l);
905
+ else
906
+ for (var c = e.length - 1; c >= 0; c--)
907
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(n, a, t) : s(n, a)) || t);
908
+ return r > 3 && t && Object.defineProperty(n, a, t), t;
909
+ }, K = function(e, n) {
910
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
911
+ return Reflect.metadata(e, n);
912
+ };
913
+ const Be = class {
914
+ constructor(e) {
915
+ var n, a;
916
+ w(this, e), this.timezoneChanged = f(this, "timezoneChanged", 7), this.languageChanged = f(this, "languageChanged", 7), this.themeConfig = void 0, this.bookingInfo = void 0, this.selectedTimezone = ((n = this.bookingInfo) == null ? void 0 : n.timezone) || Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = ((a = this.bookingInfo) == null ? void 0 : a.language) || navigator.language;
917
+ }
918
+ themeConfigChanged(e) {
919
+ this.applyThemeConfig(e);
920
+ }
921
+ bookingInfoChangedHandler(e) {
922
+ e && (e != null && e.timezone) && this.changeTimezone(e.timezone), e && (e != null && e.language) && this.changeLanguage(e.language);
923
+ }
924
+ connectedCallback() {
925
+ }
926
+ disconnectedCallback() {
927
+ }
928
+ componentWillLoad() {
929
+ }
930
+ componentDidLoad() {
931
+ var e, n;
932
+ d("[nylas-locale-switch] Component did load"), this.applyThemeConfig(this.themeConfig), this.bookingInfo && ((e = this.bookingInfo) != null && e.timezone) && this.changeTimezone(this.bookingInfo.timezone), this.bookingInfo && ((n = this.bookingInfo) != null && n.language) && this.changeLanguage(this.bookingInfo.language);
933
+ }
934
+ applyThemeConfig(e) {
935
+ var n, a;
936
+ if (e)
937
+ for (const [l, r] of Object.entries(e))
938
+ this.host.style.setProperty(`${l}`, r), (n = this.timezoneRef) == null || n.style.setProperty(`${l}`, r), (a = this.languageRef) == null || a.style.setProperty(`${l}`, r);
939
+ }
940
+ changeTimezone(e) {
941
+ this.selectedTimezone = e, this.timezoneChanged.emit(e);
942
+ }
943
+ changeLanguage(e) {
944
+ this.selectedLanguage = e, this.languageChanged.emit(e);
945
+ }
946
+ nylasFormDropdownChangedHandler(e) {
947
+ const { name: n, value: a } = e.detail;
948
+ n === "timezone" ? this.changeTimezone(a) : n === "language" && this.changeLanguage(a);
949
+ }
950
+ getTimezoneLabelHTML(e) {
951
+ const n = Pe(e);
952
+ return o("span", { class: "timezone-label", style: {
953
+ display: "flex",
954
+ alignItems: "center",
955
+ justifyContent: "space-between",
956
+ width: "-webkit-fill-available"
957
+ } }, F[e], " ", o("span", { class: "timezone-offset", style: {
958
+ fontSize: "14px",
959
+ fontWeight: "400",
960
+ color: "var(--nylas-base-500)"
961
+ } }, n));
962
+ }
963
+ render() {
964
+ const e = Object.keys(F).map((a) => ({
965
+ labelHTML: this.getTimezoneLabelHTML(a),
966
+ label: F[a],
967
+ value: a
968
+ })), n = Object.keys(me).map((a) => ({
969
+ label: me[a],
970
+ value: a
971
+ }));
972
+ return o(k, { key: "1a324cb66322d9dd8cb552a36bd3990a592ee7e9" }, o("div", { key: "18e91795ed822ed59f22c72207ea53ea9766d887", class: "nylas-locale-switch", part: "nls" }, o("div", { key: "7eb5e5ed990f5816e9dd17b1c4d06db3f36191da", class: {
973
+ "select-wrapper": !0,
974
+ timezone: !0
975
+ }, part: "nls__timezone" }, o("select-dropdown", { key: "32323279c21ad428b38d80ad0e4a484f845f135e", name: "timezone", options: e, ref: (a) => this.timezoneRef = a, defaultSelectedOption: e.find((a) => a.value == this.selectedTimezone), exportparts: "sd_dropdown: nls__timezone-dropdown, sd_dropdown-button: nls__timezone-drop-button, sd_dropdown-button-selected-label: nls__timezone-drop-button-selected-label, sd_dropdown-content: nls__timezone-drop-content, sd_dropdown_label: nls__timezone-drop-label" }, o("span", { key: "8c8364acc7d8e52ba170fd1de2a85cae15461e03", slot: "select-icon" }, o("globe-icon", { key: "cd491eef36d00660976120510449e2d2f3e46781", width: "20", height: "20" })))), o("div", { key: "80fcd6d80efd4f69cd8b0cec376ac105f45cb5a1", class: {
976
+ "select-wrapper": !0,
977
+ language: !0
978
+ }, part: "nls__language" }, o("select-dropdown", { key: "578f4a7ddf488cac7eea767c4346167d7bb912ac", name: "language", options: n, ref: (a) => this.languageRef = a, defaultSelectedOption: n.find((a) => a.value == this.selectedLanguage), exportparts: "sd_dropdown: nls__language-dropdown, sd_dropdown-button: nls__language-drop-button, sd_dropdown-content: nls__language-drop-content, sd_dropdown_label: nls__language-drop-label" }, o("span", { key: "e35c2a746e10701f434aaaa3194b4656fc525404", slot: "select-icon" }, o("translate-icon", { key: "7981ceb4834167c19ba6655d558a9a3ae28e5829", width: "20", height: "20" }))))));
979
+ }
980
+ get host() {
981
+ return T(this);
982
+ }
983
+ static get watchers() {
984
+ return {
985
+ themeConfig: ["themeConfigChanged"],
986
+ bookingInfo: ["bookingInfoChangedHandler"]
987
+ };
988
+ }
989
+ };
990
+ rn([
991
+ B({
992
+ name: "nylas-locale-switch",
993
+ stateToProps: /* @__PURE__ */ new Map([
994
+ ["scheduler.selectedLanguage", "selectedLanguage"],
995
+ ["scheduler.selectedTimezone", "selectedTimezone"],
996
+ ["scheduler.bookingInfo", "bookingInfo"],
997
+ ["scheduler.themeConfig", "themeConfig"]
998
+ ]),
999
+ eventToProps: {
1000
+ timezoneChanged: async (e, n) => {
1001
+ d("nylas-locale-switch", "timezoneChanged", e.detail), n.scheduler.selectTimezone(e.detail);
1002
+ },
1003
+ languageChanged: async (e, n) => {
1004
+ d("nylas-locale-switch", "languageChanged", e.detail), n.scheduler.selectLanguage(e.detail);
1005
+ }
1006
+ },
1007
+ fireRegisterEvent: !0
1008
+ }),
1009
+ K("design:type", Function),
1010
+ K("design:paramtypes", []),
1011
+ K("design:returntype", void 0)
1012
+ ], Be.prototype, "render", null);
1013
+ Be.style = ln;
1014
+ const sn = ".sc-nylas-logo-h{display:flex}", cn = sn, dn = class {
1015
+ constructor(e) {
1016
+ w(this, e), this.width = "69", this.height = "24";
1017
+ }
1018
+ render() {
1019
+ return o("svg", { key: "2754c1399a5b051918a35626bcc7ef8c4469bdf6", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, o("g", { key: "305275b038021ca3f3e6dcc0fe2ae5b52386799b", "clip-path": "url(#clip0_455_3543)" }, o("path", { key: "522a651226ea7a0d10bb4cdb3cb81b4a73181313", d: "M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z", fill: "currentColor" }), o("path", { key: "ddbac2352d168bd3f351a2cef55c63afe7cfa5c8", d: "M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z", fill: "currentColor" }), o("path", { key: "3c6a6c66f1c3aace9405ebd584ca2ed5a0ded524", d: "M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z", fill: "currentColor" }), o("path", { key: "a7d53e8a5700b0fbdb0852e1986196e1201d6e29", d: "M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z", fill: "currentColor" }), o("path", { key: "39f69581e0ce463af015016ea0616cfb0d22cd5a", d: "M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z", fill: "currentColor" }), o("path", { key: "a915b2d3150d9d27eb2d94afdc9c525145efa54b", d: "M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z", fill: "currentColor" }), o("path", { key: "8f55641ad378bc25cdfa0de84eead63106874fee", d: "M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z", fill: "currentColor" }), o("path", { key: "aaaf906bb3dd324c7819b7551943abc5070bdf6b", d: "M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z", fill: "currentColor" })), o("defs", { key: "19edd2e50594677dee4a329eaa785a97c069a328" }, o("clipPath", { key: "8150c454a41dae533856dbf1458e1758f3816c71", id: "clip0_455_3543" }, o("rect", { key: "6f59a86c801dfcd1a4e7db6f151f479ad76a2a7b", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
1020
+ }
1021
+ };
1022
+ dn.style = cn;
1023
+ const fn = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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);background:rgb(255, 248, 248)}.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}', yn = fn, bn = class {
1024
+ constructor(e) {
1025
+ w(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
1026
+ }
1027
+ onError(e) {
1028
+ d(`[nylas-notification] Error: ${e.detail.notification.title}`), this.handleNotification(e);
1029
+ }
1030
+ onWarning(e) {
1031
+ d(`[nylas-notification] Warning: ${e.detail.notification.title}`), this.handleNotification(e);
1032
+ }
1033
+ onInfo(e) {
1034
+ d(`[nylas-notification] Info: ${e.detail.notification.title}`), this.handleNotification(e);
1035
+ }
1036
+ onSuccess(e) {
1037
+ d(`[nylas-notification] Success: ${e.detail.notification.title}`), this.handleNotification(e);
1038
+ }
1039
+ isChildOf(e) {
1040
+ let n = this.host.parentNode;
1041
+ for (; n; ) {
1042
+ if (n === e)
1043
+ return !0;
1044
+ n instanceof ShadowRoot ? n = n.host : n = n.parentNode;
1045
+ }
1046
+ return !1;
1047
+ }
1048
+ handleNotification(e) {
1049
+ const n = e.detail.host;
1050
+ if (e.defaultPrevented) {
1051
+ d("[nylas-notification] Event default prevented");
1052
+ return;
1053
+ }
1054
+ if (n && !this.isChildOf(n)) {
1055
+ d("[nylas-notification] Host not a parent");
1056
+ return;
1057
+ }
1058
+ if (this.ttl === 0) {
1059
+ d("[nylas-notification] TTL is 0");
1060
+ return;
1061
+ }
1062
+ if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.notification.category)) {
1063
+ d("[nylas-notification] Category not allowed");
1064
+ return;
1065
+ }
1066
+ if (this.notifications = [...this.notifications, { ...e.detail.notification }], e.detail.notification.ttl !== "none") {
1067
+ const a = e.detail.notification.ttl ? e.detail.notification.ttl : this.ttl;
1068
+ window.setTimeout(() => {
1069
+ this.notifications = this.notifications.filter((l) => l.id !== e.detail.notification.id);
1070
+ }, a);
1071
+ }
1072
+ }
1073
+ dismissNotification(e) {
1074
+ this.notifications = this.notifications.filter((n) => n.id !== e);
1075
+ }
1076
+ render() {
1077
+ return o(k, { key: "14bd95afa19f56ee11c7fd0da40569ce7db03b8b" }, o(Oe, { key: "7d235408e948e21554c9438b578c9f8dc6cbc00e" }, this.notifications.map((e) => o("div", { class: `notif ${e.type}`, key: e.id }, o("div", { class: "content" }, o("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && o("warning-icon", null)), o("span", { class: "message" }, o("span", { class: "title" }, e.title), e.description && o("span", { class: "description" }, e.description))), o("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, o("close-icon", null)))), o("slot", { key: "fda76c22b0e752e2c6bcd84bc8d92d8f8e94ce88" })));
1078
+ }
1079
+ get host() {
1080
+ return T(this);
1081
+ }
1082
+ };
1083
+ bn.style = yn;
1084
+ const hn = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.event-card-wrapper{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 4rem;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:16px;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.manage-booking-description{border-top:1px solid var(--nylas-base-200)}.manage-booking-description p{font-size:16px;margin:1rem;padding:0.5rem 1rem;font-weight:400;color:var(--nylas-base-800)}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{--dot-color:var(--nylas-base-700)}', gn = hn;
1085
+ var pn = function(e, n, a, l) {
1086
+ var r = arguments.length, t = r < 3 ? n : l === null ? l = Object.getOwnPropertyDescriptor(n, a) : l, s;
1087
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1088
+ t = Reflect.decorate(e, n, a, l);
1089
+ else
1090
+ for (var c = e.length - 1; c >= 0; c--)
1091
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(n, a, t) : s(n, a)) || t);
1092
+ return r > 3 && t && Object.defineProperty(n, a, t), t;
1093
+ }, Q = function(e, n) {
1094
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1095
+ return Reflect.metadata(e, n);
1096
+ };
1097
+ const De = class {
1098
+ constructor(e) {
1099
+ w(this, e), this.rejectBookingButtonClicked = f(this, "rejectBookingButtonClicked", 7), this.confirmBookingButtonClicked = f(this, "confirmBookingButtonClicked", 7), this.confirmBookingError = f(this, "confirmBookingError", 7), this.handleConfirmBookingButtonClicked = () => {
1100
+ this.action = "confirm";
1101
+ const n = (a) => {
1102
+ this.confirmBookingError.emit(a);
1103
+ };
1104
+ this.organizerConfirmationBookingId && !this.isLoading && this.confirmBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host, errorHandler: n });
1105
+ }, this.handleRejectBookingButtonClicked = () => {
1106
+ this.action = "reject", this.organizerConfirmationBookingId && !this.isLoading && this.rejectBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host });
1107
+ }, this.configSettings = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.organizerConfirmationBookingId = void 0, this.selectedLanguage = navigator.language, this.action = null;
1108
+ }
1109
+ themeConfigChanged(e) {
1110
+ this.applyThemeConfig(e);
1111
+ }
1112
+ connectedCallback() {
1113
+ }
1114
+ disconnectedCallback() {
1115
+ }
1116
+ async componentWillLoad() {
1117
+ d("[nylas-organizer-confirmation-card] Component will load");
1118
+ }
1119
+ async componentDidLoad() {
1120
+ d("[nylas-organizer-confirmation-card] Component did load"), this.applyThemeConfig(this.themeConfig);
1121
+ }
1122
+ applyThemeConfig(e) {
1123
+ if (e)
1124
+ for (const [n, a] of Object.entries(e))
1125
+ this.host.style.setProperty(`${n}`, a);
1126
+ }
1127
+ async resetAction() {
1128
+ this.action = null;
1129
+ }
1130
+ render() {
1131
+ var e, n, a, l, r, t, s, c, b, h, u, C;
1132
+ return o(k, { key: "222871895768a9e8125bf2c7332200e65872b475", part: "nmcc" }, o("div", { key: "4838e6be84dab176c13230870f3d0094f1054da9", class: "event-card-wrapper", part: "nmccc__card" }, o("div", { key: "004ce2abb9cc4654dd4278e6c7002b34b7346968", class: "calendar-icon" }, o("calendar-check-icon", { key: "6202df706f78fcd592738a33b1e052e94f88d6ff" })), o("div", { key: "5a1f583617511c35a29fa65f026820996941b707", class: "booked-event-header" }, o("h2", { key: "62b88591f4432538d3c57fa6af4142f0cd2c997f", slot: "card-title", part: "nmcc__title" }, !!this.organizerConfirmationBookingId && `${i.t("bookingPendingTitle")}!`)), o("div", { key: "838b6df023be444c1b1ce1dfc7df21cab18756e1", class: "manage-booking-description" }, o("p", { key: "dc119292e92c4565fb84939284fb57f1fb2ec1f6" }, i.t("bookingPendingnDescription"))), o("div", { key: "31cadc6bfc0ae9f0adf93d159cff2261631e2281", class: {
1133
+ footer: !0,
1134
+ "no-footer": !!((n = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && n.hide_cancellation_options) && !!((l = (a = this.configSettings) == null ? void 0 : a.scheduler) != null && l.hide_rescheduling_options),
1135
+ "no-template-cols": !!((t = (r = this.configSettings) == null ? void 0 : r.scheduler) != null && t.hide_cancellation_options) || !!((c = (s = this.configSettings) == null ? void 0 : s.scheduler) != null && c.hide_rescheduling_options)
1136
+ } }, !((h = (b = this.configSettings) == null ? void 0 : b.scheduler) != null && h.hide_cancellation_options) && o("button-component", { variant: "destructive", onClick: this.handleRejectBookingButtonClicked, isLoading: this.isLoading && this.action === "reject", part: "nmcc__button-outline nmcc__cancel-cta" }, `${i.t("rejectBookingButton")}`), !((C = (u = this.configSettings) == null ? void 0 : u.scheduler) != null && C.hide_rescheduling_options) && o("button-component", { variant: "basic", onClick: this.handleConfirmBookingButtonClicked, isLoading: this.isLoading && this.action === "confirm", part: "nmcc__button-outline nmcc__reschedule-cta" }, `${i.t("confirmBookingButton")}`))));
1137
+ }
1138
+ get host() {
1139
+ return T(this);
1140
+ }
1141
+ static get watchers() {
1142
+ return {
1143
+ themeConfig: ["themeConfigChanged"]
1144
+ };
1145
+ }
1146
+ };
1147
+ pn([
1148
+ B({
1149
+ name: "nylas-organizer-confirmation-card",
1150
+ stateToProps: /* @__PURE__ */ new Map([
1151
+ ["scheduler.organizerConfirmationBookingId", "organizerConfirmationBookingId"],
1152
+ ["scheduler.configSettings", "configSettings"],
1153
+ ["scheduler.isLoading", "isLoading"],
1154
+ ["scheduler.selectedLanguage", "selectedLanguage"],
1155
+ ["scheduler.themeConfig", "themeConfig"]
1156
+ ]),
1157
+ eventToProps: {
1158
+ rejectBookingButtonClicked: async (e, n) => {
1159
+ n.scheduler.setReject(e.detail.bookingId);
1160
+ },
1161
+ confirmBookingButtonClicked: async (e, n) => {
1162
+ const { host: a } = e.detail, l = await n.scheduler.updateBooking({
1163
+ bookingId: e.detail.bookingId,
1164
+ status: "confirmed"
1165
+ }), { errorHandler: r } = e.detail;
1166
+ r && (!l || "error" in l) && r(l), await a.resetAction();
1167
+ }
1168
+ },
1169
+ fireRegisterEvent: !0
1170
+ }),
1171
+ Q("design:type", Function),
1172
+ Q("design:paramtypes", []),
1173
+ Q("design:returntype", void 0)
1174
+ ], De.prototype, "render", null);
1175
+ De.style = gn;
1176
+ const mn = ':host{--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;display:block;position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;gap:4px;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:16px;font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}', un = mn;
1177
+ var kn = function(e, n, a, l) {
1178
+ var r = arguments.length, t = r < 3 ? n : l === null ? l = Object.getOwnPropertyDescriptor(n, a) : l, s;
1179
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1180
+ t = Reflect.decorate(e, n, a, l);
1181
+ else
1182
+ for (var c = e.length - 1; c >= 0; c--)
1183
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(n, a, t) : s(n, a)) || t);
1184
+ return r > 3 && t && Object.defineProperty(n, a, t), t;
1185
+ }, V = function(e, n) {
1186
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1187
+ return Reflect.metadata(e, n);
1188
+ };
1189
+ const Le = class {
1190
+ constructor(e) {
1191
+ w(this, e), this.themeConfig = void 0, this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.hour12 = void 0, this.startTime = "", this.endTime = "";
1192
+ }
1193
+ themeConfigChanged(e) {
1194
+ this.applyThemeConfig(e);
1195
+ }
1196
+ connectedCallback() {
1197
+ }
1198
+ disconnectedCallback() {
1199
+ }
1200
+ async componentWillLoad() {
1201
+ d("[nylas-selected-event-card] Component will load");
1202
+ }
1203
+ async componentDidLoad() {
1204
+ var a, l;
1205
+ d("[nylas-selected-event-card] Component did load"), this.selectedDate || console.warn('[nylas-selected-event-card] "selectedDate" prop is not provided.'), this.selectedTimeslot || console.warn('[nylas-selected-event-card] "selectedTimeslot" prop is not provided.'), this.applyThemeConfig(this.themeConfig);
1206
+ const e = S[this.selectedLanguage || "en"], n = new Intl.DateTimeFormat(e, {
1207
+ hour: "2-digit",
1208
+ minute: "2-digit",
1209
+ timeZone: this.selectedTimezone,
1210
+ hour12: this.hour12
1211
+ });
1212
+ this.startTime = n.format(new Date((a = this.selectedTimeslot) == null ? void 0 : a.start_time)), this.endTime = n.format(new Date((l = this.selectedTimeslot) == null ? void 0 : l.end_time));
1213
+ }
1214
+ applyThemeConfig(e) {
1215
+ if (e)
1216
+ for (const [n, a] of Object.entries(e))
1217
+ this.host.style.setProperty(`${n}`, a);
1218
+ }
1219
+ render() {
1220
+ var e;
1221
+ return o(k, { key: "22b7e4f0f55d7a75188ebd3e8cc009497ad5a598", part: "nsec" }, o("div", { key: "0082bd129fe4704e4bf9bcc82ab401f7c50237fe", class: "event-card", part: "nsec__card" }, o("div", { key: "37093be5b192f8a8a533cb677b432df2cec80d14", class: "calendar-icon", part: "nsec__icon" }, o("calendar-icon", { key: "253a63fa567065c7a12f6fc8b82333568b52b777" })), o("div", { key: "a2d5218bd85c6f94652b0f24a11e68f53a8920d3", class: "nylas-selected-event-card__date", part: "nsec__date" }, this.selectedDate ? ue(ke((e = this.selectedTimeslot) == null ? void 0 : e.start_time, this.selectedTimezone, S[this.selectedLanguage || "en"])) : "-"), o("div", { key: "2f11d6deedb50cb0d7b3e9791088266e06cdca1e", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), o("div", { key: "634bd96488b5b1a51064c9bf015b054648f43011", class: "event-timezone", part: "nsec__timezone" }, o("globe-icon", { key: "b327dfa7747116da0ab29ddebcb6d20c82a0a80b" }), F[this.selectedTimezone]));
1222
+ }
1223
+ get host() {
1224
+ return T(this);
1225
+ }
1226
+ static get watchers() {
1227
+ return {
1228
+ themeConfig: ["themeConfigChanged"]
1229
+ };
1230
+ }
1231
+ };
1232
+ kn([
1233
+ B({
1234
+ name: "nylas-selected-event-card",
1235
+ stateToProps: /* @__PURE__ */ new Map([
1236
+ ["scheduler.selectedDate", "selectedDate"],
1237
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
1238
+ ["scheduler.selectedTimezone", "selectedTimezone"],
1239
+ ["scheduler.selectedLanguage", "selectedLanguage"],
1240
+ ["scheduler.themeConfig", "themeConfig"],
1241
+ ["scheduler.hour12", "hour12"]
1242
+ ]),
1243
+ eventToProps: {},
1244
+ fireRegisterEvent: !0
1245
+ }),
1246
+ V("design:type", Function),
1247
+ V("design:paramtypes", []),
1248
+ V("design:returntype", void 0)
1249
+ ], Le.prototype, "render", null);
1250
+ Le.style = un;
1251
+ const vn = ':host{display:block;height:calc(100% - 48px);--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.timeslots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.time .time-label{display:flex;flex-direction:column;align-items:center;gap:4px}.time .time-label span.spots{font-size:14px;font-family:var(--nylas-font-family);font-weight:400;color:var(--nylas-base-600)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .timeslot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}', Cn = vn;
1252
+ var _n = function(e, n, a, l) {
1253
+ var r = arguments.length, t = r < 3 ? n : l === null ? l = Object.getOwnPropertyDescriptor(n, a) : l, s;
1254
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1255
+ t = Reflect.decorate(e, n, a, l);
1256
+ else
1257
+ for (var c = e.length - 1; c >= 0; c--)
1258
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(n, a, t) : s(n, a)) || t);
1259
+ return r > 3 && t && Object.defineProperty(n, a, t), t;
1260
+ }, ee = function(e, n) {
1261
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1262
+ return Reflect.metadata(e, n);
1263
+ };
1264
+ const Ie = class {
1265
+ constructor(e) {
1266
+ w(this, e), this.timeslotSelected = f(this, "timeslotSelected", 7), this.timeslotConfirmed = f(this, "timeslotConfirmed", 7), this.validateTimeslotError = f(this, "validateTimeslotError", 7), this.handleConfirmedTimeslot = async (n, a) => {
1267
+ n.preventDefault(), d("[nylas-timeslot-picker] Confirm timeslot", a), a && this.timeslotConfirmed.emit({ timeslot: a, host: this.host });
1268
+ }, this.handleMouseEnter = (n) => {
1269
+ this.hoveredTimeslotIndex = n;
1270
+ }, this.handleMouseLeave = () => {
1271
+ this.hoveredTimeslotIndex = -1;
1272
+ }, this.availability = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedDate = /* @__PURE__ */ new Date(), this.selectedLanguage = void 0, this.hour12 = void 0, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
1273
+ }
1274
+ selectedLanguageChanged(e) {
1275
+ i.changeLanguage(e);
1276
+ }
1277
+ selectedDateChanged(e) {
1278
+ var n;
1279
+ if (d("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
1280
+ const a = (n = this.availability) == null ? void 0 : n.filter((l) => M(l.start_time, e, this.selectedTimezone)).map((l) => l);
1281
+ this.times = a || [];
1282
+ }
1283
+ }
1284
+ availabilityChanged(e) {
1285
+ if (d("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
1286
+ const n = e == null ? void 0 : e.filter((a) => this.selectedDate && M(a.start_time, this.selectedDate, this.selectedTimezone)).map((a) => a);
1287
+ this.times = n || [];
1288
+ }
1289
+ }
1290
+ themeConfigChanged(e) {
1291
+ this.applyThemeConfig(e);
1292
+ }
1293
+ connectedCallback() {
1294
+ }
1295
+ disconnectedCallback() {
1296
+ }
1297
+ async componentWillLoad() {
1298
+ d("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
1299
+ }
1300
+ async componentDidLoad() {
1301
+ var n;
1302
+ d("[nylas-timeslot-picker] Component did load");
1303
+ const e = (n = this.availability) == null ? void 0 : n.filter((a) => this.selectedDate && M(a.start_time, this.selectedDate, this.selectedTimezone)).map((a) => a);
1304
+ this.times = e || [], this.applyThemeConfig(this.themeConfig);
1305
+ }
1306
+ applyThemeConfig(e) {
1307
+ if (e)
1308
+ for (const [n, a] of Object.entries(e))
1309
+ this.host.style.setProperty(`${n}`, a);
1310
+ }
1311
+ getTimeslotId(e, n) {
1312
+ return `${e.toLocaleDateString()}-${n}`;
1313
+ }
1314
+ onClickSelectTime(e, n) {
1315
+ d("[nylas-timeslot-picker] Time selected", e, n), this.selectedTimeslotIndex = this.getTimeslotId(e.start_time, n), this.timeslotSelected.emit({
1316
+ start_time: e.start_time,
1317
+ end_time: e.end_time,
1318
+ emails: e.emails,
1319
+ capacity: e == null ? void 0 : e.capacity,
1320
+ event_id: e == null ? void 0 : e.event_id,
1321
+ master_id: e == null ? void 0 : e.master_id,
1322
+ calendar_id: e == null ? void 0 : e.calendar_id
1323
+ });
1324
+ }
1325
+ async emitValidateTimeslotError(e, n) {
1326
+ this.validateTimeslotError.emit({ error: e, type: n });
1327
+ }
1328
+ getTimeSlotLabel(e) {
1329
+ const n = S[this.selectedLanguage || "en"], a = new Intl.DateTimeFormat(n, {
1330
+ hour: "2-digit",
1331
+ minute: "2-digit",
1332
+ timeZone: this.selectedTimezone,
1333
+ hour12: this.hour12
1334
+ });
1335
+ return `${a.format(e.start_time)} - ${a.format(e.end_time)}`;
1336
+ }
1337
+ render() {
1338
+ const e = S[this.selectedLanguage || "en"];
1339
+ if (this.isLoading)
1340
+ return o(k, null, o("div", { class: "loading" }, new Array(6).fill(0).map((a, l) => o("div", { class: "timeslot-skeleton", style: { animationDelay: `${l * 20}ms` } }))));
1341
+ if (this.availability && this.availability.length === 0)
1342
+ return o(k, null, o("div", { class: "empty" }, o("span", null, "No dates available")));
1343
+ const n = this.times.filter((a) => {
1344
+ const l = (a == null ? void 0 : a.event_id) || (a == null ? void 0 : a.master_id), r = typeof (a == null ? void 0 : a.capacity) == "number" && (a == null ? void 0 : a.capacity) > 0;
1345
+ return !(l && !r);
1346
+ });
1347
+ return (!this.times || this.times.length === 0 || n.length === 0) && this.selectedDate ? o(k, null, o("div", { class: "empty" }, o("span", null, "No time slots available for selected date"))) : this.selectedDate ? o(k, { part: "ntp" }, o("div", { class: "time-picker-wrapper", part: "ntp__time-picker-wrapper" }, o("div", { class: "timeslots", part: "ntp__timeslots" }, n.map((a, l) => {
1348
+ var t, s, c, b;
1349
+ const r = typeof (a == null ? void 0 : a.capacity) == "number" && (a == null ? void 0 : a.capacity) > 0;
1350
+ return o("button", { part: `ntp__timeslot ${((s = (t = this.selectedTimeslot) == null ? void 0 : t.start_time) == null ? void 0 : s.getTime()) === a.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, class: {
1351
+ time: !0,
1352
+ selected: typeof this.selectedTimeslot < "u" && ((b = (c = this.selectedTimeslot) == null ? void 0 : c.start_time) == null ? void 0 : b.getTime()) === a.start_time.getTime()
1353
+ }, onClick: () => this.onClickSelectTime(a, l), onMouseEnter: () => this.handleMouseEnter(l), onMouseLeave: () => this.handleMouseLeave() }, o("div", { class: "time-label", part: "ntp__time-label" }, this.hoveredTimeslotIndex == l || this.selectedTimeslotIndex == this.getTimeslotId(a.start_time, l) ? this.getTimeSlotLabel(a) : a.start_time.toLocaleTimeString(e, { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone, hour12: this.hour12 }), o("span", { class: "spots" }, r ? `${a == null ? void 0 : a.capacity} spots left` : null)));
1354
+ })), this.selectedTimeslot && o("div", { class: "footer" }, o("button-component", { variant: "primary", onClick: (a) => this.handleConfirmedTimeslot(a, this.selectedTimeslot), part: "ntp__button-primary" }, o("slot", { name: "timeslot-picker-cta-label" }, i.t("nextButton")))))) : o(k, null);
1355
+ }
1356
+ get host() {
1357
+ return T(this);
1358
+ }
1359
+ static get watchers() {
1360
+ return {
1361
+ selectedLanguage: ["selectedLanguageChanged"],
1362
+ selectedDate: ["selectedDateChanged"],
1363
+ availability: ["availabilityChanged"],
1364
+ themeConfig: ["themeConfigChanged"]
1365
+ };
1366
+ }
1367
+ };
1368
+ _n([
1369
+ B({
1370
+ name: "nylas-timeslot-picker",
1371
+ stateToProps: /* @__PURE__ */ new Map([
1372
+ ["scheduler.selectedDate", "selectedDate"],
1373
+ ["scheduler.availability", "availability"],
1374
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
1375
+ ["scheduler.selectedTimezone", "selectedTimezone"],
1376
+ ["scheduler.selectedLanguage", "selectedLanguage"],
1377
+ ["scheduler.isLoading", "isLoading"],
1378
+ ["scheduler.themeConfig", "themeConfig"],
1379
+ ["scheduler.hour12", "hour12"]
1380
+ ]),
1381
+ eventToProps: {
1382
+ timeslotSelected: async (e, n) => {
1383
+ d("nylas-timeslot-picker", "timeslotSelected", e.detail), n.scheduler.selectTime(e.detail);
1384
+ },
1385
+ timeslotConfirmed: async (e, n) => {
1386
+ var r;
1387
+ d("nylas-timeslot-picker", "timeslotConfirmed", e.detail);
1388
+ const { timeslot: a, host: l } = e.detail;
1389
+ if (a && (a != null && a.event_id) && (a != null && a.capacity)) {
1390
+ const t = await n.scheduler.validateGroupEventTimeslot(a);
1391
+ if (t && "error" in t) {
1392
+ const s = ((r = t.error) == null ? void 0 : r.message) || "An error occurred while validating the timeslot";
1393
+ s === "Event is full" ? l.emitValidateTimeslotError(s, "info") : l.emitValidateTimeslotError(s, "error");
1394
+ }
1395
+ } else
1396
+ n.scheduler.toggleAdditionalData(!0);
1397
+ },
1398
+ validateTimeslotError: async (e, n) => {
1399
+ d("nylas-timeslot-picker", "validateTimeslotError", e.detail);
1400
+ }
1401
+ },
1402
+ fireRegisterEvent: !0
1403
+ }),
1404
+ ee("design:type", Function),
1405
+ ee("design:paramtypes", []),
1406
+ ee("design:returntype", void 0)
1407
+ ], Ie.prototype, "render", null);
1408
+ Ie.style = Cn;
1409
+ export {
1410
+ ve as nylas_booked_event_card,
1411
+ Ce as nylas_booking_form,
1412
+ _e as nylas_cancel_booking_form,
1413
+ we as nylas_cancelled_event_card,
1414
+ xe as nylas_confirmed_event_card,
1415
+ Ee as nylas_date_picker,
1416
+ Be as nylas_locale_switch,
1417
+ dn as nylas_logo,
1418
+ bn as nylas_notification,
1419
+ De as nylas_organizer_confirmation_card,
1420
+ Le as nylas_selected_event_card,
1421
+ Ie as nylas_timeslot_picker
1422
+ };