@nylas/react 2.0.3 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/{abstract-provider-bdb7d9b4-12a95387.cjs → abstract-provider-45ada3b4-31e3ed72.cjs} +1 -1
  2. package/dist/{abstract-provider-bdb7d9b4-22cf4a74.js → abstract-provider-45ada3b4-abd3105d.js} +1 -1
  3. package/dist/{add-circle-icon_2.entry-d56f519c.cjs → add-circle-icon_2.entry-48953f9c.cjs} +1 -1
  4. package/dist/{add-circle-icon_2.entry-0ff79148.js → add-circle-icon_2.entry-f6f8b5e5.js} +1 -1
  5. package/dist/{archive-icon.entry-aaff46ec.js → archive-icon.entry-b3a76711.js} +1 -1
  6. package/dist/{archive-icon.entry-6ab120ff.cjs → archive-icon.entry-e2880dc7.cjs} +1 -1
  7. package/dist/{arrow-icon.entry-d57cf44f.cjs → arrow-icon.entry-84d1e26c.cjs} +1 -1
  8. package/dist/{arrow-icon.entry-d8fcbc1f.js → arrow-icon.entry-9b3441aa.js} +1 -1
  9. package/dist/{bold-icon.entry-e48075a4.js → bold-icon.entry-0749a116.js} +1 -1
  10. package/dist/{bold-icon.entry-0f23543d.cjs → bold-icon.entry-e1d8ab5e.cjs} +1 -1
  11. package/dist/{button-component_2.entry-3d622397.cjs → button-component_2.entry-1a817230.cjs} +1 -1
  12. package/dist/{button-component_2.entry-5db80bec.js → button-component_2.entry-6eb55e97.js} +1 -1
  13. package/dist/calendar-agenda-fill-icon_37.entry-0ca8b9f4.cjs +6 -0
  14. package/dist/calendar-agenda-fill-icon_37.entry-4adf73a2.js +5231 -0
  15. package/dist/{calendar-cancel-icon.entry-8b43441c.js → calendar-cancel-icon.entry-2a29cb3f.js} +1 -1
  16. package/dist/{calendar-cancel-icon.entry-9546c7c3.cjs → calendar-cancel-icon.entry-e0dee585.cjs} +1 -1
  17. package/dist/{calendar-check-icon.entry-a03b249a.cjs → calendar-check-icon.entry-7f96d456.cjs} +1 -1
  18. package/dist/{calendar-check-icon.entry-4e6abda7.js → calendar-check-icon.entry-c12b63ea.js} +1 -1
  19. package/dist/{calendar-icon.entry-cd4b0ec4.cjs → calendar-icon.entry-a2d19ff2.cjs} +1 -1
  20. package/dist/{calendar-icon.entry-5b622c12.js → calendar-icon.entry-e82a5169.js} +1 -1
  21. package/dist/checkbox-component.entry-59612a67.js +52 -0
  22. package/dist/checkbox-component.entry-ddce70bc.cjs +1 -0
  23. package/dist/checkbox-group_4.entry-3311da64.cjs +28 -0
  24. package/dist/{checkbox-group_4.entry-b2a5b2b2.js → checkbox-group_4.entry-7df47ad4.js} +287 -246
  25. package/dist/{checkmark-circle-icon.entry-30582af4.js → checkmark-circle-icon.entry-677b0def.js} +1 -1
  26. package/dist/{checkmark-circle-icon.entry-9617301c.cjs → checkmark-circle-icon.entry-67df713b.cjs} +1 -1
  27. package/dist/checkmark-icon_15.entry-2121e1b7.cjs +5 -0
  28. package/dist/checkmark-icon_15.entry-9fd0ec58.js +1412 -0
  29. package/dist/chevron-icon_3.entry-1a42235c.cjs +1 -0
  30. package/dist/{chevron-icon_3.entry-517447a6.js → chevron-icon_3.entry-f0ad71d9.js} +19 -10
  31. package/dist/{clock-icon_4.entry-5351318c.cjs → clock-icon_4.entry-88822a84.cjs} +1 -1
  32. package/dist/{clock-icon_4.entry-7ea1274d.js → clock-icon_4.entry-e7472d5f.js} +1 -1
  33. package/dist/{customParseFormat-f0d21eb3-904f1e57.js → customParseFormat-eeec04f5-3ad26beb.js} +1 -1
  34. package/dist/{customParseFormat-f0d21eb3-769d6bf2.cjs → customParseFormat-eeec04f5-d5957784.cjs} +1 -1
  35. package/dist/{delete-icon.entry-64b61f5c.cjs → delete-icon.entry-3cb58910.cjs} +1 -1
  36. package/dist/{delete-icon.entry-02e44ba1.js → delete-icon.entry-813429d7.js} +1 -1
  37. package/dist/{document-refresh-icon.entry-2f599a22.cjs → document-refresh-icon.entry-ae361b0b.cjs} +1 -1
  38. package/dist/{document-refresh-icon.entry-fcaa84ad.js → document-refresh-icon.entry-c224c778.js} +1 -1
  39. package/dist/{feedbackSync-b9c9e719-b54b3268.js → feedbackSync-0ebd0eda-803c3ebe.js} +1 -1
  40. package/dist/{feedbackSync-b9c9e719-bee3fea1.cjs → feedbackSync-0ebd0eda-e12b00d5.cjs} +1 -1
  41. package/dist/{folder-icon.entry-55c123dc.cjs → folder-icon.entry-107841af.cjs} +1 -1
  42. package/dist/{folder-icon.entry-f4862c1b.js → folder-icon.entry-9c1f7c41.js} +1 -1
  43. package/dist/{forward-icon.entry-4a41e94f.js → forward-icon.entry-4ac22c16.js} +1 -1
  44. package/dist/{forward-icon.entry-82719382.cjs → forward-icon.entry-6cec1f94.cjs} +1 -1
  45. package/dist/globe-icon.entry-7798c93b.js +16 -0
  46. package/dist/globe-icon.entry-909c1382.cjs +1 -0
  47. package/dist/google-logo-icon_6.entry-1f4ad364.cjs +2 -0
  48. package/dist/{google-logo-icon_6.entry-b331ab60.js → google-logo-icon_6.entry-b198c90a.js} +332 -282
  49. package/dist/{google-meet-icon_5.entry-e3d44d56.cjs → google-meet-icon_5.entry-82d87e77.cjs} +1 -1
  50. package/dist/{google-meet-icon_5.entry-eb9f7d93.js → google-meet-icon_5.entry-fa6dc1dc.js} +1 -1
  51. package/dist/{inbox-icon.entry-a385095d.js → inbox-icon.entry-1b123e64.js} +1 -1
  52. package/dist/{inbox-icon.entry-fa9085cd.cjs → inbox-icon.entry-84f96d31.cjs} +1 -1
  53. package/dist/{index-ad781fbc.js → index-140eb219.js} +6753 -6439
  54. package/dist/index-d8a42c15.cjs +118 -0
  55. package/dist/{index.es-ccb2a286-dfa2bfbe.js → index.es-57d4a08f-184cbc01.js} +1 -1
  56. package/dist/{index.es-ccb2a286-9a2c0934.cjs → index.es-57d4a08f-b0a2ca19.cjs} +1 -1
  57. package/dist/info-icon_2.entry-f09e7dae.cjs +1 -0
  58. package/dist/info-icon_2.entry-f8b72d08.js +35 -0
  59. package/dist/input-component.entry-44607977.js +93 -0
  60. package/dist/input-component.entry-fd38953d.cjs +1 -0
  61. package/dist/input-dropdown_2.entry-4c2e5e1a.cjs +1 -0
  62. package/dist/{input-dropdown_2.entry-1b55ef0c.js → input-dropdown_2.entry-6898b420.js} +30 -9
  63. package/dist/{italic-icon.entry-4266a817.js → italic-icon.entry-16aa1ada.js} +1 -1
  64. package/dist/{italic-icon.entry-843feb2b.cjs → italic-icon.entry-beef2254.cjs} +1 -1
  65. package/dist/lib/elements/index.d.ts +1 -0
  66. package/dist/lib/notetaker/SendNotetaker/SendNotetaker.d.ts +3 -2
  67. package/dist/lib/notetaker/VideoPlayer/VideoPlayer.d.ts +2 -0
  68. package/dist/lib/notetaker/lib/store.d.ts +1 -2
  69. package/dist/multi-select-dropdown.entry-50133d29.js +130 -0
  70. package/dist/multi-select-dropdown.entry-c82cd6d4.cjs +1 -0
  71. package/dist/{nylas-booked-event-card_11.entry-ccf30d91.js → nylas-booked-event-card_11.entry-56768a09.js} +69 -69
  72. package/dist/nylas-booked-event-card_11.entry-eb4b3c5c.cjs +1 -0
  73. package/dist/nylas-date-component_2.entry-93f2f352.cjs +1 -0
  74. package/dist/nylas-date-component_2.entry-df957150.js +307 -0
  75. package/dist/nylas-form-card.entry-4d95a4ad.cjs +1 -0
  76. package/dist/nylas-form-card.entry-7724e61f.js +72 -0
  77. package/dist/nylas-notification_2.entry-448c2cb8.cjs +1 -0
  78. package/dist/nylas-notification_2.entry-af763b6c.js +85 -0
  79. package/dist/{nylas-scheduler-editor.entry-aa079dff.js → nylas-scheduler-editor.entry-0e4ba46d.js} +45 -34
  80. package/dist/{nylas-scheduler-editor.entry-9744694a.cjs → nylas-scheduler-editor.entry-e36cdd9d.cjs} +2 -2
  81. package/dist/{nylas-scheduling.entry-7441979c.js → nylas-scheduling.entry-1b207e91.js} +196 -185
  82. package/dist/nylas-scheduling.entry-904dd10e.cjs +1 -0
  83. package/dist/{person-icon.entry-acf4d22b.cjs → person-icon.entry-70d46ca6.cjs} +1 -1
  84. package/dist/{person-icon.entry-23a69633.js → person-icon.entry-f2979577.js} +1 -1
  85. package/dist/{play-icon.entry-aa088180.cjs → play-icon.entry-c2cf0b12.cjs} +1 -1
  86. package/dist/{play-icon.entry-4e7884d4.js → play-icon.entry-d387df5d.js} +1 -1
  87. package/dist/radio-button-group.entry-45dbd2df.js +56 -0
  88. package/dist/radio-button-group.entry-94e06176.cjs +1 -0
  89. package/dist/react.cjs +1 -1
  90. package/dist/react.js +41 -40
  91. package/dist/{refresh-icon.entry-96cb008f.cjs → refresh-icon.entry-5ab20f26.cjs} +1 -1
  92. package/dist/{refresh-icon.entry-d1603555.js → refresh-icon.entry-777cff27.js} +1 -1
  93. package/dist/{register-component-9d4ceee5-46f58baf.js → register-component-0aad9e3d-b395364a.js} +1 -1
  94. package/dist/{register-component-9d4ceee5-6fabc42c.cjs → register-component-0aad9e3d-d2f2e543.cjs} +1 -1
  95. package/dist/{reply-all-icon.entry-537f7718.cjs → reply-all-icon.entry-3c90510e.cjs} +1 -1
  96. package/dist/{reply-all-icon.entry-6fae7288.js → reply-all-icon.entry-e2dd6da9.js} +1 -1
  97. package/dist/{reply-icon.entry-ae114e35.js → reply-icon.entry-00a97d9f.js} +1 -1
  98. package/dist/{reply-icon.entry-72fa6e4c.cjs → reply-icon.entry-d96478be.cjs} +1 -1
  99. package/dist/{sent-icon.entry-30a6ac17.cjs → sent-icon.entry-2d16da4e.cjs} +1 -1
  100. package/dist/{sent-icon.entry-b10d5e26.js → sent-icon.entry-949cf214.js} +1 -1
  101. package/dist/{spam-icon.entry-bed45849.js → spam-icon.entry-3baf9e79.js} +1 -1
  102. package/dist/{spam-icon.entry-357aa525.cjs → spam-icon.entry-7ee61730.cjs} +1 -1
  103. package/dist/{star-icon.entry-010349a5.js → star-icon.entry-9fdb278b.js} +1 -1
  104. package/dist/{star-icon.entry-53c85ebb.cjs → star-icon.entry-dc702d73.cjs} +1 -1
  105. package/dist/{stop-icon.entry-20af3bf5.cjs → stop-icon.entry-b5ae7e55.cjs} +1 -1
  106. package/dist/{stop-icon.entry-18f650bf.js → stop-icon.entry-efa1ea66.js} +1 -1
  107. package/dist/textarea-component.entry-247aca42.cjs +1 -0
  108. package/dist/textarea-component.entry-7c6fc4d8.js +55 -0
  109. package/dist/toggle-switch.entry-a0295d17.js +49 -0
  110. package/dist/toggle-switch.entry-d52b0338.cjs +1 -0
  111. package/dist/{translate-icon.entry-2308a8e4.js → translate-icon.entry-219cab17.js} +1 -1
  112. package/dist/{translate-icon.entry-7cb7a479.cjs → translate-icon.entry-985b3b29.cjs} +1 -1
  113. package/dist/{trash-fill-icon.entry-7f410c82.js → trash-fill-icon.entry-03c90559.js} +1 -1
  114. package/dist/{trash-fill-icon.entry-c70b9326.cjs → trash-fill-icon.entry-4dfd7d24.cjs} +1 -1
  115. package/dist/{underline-icon.entry-58ef1a9f.js → underline-icon.entry-58fa18b5.js} +1 -1
  116. package/dist/{underline-icon.entry-23f478f3.cjs → underline-icon.entry-c60b77a6.cjs} +1 -1
  117. package/package.json +3 -3
  118. package/dist/calendar-agenda-fill-icon_36.entry-75d7cd5b.cjs +0 -6
  119. package/dist/calendar-agenda-fill-icon_36.entry-78fc2e0d.js +0 -4708
  120. package/dist/checkbox-component_2.entry-82f4b1f2.js +0 -115
  121. package/dist/checkbox-component_2.entry-c9c8a87d.cjs +0 -1
  122. package/dist/checkbox-group_4.entry-5a4f0ed2.cjs +0 -28
  123. package/dist/checkmark-icon_15.entry-01536ed2.js +0 -1339
  124. package/dist/checkmark-icon_15.entry-c5eaad9b.cjs +0 -5
  125. package/dist/chevron-icon_3.entry-26f14744.cjs +0 -1
  126. package/dist/globe-icon_2.entry-3f0e408e.cjs +0 -1
  127. package/dist/globe-icon_2.entry-8f5c79b2.js +0 -210
  128. package/dist/google-logo-icon_6.entry-9c91c3d4.cjs +0 -2
  129. package/dist/index-dc6efb5e.cjs +0 -118
  130. package/dist/info-icon_2.entry-9f32753b.cjs +0 -1
  131. package/dist/info-icon_2.entry-c18a111e.js +0 -35
  132. package/dist/input-component.entry-eae64f46.js +0 -84
  133. package/dist/input-component.entry-ff9e04c9.cjs +0 -1
  134. package/dist/input-dropdown_2.entry-67d6d292.cjs +0 -1
  135. package/dist/multi-select-dropdown.entry-854265ef.js +0 -121
  136. package/dist/multi-select-dropdown.entry-ca9acf75.cjs +0 -1
  137. package/dist/nylas-booked-event-card_11.entry-8d3e2019.cjs +0 -1
  138. package/dist/nylas-form-card.entry-481ede48.js +0 -58
  139. package/dist/nylas-form-card.entry-58162c72.cjs +0 -1
  140. package/dist/nylas-notification_2.entry-7d3ed3b0.js +0 -85
  141. package/dist/nylas-notification_2.entry-dffa3ff6.cjs +0 -1
  142. package/dist/nylas-scheduling.entry-b1fcb48f.cjs +0 -1
  143. package/dist/radio-button-group.entry-243d7988.js +0 -47
  144. package/dist/radio-button-group.entry-cea225c8.cjs +0 -1
  145. package/dist/textarea-component.entry-b19642f1.cjs +0 -1
  146. package/dist/textarea-component.entry-e6120440.js +0 -39
  147. package/dist/toggle-switch.entry-32b0e964.js +0 -34
  148. package/dist/toggle-switch.entry-becdda2c.cjs +0 -1
@@ -1,1339 +0,0 @@
1
- import { r as b, h as s, a as m, g as x, b as d, S as q, H as w, i as c, y as S, T as H, P as V, U as M } from "./index-ad781fbc.js";
2
- import { R as C } from "./register-component-9d4ceee5-46f58baf.js";
3
- import { E as k, P as E, f as J } from "./constants-f51538ef-e0a5f026.js";
4
- import "react";
5
- import "react/jsx-runtime";
6
- import "react-dom";
7
- const G = ".sc-checkmark-icon-h{display:flex}", X = G, Q = class {
8
- constructor(e) {
9
- b(this, e), this.width = "18", this.height = "14";
10
- }
11
- render() {
12
- return s("svg", { key: "a739b30f83d6510e6644045ba736860eb524c838", width: this.width, height: this.height, viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "9621004de9b8789eab6f4d0616ae0ff25124fd44", d: "M1.53033 7.46967C1.23744 7.17678 0.762563 7.17678 0.46967 7.46967C0.176777 7.76256 0.176777 8.23744 0.46967 8.53033L4.96967 13.0303C5.26256 13.3232 5.73744 13.3232 6.03033 13.0303L17.0303 2.03033C17.3232 1.73744 17.3232 1.26256 17.0303 0.96967C16.7374 0.676777 16.2626 0.676777 15.9697 0.96967L5.5 11.4393L1.53033 7.46967Z", fill: "#293056" }));
13
- }
14
- };
15
- Q.style = X;
16
- const Y = ".sc-copy-icon-h{display:flex}", ee = Y, te = class {
17
- constructor(e) {
18
- b(this, e), this.width = "16", this.height = "16";
19
- }
20
- render() {
21
- return s("svg", { key: "af5249494e43163c59f43f0e21ff4a9063566023", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "d1b78a39d0dd7ce2a3823d54e2e0dbd5f260c188", d: "M4 0.75C2.89543 0.75 2 1.64543 2 2.75V12.75C2 13.8546 2.89543 14.75 4 14.75H10C11.1046 14.75 12 13.8546 12 12.75V2.75C12 1.64543 11.1046 0.75 10 0.75H4ZM3 2.75C3 2.19772 3.44772 1.75 4 1.75H10C10.5523 1.75 11 2.19772 11 2.75V12.75C11 13.3023 10.5523 13.75 10 13.75H4C3.44772 13.75 3 13.3023 3 12.75V2.75ZM0 4.75001C0 4.00973 0.402199 3.36339 1 3.01758V13.25C1 14.6307 2.11929 15.75 3.5 15.75H9.73244C9.38663 16.3478 8.74028 16.75 8 16.75H3.5C1.567 16.75 0 15.183 0 13.25V4.75001Z", fill: "currentColor" }));
22
- }
23
- };
24
- te.style = ee;
25
- const ne = ".sc-dragable-icon-h{display:flex}", ae = ne, oe = class {
26
- constructor(e) {
27
- b(this, e), this.width = "20", this.height = "20";
28
- }
29
- render() {
30
- return s("svg", { key: "e4d3ba685832139b22eb5b024479e22f2ddfc811", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "68f15598ca1251c3926a3b88adb0947f1a5b6b4a", d: "M15.5 18C16.3284 18 17 18.6716 17 19.5C17 20.3284 16.3284 21 15.5 21C14.6716 21 14 20.3284 14 19.5C14 18.6716 14.6716 18 15.5 18ZM8.5 18C9.32843 18 10 18.6716 10 19.5C10 20.3284 9.32843 21 8.5 21C7.67157 21 7 20.3284 7 19.5C7 18.6716 7.67157 18 8.5 18ZM15.5 11C16.3284 11 17 11.6716 17 12.5C17 13.3284 16.3284 14 15.5 14C14.6716 14 14 13.3284 14 12.5C14 11.6716 14.6716 11 15.5 11ZM8.5 11C9.32843 11 10 11.6716 10 12.5C10 13.3284 9.32843 14 8.5 14C7.67157 14 7 13.3284 7 12.5C7 11.6716 7.67157 11 8.5 11ZM15.5 4C16.3284 4 17 4.67157 17 5.5C17 6.32843 16.3284 7 15.5 7C14.6716 7 14 6.32843 14 5.5C14 4.67157 14.6716 4 15.5 4ZM8.5 4C9.32843 4 10 4.67157 10 5.5C10 6.32843 9.32843 7 8.5 7C7.67157 7 7 6.32843 7 5.5C7 4.67157 7.67157 4 8.5 4Z", fill: "currentColor" }));
31
- }
32
- };
33
- oe.style = ae;
34
- const le = ".sc-eye-icon-h{display:flex}", se = le, ie = class {
35
- constructor(e) {
36
- b(this, e), this.width = "17", this.height = "10";
37
- }
38
- render() {
39
- return s("svg", { key: "2b2a63f9602d85c9661986eb2dd8e220a02e5570", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "8609bab91f97b282d80282736ce38f895e7b6fc1", d: "M1.75909 6.60214C2.44254 3.32689 5.29437 1 8.50002 1C11.7057 1 14.5574 3.32688 15.2409 6.60215C15.2974 6.87246 15.5622 7.04587 15.8325 6.98946C16.1029 6.93304 16.2763 6.66817 16.2199 6.39785C15.4425 2.67312 12.1934 0 8.50002 0C4.8066 0 1.55742 2.67311 0.780175 6.39786C0.723767 6.66818 0.897177 6.93305 1.1675 6.98946C1.43782 7.04587 1.70268 6.87246 1.75909 6.60214ZM8.5 3C6.567 3 5 4.567 5 6.5C5 8.433 6.567 10 8.5 10C10.433 10 12 8.433 12 6.5C12 4.567 10.433 3 8.5 3ZM6 6.5C6 5.11929 7.11929 4 8.5 4C9.88071 4 11 5.11929 11 6.5C11 7.88071 9.88071 9 8.5 9C7.11929 9 6 7.88071 6 6.5Z", fill: "currentColor" }));
40
- }
41
- };
42
- ie.style = se;
43
- const re = ".sc-feedback-icon-h{display:flex}", ce = re, de = class {
44
- constructor(e) {
45
- b(this, e), this.width = "11", this.height = "14";
46
- }
47
- render() {
48
- return s("svg", { key: "0cef0443a3b22ffa2bd9be587f55175bef8557cf", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "20631452d3f3bc031b79d3337eda08143db490e4", d: "M0.5 8.875C0.5 8.875 1.125 8.25 3 8.25C4.875 8.25 6.125 9.5 8 9.5C9.875 9.5 10.5 8.875 10.5 8.875V1.375C10.5 1.375 9.875 2 8 2C6.125 2 4.875 0.75 3 0.75C1.125 0.75 0.5 1.375 0.5 1.375V8.875ZM0.5 8.875V13.25", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" }));
49
- }
50
- };
51
- de.style = ce;
52
- const pe = ':host{display:block;position:relative;--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;width:100%}@media screen and (max-width: 768px){:host{position:unset}}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.color-picker-container{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%;width:-moz-available;width:-webkit-fill-available;padding-left:0;gap:0;overflow:hidden}.color-picker-container:focus{outline-color:var(--nylas-primary)}.color-picker-container.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}.color-picker-container.error::placeholder{font-weight:400}.color-picker-container::placeholder{color:var(--nylas-base-300)}.color-picker-container input{display:flex;align-items:center;height:100%;appearance:none;border:none;border-right:1px solid var(--nylas-base-200);background:transparent}.color-picker-container input::-webkit-color-swatch{min-width:30px;border-radius:0.25rem;border:1px solid var(--nylas-base-200);margin:0.25rem}.color-picker-container input::-moz-color-swatch{min-width:30px;border-radius:0.25rem;border:1px solid var(--nylas-base-200);margin:0.25rem}.color-picker-container.error{border:1px solid var(--nylas-error)}.color-picker-container:hover,.color-picker-container:active{outline:1px solid var(--nylas-primary)}.color-picker-container:active{outline:2px solid var(--nylas-primary)}.color-picker-container label{width:100%}.labelBtn{color:var(--nylas-base-800);padding:14px;font-size:16px;font-family:var(--nylas-font-family);cursor:pointer;display:flex;flex-direction:row;justify-content:space-between;width:100%;gap:0.5rem;background:transparent;border:none}.labelBtn.error{border:1px solid var(--nylas-error)}.labelBtn.focus{background:transparent}.labelBtn:hover,.labelBtn:active{outline:1px solid var(--nylas-primary)}.labelBtn span.chevron{display:flex;align-self:center}.labelBtn span.open{transform:rotate(90deg)}.labelBtn span.closed{transform:rotate(270deg)}.labelBtn span.selected-option{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:144px;font-size:14px;line-height:20px}@media screen and (max-width: 768px){.labelBtn span.selected-option{max-width:124px;font-size:16px}}', fe = pe, ye = class {
53
- constructor(e) {
54
- b(this, e), this.nylasFormDropdownChanged = m(this, "nylasFormDropdownChanged", 7), this.componentType = "color-picker", this.name = void 0, this.defaultSelectedColor = void 0, this.selectedColor = this.defaultSelectedColor, this.isOpen = !1, this.ariaActivedescendant = "", this.errorMessage = "";
55
- }
56
- componentWillLoad() {
57
- this.selectedColor = this.defaultSelectedColor, this.el.setAttribute("component-type", this.componentType);
58
- }
59
- handleFocus() {
60
- this.isOpen = !0;
61
- }
62
- handleBlur() {
63
- this.isOpen = !1;
64
- }
65
- handleInput(e) {
66
- this.selectedColor = e.target.value;
67
- }
68
- handleChange(e) {
69
- this.selectedColor = e.target.value, this.nylasFormDropdownChanged.emit({
70
- value: this.selectedColor,
71
- name: this.name,
72
- error: this.errorMessage
73
- });
74
- }
75
- handleKeyDown(e) {
76
- var t;
77
- (e.code === "Enter" || e.code === "Space") && (e.preventDefault(), (t = this.inputRef) == null || t.click());
78
- }
79
- handleOutsideClick(e) {
80
- !e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
81
- }
82
- render() {
83
- return s("div", { key: "354f7c502fadd2c6a30619365b9939523d9cd770", class: "color-picker-container", part: "icp_color-picker", tabindex: "0", onKeyDown: (e) => this.handleKeyDown(e) }, s("input", { key: "cc5803d2e90064b15137717043581f24cf80fda3", type: "color", ref: (e) => this.inputRef = e, id: this.name, name: this.name, value: this.selectedColor, tabindex: "-1", onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur(), onInput: (e) => this.handleInput(e), onChange: (e) => this.handleChange(e), onKeyDown: (e) => this.handleKeyDown(e) }), s("label", { key: "75e26e605a36d5a3505f41dbdad576484b14ac43", part: "icp_color-picker-button", htmlFor: this.name, class: { labelBtn: !0, open: this.isOpen, error: !!this.errorMessage }, "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? "true" : "false", "aria-label": this.name }, s("span", { key: "9a321653073ef9aa8a9372e291bd04244b6dfe46", class: "selected-option", part: "icp_color-picker-button-selected-label" }, this.selectedColor || "Select a color"), s("span", { key: "62ed4fb1337b47735c823b8e164bb8bb57325ffd", class: {
84
- open: this.isOpen,
85
- closed: !this.isOpen,
86
- chevron: !0
87
- }, "aria-hidden": "true" }, s("chevron-icon", { key: "5c304ff53cfc6d3632f4fbbd8415c318301b4e38", width: "16", height: "16" })), this.errorMessage && s("span", { class: "error help-text" }, this.errorMessage)));
88
- }
89
- get el() {
90
- return x(this);
91
- }
92
- };
93
- ye.style = fe;
94
- const he = ':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;width:inherit}.logo-container{display:flex;flex-direction:row;gap:2rem}.logo-container .input-container{flex:1}.logo-container .input-container span.error-message{color:var(--nylas-error)}.logo-container .logo{display:flex;justify-content:center;align-items:center;width:200px;height:100px;border:var(--nylas-base-200) solid 1px;border-radius:var(--nylas-border-radius-2x);overflow:hidden;padding:10px}.logo-container .logo img{max-height:100%;max-width:100%;object-fit:contain;object-position:center}', ue = he;
95
- var be = function(e, t, a, o) {
96
- var r = arguments.length, l = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, a) : o, n;
97
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
98
- l = Reflect.decorate(e, t, a, o);
99
- else
100
- for (var i = e.length - 1; i >= 0; i--)
101
- (n = e[i]) && (l = (r < 3 ? n(l) : r > 3 ? n(t, a, l) : n(t, a)) || l);
102
- return r > 3 && l && Object.defineProperty(t, a, l), l;
103
- }, O = function(e, t) {
104
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
105
- return Reflect.metadata(e, t);
106
- };
107
- const N = class {
108
- constructor(e) {
109
- b(this, e), this.nylasFormInputImageUrlInvalid = m(this, "nylasFormInputImageUrlInvalid", 7), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.componentType = "image-url", this.imageUrl = "", this.errorMessage = "", this.name = "input-image-url", this.currentImageUrl = this.imageUrl, this.error = "";
110
- }
111
- connectedCallback() {
112
- d("nylas-image-input", "connectedCallback");
113
- }
114
- disconnectedCallback() {
115
- d("nylas-image-input", "disconnectedCallback");
116
- }
117
- componentWillLoad() {
118
- d("nylas-image-input", "componentWillLoad"), this.host.setAttribute("name", this.name), this.host.setAttribute("component-type", this.componentType);
119
- }
120
- componentDidLoad() {
121
- d("nylas-image-input", "componentDidLoad"), this.currentImageUrl = this.imageUrl, this.setImage(this.imageUrl, !1);
122
- }
123
- componentWillUpdate() {
124
- d("nylas-image-input", "componentWillUpdate");
125
- }
126
- componentDidUpdate() {
127
- d("nylas-image-input", "componentDidUpdate");
128
- }
129
- componentWillRender() {
130
- d("nylas-image-input", "componentWillRender");
131
- }
132
- componentDidRender() {
133
- d("nylas-image-input", "componentDidRender");
134
- }
135
- elementNameChangedHandler(e) {
136
- d("nylas-image-input", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
137
- }
138
- errorMessageChangedHandler(e) {
139
- d("nylas-image-input", "errorMessageChangedHandler", e), this.error && (this.error = e);
140
- }
141
- async nylasFormInputChangedHandler(e) {
142
- const { name: t, value: a } = e.detail;
143
- t === this.name && this.setImage(a);
144
- }
145
- async nylasFormInputBlurHandler(e) {
146
- const { name: t, value: a } = e.detail;
147
- t === this.name && this.setImage(a);
148
- }
149
- setImage(e, t = !0) {
150
- this.error = "", q(e).then(() => {
151
- this.currentImageUrl = e, this.internals.setValidity({}), this.internals.setFormValue(this.currentImageUrl, this.name), t && this.valueChanged.emit({ value: this.currentImageUrl, name: this.name });
152
- }).catch(() => {
153
- this.error = this.errorMessage || "Invalid image URL.", this.nylasFormInputImageUrlInvalid.emit({ value: this.error, name: this.name }), typeof this.internals.setValidity == "function" && this.internals.setValidity({ customError: !0 }, this.error);
154
- });
155
- }
156
- render() {
157
- return s(w, { key: "8714725206ddd2b1e5cda73632dd61f08b0b9683" }, s("div", { key: "c85385627929d92520132f4ff8a53060df5d1434", class: "logo-container" }, s("div", { key: "83391a115c511188b7f1a1128e7c3860a46406ad", class: "input-container" }, s("input-component", { key: "204b9d5bb3aff58f9053cc1bfa0d52de449aaa2e", name: this.name, id: this.name, type: "text", required: !1, exportparts: "ic_input: iiu__logo-input-textfield", defaultValue: this.imageUrl ?? "" }), this.error && s("span", { class: "error-message" }, this.error)), this.currentImageUrl && !this.error && s("div", { class: "logo" }, s("img", { src: this.currentImageUrl, alt: "Logo" }))));
158
- }
159
- static get formAssociated() {
160
- return !0;
161
- }
162
- get host() {
163
- return x(this);
164
- }
165
- static get watchers() {
166
- return {
167
- name: ["elementNameChangedHandler"],
168
- errorMessage: ["errorMessageChangedHandler"]
169
- };
170
- }
171
- };
172
- be([
173
- C({
174
- name: "nylas-image-input",
175
- eventToProps: {
176
- valueChanged: async (e, t) => {
177
- const { valueChanged: a } = e.detail;
178
- a && a(e);
179
- }
180
- }
181
- }),
182
- O("design:type", Function),
183
- O("design:paramtypes", []),
184
- O("design:returntype", void 0)
185
- ], N.prototype, "render", null);
186
- N.style = ue;
187
- const ge = ':host{display:block;margin:1rem;--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-additional-participants__title{color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-additional-participants__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-additional-participants__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-additional-participants__input_group{padding-top:8px;display:flex;flex-direction:column;gap:4px}.nylas-additional-participants__input_group label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%}.nylas-additional-participants__input_group label span.org-as-participant{width:max-content}.nylas-additional-participants__error{color:var(--nylas-error);font-size:14px;font-family:var(--nylas-font-family);font-weight:400;line-height:16px;margin:0;text-align:left}.nylas-additional-participants__input_wrapper{display:flex;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-300)}.nylas-additional-participants__input_wrapper.error{border-color:var(--nylas-error)}.nylas-additional-participants__input_wrapper button{padding:12px;border:none;border-left:1px solid var(--nylas-base-300);background:none;cursor:pointer}.nylas-additional-participants__input_wrapper button:hover,.nylas-additional-participants__input_wrapper button:active{color:var(--nylas-primary)}.nylas-additional-participants__input_wrapper_organizer{border:none}.nylas-additional-participants__input{flex:1;display:flex;justify-content:space-between}.nylas-additional-participants__input input{border:none;outline:none;background:none;width:100%}.nylas-additional-participants__input input-dropdown{width:100%}.nylas-additional-participants__input input-dropdown::part(id_dropdown){width:100%;height:100%}.nylas-additional-participants__input input-dropdown::part(id_dropdown-input){height:100%;border-radius:var(--nylas-border-radius-2x);border:none;border-top-right-radius:initial;border-bottom-right-radius:initial;padding-left:16px}.nylas-additional-participants__input input-component::part(ic__input){background:var(--nylas-base-50)}.nylas-additional-participants__input input-component::part(ic__label){font-size:14px}.nylas-additional-participants__input input-component div.required-input{display:flex;gap:4px}.nylas-additional-participants__input input-component div.required-input label{display:flex;gap:4px;align-items:center}.nylas-additional-participants__input input-component div.required-input label tooltip-component#organizer_participant_tooltip::part(tc__content){left:-84px}.nylas-additional-participants__add{padding:12px;display:flex;align-items:center;border:none;background:none;cursor:pointer}.nylas-additional-participants__add span{padding:0 8px;font-size:16px;font-style:normal;font-weight:500}.nylas-additional-participants__add:hover,.nylas-additional-participants__add:active{color:var(--nylas-primary)}', me = ge;
188
- var ve = function(e, t, a, o) {
189
- var r = arguments.length, l = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, a) : o, n;
190
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
191
- l = Reflect.decorate(e, t, a, o);
192
- else
193
- for (var i = e.length - 1; i >= 0; i--)
194
- (n = e[i]) && (l = (r < 3 ? n(l) : r > 3 ? n(t, a, l) : n(t, a)) || l);
195
- return r > 3 && l && Object.defineProperty(t, a, l), l;
196
- }, I = function(e, t) {
197
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
198
- return Reflect.metadata(e, t);
199
- };
200
- const z = class {
201
- constructor(e) {
202
- b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "participants", this.selectedConfiguration = void 0, this.currentUser = void 0, this.currentUserCalendars = void 0, this.participantOptions = void 0, this.eventParticipants = void 0, this.roundRobinConfig = void 0, this.selectedLanguage = void 0, this.participants = this.eventParticipants ?? [], this.participantErrors = {}, this.includeOrganizerAsParticipant = !0, this.isRoundRobinConfig = !1, this.error = "", this.requiredError = "", this.patternError = "";
203
- }
204
- elementNameChangedHandler(e) {
205
- d("nylas-additional-participants", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
206
- }
207
- selectedConfigurationAndCurrentUserChangedHandler(e, t, a) {
208
- d("nylas-additional-participants", "selectedConfigurationAndCurrentUserChangedHandler", e, this.currentUser), a === "selectedConfiguration" ? this.updateState(e, this.currentUser, !1) : a === "currentUser" && this.updateState(this.selectedConfiguration, e, !1);
209
- }
210
- selectedLanguageChangedHandler(e, t) {
211
- e !== t && (c.changeLanguage(e), this.requiredError = c.t("fieldRequired", { field: c.t("email") }), this.patternError = c.t("invalidInputFormat", { field: c.t("email") }), this.error && (this.error = c.t("nylasAdditionalParticipants.error")));
212
- }
213
- connectedCallback() {
214
- d("nylas-additional-participants", "connectedCallback");
215
- }
216
- componentWillLoad() {
217
- d("nylas-additional-participants", "componentWillLoad"), this.host.setAttribute("name", this.name);
218
- }
219
- componentDidLoad() {
220
- d("nylas-additional-participants", "componentDidLoad"), this.selectedConfiguration ? this.updateState(this.selectedConfiguration, this.currentUser, !1) : this.eventParticipants && (this.participants = this.eventParticipants || [], this.isRoundRobinConfig = this.roundRobinConfig || !1, this.updateFormValue(!0));
221
- }
222
- disconnectedCallback() {
223
- d("nylas-additional-participants", "disconnectedCallback");
224
- }
225
- updateState(e, t, a = !0) {
226
- var o, r, l, n;
227
- this.isRoundRobinConfig = (r = (o = e == null ? void 0 : e.availability) == null ? void 0 : o.availability_rules) != null && r.availability_method ? ((n = (l = e == null ? void 0 : e.availability) == null ? void 0 : l.availability_rules) == null ? void 0 : n.availability_method) !== "collective" : !1, this.participants = (e == null ? void 0 : e.participants) || this.eventParticipants || [], this.includeOrganizerAsParticipant = !!(this.isRoundRobinConfig && this.participants.find((i) => i.email === (t == null ? void 0 : t.email))), this.updateOrganizerAsParticipant(a);
228
- }
229
- get isInternalsAvailable() {
230
- return this.internals !== void 0 && typeof this.internals.setFormValue == "function" && typeof this.internals.setValidity == "function";
231
- }
232
- onInputOptionChanged(e) {
233
- var l, n, i, p;
234
- d("nylas-additional-participants", "onInputOptionChanged");
235
- const t = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, a = e.detail.name, o = (l = this.participantOptions) == null ? void 0 : l.find((f) => f.email === e.detail.value);
236
- if (!o && this.isRoundRobinConfig) {
237
- this.isInternalsAvailable && this.internals.setValidity({ customError: !0 }, "For round robin configuration, participant should be selected from the dropdown."), this.participantErrors[a] = "For round robin page, participant should be selected from the dropdown.", this.participants[a].is_valid = !1, this.participants = [...this.participants];
238
- return;
239
- } else if (!o && !t.test(e.detail.value)) {
240
- this.isInternalsAvailable && this.internals.setValidity({ customError: !0 }, c.t("nylasAdditionalParticipants.error_email")), this.participantErrors[a] = c.t("nylasAdditionalParticipants.error_email"), this.participants[a].is_valid = !1, this.participants = [...this.participants];
241
- return;
242
- } else
243
- this.participantErrors[a] = "", this.participants[a].is_valid = !0, this.isInternalsAvailable && this.internals.setValidity({});
244
- this.participants[a].email = e.detail.value;
245
- const r = (n = o == null ? void 0 : o.calendars) == null ? void 0 : n.find((f) => f.is_primary);
246
- this.participants[a].availability = o && (r != null && r.id) ? { calendar_ids: [r.id] } : (i = o == null ? void 0 : o.calendars[0]) != null && i.id ? { calendar_ids: [o.calendars[0].id] } : void 0, this.participants[a].booking = o && this.isRoundRobinConfig && (r != null && r.id) ? { calendar_id: r.id } : this.isRoundRobinConfig && ((p = o == null ? void 0 : o.calendars[0]) != null && p.id) ? { calendar_id: o.calendars[0].id } : void 0, this.participants[a].name = (o == null ? void 0 : o.name) || e.detail.value, this.participants = [...this.participants], this.updateFormValue();
247
- }
248
- updateOrganizerAsParticipant(e = !0) {
249
- var a, o, r, l, n, i, p;
250
- const t = this.participants.find((f) => {
251
- var h;
252
- return f.email === ((h = this.currentUser) == null ? void 0 : h.email);
253
- });
254
- if (this.isRoundRobinConfig && !t && ((a = this.currentUser) != null && a.email)) {
255
- const f = ((r = (o = this.currentUserCalendars) == null ? void 0 : o.find((h) => h.is_primary)) == null ? void 0 : r.id) || ((n = (l = this.currentUserCalendars) == null ? void 0 : l[0]) == null ? void 0 : n.id) || "primary";
256
- this.participants = [
257
- {
258
- name: (i = this.currentUser) == null ? void 0 : i.name,
259
- email: (p = this.currentUser) == null ? void 0 : p.email,
260
- is_organizer: !0,
261
- availability: {
262
- calendar_ids: [f]
263
- },
264
- booking: {
265
- calendar_id: f
266
- }
267
- },
268
- ...this.participants
269
- ];
270
- }
271
- this.updateFormValue(e);
272
- }
273
- addParticipant() {
274
- d("nylas-additional-participants", "addParticipant"), this.participants = [...this.participants, { name: "", email: "", is_organizer: !1 }], this.updateFormValue();
275
- }
276
- removeParticipant(e) {
277
- d("nylas-additional-participants", "removeParticipant"), this.participants = this.participants.filter((t, a) => a !== e), this.updateFormValue();
278
- }
279
- updateFormValue(e = !0) {
280
- d("nylas-additional-participants", "updateFormValue");
281
- const t = this.isRoundRobinConfig ? this.includeOrganizerAsParticipant ? this.participants : this.participants.filter((a) => !a.is_organizer) : this.participants;
282
- t.length === 0 ? (this.error = c.t("nylasAdditionalParticipants.error"), this.isInternalsAvailable && this.internals.setValidity({ customError: !0 }, this.error)) : (this.isInternalsAvailable && this.internals.setValidity({}), this.error = "", this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(t), this.name), e && this.valueChanged.emit({ value: JSON.stringify(t), name: this.name }));
283
- }
284
- getArrayDifference(e, t) {
285
- return e.filter((o) => !t.some((r) => o.email === r.email)).map((o) => ({ value: o.email, label: o.email }));
286
- }
287
- render() {
288
- return s(w, { key: "4d547fe2488b5019af5d63d9691a740e8efb5f43", part: "nadtnlpart" }, s("nylas-form-card", { key: "627e61e9080b989b5871d798339e718e68bb639d", exportparts: "nfc, nfc__header" }, s("h3", { key: "447dc3fee1b9e4014a7aa6e54a01dbf84d4893ac", slot: "header-title", class: "nylas-additional-participants__title", part: "nadtnlpart__title" }, c.t("nylasAdditionalParticipants.headerTitle")), s("p", { key: "f116167709f9464422d4dedba69a1db6c3b55b0e", slot: "header-subtitle", class: "nylas-additional-participants__subtitle", part: "nadtnlpart__subtitle" }, c.t("nylasAdditionalParticipants.headerSubTitle")), s("div", { key: "f231168dcab771100276cbd76710ec0446cdfa8c", slot: "content", class: "nylas-additional-participants__content", part: "nadtnlpart__content" }, s("div", { key: "47f0cf5882fa4f88a09ba74b70136e7911cae75f" }, this.participants.map((e, t) => s("div", { class: "nylas-additional-participants__input_group", part: "nadtnlpart__input_group" }, !e.is_organizer && s("label", null, `${c.t("nylasAdditionalParticipants.participant")} ${t}`), s("div", { part: "nadtnlpart__input_wrapper", class: {
289
- "nylas-additional-participants__input_wrapper": !0,
290
- "nylas-additional-participants__input_wrapper_organizer": (e == null ? void 0 : e.is_organizer) === !0,
291
- "nylas-additional-participants__input_wrapper_invalid": e.is_valid === !1,
292
- error: e.is_valid === !1
293
- } }, s("div", { class: { "nylas-additional-participants__input": !0, organizer: (e == null ? void 0 : e.is_organizer) === !0 }, part: "nadtnlpart__input" }, e.is_organizer ? s("input-component", { class: "label-input", name: `${t}`, key: t, label: c.t("nylasAdditionalParticipants.organizer"), required: !1, requiredError: this.requiredError, patternError: this.patternError, readOnly: e.is_organizer, defaultValue: e.email }, this.isRoundRobinConfig && s("div", { class: "required-input", slot: "additional-input" }, s("input", { type: "checkbox", name: "organizer_participant", id: "organizer_participant", onClick: () => {
294
- this.includeOrganizerAsParticipant = !this.includeOrganizerAsParticipant, this.updateFormValue();
295
- }, checked: this.includeOrganizerAsParticipant }), s("label", { htmlFor: "organizer_participant", "aria-label": "Include as participant" }, s("span", { class: "org-as-participant", part: "nadtnlpart__org-as-participant" }, c.t("nylasAdditionalParticipants.organizerAsParticipant")), s("tooltip-component", { id: "organizer_participant_tooltip" }, s("info-icon", { slot: "tooltip-icon" }), s("span", { slot: "tooltip-content" }, s("strong", null, c.t("nylasAdditionalParticipants.tooltip.includeOrganizer"), ":"), " ", c.t("nylasAdditionalParticipants.tooltip.includeOrganizerDesc"), " ", s("br", null), s("strong", null, c.t("nylasAdditionalParticipants.tooltip.excludeOrganizer"), ":"), " ", c.t("nylasAdditionalParticipants.tooltip.excludeOrganizerDesc")))))) : s("input-dropdown", { id: `${t}`, name: `${t}`, filterable: !0, inputValue: e.email, options: this.getArrayDifference(this.participantOptions || [], this.participants) }), !e.is_organizer && s("button", { onClick: () => this.removeParticipant(t), part: "nadtnlpart__remove-participant" }, s("close-icon", null)))), !e.is_valid && s("p", { class: "nylas-additional-participants__error", part: "nadtnlpart__error" }, this.participantErrors[t]))), s("p", { key: "d2b56b8aedb241aa6f30d7a1cd6bbb65c3b3df83", class: "nylas-additional-participants__error", part: "nadtnlpart__error" }, this.error)), s("button", { key: "e9ae0842ddbfa5e99216104204e944931c234d2a", class: "nylas-additional-participants__add", part: "nadtnlpart__add-participant", onClick: () => this.addParticipant() }, s("add-circle-icon", { key: "72c4f18b78923e41c5bf85203dfddce1faf69c66" }), " ", s("span", { key: "aa8f679690c7a591d120bafb6d3df96e74db4b5e" }, this.participants.length > 1 ? c.t("nylasAdditionalParticipants.addParticipant", { context: "next" }) : c.t("nylasAdditionalParticipants.addParticipant", { context: "first" }))))));
296
- }
297
- static get formAssociated() {
298
- return !0;
299
- }
300
- get host() {
301
- return x(this);
302
- }
303
- static get watchers() {
304
- return {
305
- name: ["elementNameChangedHandler"],
306
- currentUser: ["selectedConfigurationAndCurrentUserChangedHandler"],
307
- selectedConfiguration: ["selectedConfigurationAndCurrentUserChangedHandler"],
308
- selectedLanguage: ["selectedLanguageChangedHandler"]
309
- };
310
- }
311
- };
312
- ve([
313
- C({
314
- name: "nylas-additional-participants",
315
- stateToProps: /* @__PURE__ */ new Map([
316
- ["schedulerConfig.additionalParticipants", "participantOptions"],
317
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
318
- ["schedulerConfig.currentUser", "currentUser"],
319
- ["schedulerConfig.calendars", "currentUserCalendars"],
320
- ["schedulerConfig.selectedLanguage", "selectedLanguage"]
321
- ]),
322
- eventToProps: {},
323
- fireRegisterEvent: !0
324
- }),
325
- I("design:type", Function),
326
- I("design:paramtypes", []),
327
- I("design:returntype", void 0)
328
- ], z.prototype, "render", null);
329
- z.style = me;
330
- const xe = ':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}.nylas-event-description{display:flex;flex-direction:column;gap:4px;position:relative}.nylas-event-description label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-description label span.label-icon{margin-left:4px}.nylas-event-description label span.label-icon tooltip-component{display:flex}.nylas-event-description textarea{padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px;border:1px solid var(--nylas-base-200)}.nylas-event-description textarea::-webkit-resizer{display:none}.nylas-event-description div.event-description{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);white-space:nowrap;scrollbar-width:thin;min-height:50px;overflow-y:auto;white-space:pre-wrap;line-height:1.5;}.nylas-event-description div.event-description::-webkit-scrollbar{width:6px;height:6px}.nylas-event-description div.event-description.error{border-color:var(--nylas-error);border-width:2px;outline:none}.nylas-event-description span.add-additional-fields{display:flex;align-items:center;gap:8px}.nylas-event-description span.add-additional-fields button-component button{height:35px}.nylas-event-description span.help-text{display:inline-block;gap:4px;align-items:center;color:var(--nylas-base-500);font-size:14px;font-style:normal;font-weight:400;line-height:21px;position:relative}.nylas-event-description span.help-text span.label-icon{display:inline-block}.nylas-event-description span.help-text span.label-icon tooltip-component::part(tc__container){position:unset}.nylas-event-description span.help-text span.label-icon tooltip-component::part(tc__content){position:absolute;top:4px;left:50%;transform:translateX(-50%)}.nylas-event-description .highlighted-tag{background-color:var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:2px 5px;margin-left:4px;margin-bottom:4px;display:inline-block;vertical-align:baseline}.nylas-event-description .token-options{display:block;background-color:var(--nylas-base-0);width:100%;max-height:336px;margin-top:28px;overflow:auto;z-index:1;border-radius:4px;position:absolute;bottom:108px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}@media screen and (max-width: 768px){.nylas-event-description .token-options{right:0;width:325px;max-width:unset}}.nylas-event-description .token-options ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px;margin:0}.nylas-event-description .token-options ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.nylas-event-description .token-options ul li .token-label{display:flex;flex-direction:column;font-weight:400}.nylas-event-description .token-options ul li .token-label .token{color:var(--nylas-abse-900);font-size:16px;line-height:24px}.nylas-event-description .token-options ul li .token-label .description{color:var(--nylas-base-600);font-size:14px;line-height:21px}.nylas-event-description .token-options ul li:hover,.nylas-event-description .token-options ul li:focus,.nylas-event-description .token-options ul li:active,.nylas-event-description .token-options ul li.active{background-color:var(--nylas-base-100)}.nylas-event-description .token-options ul li:hover .token-label .token,.nylas-event-description .token-options ul li:focus .token-label .token,.nylas-event-description .token-options ul li:active .token-label .token,.nylas-event-description .token-options ul li.active .token-label .token{color:var(--nylas-primary)}.nylas-event-description .token-options .selected{background-color:var(--nylas-base-100)}', ke = xe;
331
- var we = function(e, t, a, o) {
332
- var r = arguments.length, l = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, a) : o, n;
333
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
334
- l = Reflect.decorate(e, t, a, o);
335
- else
336
- for (var i = e.length - 1; i >= 0; i--)
337
- (n = e[i]) && (l = (r < 3 ? n(l) : r > 3 ? n(t, a, l) : n(t, a)) || l);
338
- return r > 3 && l && Object.defineProperty(t, a, l), l;
339
- }, A = function(e, t) {
340
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
341
- return Reflect.metadata(e, t);
342
- };
343
- const B = class {
344
- constructor(e) {
345
- var t, a, o, r;
346
- b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.eventDescription = (a = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) == null ? void 0 : a.description, this.name = "description", this.selectedLanguage = void 0, this.hideAutoPopulateButton = !1, this.noTemplates = !1, this.description = this.eventDescription || ((r = (o = this.selectedConfiguration) == null ? void 0 : o.event_booking) == null ? void 0 : r.description) || "", this.showTokens = !1, this.availableTokens = k.map((l) => ({
347
- label: l.token,
348
- value: l.value,
349
- labelHTML: l
350
- })), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 }, this.validationError = "", this.additionalFieldTokens = [];
351
- }
352
- elementNameChangedHandler(e) {
353
- d("nylas-event-description", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
354
- }
355
- selectedConfigurationChangedHandler(e) {
356
- var l, n;
357
- d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e);
358
- const t = ((l = e == null ? void 0 : e.event_booking) == null ? void 0 : l.description) || this.eventDescription || "", a = ((n = e == null ? void 0 : e.scheduler) == null ? void 0 : n.additional_fields) || {}, r = (Object.keys(a) || []).map((i) => ({
359
- token: `$${i}`,
360
- value: `\${${i}}`,
361
- description: a[i].label || ""
362
- }));
363
- this.additionalFieldTokens = [...r], this.availableTokens = [...k, ...r].map((i) => ({
364
- label: i.token,
365
- value: i.value,
366
- labelHTML: i
367
- })), this.filteredTokens = [...this.availableTokens], this.description = t, t && this.updateEventDescriptionFromProp(t);
368
- }
369
- selectedLanguageChangedHandler(e, t) {
370
- if (e === t)
371
- return;
372
- c.changeLanguage(e);
373
- const a = {
374
- $invitee: "invitee",
375
- $invitee_email: "inviteeEmail",
376
- $duration: "duration"
377
- };
378
- this.availableTokens = this.availableTokens.map((o) => (a[o.label] && (o.labelHTML.description = c.t(`nylasEventTitle.eventTitleTokenDescription.${a[o.label]}`)), o)), this.filteredTokens = [...this.availableTokens];
379
- }
380
- connectedCallback() {
381
- d("nylas-event-description", "connectedCallback");
382
- }
383
- componentWillLoad() {
384
- d("nylas-event-description", "componentWillLoad"), this.host.setAttribute("name", this.name);
385
- }
386
- componentDidLoad() {
387
- d("nylas-event-description", "componentDidLoad"), this.selectedConfiguration ? this.selectedConfigurationChangedHandler(this.selectedConfiguration) : (this.description = this.eventDescription || "", this.updateEventDescriptionFromProp(this.description));
388
- }
389
- disconnectedCallback() {
390
- d("nylas-event-description", "disconnectedCallback");
391
- }
392
- valueChangedHandler(e) {
393
- const { name: t, value: a } = e.detail;
394
- if (t === "additional-fields") {
395
- const o = JSON.parse(a.toString()), l = (Object.keys(o) || []).map((n) => ({
396
- token: `$${n}`,
397
- value: `\${${n}}`,
398
- description: o[n].label || ""
399
- }));
400
- this.additionalFieldTokens = [...l], this.availableTokens = [...k, ...l].map((n) => ({
401
- label: n.token,
402
- value: n.value,
403
- labelHTML: n
404
- })), this.filteredTokens = [...this.availableTokens];
405
- }
406
- }
407
- updateEventDescriptionFromProp(e) {
408
- d("nylas-event-description", "updateEventDescriptionFromProp", e);
409
- const t = e || this.description;
410
- this.descriptionRef && (this.descriptionRef.innerHTML = this.highlightTokens(t));
411
- }
412
- highlightTokens(e) {
413
- let t = e;
414
- return [...k, ...this.additionalFieldTokens].forEach((a) => {
415
- const o = a.value, r = new RegExp(`(\\${o})(?!\\w)`, "g");
416
- t = (t == null ? void 0 : t.replace(r, '<span class="highlighted-tag">$1</span>')) || "";
417
- }), t;
418
- }
419
- getCurrentSelectionForBrowser() {
420
- var o, r, l;
421
- const e = (n, i, p, f) => {
422
- const h = n.replace(/[\u200B-\u200D\uFEFF]/g, ""), y = h.lastIndexOf("$"), u = h.substring(y).split(" ")[0];
423
- return {
424
- focusOffset: i,
425
- dollarIndex: y,
426
- lastWord: u,
427
- currentText: h,
428
- node: p,
429
- allSelected: f
430
- };
431
- }, t = (n) => {
432
- var i, p;
433
- return n.anchorOffset === 0 && n.focusOffset === ((p = (i = n.focusNode) == null ? void 0 : i.nodeValue) == null ? void 0 : p.length);
434
- };
435
- switch (M()) {
436
- case "Chrome": {
437
- const n = (o = this.host.shadowRoot) == null ? void 0 : o.getSelection(), i = n == null ? void 0 : n.focusNode, p = (i == null ? void 0 : i.nodeValue) || "", f = n && t(n);
438
- return e(p, (n == null ? void 0 : n.focusOffset) || -1, i, f);
439
- }
440
- case "Firefox": {
441
- const n = document.getSelection(), i = ((r = n == null ? void 0 : n.anchorNode) == null ? void 0 : r.nodeValue) || "", p = n && t(n);
442
- return e(i, (n == null ? void 0 : n.focusOffset) || -1, n == null ? void 0 : n.anchorNode, p);
443
- }
444
- case "Safari": {
445
- const n = window.getSelection(), i = n == null ? void 0 : n.getComposedRanges(this.host.shadowRoot)[0], p = ((l = i == null ? void 0 : i.startContainer) == null ? void 0 : l.nodeValue) || "", f = n && t(n);
446
- return e(p, (i == null ? void 0 : i.endOffset) || -1, i == null ? void 0 : i.startContainer, f);
447
- }
448
- default:
449
- return console.warn("Browser not supported"), null;
450
- }
451
- }
452
- handleChange(e) {
453
- let t = e.target.textContent || "";
454
- t = S(t);
455
- const a = this.getCurrentSelectionForBrowser();
456
- if (!a) {
457
- this.updateEventDescription(t), this.resetDropdown();
458
- return;
459
- }
460
- const { focusOffset: o, dollarIndex: r, lastWord: l, currentText: n } = a;
461
- if (r === -1 || o < r) {
462
- this.updateEventDescription(t), this.resetDropdown();
463
- return;
464
- }
465
- l.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
466
- $value: l,
467
- fullText: n,
468
- index: r,
469
- focusOffset: o
470
- }, this.populateSuggestionsDropdown(l)) : this.resetDropdown(), this.updateEventDescription(t);
471
- }
472
- handleInputKeyDown(e) {
473
- var a, o, r, l;
474
- const t = this.getCurrentSelectionForBrowser();
475
- if (t != null && t.allSelected && !H(e) && (this.descriptionRef.innerHTML = ""), e.key === "Enter") {
476
- e.preventDefault();
477
- const n = (a = this.host.shadowRoot) == null ? void 0 : a.getElementById(this.ariaActivedescendant);
478
- if (n)
479
- n.click(), this.ariaActivedescendant = "";
480
- else {
481
- const i = t == null ? void 0 : t.node, p = (t == null ? void 0 : t.focusOffset) || 0;
482
- if (!i || p === -1 || this.descriptionRef.childNodes.length === 0) {
483
- const f = document.createTextNode(`
484
- `);
485
- this.descriptionRef.insertBefore(f, this.descriptionRef.firstChild);
486
- const h = document.createRange();
487
- h.setStart(f, 1), h.collapse(!0);
488
- const y = window.getSelection();
489
- y == null || y.removeAllRanges(), y == null || y.addRange(h);
490
- } else if (i.nodeType === Node.TEXT_NODE) {
491
- const f = i.nodeValue || "", h = f.slice(0, p) + `
492
- ` + f.slice(p);
493
- i.nodeValue = h;
494
- const y = document.createRange();
495
- y.setStart(i, p + 1), y.collapse(!0);
496
- const u = window.getSelection();
497
- u == null || u.removeAllRanges(), u == null || u.addRange(y);
498
- }
499
- this.descriptionRef.focus();
500
- }
501
- } else if (e.key === "ArrowDown") {
502
- this.showTokens && e.preventDefault();
503
- const n = (o = this.host.shadowRoot) == null ? void 0 : o.getElementById(this.ariaActivedescendant);
504
- if (n) {
505
- const i = n.nextElementSibling;
506
- i ? this.ariaActivedescendant = i.id : this.ariaActivedescendant = this.filteredTokens[0].label;
507
- } else
508
- this.ariaActivedescendant = this.filteredTokens[0].label;
509
- } else if (e.key === "ArrowUp") {
510
- this.showTokens && e.preventDefault();
511
- const n = (r = this.host.shadowRoot) == null ? void 0 : r.getElementById(this.ariaActivedescendant);
512
- if (n) {
513
- const i = n.previousElementSibling;
514
- i ? this.ariaActivedescendant = i.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
515
- } else
516
- this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
517
- } else if (e.key === "Escape")
518
- e.preventDefault(), this.resetDropdown();
519
- else if (e.key === "Backspace" || e.key === "Delete") {
520
- const n = (l = t == null ? void 0 : t.node) == null ? void 0 : l.parentNode;
521
- t != null && t.currentText.startsWith("${") && n && n.nodeName === "SPAN" && (e.preventDefault(), n.removeChild(t.node), n.remove(), this.resetDropdown()), (this.descriptionRef.textContent === "" || t != null && t.allSelected) && (this.descriptionRef.innerHTML = "", this.updateEventDescription(""));
522
- }
523
- }
524
- selectOption(e, t) {
525
- var T;
526
- e.preventDefault();
527
- const a = this.currentWord.fullText, o = this.currentWord.$value;
528
- let r = this.descriptionRef.firstChild, l = null;
529
- for (; r; ) {
530
- if (r.nodeType === 3) {
531
- const v = ((T = r.textContent) == null ? void 0 : T.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", L = a.replace(/[\u200B-\u200D\uFEFF]/g, "");
532
- if (v.includes(L)) {
533
- l = r;
534
- break;
535
- }
536
- }
537
- r = r.nextSibling;
538
- }
539
- if (!l)
540
- return;
541
- const n = l.textContent || "", i = n.indexOf(o), p = n.substring(0, i), f = n.substring(i + o.length), h = document.createTextNode(p), y = document.createRange(), u = document.createElement("span");
542
- u.classList.add("highlighted-tag"), u.textContent = `${t.value}`;
543
- const _ = document.createTextNode(f);
544
- if (f !== "")
545
- l.replaceWith(h, u, _), y.setStart(_, 1);
546
- else {
547
- const v = document.createTextNode("​");
548
- l.replaceWith(h, u, v), y.setStart(v, 1);
549
- }
550
- this.resetDropdown(), this.descriptionRef.focus();
551
- const g = window.getSelection();
552
- y.collapse(!0), g == null || g.removeAllRanges(), g == null || g.addRange(y), this.updateEventDescription(this.descriptionRef.textContent || "");
553
- }
554
- populateSuggestionsDropdown(e = "") {
555
- this.filteredTokens = this.availableTokens.filter((t) => t.label.startsWith(e.toString()) || t.value.startsWith(e.toString())), this.filteredTokens.length > 0 && (this.ariaActivedescendant = this.filteredTokens[0].label);
556
- }
557
- get isInternalsAvailable() {
558
- return typeof this.internals < "u" && typeof this.internals.setValidity == "function" && typeof this.internals.setFormValue == "function";
559
- }
560
- updateEventDescription(e) {
561
- var a;
562
- const t = e.replace(/ +/g, " ");
563
- this.isInternalsAvailable && ((a = this.internals) == null || a.setFormValue(t, this.name)), this.valueChanged.emit({ value: t, name: this.name });
564
- }
565
- resetDropdown() {
566
- this.showTokens = !1, this.ariaActivedescendant = "";
567
- }
568
- getLabelHTML(e) {
569
- return s("div", { class: "token-label" }, s("span", { class: "token" }, e.token), s("span", { class: "description" }, e.description));
570
- }
571
- handleAddAdditionalFields() {
572
- if (this.additionalFieldTokens.length === 0)
573
- return;
574
- const e = this.descriptionRef.innerHTML, t = "--- Additional Fields ---", a = "--- End Additional Fields ---", o = e.indexOf(t), r = e.indexOf(a);
575
- let l = t + `
576
- `;
577
- this.additionalFieldTokens.forEach((i) => {
578
- l += `${i.description}: ${i.value}
579
- `;
580
- }), l += a;
581
- let n;
582
- o !== -1 && r !== -1 ? n = e.substring(0, o) + l + e.substring(r + a.length) : n = e + l, this.updateEventDescriptionFromProp(n), this.updateEventDescription(n);
583
- }
584
- render() {
585
- var e;
586
- return s(w, { key: "22675b5fed7bbca517109629eae72cbcc92b21a9" }, s("div", { key: "16c888f9635a3d6a40e1caaa98a032044a29abe1", class: "nylas-event-description", part: "nedesc" }, s("label", { key: "05f549d01ea2477c208c4e27f41ae7c5d3487ce9", htmlFor: "description" }, c.t("nylasEventDescription.headerTitle"), s("span", { key: "5355ed1517f58fc6c07ce121be35998154a166cc", class: "label-icon" }, s("tooltip-component", { key: "2efa954b0f0ee944b5b88039d97d72fa0d3ec46e" }, s("info-icon", { key: "e6c02583a6668f0c25771183a7a11d4c0de87887", slot: "tooltip-icon" }), s("span", { key: "ff003ecf4ba64e385fc50edff5c4a621a3600e5e", slot: "tooltip-content" }, c.t("nylasEventDescription.tooltip.desc"))))), s("div", { key: "296a0a0321ab1b1be9f3b6e89bcf9f58da8b6969", id: "event-description", class: { "event-description": !0 }, part: "nedesc__textarea", contentEditable: "true", onInput: (t) => this.handleChange(t), onKeyDown: (t) => this.handleInputKeyDown(t), ref: (t) => this.descriptionRef = t }), !this.noTemplates && this.showTokens && ((e = this.filteredTokens) == null ? void 0 : e.length) > 0 && s("div", { class: "token-options", part: "nedesc__dropdown-content" }, s("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map((t) => s("li", { tabindex: "0", key: t.label, id: t.label, class: { active: this.ariaActivedescendant === t.label }, onClick: (a) => this.selectOption(a, t), role: "option" }, this.getLabelHTML(t.labelHTML))))), !this.noTemplates && s("span", { class: "help-text" }, c.t("nylasEventTitle.helpText", { context: "start", field: c.t("nylasEventTitle.description") }), " ", s("code", null, "$"), " ", c.t("nylasEventTitle.helpText", { context: "end" }), s("span", { class: "label-icon" }, s("tooltip-component", null, s("info-icon", { slot: "tooltip-icon", width: "13", height: "13" }), s("span", { slot: "tooltip-content" }, c.t("nylasEventTitle.tooltip.desc"), " ", s("code", null, "${invitee}"))))), !this.noTemplates && !this.hideAutoPopulateButton && s("span", { class: "add-additional-fields" }, s("button-component", { variant: "basic", onClick: () => this.handleAddAdditionalFields() }, c.t("nylasEventDescription.addAdditionalFields.buttonText")), s("span", { class: "label-icon" }, s("tooltip-component", null, s("info-icon", { slot: "tooltip-icon" }), s("span", { slot: "tooltip-content" }, c.t("nylasEventDescription.addAdditionalFields.tooltip.desc"), " ", s("code", null, "${invitee}")))))));
587
- }
588
- static get formAssociated() {
589
- return !0;
590
- }
591
- get host() {
592
- return x(this);
593
- }
594
- static get watchers() {
595
- return {
596
- name: ["elementNameChangedHandler"],
597
- selectedConfiguration: ["selectedConfigurationChangedHandler"],
598
- selectedLanguage: ["selectedLanguageChangedHandler"]
599
- };
600
- }
601
- };
602
- we([
603
- C({
604
- name: "nylas-event-description",
605
- stateToProps: /* @__PURE__ */ new Map([
606
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
607
- ["schedulerConfig.selectedLanguage", "selectedLanguage"]
608
- ]),
609
- eventToProps: {},
610
- fireRegisterEvent: !0
611
- }),
612
- A("design:type", Function),
613
- A("design:paramtypes", []),
614
- A("design:returntype", void 0)
615
- ], B.prototype, "render", null);
616
- B.style = ke;
617
- const Ce = ':host{display:block;margin:1rem;--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-event-info__title{color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-event-info__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-event-info__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-event-info__block{display:flex;justify-content:space-between;gap:0.5rem}', _e = Ce;
618
- var Te = function(e, t, a, o) {
619
- var r = arguments.length, l = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, a) : o, n;
620
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
621
- l = Reflect.decorate(e, t, a, o);
622
- else
623
- for (var i = e.length - 1; i >= 0; i--)
624
- (n = e[i]) && (l = (r < 3 ? n(l) : r > 3 ? n(t, a, l) : n(t, a)) || l);
625
- return r > 3 && l && Object.defineProperty(t, a, l), l;
626
- }, D = function(e, t) {
627
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
628
- return Reflect.metadata(e, t);
629
- };
630
- const U = class {
631
- constructor(e) {
632
- b(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedLanguage = void 0;
633
- }
634
- selectedLanguageChangedHandler(e, t) {
635
- e !== t && c.changeLanguage(e);
636
- }
637
- connectedCallback() {
638
- d("nylas-event-info", "connectedCallback");
639
- }
640
- componentWillLoad() {
641
- d("nylas-event-info", "componentWillLoad");
642
- }
643
- componentDidLoad() {
644
- d("nylas-event-info", "componentDidLoad"), V(["inputs"], this.el);
645
- }
646
- disconnectedCallback() {
647
- d("nylas-event-info", "disconnectedCallback");
648
- }
649
- render() {
650
- return s(w, { key: "cfa64573a181b73e281bdba4701609cb868252c8" }, s("nylas-form-card", { key: "78088bb50a3234e17c199abc6b4e1a2fffd94707", exportparts: "nfc__header: nei__header" }, s("h1", { key: "ab1659b45f24e04683d73661fdc76a8b787398f2", slot: "header-title", class: "nylas-event-info__title", part: "nei__title" }, c.t("nylasEventInfo.headerTitle")), s("div", { key: "eda2bc7c2ce9cb16b92d48aa15dabf965d71b926", slot: "content", class: "nylas-event-info__content" }, s("slot", { key: "8c12079eb30485a8fb8c1821223b54551268b4b1", name: "inputs" }))));
651
- }
652
- static get formAssociated() {
653
- return !0;
654
- }
655
- get el() {
656
- return x(this);
657
- }
658
- static get watchers() {
659
- return {
660
- selectedLanguage: ["selectedLanguageChangedHandler"]
661
- };
662
- }
663
- };
664
- Te([
665
- C({
666
- name: "nylas-event-info",
667
- stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedLanguage", "selectedLanguage"]]),
668
- eventToProps: {},
669
- fireRegisterEvent: !0
670
- }),
671
- D("design:type", Function),
672
- D("design:paramtypes", []),
673
- D("design:returntype", void 0)
674
- ], U.prototype, "render", null);
675
- U.style = _e;
676
- const Ee = ':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}.nylas-event-location{display:flex;flex-direction:column;gap:4px;font-family:var(--nylas-font-family)}.nylas-event-location label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-location label span.label-icon{margin-left:4px}.nylas-event-location label span.label-icon tooltip-component{display:flex}.nylas-event-location span[slot=select-icon]{border-right:1px solid var(--nylas-base-200);padding:16px 0.75rem 16px 0.5rem;border-radius:var(--nylas-border-radius-2x);border-bottom-right-radius:0;border-top-right-radius:0;height:20px}.nylas-event-location div.location-input{display:grid;grid-template-columns:auto 1fr;width:100%;gap:0.5rem}@media screen and (max-width: 768px){.nylas-event-location div.location-input{grid-template-columns:1fr}}.nylas-event-location div.location-input input{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:12px 16px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}.nylas-event-location select-dropdown{width:208px}@media screen and (max-width: 768px){.nylas-event-location select-dropdown{width:100%}}.nylas-event-location select-dropdown::part(sd_dropdown){width:100%}.nylas-event-location select-dropdown::part(sd_dropdown-content){left:calc(35px + 0.5rem)}.nylas-event-location select-dropdown::part(sd_dropdown-button){display:flex;justify-content:space-between;width:100%;border:1px solid var(--nylas-base-200);padding:0 0.5rem}.nylas-event-location select-dropdown::part(sd_dropdown-button-selected-label){display:inline-flex;align-self:center;padding:14px 0;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', Le = Ee;
677
- var Oe = function(e, t, a, o) {
678
- var r = arguments.length, l = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, a) : o, n;
679
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
680
- l = Reflect.decorate(e, t, a, o);
681
- else
682
- for (var i = e.length - 1; i >= 0; i--)
683
- (n = e[i]) && (l = (r < 3 ? n(l) : r > 3 ? n(t, a, l) : n(t, a)) || l);
684
- return r > 3 && l && Object.defineProperty(t, a, l), l;
685
- }, P = function(e, t) {
686
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
687
- return Reflect.metadata(e, t);
688
- };
689
- const W = class {
690
- constructor(e) {
691
- var t;
692
- b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "location", this.currentUser = void 0, this.userProvider = void 0, this.eventConferencing = void 0, this.conferenceProviders = void 0, this.selectedConfiguration = void 0, this.eventLocation = void 0, this.selectedLanguage = void 0, this.location = this.eventLocation ?? "", this.grantId = this.eventConferencing ? this.setDefaultGrantID(this.eventConferencing) : "", this.selectedLocationOption = void 0, this.userProviderState = this.userProvider ?? ((t = this.currentUser) == null ? void 0 : t.provider) ?? "", this.locationOptions = [
693
- { value: "none", label: c.t("nylasEventLocation.conferenceOptions.none"), labelHTML: this.getLabelHTML("none") },
694
- { value: "custom", label: c.t("nylasEventLocation.conferenceOptions.custom"), labelHTML: this.getLabelHTML("custom") }
695
- ];
696
- }
697
- elementNameChangedHandler(e) {
698
- d("nylas-event-location", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
699
- }
700
- selectedConfigurationChangedHandler(e) {
701
- var o, r;
702
- d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e);
703
- const t = ((o = e == null ? void 0 : e.event_booking) == null ? void 0 : o.location) || this.eventLocation, a = ((r = e == null ? void 0 : e.event_booking) == null ? void 0 : r.conferencing) || this.eventConferencing;
704
- a != null && a.provider ? (this.selectedLocationOption = this.setDefaultLocationOption(a, t ?? ""), this.grantId = this.setDefaultGrantID(a), this.location = t || "") : t ? (this.selectedLocationOption = t ? "custom" : "none", this.location = t) : (this.selectedLocationOption = "none", this.location = "");
705
- }
706
- currentUserChangedHandler(e) {
707
- d("nylas-custom-booking-flow", "currentUserChangedHandler", e), e != null && e.provider && (this.userProviderState = e == null ? void 0 : e.provider, this.setLocationOptionsForProvider(this.userProviderState));
708
- }
709
- conferenceProvidersChanged(e) {
710
- e != null && e.zoom && !this.locationOptions.some((t) => t.value === "zoom") && this.locationOptions.push({ value: "zoom", label: c.t("nylasEventLocation.conferenceOptions.zoom"), labelHTML: this.getLabelHTML("zoom") });
711
- }
712
- selectedLanguageChangedHandler(e, t) {
713
- if (e === t)
714
- return;
715
- c.changeLanguage(e), this.locationOptions.map((o) => o.value).forEach((o) => {
716
- const r = this.locationOptions.findIndex((l) => l.value === o);
717
- this.locationOptions[r].label = c.t(`nylasEventLocation.conferenceOptions.${o}`), this.locationOptions[r].labelHTML = this.getLabelHTML(o);
718
- }), this.locationOptions = [...this.locationOptions];
719
- }
720
- connectedCallback() {
721
- d("nylas-event-location", "connectedCallback");
722
- }
723
- componentWillLoad() {
724
- d("nylas-event-location", "componentWillLoad"), this.host.setAttribute("name", this.name);
725
- }
726
- componentDidLoad() {
727
- var t, a, o, r;
728
- d("nylas-event-location", "componentDidLoad"), (t = this.selectedConfiguration) != null && t.event_booking ? this.selectedConfigurationChangedHandler(this.selectedConfiguration) : (this.selectedLocationOption = this.setDefaultLocationOption(this.eventConferencing || null, this.eventLocation ?? ""), this.location = this.eventLocation ?? ""), this.userProviderState = this.userProvider ?? ((a = this.currentUser) == null ? void 0 : a.provider) ?? "", this.setLocationOptionsForProvider(this.userProviderState);
729
- const e = (o = this.internals) == null ? void 0 : o.form;
730
- if (e) {
731
- const l = new FormData(e);
732
- l.set("conference", this.getConferencePayload()), l.set(this.name, this.location);
733
- }
734
- (r = this.conferenceProviders) != null && r.zoom && !this.locationOptions.some((l) => l.value === "zoom") && this.locationOptions.push({ value: "zoom", label: c.t("nylasEventLocation.conferenceOptions.zoom"), labelHTML: this.getLabelHTML("zoom") });
735
- }
736
- disconnectedCallback() {
737
- d("nylas-event-location", "disconnectedCallback");
738
- }
739
- getConferencePayload() {
740
- var a;
741
- if (this.selectedLocationOption === "custom" || this.selectedLocationOption === "none")
742
- return JSON.stringify(null);
743
- const e = (a = this.conferenceProviders) == null ? void 0 : a[this.selectedLocationOption], t = {
744
- provider: E[this.selectedLocationOption],
745
- autocreate: e ? {
746
- conf_grant_id: e
747
- } : {}
748
- };
749
- return JSON.stringify(t);
750
- }
751
- nylasFormDropdownChangedHandler(e) {
752
- var a, o, r;
753
- this.selectedLocationOption = e.detail.value;
754
- let t;
755
- switch (this.selectedLocationOption) {
756
- case "none": {
757
- this.location = "", this.setFormValue("", this.name), this.valueChanged.emit({ value: "", name: this.name }), this.valueChanged.emit({ value: JSON.stringify(null), name: "conference" });
758
- break;
759
- }
760
- case "custom": {
761
- this.valueChanged.emit({ value: JSON.stringify(null), name: "conference" });
762
- break;
763
- }
764
- case "google": {
765
- this.location = "", this.setFormValue("", this.name);
766
- const l = (a = this.conferenceProviders) == null ? void 0 : a.google;
767
- t = {
768
- provider: E.google,
769
- autocreate: l ? {
770
- conf_grant_id: l
771
- } : {}
772
- }, this.valueChanged.emit({ value: JSON.stringify(t), name: "conference" }), this.valueChanged.emit({ value: "", name: this.name });
773
- break;
774
- }
775
- case "microsoft": {
776
- this.location = "", this.setFormValue("", this.name);
777
- const l = (o = this.conferenceProviders) == null ? void 0 : o.microsoft;
778
- t = {
779
- provider: E.microsoft,
780
- autocreate: l ? {
781
- conf_grant_id: l
782
- } : {}
783
- }, this.valueChanged.emit({ value: JSON.stringify(t), name: "conference" }), this.valueChanged.emit({ value: "", name: this.name });
784
- break;
785
- }
786
- case "zoom": {
787
- this.location = "", this.setFormValue("", this.name);
788
- const l = (r = this.conferenceProviders) == null ? void 0 : r.zoom;
789
- t = {
790
- provider: E.zoom,
791
- autocreate: l ? {
792
- conf_grant_id: l
793
- } : {}
794
- }, this.valueChanged.emit({ value: JSON.stringify(t), name: "conference" }), this.valueChanged.emit({ value: "", name: this.name });
795
- break;
796
- }
797
- }
798
- }
799
- setLocationOptionsForProvider(e) {
800
- switch (e) {
801
- case "google":
802
- this.locationOptions.some((t) => t.value === "google") || this.locationOptions.push({ value: "google", label: c.t("nylasEventLocation.conferenceOptions.google"), labelHTML: this.getLabelHTML("google") });
803
- break;
804
- case "microsoft":
805
- this.locationOptions.some((t) => t.value === "microsoft") || this.locationOptions.push({ value: "microsoft", label: c.t("nylasEventLocation.conferenceOptions.google"), labelHTML: this.getLabelHTML("microsoft") });
806
- break;
807
- }
808
- }
809
- setDefaultLocationOption(e, t) {
810
- return e != null && (e == null ? void 0 : e.provider) != null ? J[e == null ? void 0 : e.provider] : t ? "custom" : "none";
811
- }
812
- setDefaultGrantID(e) {
813
- var t;
814
- return e != null && (e == null ? void 0 : e.autocreate) != null ? (t = e == null ? void 0 : e.autocreate) == null ? void 0 : t.conf_grant_id : "";
815
- }
816
- setFormValue(e, t) {
817
- typeof this.internals.setFormValue == "function" && this.internals.setFormValue(e, t);
818
- }
819
- handleChange(e) {
820
- const t = S(e.target.value);
821
- this.location = t, this.setFormValue(t, this.name), this.valueChanged.emit({ value: t, name: this.name });
822
- }
823
- getIcon(e) {
824
- switch (e) {
825
- case "none":
826
- return s("location-off-icon", null);
827
- case "custom":
828
- return s("location-icon", null);
829
- case "google":
830
- return s("google-meet-icon", null);
831
- case "microsoft":
832
- return s("microsoft-teams-icon", null);
833
- case "zoom":
834
- return s("zoom-icon", null);
835
- }
836
- }
837
- getLabelHTML(e) {
838
- return s("span", { class: "location-label", style: {
839
- display: "flex",
840
- alignItems: "center",
841
- gap: "16px",
842
- width: "-webkit-fill-available"
843
- } }, this.getIcon(e), s("span", { class: "location-text", style: {
844
- fontSize: "14px",
845
- fontWeight: "400"
846
- } }, c.t(`nylasEventLocation.conferenceOptions.${e}`)));
847
- }
848
- render() {
849
- const e = typeof this.selectedLocationOption < "u" ? this.locationOptions.find((t) => t.value == this.selectedLocationOption) : null;
850
- return s(w, { key: "bf87c5a654fdee86010c2668fac1f83a73ff10e0" }, s("div", { key: "02aff0e3cec5648119ad49765cc9dd286590a394", class: "nylas-event-location", part: "nel" }, s("label", { key: "3020aa8125f0c83d64354165ec2d86d686074b03", htmlFor: "location" }, c.t("nylasEventLocation.headerTitle"), s("span", { key: "3548617f680e2c9c32d9923b363b5102bf18e038", class: "label-icon" }, s("tooltip-component", { key: "b3a39251ae1765b57495b114bd7bacac5ccebff0" }, s("info-icon", { key: "6d9ce12b83c54a9d50f117f6489dde230793dcbd", slot: "tooltip-icon" }), s("span", { key: "43a481ff7264a34c40a2c14a3de27c25c70fc6d2", slot: "tooltip-content" }, c.t("nylasEventLocation.tooltip.desc"))))), s("div", { key: "89f50d652845a1e8f2ceae3fa1801e08cf9a7f1c", class: "location-input" }, s("select-dropdown", { key: "a686995fc1dafea5e551ba7dd120faff715ba781", withSearch: !1, name: "location", options: this.locationOptions, defaultSelectedOption: e, exportparts: "sd_dropdown: nel__dropdown, sd_dropdown-button: nel__dropdown-button, sd_dropdown-content: nel__dropdown-content" }, s("span", { key: "f76bd15d42f02f9492a3164da072acf2e4199955", slot: "select-icon" }, this.getIcon(this.selectedLocationOption))), this.selectedLocationOption === "custom" && s("input", { type: "text", part: "nel__location", id: "location", name: "location", maxlength: "1024", value: this.location, onInput: (t) => this.handleChange(t) }))));
851
- }
852
- static get formAssociated() {
853
- return !0;
854
- }
855
- get host() {
856
- return x(this);
857
- }
858
- static get watchers() {
859
- return {
860
- name: ["elementNameChangedHandler"],
861
- selectedConfiguration: ["selectedConfigurationChangedHandler"],
862
- currentUser: ["currentUserChangedHandler"],
863
- conferenceProviders: ["conferenceProvidersChanged"],
864
- selectedLanguage: ["selectedLanguageChangedHandler"]
865
- };
866
- }
867
- };
868
- Oe([
869
- C({
870
- name: "nylas-event-location",
871
- stateToProps: /* @__PURE__ */ new Map([
872
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
873
- ["schedulerConfig.conferenceProviders", "conferenceProviders"],
874
- ["schedulerConfig.currentUser", "currentUser"],
875
- ["schedulerConfig.selectedLanguage", "selectedLanguage"]
876
- ]),
877
- eventToProps: {},
878
- fireRegisterEvent: !0
879
- }),
880
- P("design:type", Function),
881
- P("design:paramtypes", []),
882
- P("design:returntype", void 0)
883
- ], W.prototype, "render", null);
884
- W.style = Le;
885
- const Ie = ':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-event-title{display:flex;flex-direction:column;gap:4px;position:relative;text-align:left}.nylas-event-title div.title{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);overflow:auto;white-space:nowrap;scrollbar-width:thin}.nylas-event-title div.title::-webkit-scrollbar{width:6px;height:6px}.nylas-event-title div.title.error{border-color:var(--nylas-error);border-width:2px;outline:none}.nylas-event-title input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-event-title span.help-text{display:inline-block;gap:4px;align-items:center;color:var(--nylas-base-500);font-size:14px;font-style:normal;font-weight:400;line-height:21px;position:relative}.nylas-event-title span.help-text span.label-icon{display:inline-block}.nylas-event-title span.help-text span.label-icon tooltip-component::part(tc__container){position:unset}.nylas-event-title span.help-text span.label-icon tooltip-component::part(tc__content){position:absolute;top:4px;left:50%;transform:translateX(-50%)}.nylas-event-title span.error-message{color:var(--nylas-error)}.nylas-event-title label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-title label span.required{color:var(--nylas-error, #cc4841)}.nylas-event-title label span.label-icon{margin-left:4px}.nylas-event-title label span.label-icon tooltip-component{display:flex}.highlighted-tag{background-color:var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:5px;margin-left:4px}.token-options{display:block;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;top:80px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}@media screen and (max-width: 768px){.token-options{right:0;width:325px;max-width:unset}}.token-options ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px;margin:0}.token-options ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.token-options ul li .token-label{display:flex;flex-direction:column;font-weight:400}.token-options ul li .token-label .token{color:var(--nylas-abse-900);font-size:16px;line-height:24px}.token-options ul li .token-label .description{color:var(--nylas-base-600);font-size:14px;line-height:21px}.token-options ul li:hover,.token-options ul li:focus,.token-options ul li:active,.token-options ul li.active{background-color:var(--nylas-base-100)}.token-options ul li:hover .token-label .token,.token-options ul li:focus .token-label .token,.token-options ul li:active .token-label .token,.token-options ul li.active .token-label .token{color:var(--nylas-primary)}.token-options .selected{background-color:var(--nylas-base-100)}', Ae = Ie;
886
- var De = function(e, t, a, o) {
887
- var r = arguments.length, l = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, a) : o, n;
888
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
889
- l = Reflect.decorate(e, t, a, o);
890
- else
891
- for (var i = e.length - 1; i >= 0; i--)
892
- (n = e[i]) && (l = (r < 3 ? n(l) : r > 3 ? n(t, a, l) : n(t, a)) || l);
893
- return r > 3 && l && Object.defineProperty(t, a, l), l;
894
- }, F = function(e, t) {
895
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
896
- return Reflect.metadata(e, t);
897
- };
898
- const j = class {
899
- constructor(e) {
900
- var t, a;
901
- b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.eventTitle = (a = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) == null ? void 0 : a.title, this.name = "title", this.selectedLanguage = void 0, this.noTemplates = !1, this.showTokens = !1, this.availableTokens = k.map((o) => ({
902
- label: o.token,
903
- value: o.value,
904
- labelHTML: o
905
- })), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 }, this.validationError = "", this.configEventTitle = "", this.additionalFieldTokens = [];
906
- }
907
- elementNameChangedHandler(e) {
908
- d("[nylas-event-title]", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
909
- }
910
- ariaActivedescendantChangedHandler(e) {
911
- var t, a;
912
- if (d("[nylas-event-title]", "ariaActivedescendantChangedHandler", e), e !== "") {
913
- const o = (t = this.host.shadowRoot) == null ? void 0 : t.getElementById(e);
914
- o == null || o.classList.add("active");
915
- } else {
916
- const o = (a = this.host.shadowRoot) == null ? void 0 : a.querySelectorAll(".token-options li.active");
917
- o == null || o.forEach((r) => r.classList.remove("active"));
918
- }
919
- }
920
- configChangedHandler(e) {
921
- var l, n;
922
- const t = (l = e == null ? void 0 : e.event_booking) == null ? void 0 : l.title, a = ((n = e == null ? void 0 : e.scheduler) == null ? void 0 : n.additional_fields) || {}, r = (Object.keys(a) || []).map((i) => ({
923
- token: `$${i}`,
924
- value: `\${${i}}`,
925
- description: a[i].label || ""
926
- }));
927
- this.additionalFieldTokens = [...r], this.availableTokens = [...k, ...r].map((i) => ({
928
- label: i.token,
929
- value: i.value,
930
- labelHTML: i
931
- })), this.filteredTokens = [...this.availableTokens], t && (this.configEventTitle = t, this.updateEventTitleFromProp(t));
932
- }
933
- selectedLanguageChangedHandler(e, t) {
934
- if (e === t)
935
- return;
936
- c.changeLanguage(e);
937
- const a = {
938
- $invitee: "invitee",
939
- $invitee_email: "inviteeEmail",
940
- $duration: "duration"
941
- };
942
- this.availableTokens = this.availableTokens.map((o) => (a[o.label] && (o.labelHTML.description = c.t(`nylasEventTitle.eventTitleTokenDescription.${a[o.label]}`)), o)), this.filteredTokens = [...this.availableTokens];
943
- }
944
- connectedCallback() {
945
- d("[nylas-event-title]", "connectedCallback");
946
- }
947
- componentWillLoad() {
948
- d("[nylas-event-title]", "componentWillLoad"), this.host.setAttribute("name", this.name);
949
- }
950
- componentDidLoad() {
951
- var t, a, o, r;
952
- d("[nylas-event-title]", "componentDidLoad");
953
- let e = this.eventTitle || this.configEventTitle;
954
- (a = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) != null && a.title && (e = (r = (o = this.selectedConfiguration) == null ? void 0 : o.event_booking) == null ? void 0 : r.title), e && (this.updateEventTitleFromProp(e), this.updateEventTitle(e, !0));
955
- }
956
- disconnectedCallback() {
957
- d("[nylas-event-title]", "disconnectedCallback");
958
- }
959
- formSubmittedHandler(e) {
960
- var t, a;
961
- d("[nylas-event-title]", "formSubmittedHandler", e), (a = (t = this.internals) == null ? void 0 : t.validity) != null && a.valid ? this.validationError = "" : this.validationError = "eventTitleRequired";
962
- }
963
- valueChangedHandler(e) {
964
- const { name: t, value: a } = e.detail;
965
- if (t === "additional-fields") {
966
- const o = JSON.parse(a.toString()), l = (Object.keys(o) || []).map((n) => ({
967
- token: `$${n}`,
968
- value: `\${${n}}`,
969
- description: o[n].label || ""
970
- }));
971
- this.additionalFieldTokens = [...l], this.availableTokens = [...k, ...l].map((n) => ({
972
- label: n.token,
973
- value: n.value,
974
- labelHTML: n
975
- })), this.filteredTokens = [...this.availableTokens];
976
- }
977
- }
978
- updateEventTitleFromProp(e) {
979
- var a, o, r;
980
- d("[nylas-event-title]", "eventTitleChangedHandler", e);
981
- const t = e || this.configEventTitle;
982
- this.titleRef && (this.titleRef.innerHTML = this.highlightTokens(t), typeof this.internals.setValidity == "function" && (!t || t === "" ? (this.titleRef.focus(), (a = this.internals) == null || a.setValidity({ customError: !0 }, "Event title is required", this.titleRef)) : ((o = this.internals) == null || o.setValidity({ customError: !1 }), this.isInternalsAvailable && ((r = this.internals) == null || r.setFormValue(t, this.name)))));
983
- }
984
- highlightTokens(e) {
985
- let t = e;
986
- return [...k, ...this.additionalFieldTokens].forEach((a) => {
987
- const o = a.value, r = new RegExp(`(\\${o})(?!\\w)`, "g");
988
- t = (t == null ? void 0 : t.replace(r, '<span class="highlighted-tag">$1</span>')) || "";
989
- }), t;
990
- }
991
- getCurrentSelectionForBrowser() {
992
- var o, r, l;
993
- const e = (n, i, p, f) => {
994
- const h = n.replace(/[\u200B-\u200D\uFEFF]/g, ""), y = h.lastIndexOf("$"), u = h.substring(y).split(" ")[0];
995
- return {
996
- focusOffset: i,
997
- dollarIndex: y,
998
- lastWord: u,
999
- currentText: h,
1000
- node: p,
1001
- allSelected: f
1002
- };
1003
- }, t = (n) => {
1004
- var i, p;
1005
- return n.anchorOffset === 0 && n.focusOffset === ((p = (i = n.focusNode) == null ? void 0 : i.nodeValue) == null ? void 0 : p.length);
1006
- };
1007
- switch (M()) {
1008
- case "Chrome": {
1009
- const n = (o = this.host.shadowRoot) == null ? void 0 : o.getSelection(), i = n == null ? void 0 : n.focusNode, p = (i == null ? void 0 : i.nodeValue) || "", f = n && t(n);
1010
- return e(p, (n == null ? void 0 : n.focusOffset) || -1, i, f);
1011
- }
1012
- case "Firefox": {
1013
- const n = document.getSelection(), i = ((r = n == null ? void 0 : n.anchorNode) == null ? void 0 : r.nodeValue) || "", p = n && t(n);
1014
- return e(i, (n == null ? void 0 : n.focusOffset) || -1, n == null ? void 0 : n.anchorNode, p);
1015
- }
1016
- case "Safari": {
1017
- const n = window.getSelection(), i = n == null ? void 0 : n.getComposedRanges(this.host.shadowRoot)[0], p = ((l = i == null ? void 0 : i.startContainer) == null ? void 0 : l.nodeValue) || "", f = n && t(n);
1018
- return e(p, (i == null ? void 0 : i.endOffset) || -1, i == null ? void 0 : i.startContainer, f);
1019
- }
1020
- default:
1021
- return console.warn("Browser not supported"), null;
1022
- }
1023
- }
1024
- handleChange(e) {
1025
- let t = e.target.textContent || "";
1026
- t = S(t);
1027
- const a = this.getCurrentSelectionForBrowser();
1028
- if (!a) {
1029
- this.updateEventTitle(t), this.resetDropdown();
1030
- return;
1031
- }
1032
- const { focusOffset: o, dollarIndex: r, lastWord: l, currentText: n } = a;
1033
- if (r === -1 || o < r) {
1034
- this.updateEventTitle(t), this.resetDropdown();
1035
- return;
1036
- }
1037
- l.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
1038
- $value: l,
1039
- fullText: n,
1040
- index: r,
1041
- focusOffset: o
1042
- }, this.populateSuggestionsDropdown(l)) : this.resetDropdown(), this.updateEventTitle(t);
1043
- }
1044
- handleInputKeyDown(e) {
1045
- var a, o, r, l, n;
1046
- const t = this.getCurrentSelectionForBrowser();
1047
- if (t != null && t.allSelected && !H(e) && (this.titleRef.innerHTML = ""), e.key === "Enter") {
1048
- e.preventDefault();
1049
- const i = (a = this.host.shadowRoot) == null ? void 0 : a.getElementById(this.ariaActivedescendant);
1050
- i && (i.click(), this.ariaActivedescendant = "");
1051
- } else if (e.key === "ArrowDown") {
1052
- e.preventDefault();
1053
- const i = (o = this.host.shadowRoot) == null ? void 0 : o.getElementById(this.ariaActivedescendant);
1054
- if (i) {
1055
- const p = i.nextElementSibling;
1056
- p ? this.ariaActivedescendant = p.id : this.ariaActivedescendant = this.filteredTokens[0].label;
1057
- } else
1058
- this.ariaActivedescendant = this.filteredTokens[0].label;
1059
- } else if (e.key === "ArrowUp") {
1060
- e.preventDefault();
1061
- const i = (r = this.host.shadowRoot) == null ? void 0 : r.getElementById(this.ariaActivedescendant);
1062
- if (i) {
1063
- const p = i.previousElementSibling;
1064
- p ? this.ariaActivedescendant = p.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
1065
- } else
1066
- this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
1067
- } else if (e.key === "Escape")
1068
- e.preventDefault(), this.resetDropdown();
1069
- else if (e.key === "Backspace" || e.key === "Delete") {
1070
- const i = (l = t == null ? void 0 : t.node) == null ? void 0 : l.parentNode;
1071
- t != null && t.currentText.startsWith("${") && i && i.nodeName === "SPAN" && (e.preventDefault(), i.removeChild(t.node), i.remove(), this.resetDropdown(), this.updateEventTitle(((n = this.titleRef) == null ? void 0 : n.textContent) || "")), (this.titleRef.textContent === "" || t != null && t.allSelected) && (this.titleRef.innerHTML = "", this.updateEventTitle(""));
1072
- }
1073
- }
1074
- selectOption(e, t) {
1075
- var T;
1076
- e.preventDefault();
1077
- const a = this.currentWord.fullText, o = this.currentWord.$value;
1078
- let r = this.titleRef.firstChild, l = null;
1079
- for (; r; ) {
1080
- if (r.nodeType === 3) {
1081
- const v = ((T = r.textContent) == null ? void 0 : T.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", L = a.replace(/[\u200B-\u200D\uFEFF]/g, "");
1082
- if (v.includes(L)) {
1083
- l = r;
1084
- break;
1085
- }
1086
- }
1087
- r = r.nextSibling;
1088
- }
1089
- if (!l)
1090
- return;
1091
- const n = l.textContent || "", i = n.indexOf(o), p = n.substring(0, i), f = n.substring(i + o.length), h = document.createTextNode(p), y = document.createRange(), u = document.createElement("span");
1092
- u.classList.add("highlighted-tag"), u.textContent = `${t.value}`;
1093
- const _ = document.createTextNode(f);
1094
- if (f !== "")
1095
- l.replaceWith(h, u, _), y.setStart(_, 1);
1096
- else {
1097
- const v = document.createTextNode("​");
1098
- l.replaceWith(h, u, v), y.setStart(v, 1);
1099
- }
1100
- this.resetDropdown(), this.titleRef.focus();
1101
- const g = window.getSelection();
1102
- y.collapse(!0), g == null || g.removeAllRanges(), g == null || g.addRange(y), this.updateEventTitle(this.titleRef.textContent || "");
1103
- }
1104
- populateSuggestionsDropdown(e = "") {
1105
- this.filteredTokens = this.availableTokens.filter((t) => t.label.startsWith(e.toString()) || t.value.startsWith(e.toString())), this.filteredTokens.length > 0 && (this.ariaActivedescendant = this.filteredTokens[0].label);
1106
- }
1107
- get isInternalsAvailable() {
1108
- return typeof this.internals < "u" && typeof this.internals.setValidity == "function" && typeof this.internals.setFormValue == "function";
1109
- }
1110
- updateEventTitle(e, t = !1) {
1111
- var o, r, l;
1112
- const a = e.replace(/ +/g, " ");
1113
- a === "" || /^[\s]*$/.test(a) ? (this.validationError = "eventTitleRequired", this.isInternalsAvailable && ((o = this.internals) == null || o.setValidity({ customError: !0 }, "Event title is required", this.titleRef))) : (this.validationError = "", this.isInternalsAvailable && ((r = this.internals) == null || r.setValidity({ customError: !1 }))), this.isInternalsAvailable && ((l = this.internals) == null || l.setFormValue(a, this.name)), t || this.valueChanged.emit({ value: a, name: this.name });
1114
- }
1115
- resetDropdown() {
1116
- this.showTokens = !1, this.ariaActivedescendant = "";
1117
- }
1118
- getLabelHTML(e) {
1119
- return s("div", { class: "token-label" }, s("span", { class: "token" }, e.token), s("span", { class: "description" }, e.description));
1120
- }
1121
- render() {
1122
- var e;
1123
- return s(w, { key: "82d877ce83823d86e6794caa07c9b4761523bb93" }, s("div", { key: "b97274fd9221bd8e21390b951074b60dff6eddcf", class: "nylas-event-title", part: "net" }, s("label", { key: "6313ef273c9468915f313c2a9d15f4428e74d3ed", htmlFor: "title" }, c.t("nylasEventTitle.headerTitle"), s("span", { key: "41b89ee75850a7597b75013de036d398d6b8e4a9", class: "required" }, "*")), s("div", { key: "94d600363804e2d88260475a3ebb0159537fa7c2", class: {
1124
- title: !0,
1125
- error: this.validationError !== ""
1126
- }, part: "net__title", ref: (t) => this.titleRef = t, contentEditable: "true", onInput: (t) => this.handleChange(t), onKeyDown: (t) => this.handleInputKeyDown(t) }), !this.noTemplates && this.showTokens && ((e = this.filteredTokens) == null ? void 0 : e.length) > 0 && s("div", { class: "token-options", part: "net__dropdown-content" }, s("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map((t) => s("li", { tabindex: "0", key: t.label, id: t.label, class: { active: this.ariaActivedescendant === t.label }, onClick: (a) => this.selectOption(a, t), role: "option" }, this.getLabelHTML(t.labelHTML))))), !this.noTemplates && s("span", { class: "help-text" }, c.t("nylasEventTitle.helpText", { context: "start", field: c.t("nylasEventTitle.title") }), " ", s("code", null, "$"), " ", c.t("nylasEventTitle.helpText", { context: "end" }), s("span", { class: "label-icon" }, s("tooltip-component", null, s("info-icon", { slot: "tooltip-icon" }), s("span", { slot: "tooltip-content" }, c.t("nylasEventTitle.tooltip.desc"), " ", s("code", null, "${invitee}"))))), this.validationError != "" && s("span", { class: "error-message" }, c.t(`nylasEventTitle.${this.validationError}`))));
1127
- }
1128
- static get formAssociated() {
1129
- return !0;
1130
- }
1131
- get host() {
1132
- return x(this);
1133
- }
1134
- static get watchers() {
1135
- return {
1136
- name: ["elementNameChangedHandler"],
1137
- ariaActivedescendant: ["ariaActivedescendantChangedHandler"],
1138
- selectedConfiguration: ["configChangedHandler"],
1139
- selectedLanguage: ["selectedLanguageChangedHandler"]
1140
- };
1141
- }
1142
- };
1143
- De([
1144
- C({
1145
- name: "nylas-event-title",
1146
- stateToProps: /* @__PURE__ */ new Map([
1147
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
1148
- ["schedulerConfig.selectedLanguage", "selectedLanguage"]
1149
- ]),
1150
- eventToProps: {},
1151
- fireRegisterEvent: !0
1152
- }),
1153
- F("design:type", Function),
1154
- F("design:paramtypes", []),
1155
- F("design:returntype", void 0)
1156
- ], j.prototype, "render", null);
1157
- j.style = Ae;
1158
- const Pe = ':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}.card-wrapper{background:var(--nylas-base-0);display:flex;flex-direction:column;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;padding:32px;width:562px;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){.card-wrapper{width:100%;border-radius:0px}}.header{overflow-wrap:anywhere;display:flex;flex-direction:column;font-size:16px;font-weight:400}.header h2{color:var(--nylas-base-900);font-size:24px;font-weight:600;text-align:left;margin:0}.description.title-desc{margin-bottom:2rem}.description.footer-desc{margin-top:2rem}.description.footer-desc a{color:var(--nylas-primary);text-decoration:none}.description p{margin:0;font-size:18px;color:var(--nylas-base-600)}.footer{margin-top:1rem;padding-top:1rem;display:flex;justify-content:flex-end;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)}.close-button{width:100%;display:flex;justify-content:flex-end}.close-button button-component button{padding:0;height:auto}.close-button button-component button:hover{background-color:transparent !important}button-component{--dot-color:var(--nylas-base-700)}', Fe = Pe;
1159
- var $e = function(e, t, a, o) {
1160
- var r = arguments.length, l = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, a) : o, n;
1161
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1162
- l = Reflect.decorate(e, t, a, o);
1163
- else
1164
- for (var i = e.length - 1; i >= 0; i--)
1165
- (n = e[i]) && (l = (r < 3 ? n(l) : r > 3 ? n(t, a, l) : n(t, a)) || l);
1166
- return r > 3 && l && Object.defineProperty(t, a, l), l;
1167
- }, $ = function(e, t) {
1168
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1169
- return Reflect.metadata(e, t);
1170
- };
1171
- const Z = class {
1172
- constructor(e) {
1173
- b(this, e), this.feedbackModalClosed = m(this, "feedbackModalClosed", 7), this.feedbackSubmitted = m(this, "feedbackSubmitted", 7), this.triggerValidation = m(this, "triggerValidation", 7), this.handleConfirmBookingButtonClicked = () => {
1174
- this.triggerValidation.emit().defaultPrevented || this.feedbackSubmitted.emit({ feedback: this.feedbackMessage });
1175
- }, this.themeConfig = void 0, this.feedbackMessage = "";
1176
- }
1177
- connectedCallback() {
1178
- }
1179
- disconnectedCallback() {
1180
- }
1181
- async componentWillLoad() {
1182
- d("[nylas-feedback-form] Component will load");
1183
- }
1184
- async componentDidLoad() {
1185
- d("[nylas-feedback-form] Component did load"), this.applyThemeConfig(this.themeConfig);
1186
- }
1187
- applyThemeConfig(e) {
1188
- if (e)
1189
- for (const [t, a] of Object.entries(e))
1190
- this.host.style.setProperty(`${t}`, a);
1191
- }
1192
- handleFormInputChanged(e) {
1193
- d("[nylas-feedback-form] Form input changed"), e.detail.value && (this.triggerValidation.emit(), e.detail.name === "feedback" && (this.feedbackMessage = e.detail.value));
1194
- }
1195
- closeModal(e) {
1196
- e.preventDefault(), e.stopImmediatePropagation(), this.feedbackModalClosed.emit();
1197
- }
1198
- render() {
1199
- return s(w, { key: "3dfba1b006f09a9ac9ccdd03a659784b86df25d4", part: "nfbf" }, s("div", { key: "f548f82b9689115b254815c0a6b940d1450ada04", class: "card-wrapper", part: "nfbfc__card" }, s("div", { key: "3e1be6b2ff7d6818b677f09772cde78edb4c7ef1", class: "close-button" }, s("button-component", { key: "dd98523ad84cc745f24daa400bb41753d103c3c6", tooltip: "Close", id: "close", variant: "invisible", onClick: (e) => this.closeModal(e), part: "nfbf__close-button" }, s("close-icon", { key: "0b919c2be114e231ff8eb7121536b6c24dfb7158" }))), s("div", { key: "2c62e429a6871d1dc6a34df4fc37440e61e9e041", class: "header" }, s("h2", { key: "8c1009dc5a853bb0cbc21b64958353c95a0ca140", slot: "card-title", part: "nfbf__title" }, c.t("feedbackFormTitle"))), s("div", { key: "b16e5a7c0e3b299d6ee9a74d154aa3628e9d4d25", class: "description title-desc" }, s("p", { key: "00675ebd52e88ed101df5710b3bded1f6424c274" }, c.t("feedbackFormDescription"))), s("textarea-component", { key: "7b021701b44eb5b3ba02ee3191d3866489f4ec8a", label: c.t("feedbackMessageLabel"), required: !0, maxLength: 500, part: "nfbf__description", name: "feedback", placeholder: c.t("feedbackMessagePlaceholder") }), s("div", { key: "def91af529f167b1fac0cc078f79cec67b961a1a", class: "description footer-desc" }, s("p", { key: "ad346ef93ae4a25fd5478284ff5415eb62b54f26" }, "By sending this report, you agree to Nylas’ access to the data necessary to respond to this issue, subject to Nylas’", " ", s("a", { key: "cd6a79cf548346d92d04264c4ff7244a032c3977", href: "https://www.nylas.com/privacy-policy/", target: "_blank", rel: "nofollow noreferrer noopener" }, "Privacy Policy"), ".")), s("div", { key: "5dfee1045b6711f5cf7d15009c86c0fd9b76b137", class: {
1200
- footer: !0
1201
- } }, s("button-component", { key: "45894bd04b89365c83d7e2a07e8a62ee7c94b6c0", variant: "invisible", onClick: (e) => this.closeModal(e), part: "nfbf__button-outline nfbf__cancel-cta" }, `${c.t("feedbackModalCloseButton")}`), s("button-component", { key: "ac586974014c3e3b6b454a8b830585b76bc1f290", variant: "primary", onClick: this.handleConfirmBookingButtonClicked, part: "nfbf__button-outline nfbf__reschedule-cta" }, `${c.t("feedbackModalSubmitButton")}`))));
1202
- }
1203
- get host() {
1204
- return x(this);
1205
- }
1206
- };
1207
- $e([
1208
- C({
1209
- name: "nylas-feedback-form",
1210
- stateToProps: /* @__PURE__ */ new Map([]),
1211
- eventToProps: {
1212
- feedbackSubmitted: async (e, t) => {
1213
- }
1214
- },
1215
- localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
1216
- fireRegisterEvent: !0
1217
- }),
1218
- $("design:type", Function),
1219
- $("design:paramtypes", []),
1220
- $("design:returntype", void 0)
1221
- ], Z.prototype, "render", null);
1222
- Z.style = Fe;
1223
- const Re = ':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-reminder-time{display:flex;flex-direction:column;gap:4px}.nylas-reminder-time label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-reminder-time label span.required{color:var(--nylas-error, #cc4841)}.nylas-reminder-time label span.label-icon{margin-left:4px}.nylas-reminder-time label span.label-icon tooltip-component{display:flex}.nylas-reminder-time__wrapper{display:flex;align-items:center;justify-content:flex-end;gap:0.5rem}.nylas-reminder-time__wrapper input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);font-size:16px;line-height:24px;width:48px}.nylas-reminder-time__wrapper input-dropdown{width:80px}.nylas-reminder-time__wrapper input-dropdown::part(id_dropdown-input){border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:14px 16px}.nylas-reminder-time__wrapper input-dropdown::part(id_dropdown-content){width:100%;min-width:unset;height:160px}.nylas-reminder-time__wrapper select-dropdown{width:120px}@media screen and (max-width: 768px){.nylas-reminder-time__wrapper select-dropdown{width:100%}}.nylas-reminder-time__wrapper select-dropdown::part(sd_dropdown-button){border:1px solid var(--nylas-base-200)}', Se = Re;
1224
- var He = function(e, t, a, o) {
1225
- var r = arguments.length, l = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, a) : o, n;
1226
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1227
- l = Reflect.decorate(e, t, a, o);
1228
- else
1229
- for (var i = e.length - 1; i >= 0; i--)
1230
- (n = e[i]) && (l = (r < 3 ? n(l) : r > 3 ? n(t, a, l) : n(t, a)) || l);
1231
- return r > 3 && l && Object.defineProperty(t, a, l), l;
1232
- }, R = function(e, t) {
1233
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1234
- return Reflect.metadata(e, t);
1235
- };
1236
- const K = class {
1237
- constructor(e) {
1238
- b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "reminder-time", this.eventReminderTimeMinutes = void 0, this.selectedLanguage = void 0, this.selectedNumber = void 0, this.selectedPeriod = void 0, this.errorState = !1;
1239
- }
1240
- elementNameChangedHandler(e) {
1241
- d("nylas-reminder-time", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1242
- }
1243
- eventReminderTimeMinutesChangedHandler(e, t) {
1244
- d("nylas-reminder-time", "eventReminderTimeMinutesChangedHandler", e), this.updateNumberAndPeriodFromMinutes(e), this.isInternalsAvailable && this.internals.setFormValue(e == null ? void 0 : e.toString(), this.name);
1245
- }
1246
- selectedLanguageChangedHandler(e, t) {
1247
- e !== t && c.changeLanguage(e);
1248
- }
1249
- connectedCallback() {
1250
- d("nylas-reminder-time", "connectedCallback");
1251
- }
1252
- componentWillLoad() {
1253
- d("nylas-reminder-time", "componentWillLoad"), this.host.setAttribute("name", this.name);
1254
- }
1255
- componentDidLoad() {
1256
- d("nylas-reminder-time", "componentDidLoad"), this.updateNumberAndPeriodFromMinutes(this.eventReminderTimeMinutes || 30);
1257
- }
1258
- disconnectedCallback() {
1259
- d("nylas-reminder-time", "disconnectedCallback");
1260
- }
1261
- nylasSuggestReminderMinutesHandler(e) {
1262
- const { minutes: t } = e.detail;
1263
- this.errorState = !1, this.valueChanged.emit({ value: t.toString(), name: this.name }), this.isInternalsAvailable && this.internals.setFormValue(t.toString(), this.name), this.updateNumberAndPeriodFromMinutes(t + 7), setTimeout(() => {
1264
- this.updateNumberAndPeriodFromMinutes(t);
1265
- }, 10);
1266
- }
1267
- timePeriodChangedHandler(e) {
1268
- const { number: t, period: a } = e.detail;
1269
- let o;
1270
- const r = 60, l = r * 24, n = l * 7, i = l * 30;
1271
- a === "minute" ? o = t : a === "hour" ? o = t * r : a === "day" ? o = t * l : a === "week" ? o = t * n : a === "month" ? o = t * i : o = 0, this.errorState = o % 5 !== 0, this.valueChanged.emit({ value: o, name: this.name }), this.isInternalsAvailable && this.internals.setFormValue(o.toString(), this.name);
1272
- }
1273
- updateNumberAndPeriodFromMinutes(e) {
1274
- let l, n;
1275
- e === 0 ? (l = 0, n = "minute") : e >= 43200 && e % 43200 === 0 ? (l = Math.floor(e / 43200), n = "month") : e >= 10080 && e % 10080 === 0 ? (l = Math.floor(e / 10080), n = "week") : e >= 1440 && e % 1440 === 0 ? (l = Math.floor(e / 1440), n = "day") : e >= 60 && e % 60 === 0 ? (l = Math.floor(e / 60), n = "hour") : (l = e, n = "minute"), this.selectedNumber = l, this.selectedPeriod = n;
1276
- }
1277
- get isInternalsAvailable() {
1278
- return this.internals !== void 0 && typeof this.internals.setFormValue == "function" && typeof this.internals.setValidity == "function";
1279
- }
1280
- render() {
1281
- const e = typeof this.selectedNumber == "number" && typeof this.selectedPeriod == "string";
1282
- return s(w, { key: "e19066f3a7ccfaeba4b2ae9b4e370a35d479b0f6" }, s("div", { key: "f8a6527dfa9541a953de5c17ea07b924ca9810c2", class: "nylas-reminder-time", part: "nrt" }, s("div", { key: "ff839bfde9b694f1370a4a459f3e698b93aca9c7", class: "nylas-reminder-time__wrapper" }, e && s("time-period-selector", { id: "limit-future-bookings", part: "nrt__time-period-selector", hasError: this.errorState, timePeriods: [
1283
- { value: "minute", label: c.t("timeDuration", { context: "minute" }) },
1284
- { value: "hour", label: c.t("timeDuration", { context: "hour" }) },
1285
- { value: "day", label: c.t("timePeriod", { context: "day" }) }
1286
- ], exportparts: "tps__number-dropdown: nrt__number-dropdown, tps__number-dropdown-button: nrt__number-dropdown-button, tps__number-dropdown-content: nrt__number-dropdown-content, tps__period-dropdown: nrt__period-dropdown, tps__period-dropdown-button: nrt__period-dropdown-button, tps__period-dropdown-content: nrt__period-dropdown-content", defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod }))));
1287
- }
1288
- static get formAssociated() {
1289
- return !0;
1290
- }
1291
- get host() {
1292
- return x(this);
1293
- }
1294
- static get watchers() {
1295
- return {
1296
- name: ["elementNameChangedHandler"],
1297
- eventReminderTimeMinutes: ["eventReminderTimeMinutesChangedHandler"],
1298
- selectedLanguage: ["selectedLanguageChangedHandler"]
1299
- };
1300
- }
1301
- };
1302
- He([
1303
- C({
1304
- name: "nylas-reminder-time",
1305
- stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedLanguage", "selectedLanguage"]]),
1306
- eventToProps: {},
1307
- fireRegisterEvent: !0
1308
- }),
1309
- R("design:type", Function),
1310
- R("design:paramtypes", []),
1311
- R("design:returntype", void 0)
1312
- ], K.prototype, "render", null);
1313
- K.style = Se;
1314
- const Me = ".sc-trash-icon-h{display:flex}", Ne = Me, ze = class {
1315
- constructor(e) {
1316
- b(this, e), this.width = "20", this.height = "21";
1317
- }
1318
- render() {
1319
- return s("svg", { key: "cd43bcf8a91abf12501571439a02652afeff0b0f", width: this.width, height: this.height, viewBox: "0 0 20 21", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "2870e48a14d2a84175298a75d47e3224a10385a4", d: "M10 0.25C11.733 0.25 13.1492 1.60645 13.2449 3.31558L13.25 3.5H18.5C18.9142 3.5 19.25 3.83579 19.25 4.25C19.25 4.6297 18.9678 4.94349 18.6018 4.99315L18.5 5H17.704L16.4239 18.0192C16.2912 19.3683 15.1984 20.41 13.8626 20.4945L13.6871 20.5H6.31293C4.95734 20.5 3.81365 19.5145 3.59883 18.1934L3.57614 18.0192L2.295 5H1.5C1.1203 5 0.806509 4.71785 0.756847 4.35177L0.75 4.25C0.75 3.8703 1.03215 3.55651 1.39823 3.50685L1.5 3.5H6.75C6.75 1.70507 8.20507 0.25 10 0.25ZM16.197 5H3.802L5.06893 17.8724C5.12768 18.4696 5.60033 18.9343 6.18585 18.9936L6.31293 19H13.6871C14.2872 19 14.7959 18.5751 14.9123 17.9982L14.9311 17.8724L16.197 5ZM11.75 7.75C12.1297 7.75 12.4435 8.03215 12.4932 8.39823L12.5 8.5V15.5C12.5 15.9142 12.1642 16.25 11.75 16.25C11.3703 16.25 11.0565 15.9678 11.0068 15.6018L11 15.5V8.5C11 8.08579 11.3358 7.75 11.75 7.75ZM8.25 7.75C8.6297 7.75 8.94349 8.03215 8.99315 8.39823L9 8.5V15.5C9 15.9142 8.66421 16.25 8.25 16.25C7.8703 16.25 7.55651 15.9678 7.50685 15.6018L7.5 15.5V8.5C7.5 8.08579 7.83579 7.75 8.25 7.75ZM10 1.75C9.08183 1.75 8.32881 2.45711 8.2558 3.35647L8.25 3.5H11.75C11.75 2.5335 10.9665 1.75 10 1.75Z", fill: "currentColor" }));
1320
- }
1321
- };
1322
- ze.style = Ne;
1323
- export {
1324
- Q as checkmark_icon,
1325
- te as copy_icon,
1326
- oe as dragable_icon,
1327
- ie as eye_icon,
1328
- de as feedback_icon,
1329
- ye as input_color_picker,
1330
- N as input_image_url,
1331
- z as nylas_additional_participants,
1332
- B as nylas_event_description,
1333
- U as nylas_event_info,
1334
- W as nylas_event_location,
1335
- j as nylas_event_title,
1336
- Z as nylas_feedback_form,
1337
- K as nylas_reminder_time,
1338
- ze as trash_icon
1339
- };