@nylas/react 1.1.0-canary.15 → 1.1.0-canary.17

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 (129) hide show
  1. package/dist/add-circle-icon_2.entry-936fd73b.cjs +1 -0
  2. package/dist/add-circle-icon_2.entry-ce6aaa1d.js +25 -0
  3. package/dist/{archive-icon_7.entry-ca8262ff.js → archive-icon_7.entry-60e900b6.js} +18 -18
  4. package/dist/{archive-icon_7.entry-25d8b2f0.cjs → archive-icon_7.entry-8c8317e9.cjs} +1 -1
  5. package/dist/{arrow-icon.entry-991ba7cd.js → arrow-icon.entry-057db95a.js} +2 -2
  6. package/dist/{arrow-icon.entry-01192ecf.cjs → arrow-icon.entry-2d4e9572.cjs} +1 -1
  7. package/dist/bold-icon_3.entry-557c6007.js +35 -0
  8. package/dist/{bold-icon_3.entry-e94dcf5b.cjs → bold-icon_3.entry-ba732761.cjs} +1 -1
  9. package/dist/{add-circle-icon_2.entry-3f834b47.js → button-component.entry-22d0ac2e.js} +5 -15
  10. package/dist/button-component.entry-385f9581.cjs +1 -0
  11. package/dist/{calendar-cancel-icon.entry-f646c147.js → calendar-cancel-icon.entry-820cf967.js} +5 -5
  12. package/dist/{calendar-cancel-icon.entry-9088fa8b.cjs → calendar-cancel-icon.entry-b2657caf.cjs} +1 -1
  13. package/dist/{calendar-check-icon_2.entry-a7e4d0e6.js → calendar-check-icon_2.entry-128a5d67.js} +9 -9
  14. package/dist/{calendar-check-icon_2.entry-4dc1391a.cjs → calendar-check-icon_2.entry-b13e7cbb.cjs} +1 -1
  15. package/dist/{calendar-icon.entry-1658930c.js → calendar-icon.entry-a43e6011.js} +5 -5
  16. package/dist/{calendar-icon.entry-1e2acd5c.cjs → calendar-icon.entry-d17d7cfb.cjs} +1 -1
  17. package/dist/calendar-info-icon_28.entry-b4f09bfe.cjs +1 -0
  18. package/dist/{calendar-info-icon_25.entry-493c5547.js → calendar-info-icon_28.entry-b71c23c5.js} +754 -828
  19. package/dist/{chevron-icon_3.entry-52b97043.cjs → chevron-icon_3.entry-4807a0b1.cjs} +1 -1
  20. package/dist/{chevron-icon_3.entry-b3c7eb44.js → chevron-icon_3.entry-e0796c69.js} +5 -5
  21. package/dist/{clock-icon_2.entry-882249ee.cjs → clock-icon_2.entry-267614c2.cjs} +1 -1
  22. package/dist/{clock-icon_2.entry-58f07042.js → clock-icon_2.entry-e959ae50.js} +7 -7
  23. package/dist/{constants-f34b9c6e-1da5094b.cjs → constants-f34b9c6e-ebc2e19c.cjs} +1 -1
  24. package/dist/{constants-f34b9c6e-628beaa8.js → constants-f34b9c6e-efe2836b.js} +1 -1
  25. package/dist/{document-refresh-icon.entry-b53316b4.js → document-refresh-icon.entry-b4c217df.js} +2 -2
  26. package/dist/{document-refresh-icon.entry-4f581bf4.cjs → document-refresh-icon.entry-b8850675.cjs} +1 -1
  27. package/dist/elements/index.d.ts +1 -0
  28. package/dist/{elements-dc5b338e-3284591d.cjs → elements-dc5b338e-a33785e3.cjs} +1 -1
  29. package/dist/{elements-dc5b338e-7abe37c6.js → elements-dc5b338e-b0a290ae.js} +1 -1
  30. package/dist/{focus-visible-e8093c16-d6612604.js → focus-visible-e8093c16-5f1ae916.js} +1 -1
  31. package/dist/{focus-visible-e8093c16-cb6c97b1.cjs → focus-visible-e8093c16-d2afb13d.cjs} +1 -1
  32. package/dist/{forward-icon_6.entry-e402ad1e.cjs → forward-icon_6.entry-0009e4f0.cjs} +3 -3
  33. package/dist/{forward-icon_6.entry-d54244f7.js → forward-icon_6.entry-53683e82.js} +9 -9
  34. package/dist/{globe-icon.entry-e83c79c2.js → globe-icon.entry-dbb47687.js} +4 -4
  35. package/dist/{globe-icon.entry-db7377d9.cjs → globe-icon.entry-df67eab8.cjs} +1 -1
  36. package/dist/google-logo-icon_4.entry-77f3b86e.js +454 -0
  37. package/dist/google-logo-icon_4.entry-c5db1be3.cjs +1 -0
  38. package/dist/index-53420959-16700a42.cjs +1 -0
  39. package/dist/index-53420959-f0c4f9af.js +5 -0
  40. package/dist/{index-2d032bec.js → index-5851f0a2.js} +816 -825
  41. package/dist/{index-6d9eeb53-91d36348.js → index-6d9eeb53-2f37342f.js} +2 -2
  42. package/dist/{index-6d9eeb53-f478270c.cjs → index-6d9eeb53-ded66877.cjs} +1 -1
  43. package/dist/{index-9c04361d.cjs → index-769f0fdd.cjs} +3 -3
  44. package/dist/{index.es-9cc0eb3c-ee2ebbe1.js → index.es-9cc0eb3c-2cf4632f.js} +1 -1
  45. package/dist/{index.es-9cc0eb3c-2242baf6.cjs → index.es-9cc0eb3c-e8de46e6.cjs} +1 -1
  46. package/dist/{info-icon_2.entry-74eb7415.js → info-icon_2.entry-c27ac645.js} +3 -3
  47. package/dist/{info-icon_2.entry-4b257e73.cjs → info-icon_2.entry-e355fb7d.cjs} +1 -1
  48. package/dist/{input-component.entry-6bb4a5e8.js → input-component.entry-a38a65da.js} +4 -4
  49. package/dist/{input-component.entry-3ef7ce2c.cjs → input-component.entry-ef2b397d.cjs} +1 -1
  50. package/dist/input-dropdown_2.entry-9e50060e.cjs +1 -0
  51. package/dist/{input-dropdown_2.entry-f71e4c01.js → input-dropdown_2.entry-ce1da1b3.js} +37 -26
  52. package/dist/loading-icon.entry-175aca19.cjs +1 -0
  53. package/dist/loading-icon.entry-4ab88ed8.js +15 -0
  54. package/dist/{mailbox-store-64b4ef7c-202f1afd.js → mailbox-store-64b4ef7c-47dac9aa.js} +2 -2
  55. package/dist/{mailbox-store-64b4ef7c-74f959be.cjs → mailbox-store-64b4ef7c-ebe84c96.cjs} +1 -1
  56. package/dist/nylas-booked-event-card_10.entry-6de99d57.cjs +1 -0
  57. package/dist/{nylas-booked-event-card_10.entry-ddfcff5e.js → nylas-booked-event-card_10.entry-ef9c2d62.js} +11 -11
  58. package/dist/{nylas-custom-booking-flow.entry-63ed387e.cjs → nylas-custom-booking-flow.entry-c59c1306.cjs} +1 -1
  59. package/dist/{nylas-custom-booking-flow.entry-a1f66d05.js → nylas-custom-booking-flow.entry-f31400e2.js} +2 -2
  60. package/dist/{nylas-form-card.entry-ea1153b9.js → nylas-form-card.entry-b189e066.js} +2 -2
  61. package/dist/{nylas-form-card.entry-6fece0ff.cjs → nylas-form-card.entry-bc048703.cjs} +1 -1
  62. package/dist/{nylas-if-state.entry-05f8f66f.js → nylas-if-state.entry-5bdf8669.js} +3 -3
  63. package/dist/{nylas-if-state.entry-b75320f0.cjs → nylas-if-state.entry-933c79e0.cjs} +1 -1
  64. package/dist/{nylas-list-folders.entry-edc61b97.cjs → nylas-list-folders.entry-5d1bef7f.cjs} +1 -1
  65. package/dist/{nylas-list-folders.entry-bd5a1b1d.js → nylas-list-folders.entry-f0e7ae4e.js} +3 -3
  66. package/dist/{nylas-list-threads.entry-79ad0944.cjs → nylas-list-threads.entry-3e300e7e.cjs} +1 -1
  67. package/dist/{nylas-list-threads.entry-f3cd80de.js → nylas-list-threads.entry-3f7451ad.js} +3 -3
  68. package/dist/{nylas-login.entry-68873357.cjs → nylas-login.entry-dbf9e11f.cjs} +1 -1
  69. package/dist/{nylas-login.entry-b3207e82.js → nylas-login.entry-e3b757a0.js} +7 -7
  70. package/dist/{nylas-mailbox-pagination.entry-2ef5b88a.cjs → nylas-mailbox-pagination.entry-0db12a01.cjs} +1 -1
  71. package/dist/{nylas-mailbox-pagination.entry-22c5b9ca.js → nylas-mailbox-pagination.entry-6c845a2a.js} +2 -2
  72. package/dist/{nylas-mailbox-toolbar-button.entry-f2fa3a8e.cjs → nylas-mailbox-toolbar-button.entry-553f041a.cjs} +1 -1
  73. package/dist/{nylas-mailbox-toolbar-button.entry-95bb58b5.js → nylas-mailbox-toolbar-button.entry-ec196947.js} +4 -4
  74. package/dist/{nylas-mailbox.entry-4ef7d18d.js → nylas-mailbox.entry-1552ad11.js} +7 -7
  75. package/dist/{nylas-mailbox.entry-4b1d320f.cjs → nylas-mailbox.entry-c0bbca56.cjs} +1 -1
  76. package/dist/{nylas-provider.entry-7f7e098a.js → nylas-provider.entry-6d286e92.js} +37 -37
  77. package/dist/{nylas-provider.entry-b629340a.cjs → nylas-provider.entry-d4bf23c2.cjs} +1 -1
  78. package/dist/{nylas-scheduler-editor.entry-19a29c4c.cjs → nylas-scheduler-editor.entry-00a71304.cjs} +2 -2
  79. package/dist/{nylas-scheduler-editor.entry-2d19593f.js → nylas-scheduler-editor.entry-caa1026b.js} +8 -7
  80. package/dist/{nylas-scheduling.entry-753cb746.js → nylas-scheduling.entry-19ff3d50.js} +9 -9
  81. package/dist/nylas-scheduling.entry-f1fb67d2.cjs +1 -0
  82. package/dist/{nylas-threads-refresh.entry-5a774ad7.js → nylas-threads-refresh.entry-6acf3c2b.js} +4 -4
  83. package/dist/{nylas-threads-refresh.entry-0a832631.cjs → nylas-threads-refresh.entry-bc4c10ea.cjs} +1 -1
  84. package/dist/{nylas-threads-search.entry-451c6d5c.js → nylas-threads-search.entry-82fa1504.js} +5 -5
  85. package/dist/{nylas-threads-search.entry-5b57688b.cjs → nylas-threads-search.entry-ee28712c.cjs} +1 -1
  86. package/dist/nylas-time-window-picker.entry-131f84b4.cjs +1 -0
  87. package/dist/nylas-time-window-picker.entry-3c45d82e.js +316 -0
  88. package/dist/{nylas-view-thread.entry-7b273955.cjs → nylas-view-thread.entry-0d9a4aa9.cjs} +1 -1
  89. package/dist/{nylas-view-thread.entry-e0af8998.js → nylas-view-thread.entry-695a7b0b.js} +6 -6
  90. package/dist/{play-icon_2.entry-58592b64.js → play-icon_2.entry-ab47588e.js} +3 -3
  91. package/dist/{play-icon_2.entry-5b22a7ca.cjs → play-icon_2.entry-b1167d3a.cjs} +1 -1
  92. package/dist/react.cjs +1 -1
  93. package/dist/react.js +41 -40
  94. package/dist/{refresh-icon.entry-876b8aea.cjs → refresh-icon.entry-28e3ade7.cjs} +1 -1
  95. package/dist/{refresh-icon.entry-90756bc6.js → refresh-icon.entry-43267155.js} +5 -5
  96. package/dist/{register-component-a5a9ca5d-8bede801.js → register-component-a5a9ca5d-538c35c3.js} +1 -1
  97. package/dist/{register-component-a5a9ca5d-1fbb27d2.cjs → register-component-a5a9ca5d-8b06415c.cjs} +1 -1
  98. package/dist/scheduler-config-store-4a50a03d-40e87f35.cjs +1 -0
  99. package/dist/{scheduler-config-store-ec3b6190-cbc40d60.js → scheduler-config-store-4a50a03d-4a2e2abf.js} +4 -3
  100. package/dist/{scheduler-store-f02ce045-1d93c571.js → scheduler-store-f02ce045-121c1e09.js} +1 -1
  101. package/dist/{scheduler-store-f02ce045-712c600c.cjs → scheduler-store-f02ce045-f11cfad9.cjs} +1 -1
  102. package/dist/{textarea-component.entry-3ea161d6.js → textarea-component.entry-1ec19adb.js} +4 -4
  103. package/dist/{textarea-component.entry-9d6b5cdc.cjs → textarea-component.entry-402a369b.cjs} +1 -1
  104. package/dist/{translate-icon.entry-04dde6b1.cjs → translate-icon.entry-59f4e190.cjs} +1 -1
  105. package/dist/{translate-icon.entry-be9c3401.js → translate-icon.entry-d412697e.js} +6 -6
  106. package/dist/{warning-icon.entry-347d77af.js → warning-icon.entry-3ee1f451.js} +5 -5
  107. package/dist/{warning-icon.entry-84121a43.cjs → warning-icon.entry-aa6b2c2c.cjs} +1 -1
  108. package/package.json +3 -3
  109. package/dist/add-circle-icon_2.entry-00dc2c13.cjs +0 -1
  110. package/dist/bold-icon_3.entry-81a3ff1e.js +0 -35
  111. package/dist/calendar-info-icon_25.entry-7513d798.cjs +0 -1
  112. package/dist/close-icon.entry-4a39816a.js +0 -15
  113. package/dist/close-icon.entry-f1166251.cjs +0 -1
  114. package/dist/google-logo-icon_4.entry-8818686b.js +0 -429
  115. package/dist/google-logo-icon_4.entry-fa65ae29.cjs +0 -1
  116. package/dist/index-53420959-41ed02ae.js +0 -5
  117. package/dist/index-53420959-a76f0327.cjs +0 -1
  118. package/dist/input-dropdown_2.entry-a87714fc.cjs +0 -1
  119. package/dist/loading-icon.entry-30724cb0.js +0 -15
  120. package/dist/loading-icon.entry-bb250f1c.cjs +0 -1
  121. package/dist/nylas-additional-participants.entry-567c7c2a.cjs +0 -1
  122. package/dist/nylas-additional-participants.entry-7961be04.js +0 -81
  123. package/dist/nylas-booked-event-card_10.entry-c2f889ba.cjs +0 -1
  124. package/dist/nylas-scheduling.entry-70454242.cjs +0 -1
  125. package/dist/people-icon.entry-c7fb7f6c.cjs +0 -1
  126. package/dist/people-icon.entry-de3fada0.js +0 -15
  127. package/dist/scheduler-config-store-ec3b6190-104df545.cjs +0 -1
  128. package/dist/toggle-switch.entry-10aa0c1a.cjs +0 -1
  129. package/dist/toggle-switch.entry-a08c1027.js +0 -25
@@ -1,429 +0,0 @@
1
- import { r as D, h as n, c as y, x as nt, d, y as q, H as K, g as Q } from "./index-2d032bec.js";
2
- import { R as X } from "./register-component-a5a9ca5d-8bede801.js";
3
- import { D as at } from "./constants-f34b9c6e-628beaa8.js";
4
- import "react";
5
- import "react-dom";
6
- const it = ".sc-google-logo-icon-h{display:flex}", st = it, ot = class {
7
- constructor(t) {
8
- D(this, t), this.width = "24", this.height = "24";
9
- }
10
- render() {
11
- return n("svg", { key: "48ccae649f280d48621dfb214a08b980155680a1", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("g", { key: "10196951caa0fa0b94b57c57a62d8bcb31d92d91", "clip-path": "url(#clip0_959_12452)" }, n("path", { key: "0d2358cd1dcbd7f9ef2dfa17a5075a341210a43c", d: "M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z", fill: "#4285F4" }), n("path", { key: "8540c5619b64996b6b158fe50609aa378dfd468f", d: "M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z", fill: "#34A853" }), n("path", { key: "b683a33b6068de0793ef4426e6404d438dbdf73e", d: "M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z", fill: "#FBBC05" }), n("path", { key: "916d663bbb04c8267e595adf9125068232414ed7", d: "M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z", fill: "#EA4335" })), n("defs", { key: "a941f8ccb1711f648dc3e2db750496a2491b4b55" }, n("clipPath", { key: "caef3b6e814ed957bcee43a794130dce6760702d", id: "clip0_959_12452" }, n("rect", { key: "df7c24b60402fd2e9d248f4e5ccfbaa640d549ae", width: 24, height: 24, fill: "white" }))));
12
- }
13
- };
14
- ot.style = st;
15
- const rt = ".sc-microsoft-logo-icon-h{display:flex}", lt = rt, dt = class {
16
- constructor(t) {
17
- D(this, t), this.width = "22", this.height = "22";
18
- }
19
- render() {
20
- return n("svg", { key: "4aa3482048f90ecbcb46d539716464bdf2c20e47", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("path", { key: "27924938927bdc57e665d91623f07684aea3a6ee", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), n("path", { key: "91decf0bfe7ef26f93ea724fa9738d1ffa1ae4a6", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), n("path", { key: "0f455cec58fd99a755157ab9ca950242a634d541", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), n("path", { key: "80c930047e54c708d5f7cde3d88f33f2a0d0dbd5", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
21
- }
22
- };
23
- dt.style = lt;
24
- function ct({ id: t, formState: e, activeTab: a, calendars: s }) {
25
- var o;
26
- switch (a) {
27
- case "eventInfo":
28
- const i = e.title, l = e.description, r = parseInt(e.duration), b = e.location;
29
- return n(
30
- "div",
31
- { key: t },
32
- n(
33
- "nylas-event-info",
34
- null,
35
- n(
36
- "div",
37
- { slot: "inputs" },
38
- n("nylas-event-title", { name: "title", eventTitle: i, exportparts: "net, net__title, net__dropdown-content" }),
39
- n("nylas-event-duration", { name: "duration", eventDurationMinutes: r, exportparts: "ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
40
- n("nylas-event-location", { name: "location", eventLocation: b, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
41
- n("nylas-event-description", { name: "description", eventDescription: l, exportparts: "nedesc, nedesc__textarea" })
42
- )
43
- )
44
- );
45
- case "availability":
46
- const u = e.availability.openHours, f = e.availability.timezone ? e.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone, h = (o = e.participants) == null ? void 0 : o.find((v) => v.is_organizer), m = (h == null ? void 0 : h.email) ?? "primary", g = e.calendarIds.length > 0 ? e.calendarIds : [m], _ = e.bookingCalendar == "primary" ? m : e.bookingCalendar;
47
- return n(
48
- "div",
49
- { key: t },
50
- n("nylas-booking-calendar-picker", { name: "booking-calendar", calendars: s ?? [], defaultBookingCalendar: _, exportparts: "nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content" }),
51
- n("nylas-calendar-picker", { name: "calendars", calendars: s ?? [], defaultSelectedCalendars: g, exportparts: "ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content" }),
52
- n("nylas-availability-picker", { name: "availability", openHours: u, defaultTimezone: f, exportparts: "nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times" })
53
- );
54
- case "bookingOptions":
55
- return n(
56
- "div",
57
- { key: t },
58
- n("nylas-buffer-time", { name: "buffer-time", buffer: e.buffer, exportparts: "nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview" }),
59
- n(
60
- "nylas-event-limits",
61
- null,
62
- n(
63
- "div",
64
- { slot: "inputs" },
65
- n("nylas-min-booking-notice", { name: "min-booking-notice", minBookingNotice: e.minBookingNotice, exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
66
- n("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: e.availableDaysInFuture, exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
67
- n("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: e.minCancellationNotice, exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
68
- n("nylas-cancellation-policy", { name: "cancellation-policy", cancellationPolicy: e.cancellationPolicy, exportparts: "ncpolicy, ncpolicy__textarea" })
69
- )
70
- ),
71
- n("nylas-timeslot-interval", { name: "timeslot-interval", eventDurationMinutes: parseInt(e.duration), exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
72
- n("nylas-customize-booking-settings", { name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
73
- );
74
- }
75
- }
76
- const bt = '.sc-nylas-editor-tabs-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:554px;display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}', ut = bt;
77
- var ht = function(t, e, a, s) {
78
- var o = arguments.length, i = o < 3 ? e : s === null ? s = Object.getOwnPropertyDescriptor(e, a) : s, l;
79
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
80
- i = Reflect.decorate(t, e, a, s);
81
- else
82
- for (var r = t.length - 1; r >= 0; r--)
83
- (l = t[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(e, a, i) : l(e, a)) || i);
84
- return o > 3 && i && Object.defineProperty(e, a, i), i;
85
- }, T = function(t, e) {
86
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
87
- return Reflect.metadata(t, e);
88
- };
89
- const Y = class {
90
- constructor(t) {
91
- D(this, t), this.schedulerConfigChanged = y(this, "schedulerConfigChanged", 7), this.cancelButtonClick = y(this, "cancelButtonClick", 7), this.formSubmitted = y(this, "formSubmitted", 7), this.previewButtonClicked = y(this, "previewButtonClicked", 7), this.setError = (e) => {
92
- this.error = e.message;
93
- }, this.formSubmissionHandler = async (e) => {
94
- var O, F, P, E, R, N, j, M, V, U, z, A, $, Z, G, J;
95
- if (e.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity())
96
- return;
97
- this.isLoading = !0, this.hasUnsavedChanges = !1;
98
- const s = this.updateFormState(), { title: o, description: i, duration: l, availability: r, calendarIds: b, bookingCalendar: u, location: f, bookingType: h, buffer: m, availableDaysInFuture: g, minCancellationNotice: _, minBookingNotice: v, cancellationPolicy: C, timeslotInterval: p, additionalGuestsHidden: x, hideCancellationOptions: S, hideReschedulingOptions: L } = s, c = (F = (O = this.selectedConfiguration) == null ? void 0 : O.participants) == null ? void 0 : F.find((W) => W.is_organizer), w = l ? parseInt(l) : 30, k = {
99
- ...((P = this.selectedConfiguration) == null ? void 0 : P.id) && { id: this.selectedConfiguration.id },
100
- version: ((E = this.selectedConfiguration) == null ? void 0 : E.version) ?? "1.0.0",
101
- availability: {
102
- duration_minutes: w,
103
- interval_minutes: (p == null ? void 0 : p.interval) ?? w,
104
- round_to: p == null ? void 0 : p.roundTo,
105
- availability_rules: {
106
- availability_method: ((j = (N = (R = this.selectedConfiguration) == null ? void 0 : R.availability) == null ? void 0 : N.availability_rules) == null ? void 0 : j.availability_method) ?? "collective",
107
- buffer: m || { before: 0, after: 0 },
108
- default_open_hours: ((U = (V = (M = this.selectedConfiguration) == null ? void 0 : M.availability) == null ? void 0 : V.availability_rules) == null ? void 0 : U.default_open_hours) ?? at,
109
- round_robin_group_id: (($ = (A = (z = this.selectedConfiguration) == null ? void 0 : z.availability) == null ? void 0 : A.availability_rules) == null ? void 0 : $.round_robin_group_id) ?? ""
110
- }
111
- },
112
- participants: [
113
- {
114
- name: (c == null ? void 0 : c.name) ?? (c == null ? void 0 : c.email) ?? ((Z = this.currentUser) == null ? void 0 : Z.name) ?? ((G = this.currentUser) == null ? void 0 : G.email) ?? "",
115
- email: (c == null ? void 0 : c.email) ?? ((J = this.currentUser) == null ? void 0 : J.email) ?? "",
116
- is_organizer: !0,
117
- availability: {
118
- calendar_ids: b != null && b.length ? b : ["primary"],
119
- open_hours: (r == null ? void 0 : r.openHours) ?? []
120
- },
121
- booking: {
122
- calendar_id: u && u !== "" ? u : "primary"
123
- }
124
- }
125
- ],
126
- event_booking: {
127
- title: (o == null ? void 0 : o.toString()) ?? "",
128
- description: (i == null ? void 0 : i.toString()) ?? "",
129
- location: (f == null ? void 0 : f.toString()) ?? "",
130
- booking_type: (h == null ? void 0 : h.toString()) ?? "booking",
131
- timezone: (r == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone
132
- },
133
- scheduler: {
134
- cancellation_policy: C ?? "",
135
- available_days_in_future: g ?? 30,
136
- min_cancellation_notice: _ ?? 0,
137
- min_booking_notice: v ?? 60,
138
- additional_guests_hidden: x ?? !1,
139
- hide_cancellation_options: S ?? !1,
140
- hide_rescheduling_options: L ?? !1
141
- }
142
- }, B = nt(k, this.selectedConfiguration), H = this.action === "create" ? B : k, et = (W) => {
143
- this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
144
- this.changesSaved = !1;
145
- }, 5e3);
146
- };
147
- this.schedulerConfigChanged.emit({ config: H, resetLoadingState: et, setError: this.setError, action: this.action });
148
- }, this.calendars = void 0, this.selectedConfiguration = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.action = "create", this.activeTab = "eventInfo", this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
149
- }
150
- configChangedHandler(t) {
151
- d("[nylas-editor-tabs]", "configChangedHandler", t, this.selectedConfiguration), this.formState = {
152
- ...this.getFormStateFromConfig(t)
153
- }, t.id ? this.action = "edit" : this.action = "create";
154
- }
155
- connectedCallback() {
156
- d("[nylas-editor-tabs]", "connectedCallback");
157
- }
158
- componentWillLoad() {
159
- d("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
160
- }
161
- componentDidLoad() {
162
- d("[nylas-editor-tabs]", "componentDidLoad");
163
- }
164
- disconnectedCallback() {
165
- d("[nylas-editor-tabs]", "disconnectedCallback");
166
- }
167
- handleValueChanged(t) {
168
- d("[nylas-editor-tabs]", "handleValueChanged", t);
169
- const { name: e, value: a } = t.detail;
170
- this.formState = { ...this.formState, [e]: a }, this.hasUnsavedChanges = !0, this.error = "";
171
- }
172
- getFormStateFromConfig(t) {
173
- var a, s, o, i, l, r, b, u, f, h, m, g, _, v, C, p, x, S, L, c, w, k, B;
174
- const e = (a = t == null ? void 0 : t.participants) == null ? void 0 : a.find((H) => H.is_organizer);
175
- return {
176
- title: ((s = t == null ? void 0 : t.event_booking) == null ? void 0 : s.title) ?? "",
177
- description: ((o = t == null ? void 0 : t.event_booking) == null ? void 0 : o.description) ?? "",
178
- duration: ((l = (i = t == null ? void 0 : t.availability) == null ? void 0 : i.duration_minutes) == null ? void 0 : l.toString()) ?? "30",
179
- availability: {
180
- timezone: ((r = t == null ? void 0 : t.event_booking) == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
181
- openHours: (b = e == null ? void 0 : e.availability) == null ? void 0 : b.open_hours
182
- },
183
- calendarIds: ((u = e == null ? void 0 : e.availability) == null ? void 0 : u.calendar_ids) ?? [],
184
- participants: (t == null ? void 0 : t.participants) ?? [],
185
- bookingCalendar: ((f = e == null ? void 0 : e.booking) == null ? void 0 : f.calendar_id) ?? (e == null ? void 0 : e.email) ?? "",
186
- location: ((h = t == null ? void 0 : t.event_booking) == null ? void 0 : h.location) ?? "",
187
- bookingType: ((m = t == null ? void 0 : t.event_booking) == null ? void 0 : m.booking_type) ?? "booking",
188
- buffer: ((_ = (g = t == null ? void 0 : t.availability) == null ? void 0 : g.availability_rules) == null ? void 0 : _.buffer) ?? { before: 0, after: 0 },
189
- cancellationPolicy: ((v = t == null ? void 0 : t.scheduler) == null ? void 0 : v.cancellation_policy) ?? "",
190
- availableDaysInFuture: ((C = t == null ? void 0 : t.scheduler) == null ? void 0 : C.available_days_in_future) ?? 30,
191
- minCancellationNotice: ((p = t == null ? void 0 : t.scheduler) == null ? void 0 : p.min_cancellation_notice) ?? 0,
192
- minBookingNotice: ((x = t == null ? void 0 : t.scheduler) == null ? void 0 : x.min_booking_notice) ?? 60,
193
- timeslotInterval: {
194
- interval: ((S = t == null ? void 0 : t.availability) == null ? void 0 : S.interval_minutes) ?? ((L = t == null ? void 0 : t.availability) == null ? void 0 : L.duration_minutes) ?? 10,
195
- roundTo: (c = t == null ? void 0 : t.availability) == null ? void 0 : c.round_to
196
- },
197
- additionalGuestsHidden: ((w = t == null ? void 0 : t.scheduler) == null ? void 0 : w.additional_guests_hidden) ?? !1,
198
- hideCancellationOptions: ((k = t == null ? void 0 : t.scheduler) == null ? void 0 : k.hide_cancellation_options) ?? !1,
199
- hideReschedulingOptions: ((B = t == null ? void 0 : t.scheduler) == null ? void 0 : B.hide_rescheduling_options) ?? !1
200
- };
201
- }
202
- updateFormState() {
203
- return new FormData(this.formRef).forEach((e, a) => {
204
- switch (a) {
205
- case "title":
206
- this.formState.title = e.toString();
207
- break;
208
- case "description":
209
- this.formState.description = e.toString();
210
- break;
211
- case "duration":
212
- this.formState.duration = e.toString();
213
- break;
214
- case "availability":
215
- this.formState.availability = JSON.parse(e.toString());
216
- break;
217
- case "participants":
218
- this.formState.participants = JSON.parse(e.toString());
219
- break;
220
- case "calendars":
221
- this.formState.calendarIds = e.toString().split(",");
222
- break;
223
- case "booking-calendar":
224
- this.formState.bookingCalendar = e.toString();
225
- break;
226
- case "location":
227
- this.formState.location = e.toString();
228
- break;
229
- case "booking-type":
230
- this.formState.bookingType = e.toString();
231
- break;
232
- case "buffer-time":
233
- this.formState.buffer = JSON.parse(e.toString());
234
- break;
235
- case "limit-future-bookings":
236
- this.formState.availableDaysInFuture = parseInt(e.toString());
237
- break;
238
- case "min-cancellation-notice":
239
- this.formState.minCancellationNotice = parseInt(e.toString());
240
- break;
241
- case "min-booking-notice":
242
- this.formState.minBookingNotice = parseInt(e.toString());
243
- break;
244
- case "cancellation-policy":
245
- this.formState.cancellationPolicy = e.toString();
246
- break;
247
- case "timeslot-interval":
248
- this.formState.timeslotInterval = JSON.parse(e.toString());
249
- break;
250
- case "customize-booking-settings":
251
- const s = JSON.parse(e.toString());
252
- this.formState.additionalGuestsHidden = s.additionalGuestsHidden, this.formState.hideCancellationOptions = s.hideCancellationOptions, this.formState.hideReschedulingOptions = s.hideReschedulingOptions;
253
- break;
254
- }
255
- }), this.formState = { ...this.formState }, this.formState;
256
- }
257
- setActiveTab(t, e) {
258
- t.preventDefault(), this.updateFormState(), this.activeTab = e;
259
- }
260
- render() {
261
- var t;
262
- return d("[nylas-editor-tabs]", "render", this.formState), n(K, { key: "de54edb776a03cca0c170f3e1d5f6201cd520172" }, n("form", { key: "013ba8fa3d09938c1cdb686884a035967e5dd5c5", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (e) => this.formRef = e, noValidate: !0 }, this.mode === "app" ? n("div", { class: "form-contents" }, n("div", { class: "tabs" }, n("button", { class: { tab: !0, active: this.activeTab == "eventInfo" }, onClick: (e) => this.setActiveTab(e, "eventInfo") }, n("calendar-info-icon", { width: "16", height: "16" }), "Event Info"), n("button", { class: { tab: !0, active: this.activeTab == "availability" }, onClick: (e) => this.setActiveTab(e, "availability") }, n("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), n("button", { class: { tab: !0, active: this.activeTab == "bookingOptions" }, onClick: (e) => this.setActiveTab(e, "bookingOptions") }, n("flow-icon", { width: "16", height: "16" }), "Booking Options")), n("div", { class: "tab-content" }, n(ct, { formState: this.formState, activeTab: this.activeTab, calendars: this.calendars, id: ((t = this.selectedConfiguration) == null ? void 0 : t.id) ?? "new" }))) : n("slot", null), n("div", { key: "d16cd84ad1d7fc69b700519851da428a2f15bdd3", class: "footer" }, n("div", { key: "91ac1d799dd53725041d6e12577e7186f8ddad95", class: "preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && n("button-component", { type: "button", disabled: this.isLoading, clickHandler: (e) => {
263
- e.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(q(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
264
- }, variant: "basic" }, "Preview")), n("div", { key: "975c3e7ebf2a11ac457785d4824d7b174a24e643", class: "buttons" }, n("p", { key: "6311d2d31ab503238a5ff98131423167aa794733", class: {
265
- "unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
266
- "saved-changes": this.changesSaved,
267
- error: this.error !== "",
268
- "error-full-width": this.error !== "" && this.action === "create"
269
- } }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), n("button-component", { key: "83e0a53f373b0fe78c80bcbce98b631fd105001d", type: "button", disabled: this.isLoading, clickHandler: (e) => {
270
- e.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
271
- }, variant: "basic" }, "Cancel"), n("button-component", { key: "35c347a3e9bd1f9b54d3919e9d09135fa1ad5c70", type: "submit", disabled: this.isLoading }, this.isLoading ? n("span", null, "Saving", n("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
272
- }
273
- get host() {
274
- return Q(this);
275
- }
276
- static get watchers() {
277
- return {
278
- selectedConfiguration: ["configChangedHandler"]
279
- };
280
- }
281
- };
282
- ht([
283
- X({
284
- name: "nylas-editor-tabs",
285
- stateToProps: /* @__PURE__ */ new Map([
286
- ["schedulerConfig.calendars", "calendars"],
287
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
288
- ["schedulerConfig.currentUser", "currentUser"]
289
- ]),
290
- eventToProps: {
291
- schedulerConfigChanged: async (t, e) => {
292
- const { resetLoadingState: a, setError: s, action: o, config: i } = t.detail, l = (r) => {
293
- const [b, u] = r;
294
- !b && u && s && s(u), a && a(t);
295
- };
296
- if (o === "edit") {
297
- const r = await e.schedulerConfig.updateConfiguration(i);
298
- l(r);
299
- } else {
300
- const r = await e.schedulerConfig.createConfiguration(i);
301
- l(r);
302
- }
303
- },
304
- cancelButtonClick: async (t, e) => {
305
- e.schedulerConfigStore.state.action = null;
306
- },
307
- previewButtonClicked: async (t, e) => {
308
- d("[nylas-editor-tabs]", "previewButtonClicked", e);
309
- },
310
- formSubmitted: async (t, e) => {
311
- d("[nylas-editor-tabs]", "formSubmitted", e);
312
- }
313
- },
314
- localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
315
- fireRegisterEvent: !0
316
- }),
317
- T("design:type", Function),
318
- T("design:paramtypes", []),
319
- T("design:returntype", void 0)
320
- ], Y.prototype, "render", null);
321
- Y.style = ut;
322
- const pt = ':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:1rem;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;overflow-y:auto}.configurations table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations table.no-configurations{height:100%}.configurations table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations table tr:last-of-type{border-bottom:0}.configurations table tr.hide{display:none}.configurations table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations table th.actions-header{text-align:right}.configurations table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations table th,.configurations table td{text-align:left;padding:1rem;font-family:inherit}.configurations table .actions{text-align:right}.configurations table .actions{display:flex;justify-content:flex-end;gap:1rem}@media screen and (max-width: 768px){.configurations table .actions{flex-direction:column;gap:0.5rem}}.configurations table .title{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .config-event-description{font-size:0.75rem}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}button-component#copy button{width:108px}', ft = pt;
323
- var yt = function(t, e, a, s) {
324
- var o = arguments.length, i = o < 3 ? e : s === null ? s = Object.getOwnPropertyDescriptor(e, a) : s, l;
325
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
326
- i = Reflect.decorate(t, e, a, s);
327
- else
328
- for (var r = t.length - 1; r >= 0; r--)
329
- (l = t[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(e, a, i) : l(e, a)) || i);
330
- return o > 3 && i && Object.defineProperty(e, a, i), i;
331
- }, I = function(t, e) {
332
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
333
- return Reflect.metadata(t, e);
334
- };
335
- const tt = class {
336
- constructor(t) {
337
- D(this, t), this.initListConfigurations = y(this, "initListConfigurations", 7), this.createButtonClick = y(this, "createButtonClick", 7), this.editButtonClick = y(this, "editButtonClick", 7), this.deleteButtonClick = y(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.state = "loading", this.error = "", this.copiedButtonIndex = -1;
338
- }
339
- connectedCallback() {
340
- d("[nylas-list-configurations]", "connectedCallback");
341
- }
342
- componentWillLoad() {
343
- d("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
344
- }
345
- componentDidLoad() {
346
- d("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit(this.host);
347
- }
348
- disconnectedCallback() {
349
- d("[nylas-list-configurations]", "disconnectedCallback");
350
- }
351
- async getState() {
352
- return this.state;
353
- }
354
- async setState(t) {
355
- this.state = t;
356
- }
357
- async setError(t) {
358
- this.error = t;
359
- }
360
- getDurationString(t) {
361
- const e = Math.floor(t / 60), a = t % 60;
362
- return `${e || ""} ${e ? `${e > 1 ? "hours" : "hour"}` : ""} ${a || ""} ${a ? `${a > 1 ? "mins" : "min"}` : ""}`;
363
- }
364
- render() {
365
- return n(K, null, n("div", { class: "header" }, n("div", { class: "description" }, n("h2", null, "All scheduling pages"), n("p", null, "Create, edit and manage all your scheduling pages.")), this.configurations && this.configurations.length > 0 && n("div", { class: "actions" }, n("button-component", { clickHandler: () => {
366
- this.createButtonClick.emit(this.host);
367
- } }, "Create new"))), n("div", { class: "configurations" }, n("table", { class: {
368
- "no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
369
- } }, n("tr", { class: {
370
- hide: this.state === "loading" || this.configurations && this.configurations.length === 0
371
- } }, n("th", null, "Scheduling page title"), n("th", null, "Duration"), n("th", { class: "actions-header" }, "Actions")), this.state === "loading" && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("h3", null, "Loading..."), n("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("calendar-icon", { width: "48", height: "48" }), n("h3", null, "No scheduling pages found"), n("p", null, "Get started with creating your first scheduling page"), n("button-component", { clickHandler: () => {
372
- this.createButtonClick.emit(this.host);
373
- } }, "Create new")))), this.state !== "loading" && this.configurations.map((t, e) => n("tr", { key: t.id }, n("td", null, n("div", { class: "title" }, n("span", { class: "config-event-title" }, t.event_booking.title), n("span", { class: "config-event-description" }, t.event_booking.description))), n("td", null, n("div", null, this.getDurationString(t.availability.duration_minutes))), n("td", null, n("div", { class: "actions" }, n("button-component", { variant: "basic", id: "copy", key: `copy-${e}`, clickHandler: async (a) => {
374
- a.preventDefault();
375
- const s = q(this.schedulerPreviewLink, t);
376
- await navigator.clipboard.writeText(s), this.copiedButtonIndex = e, setTimeout(() => {
377
- this.copiedButtonIndex = -1;
378
- }, 3e3);
379
- } }, this.copiedButtonIndex === e ? "Copied!" : "Copy link"), n("button-component", { variant: "basic", key: `edit-${e}`, clickHandler: (a) => {
380
- a.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: t });
381
- } }, "Edit"), n("button-component", { variant: "basic", key: `delete-${e}`, clickHandler: (a) => {
382
- a.preventDefault(), this.deleteButtonClick.emit({ host: this.host, configuration: t });
383
- } }, "Delete"))))))), this.state === "error" && n("div", { class: "error-container" }, n("p", { class: "error" }, this.error)));
384
- }
385
- get host() {
386
- return Q(this);
387
- }
388
- };
389
- yt([
390
- X({
391
- name: "nylas-list-configurations",
392
- stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.configurations", "configurations"]]),
393
- localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
394
- eventToProps: {
395
- initListConfigurations: async (t, e) => {
396
- const a = t.detail;
397
- await a.setState("loading");
398
- const [s, o] = await e.schedulerConfig.getConfigurations();
399
- if (!s && o && o.message) {
400
- await a.setState("error"), await a.setError(o.message);
401
- return;
402
- }
403
- await a.setState("loaded");
404
- },
405
- createButtonClick: async (t, e) => {
406
- e.schedulerConfigStore.resetSelectedConfiguration(), e.schedulerConfigStore.state.action = "create";
407
- },
408
- deleteButtonClick: async (t, e) => {
409
- const { host: a, configuration: s } = t.detail, [o, i] = await e.schedulerConfig.deleteConfiguration(s.id);
410
- !o && i && i.message && (await a.setState("error"), await a.setError(i.message));
411
- },
412
- editButtonClick: async (t, e) => {
413
- const { configuration: a } = t.detail;
414
- e.schedulerConfigStore.state.selectedConfiguration = a, e.schedulerConfigStore.state.action = "edit";
415
- }
416
- },
417
- fireRegisterEvent: !0
418
- }),
419
- I("design:type", Function),
420
- I("design:paramtypes", []),
421
- I("design:returntype", void 0)
422
- ], tt.prototype, "render", null);
423
- tt.style = ft;
424
- export {
425
- ot as google_logo_icon,
426
- dt as microsoft_logo_icon,
427
- Y as nylas_editor_tabs,
428
- tt as nylas_list_configurations
429
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-9c04361d.cjs"),J=require("./register-component-a5a9ca5d-1fbb27d2.cjs"),X=require("./constants-f34b9c6e-1da5094b.cjs");require("react");require("react-dom");const Y=".sc-google-logo-icon-h{display:flex}",tt=Y,W=class{constructor(e){t.registerInstance(this,e),this.width="24",this.height="24"}render(){return t.h("svg",{key:"48ccae649f280d48621dfb214a08b980155680a1",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.h("g",{key:"10196951caa0fa0b94b57c57a62d8bcb31d92d91","clip-path":"url(#clip0_959_12452)"},t.h("path",{key:"0d2358cd1dcbd7f9ef2dfa17a5075a341210a43c",d:"M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z",fill:"#4285F4"}),t.h("path",{key:"8540c5619b64996b6b158fe50609aa378dfd468f",d:"M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z",fill:"#34A853"}),t.h("path",{key:"b683a33b6068de0793ef4426e6404d438dbdf73e",d:"M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z",fill:"#FBBC05"}),t.h("path",{key:"916d663bbb04c8267e595adf9125068232414ed7",d:"M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z",fill:"#EA4335"})),t.h("defs",{key:"a941f8ccb1711f648dc3e2db750496a2491b4b55"},t.h("clipPath",{key:"caef3b6e814ed957bcee43a794130dce6760702d",id:"clip0_959_12452"},t.h("rect",{key:"df7c24b60402fd2e9d248f4e5ccfbaa640d549ae",width:24,height:24,fill:"white"}))))}};W.style=tt;const et=".sc-microsoft-logo-icon-h{display:flex}",nt=et,K=class{constructor(e){t.registerInstance(this,e),this.width="22",this.height="22"}render(){return t.h("svg",{key:"4aa3482048f90ecbcb46d539716464bdf2c20e47",width:this.width,height:this.height,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"27924938927bdc57e665d91623f07684aea3a6ee",d:"M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z",fill:"#F35325"}),t.h("path",{key:"91decf0bfe7ef26f93ea724fa9738d1ffa1ae4a6",d:"M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z",fill:"#81BC06"}),t.h("path",{key:"0f455cec58fd99a755157ab9ca950242a634d541",d:"M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z",fill:"#05A6F0"}),t.h("path",{key:"80c930047e54c708d5f7cde3d88f33f2a0d0dbd5",d:"M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z",fill:"#FFBA08"}))}};K.style=nt;function at({id:e,formState:n,activeTab:a,calendars:s}){var o;switch(a){case"eventInfo":const i=n.title,l=n.description,r=parseInt(n.duration),c=n.location;return t.h("div",{key:e},t.h("nylas-event-info",null,t.h("div",{slot:"inputs"},t.h("nylas-event-title",{name:"title",eventTitle:i,exportparts:"net, net__title, net__dropdown-content"}),t.h("nylas-event-duration",{name:"duration",eventDurationMinutes:r,exportparts:"ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content"}),t.h("nylas-event-location",{name:"location",eventLocation:c,exportparts:"nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content"}),t.h("nylas-event-description",{name:"description",eventDescription:l,exportparts:"nedesc, nedesc__textarea"}))));case"availability":const h=n.availability.openHours,p=n.availability.timezone?n.availability.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,b=(o=n.participants)==null?void 0:o.find(g=>g.is_organizer),f=(b==null?void 0:b.email)??"primary",y=n.calendarIds.length>0?n.calendarIds:[f],m=n.bookingCalendar=="primary"?f:n.bookingCalendar;return t.h("div",{key:e},t.h("nylas-booking-calendar-picker",{name:"booking-calendar",calendars:s??[],defaultBookingCalendar:m,exportparts:"nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content"}),t.h("nylas-calendar-picker",{name:"calendars",calendars:s??[],defaultSelectedCalendars:y,exportparts:"ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content"}),t.h("nylas-availability-picker",{name:"availability",openHours:h,defaultTimezone:p,exportparts:"nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times"}));case"bookingOptions":return t.h("div",{key:e},t.h("nylas-buffer-time",{name:"buffer-time",buffer:n.buffer,exportparts:"nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview"}),t.h("nylas-event-limits",null,t.h("div",{slot:"inputs"},t.h("nylas-min-booking-notice",{name:"min-booking-notice",minBookingNotice:n.minBookingNotice,exportparts:"nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content"}),t.h("nylas-limit-future-bookings",{name:"limit-future-bookings",availableDaysInFuture:n.availableDaysInFuture,exportparts:"nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content"}),t.h("nylas-min-cancellation-notice",{name:"min-cancellation-notice",minCancellationNotice:n.minCancellationNotice,exportparts:"nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content"}),t.h("nylas-cancellation-policy",{name:"cancellation-policy",cancellationPolicy:n.cancellationPolicy,exportparts:"ncpolicy, ncpolicy__textarea"}))),t.h("nylas-timeslot-interval",{name:"timeslot-interval",eventDurationMinutes:parseInt(n.duration),exportparts:"nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content"}),t.h("nylas-customize-booking-settings",{name:"customize-booking-settings",exportparts:"ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options"}))}}const it='.sc-nylas-editor-tabs-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:554px;display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}',st=it;var ot=function(e,n,a,s){var o=arguments.length,i=o<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,a):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,n,a,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(i=(o<3?l(i):o>3?l(n,a,i):l(n,a))||i);return o>3&&i&&Object.defineProperty(n,a,i),i},B=function(e,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,n)};const D=class{constructor(e){t.registerInstance(this,e),this.schedulerConfigChanged=t.createEvent(this,"schedulerConfigChanged",7),this.cancelButtonClick=t.createEvent(this,"cancelButtonClick",7),this.formSubmitted=t.createEvent(this,"formSubmitted",7),this.previewButtonClicked=t.createEvent(this,"previewButtonClicked",7),this.setError=n=>{this.error=n.message},this.formSubmissionHandler=async n=>{var T,E,O,F,P,R,N,j,M,V,U,z,A,$,Z,G;if(n.preventDefault(),this.formSubmitted.emit(),!this.formRef.checkValidity())return;this.isLoading=!0,this.hasUnsavedChanges=!1;const s=this.updateFormState(),{title:o,description:i,duration:l,availability:r,calendarIds:c,bookingCalendar:h,location:p,bookingType:b,buffer:f,availableDaysInFuture:y,minCancellationNotice:m,minBookingNotice:g,cancellationPolicy:w,timeslotInterval:u,additionalGuestsHidden:k,hideCancellationOptions:C,hideReschedulingOptions:x}=s,d=(E=(T=this.selectedConfiguration)==null?void 0:T.participants)==null?void 0:E.find(q=>q.is_organizer),_=l?parseInt(l):30,v={...((O=this.selectedConfiguration)==null?void 0:O.id)&&{id:this.selectedConfiguration.id},version:((F=this.selectedConfiguration)==null?void 0:F.version)??"1.0.0",availability:{duration_minutes:_,interval_minutes:(u==null?void 0:u.interval)??_,round_to:u==null?void 0:u.roundTo,availability_rules:{availability_method:((N=(R=(P=this.selectedConfiguration)==null?void 0:P.availability)==null?void 0:R.availability_rules)==null?void 0:N.availability_method)??"collective",buffer:f||{before:0,after:0},default_open_hours:((V=(M=(j=this.selectedConfiguration)==null?void 0:j.availability)==null?void 0:M.availability_rules)==null?void 0:V.default_open_hours)??X.DEFAULT_OPEN_HOURS,round_robin_group_id:((A=(z=(U=this.selectedConfiguration)==null?void 0:U.availability)==null?void 0:z.availability_rules)==null?void 0:A.round_robin_group_id)??""}},participants:[{name:(d==null?void 0:d.name)??(d==null?void 0:d.email)??(($=this.currentUser)==null?void 0:$.name)??((Z=this.currentUser)==null?void 0:Z.email)??"",email:(d==null?void 0:d.email)??((G=this.currentUser)==null?void 0:G.email)??"",is_organizer:!0,availability:{calendar_ids:c!=null&&c.length?c:["primary"],open_hours:(r==null?void 0:r.openHours)??[]},booking:{calendar_id:h&&h!==""?h:"primary"}}],event_booking:{title:(o==null?void 0:o.toString())??"",description:(i==null?void 0:i.toString())??"",location:(p==null?void 0:p.toString())??"",booking_type:(b==null?void 0:b.toString())??"booking",timezone:(r==null?void 0:r.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone},scheduler:{cancellation_policy:w??"",available_days_in_future:y??30,min_cancellation_notice:m??0,min_booking_notice:g??60,additional_guests_hidden:k??!1,hide_cancellation_options:C??!1,hide_rescheduling_options:x??!1}},S=t.mergeDeep(v,this.selectedConfiguration),L=this.action==="create"?S:v,Q=q=>{this.isLoading=!1,this.changesSaved=!0,setTimeout(()=>{this.changesSaved=!1},5e3)};this.schedulerConfigChanged.emit({config:L,resetLoadingState:Q,setError:this.setError,action:this.action})},this.calendars=void 0,this.selectedConfiguration=void 0,this.currentUser=void 0,this.schedulerPreviewLink="",this.mode="app",this.action="create",this.activeTab="eventInfo",this.isLoading=!1,this.hasUnsavedChanges=!1,this.changesSaved=!1,this.formState={},this.error=""}configChangedHandler(e){t.debug("[nylas-editor-tabs]","configChangedHandler",e,this.selectedConfiguration),this.formState={...this.getFormStateFromConfig(e)},e.id?this.action="edit":this.action="create"}connectedCallback(){t.debug("[nylas-editor-tabs]","connectedCallback")}componentWillLoad(){t.debug("[nylas-editor-tabs]","componentWillLoad"),this.formState=this.getFormStateFromConfig(this.selectedConfiguration)}componentDidLoad(){t.debug("[nylas-editor-tabs]","componentDidLoad")}disconnectedCallback(){t.debug("[nylas-editor-tabs]","disconnectedCallback")}handleValueChanged(e){t.debug("[nylas-editor-tabs]","handleValueChanged",e);const{name:n,value:a}=e.detail;this.formState={...this.formState,[n]:a},this.hasUnsavedChanges=!0,this.error=""}getFormStateFromConfig(e){var a,s,o,i,l,r,c,h,p,b,f,y,m,g,w,u,k,C,x,d,_,v,S;const n=(a=e==null?void 0:e.participants)==null?void 0:a.find(L=>L.is_organizer);return{title:((s=e==null?void 0:e.event_booking)==null?void 0:s.title)??"",description:((o=e==null?void 0:e.event_booking)==null?void 0:o.description)??"",duration:((l=(i=e==null?void 0:e.availability)==null?void 0:i.duration_minutes)==null?void 0:l.toString())??"30",availability:{timezone:((r=e==null?void 0:e.event_booking)==null?void 0:r.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone,openHours:(c=n==null?void 0:n.availability)==null?void 0:c.open_hours},calendarIds:((h=n==null?void 0:n.availability)==null?void 0:h.calendar_ids)??[],participants:(e==null?void 0:e.participants)??[],bookingCalendar:((p=n==null?void 0:n.booking)==null?void 0:p.calendar_id)??(n==null?void 0:n.email)??"",location:((b=e==null?void 0:e.event_booking)==null?void 0:b.location)??"",bookingType:((f=e==null?void 0:e.event_booking)==null?void 0:f.booking_type)??"booking",buffer:((m=(y=e==null?void 0:e.availability)==null?void 0:y.availability_rules)==null?void 0:m.buffer)??{before:0,after:0},cancellationPolicy:((g=e==null?void 0:e.scheduler)==null?void 0:g.cancellation_policy)??"",availableDaysInFuture:((w=e==null?void 0:e.scheduler)==null?void 0:w.available_days_in_future)??30,minCancellationNotice:((u=e==null?void 0:e.scheduler)==null?void 0:u.min_cancellation_notice)??0,minBookingNotice:((k=e==null?void 0:e.scheduler)==null?void 0:k.min_booking_notice)??60,timeslotInterval:{interval:((C=e==null?void 0:e.availability)==null?void 0:C.interval_minutes)??((x=e==null?void 0:e.availability)==null?void 0:x.duration_minutes)??10,roundTo:(d=e==null?void 0:e.availability)==null?void 0:d.round_to},additionalGuestsHidden:((_=e==null?void 0:e.scheduler)==null?void 0:_.additional_guests_hidden)??!1,hideCancellationOptions:((v=e==null?void 0:e.scheduler)==null?void 0:v.hide_cancellation_options)??!1,hideReschedulingOptions:((S=e==null?void 0:e.scheduler)==null?void 0:S.hide_rescheduling_options)??!1}}updateFormState(){return new FormData(this.formRef).forEach((n,a)=>{switch(a){case"title":this.formState.title=n.toString();break;case"description":this.formState.description=n.toString();break;case"duration":this.formState.duration=n.toString();break;case"availability":this.formState.availability=JSON.parse(n.toString());break;case"participants":this.formState.participants=JSON.parse(n.toString());break;case"calendars":this.formState.calendarIds=n.toString().split(",");break;case"booking-calendar":this.formState.bookingCalendar=n.toString();break;case"location":this.formState.location=n.toString();break;case"booking-type":this.formState.bookingType=n.toString();break;case"buffer-time":this.formState.buffer=JSON.parse(n.toString());break;case"limit-future-bookings":this.formState.availableDaysInFuture=parseInt(n.toString());break;case"min-cancellation-notice":this.formState.minCancellationNotice=parseInt(n.toString());break;case"min-booking-notice":this.formState.minBookingNotice=parseInt(n.toString());break;case"cancellation-policy":this.formState.cancellationPolicy=n.toString();break;case"timeslot-interval":this.formState.timeslotInterval=JSON.parse(n.toString());break;case"customize-booking-settings":const s=JSON.parse(n.toString());this.formState.additionalGuestsHidden=s.additionalGuestsHidden,this.formState.hideCancellationOptions=s.hideCancellationOptions,this.formState.hideReschedulingOptions=s.hideReschedulingOptions;break}}),this.formState={...this.formState},this.formState}setActiveTab(e,n){e.preventDefault(),this.updateFormState(),this.activeTab=n}render(){var e;return t.debug("[nylas-editor-tabs]","render",this.formState),t.h(t.Host,{key:"de54edb776a03cca0c170f3e1d5f6201cd520172"},t.h("form",{key:"013ba8fa3d09938c1cdb686884a035967e5dd5c5",onSubmit:this.formSubmissionHandler,class:"scheduler-editor",ref:n=>this.formRef=n,noValidate:!0},this.mode==="app"?t.h("div",{class:"form-contents"},t.h("div",{class:"tabs"},t.h("button",{class:{tab:!0,active:this.activeTab=="eventInfo"},onClick:n=>this.setActiveTab(n,"eventInfo")},t.h("calendar-info-icon",{width:"16",height:"16"}),"Event Info"),t.h("button",{class:{tab:!0,active:this.activeTab=="availability"},onClick:n=>this.setActiveTab(n,"availability")},t.h("calendar-patterns-icon",{width:"16",height:"16"}),"Availability"),t.h("button",{class:{tab:!0,active:this.activeTab=="bookingOptions"},onClick:n=>this.setActiveTab(n,"bookingOptions")},t.h("flow-icon",{width:"16",height:"16"}),"Booking Options")),t.h("div",{class:"tab-content"},t.h(at,{formState:this.formState,activeTab:this.activeTab,calendars:this.calendars,id:((e=this.selectedConfiguration)==null?void 0:e.id)??"new"}))):t.h("slot",null),t.h("div",{key:"d16cd84ad1d7fc69b700519851da428a2f15bdd3",class:"footer"},t.h("div",{key:"91ac1d799dd53725041d6e12577e7186f8ddad95",class:"preview"},this.schedulerPreviewLink!==""&&this.action==="edit"&&t.h("button-component",{type:"button",disabled:this.isLoading,clickHandler:n=>{n.preventDefault(),this.previewButtonClicked.emit(this.host).defaultPrevented||window.open(t.parsePreviewLink(this.schedulerPreviewLink,this.selectedConfiguration),"_blank")},variant:"basic"},"Preview")),t.h("div",{key:"975c3e7ebf2a11ac457785d4824d7b174a24e643",class:"buttons"},t.h("p",{key:"6311d2d31ab503238a5ff98131423167aa794733",class:{"unsaved-changes":this.hasUnsavedChanges&&!this.changesSaved,"saved-changes":this.changesSaved,error:this.error!=="","error-full-width":this.error!==""&&this.action==="create"}},this.error!==""?this.error:"",this.error==""&&this.hasUnsavedChanges&&!this.changesSaved?"Unsaved changes":this.error==""&&this.changesSaved?"Changes saved!":""),t.h("button-component",{key:"83e0a53f373b0fe78c80bcbce98b631fd105001d",type:"button",disabled:this.isLoading,clickHandler:n=>{n.preventDefault(),this.cancelButtonClick.emit(),this.error=""},variant:"basic"},"Cancel"),t.h("button-component",{key:"35c347a3e9bd1f9b54d3919e9d09135fa1ad5c70",type:"submit",disabled:this.isLoading},this.isLoading?t.h("span",null,"Saving",t.h("loading-icon",null)," "):this.action=="create"?"Create":"Save changes")))))}get host(){return t.getElement(this)}static get watchers(){return{selectedConfiguration:["configChangedHandler"]}}};ot([J.RegisterComponent({name:"nylas-editor-tabs",stateToProps:new Map([["schedulerConfig.calendars","calendars"],["schedulerConfig.selectedConfiguration","selectedConfiguration"],["schedulerConfig.currentUser","currentUser"]]),eventToProps:{schedulerConfigChanged:async(e,n)=>{const{resetLoadingState:a,setError:s,action:o,config:i}=e.detail,l=r=>{const[c,h]=r;!c&&h&&s&&s(h),a&&a(e)};if(o==="edit"){const r=await n.schedulerConfig.updateConfiguration(i);l(r)}else{const r=await n.schedulerConfig.createConfiguration(i);l(r)}},cancelButtonClick:async(e,n)=>{n.schedulerConfigStore.state.action=null},previewButtonClicked:async(e,n)=>{t.debug("[nylas-editor-tabs]","previewButtonClicked",n)},formSubmitted:async(e,n)=>{t.debug("[nylas-editor-tabs]","formSubmitted",n)}},localPropsToProp:new Map([["schedulerPreviewLink","schedulerPreviewLink"]]),fireRegisterEvent:!0}),B("design:type",Function),B("design:paramtypes",[]),B("design:returntype",void 0)],D.prototype,"render",null);D.style=st;const rt=':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:1rem;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;overflow-y:auto}.configurations table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations table.no-configurations{height:100%}.configurations table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations table tr:last-of-type{border-bottom:0}.configurations table tr.hide{display:none}.configurations table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations table th.actions-header{text-align:right}.configurations table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations table th,.configurations table td{text-align:left;padding:1rem;font-family:inherit}.configurations table .actions{text-align:right}.configurations table .actions{display:flex;justify-content:flex-end;gap:1rem}@media screen and (max-width: 768px){.configurations table .actions{flex-direction:column;gap:0.5rem}}.configurations table .title{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .config-event-description{font-size:0.75rem}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}button-component#copy button{width:108px}',lt=rt;var dt=function(e,n,a,s){var o=arguments.length,i=o<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,a):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,n,a,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(i=(o<3?l(i):o>3?l(n,a,i):l(n,a))||i);return o>3&&i&&Object.defineProperty(n,a,i),i},H=function(e,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,n)};const I=class{constructor(e){t.registerInstance(this,e),this.initListConfigurations=t.createEvent(this,"initListConfigurations",7),this.createButtonClick=t.createEvent(this,"createButtonClick",7),this.editButtonClick=t.createEvent(this,"editButtonClick",7),this.deleteButtonClick=t.createEvent(this,"deleteButtonClick",7),this.configurations=[],this.schedulerPreviewLink="",this.state="loading",this.error="",this.copiedButtonIndex=-1}connectedCallback(){t.debug("[nylas-list-configurations]","connectedCallback")}componentWillLoad(){t.debug("[nylas-list-configurations]","componentWillLoad"),this.configurations&&this.configurations.length>0&&(this.state="loaded")}componentDidLoad(){t.debug("[nylas-list-configurations]","componentDidLoad"),this.initListConfigurations.emit(this.host)}disconnectedCallback(){t.debug("[nylas-list-configurations]","disconnectedCallback")}async getState(){return this.state}async setState(e){this.state=e}async setError(e){this.error=e}getDurationString(e){const n=Math.floor(e/60),a=e%60;return`${n||""} ${n?`${n>1?"hours":"hour"}`:""} ${a||""} ${a?`${a>1?"mins":"min"}`:""}`}render(){return t.h(t.Host,null,t.h("div",{class:"header"},t.h("div",{class:"description"},t.h("h2",null,"All scheduling pages"),t.h("p",null,"Create, edit and manage all your scheduling pages.")),this.configurations&&this.configurations.length>0&&t.h("div",{class:"actions"},t.h("button-component",{clickHandler:()=>{this.createButtonClick.emit(this.host)}},"Create new"))),t.h("div",{class:"configurations"},t.h("table",{class:{"no-configurations":this.state!=="loading"&&(!this.configurations||this.configurations.length===0)}},t.h("tr",{class:{hide:this.state==="loading"||this.configurations&&this.configurations.length===0}},t.h("th",null,"Scheduling page title"),t.h("th",null,"Duration"),t.h("th",{class:"actions-header"},"Actions")),this.state==="loading"&&t.h("tr",{class:"no-configurations"},t.h("td",{colSpan:3},t.h("div",null,t.h("h3",null,"Loading..."),t.h("p",null,"Please wait while we fetch the scheduling pages")))),this.state!=="loading"&&(!this.configurations||this.configurations.length===0)&&t.h("tr",{class:"no-configurations"},t.h("td",{colSpan:3},t.h("div",null,t.h("calendar-icon",{width:"48",height:"48"}),t.h("h3",null,"No scheduling pages found"),t.h("p",null,"Get started with creating your first scheduling page"),t.h("button-component",{clickHandler:()=>{this.createButtonClick.emit(this.host)}},"Create new")))),this.state!=="loading"&&this.configurations.map((e,n)=>t.h("tr",{key:e.id},t.h("td",null,t.h("div",{class:"title"},t.h("span",{class:"config-event-title"},e.event_booking.title),t.h("span",{class:"config-event-description"},e.event_booking.description))),t.h("td",null,t.h("div",null,this.getDurationString(e.availability.duration_minutes))),t.h("td",null,t.h("div",{class:"actions"},t.h("button-component",{variant:"basic",id:"copy",key:`copy-${n}`,clickHandler:async a=>{a.preventDefault();const s=t.parsePreviewLink(this.schedulerPreviewLink,e);await navigator.clipboard.writeText(s),this.copiedButtonIndex=n,setTimeout(()=>{this.copiedButtonIndex=-1},3e3)}},this.copiedButtonIndex===n?"Copied!":"Copy link"),t.h("button-component",{variant:"basic",key:`edit-${n}`,clickHandler:a=>{a.preventDefault(),this.editButtonClick.emit({host:this.host,configuration:e})}},"Edit"),t.h("button-component",{variant:"basic",key:`delete-${n}`,clickHandler:a=>{a.preventDefault(),this.deleteButtonClick.emit({host:this.host,configuration:e})}},"Delete"))))))),this.state==="error"&&t.h("div",{class:"error-container"},t.h("p",{class:"error"},this.error)))}get host(){return t.getElement(this)}};dt([J.RegisterComponent({name:"nylas-list-configurations",stateToProps:new Map([["schedulerConfig.configurations","configurations"]]),localPropsToProp:new Map([["schedulerPreviewLink","schedulerPreviewLink"]]),eventToProps:{initListConfigurations:async(e,n)=>{const a=e.detail;await a.setState("loading");const[s,o]=await n.schedulerConfig.getConfigurations();if(!s&&o&&o.message){await a.setState("error"),await a.setError(o.message);return}await a.setState("loaded")},createButtonClick:async(e,n)=>{n.schedulerConfigStore.resetSelectedConfiguration(),n.schedulerConfigStore.state.action="create"},deleteButtonClick:async(e,n)=>{const{host:a,configuration:s}=e.detail,[o,i]=await n.schedulerConfig.deleteConfiguration(s.id);!o&&i&&i.message&&(await a.setState("error"),await a.setError(i.message))},editButtonClick:async(e,n)=>{const{configuration:a}=e.detail;n.schedulerConfigStore.state.selectedConfiguration=a,n.schedulerConfigStore.state.action="edit"}},fireRegisterEvent:!0}),H("design:type",Function),H("design:paramtypes",[]),H("design:returntype",void 0)],I.prototype,"render",null);I.style=lt;exports.google_logo_icon=W;exports.microsoft_logo_icon=K;exports.nylas_editor_tabs=D;exports.nylas_list_configurations=I;
@@ -1,5 +0,0 @@
1
- import { i as o } from "./index-2d032bec.js";
2
- var r = o.process;
3
- export {
4
- r as p
5
- };
@@ -1 +0,0 @@
1
- "use strict";const s=require("./index-9c04361d.cjs");var e=s.commonjsGlobal.process;exports.process=e;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-9c04361d.cjs");require("react");require("react-dom");const p=':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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{position:unset}}.dropdown{display:inline-block}.dropbtn{color:var(--nylas-base-800);padding:10px;font-size:1rem;font-family:var(--nylas-font-family);cursor:pointer;display:flex;gap:0.5rem;background:transparent;border:none;border-radius:var(--nylas-border-radius-2x);width:50px;padding:14px 16px;border-radius:var(--nylas-border-radius-2x)}.dropbtn.focus{background:transparent}.dropbtn:hover,.dropbtn:active{outline:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn span.chevron{display:flex;align-self:center}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropbtn 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){.dropbtn span.selected-option{max-width:124px;font-size:16px}}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);max-width:306px;width:max-content;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1)}@media screen and (max-width: 768px){.dropdown-content{right:0;width:325px;max-width:unset}}.search-box{border-bottom:1px solid var(--nylas-base-200);padding:10px;position:sticky;top:0;background:var(--nylas-base-0)}.search-box .icon{position:absolute;top:1.25rem;left:1.25rem;color:var(--nylas-base-300)}.dropdown-content ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.dropdown-content ul li{padding:16px, 12px, 16px, 12px;color:black;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}.dropdown-content ul li:hover,.dropdown-content ul li:focus{background-color:var(--nylas-base-100)}.dropdown-content .selected{background-color:#e7e7e7}input[type=text]{width:-webkit-fill-available;padding:inherit;border:1px solid #ccc;border-radius:4px;position:sticky;background:no-repeat scroll 7px 7px;padding-left:30px;background-size:16px 16px}',c=p,a=class{constructor(e){n.registerInstance(this,e),this.inputOptionChanged=n.createEvent(this,"inputOptionChanged",7),this.name=void 0,this.options=[],this.defaultInputOption=void 0,this.inputValue=void 0,this.pluralizedLabel="",this.selectedOption=this.defaultInputOption||null,this.isOpen=!1,this.filteredOptions=[...this.options],this.ariaActivedescendant="",this.shouldAutoScroll=!1}optionsChangedHandler(e,t){e!==t&&(this.filteredOptions=e)}defaultSelectedOptionChangedHandler(e,t){e.label!==t.label&&(this.selectedOption=e)}componentWillLoad(){this.filteredOptions=this.options,!this.selectedOption&&this.defaultInputOption&&(this.selectedOption=this.defaultInputOption),!this.selectedOption&&this.options.length>0&&(this.selectedOption=this.options[0])}toggleDropdown(){this.isOpen=!this.isOpen}selectOption(e){this.selectedOption=e,this.toggleDropdown(),this.inputOptionChanged.emit({value:e.value,name:this.name})}handleOnInput(e){const t=e.target.value,i=this.options.findIndex(o=>o.label.toLowerCase().includes(t.toLowerCase()));i>-1&&this.scrollToViewWithinParent(i),this.inputOptionChanged.emit({value:t,name:this.name})}scrollToViewWithinParent(e){var d;const t=this.options[e],i=(d=this.el.shadowRoot)==null?void 0:d.getElementById(t.value.toString()),o=this.optionsRef;this.ariaActivedescendant=t.value.toString();const r=i.getBoundingClientRect(),s=o.getBoundingClientRect();r.top<s.top?o.scrollTop-=s.top-r.top:r.bottom>s.bottom&&(o.scrollTop+=r.bottom-s.bottom)}handleSelectButtonKeyDown(e){var t;switch(e.key){case"ArrowDown":case"Enter":e.preventDefault(),this.isOpen||this.toggleDropdown(),(t=this.inputRef)==null||t.focus();break;case"Escape":this.isOpen=!1;break}}handleClick(e){if(this.isOpen){const t=e.target.value,i=this.options.findIndex(o=>o.label.toLowerCase().includes(t.toLowerCase()));i>-1&&setTimeout(()=>{this.scrollToViewWithinParent(i)},10)}}handleListboxKeydown(e){var o,r;const t=this.filteredOptions,i=t.findIndex(s=>s.value===this.ariaActivedescendant);if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){if(e.preventDefault(),i===t.length-1){this.ariaActivedescendant="",(o=this.inputRef)==null||o.focus();return}const s=i+1<t.length?i+1:0;this.ariaActivedescendant=t[s].value,this.focusOption(s)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){if(e.preventDefault(),i===0){this.ariaActivedescendant="",(r=this.inputRef)==null||r.focus();return}const s=i-1>=0?i-1:t.length-1;this.ariaActivedescendant=t[s].value,this.focusOption(s)}else e.key==="Enter"?(e.preventDefault(),this.ariaActivedescendant&&this.selectOption(t[i])):e.key==="Escape"&&(this.isOpen=!1)}focusOption(e){var r;const t=this.filteredOptions[e];if(!t)return;const i=t.value,o=(r=this.el.shadowRoot)==null?void 0:r.getElementById(i);o&&(o.focus(),o.scrollIntoView({behavior:"smooth",block:"nearest"}))}handleComboboxKeyDown(e){if(e.key==="ArrowDown"||e.key=="Tab"&&!e.shiftKey){if(e.preventDefault(),!this.isOpen){this.isOpen=!0,this.shouldAutoScroll=!0;return}this.ariaActivedescendant=this.filteredOptions[0].value,this.focusOption(0)}else e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey?(e.preventDefault(),this.ariaActivedescendant=this.filteredOptions[this.filteredOptions.length-1].value,this.focusOption(this.filteredOptions.length-1)):e.key==="Escape"&&(this.isOpen=!1)}handleOutsideClick(e){!e.composedPath().includes(this.el)&&this.isOpen&&(this.isOpen=!1)}render(){return n.h("div",{key:"763e9bef7edb44ff217147c9ee63ec0076c4cc4a",class:"dropdown",part:"id_dropdown"},n.h("input",{key:"579022217510a4be6a23c6b2f65910c4b993b42d",type:"text",name:this.name,id:this.name,part:"id_dropdown-input",class:{dropbtn:!0,open:this.isOpen},value:this.inputValue,onClick:e=>{this.toggleDropdown(),this.shouldAutoScroll=!0,this.handleClick(e)},"aria-haspopup":"listbox","aria-label":this.name,"aria-expanded":this.isOpen?"true":"false",onKeyDown:e=>this.handleComboboxKeyDown(e),onInput:e=>this.handleOnInput(e)}),this.isOpen?n.h("div",{class:"dropdown-content",part:"id_dropdown-content",ref:e=>this.optionsRef=e},n.h("ul",{tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.filteredOptions.map(e=>n.h("li",{tabindex:"0",key:e.value,id:e.value,onClick:()=>this.selectOption(e),role:"option",class:{focused:this.ariaActivedescendant===e.value.toString()}},e.labelHTML?e.labelHTML:e.label)))):null)}get el(){return n.getElement(this)}static get watchers(){return{options:["optionsChangedHandler"],defaultInputOption:["defaultSelectedOptionChangedHandler"]}}};a.style=c;const h=".time-period-selector.sc-time-period-selector{display:grid;gap:0.5rem;grid-template-columns:auto 1fr}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector,.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector{width:116px}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector{width:84px;display:flex;align-items:center}.time-period-selector.sc-time-period-selector select-dropdown#time-period.sc-time-period-selector::part(sd_dropdown-button){width:100%}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown){width:inherit;height:100%}.time-period-selector.sc-time-period-selector input-dropdown#time-number.sc-time-period-selector::part(id_dropdown-input){border:none;border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown-input){padding:17px;gap:1rem}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown-content){width:100%;max-height:200px}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown){width:inherit}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-button){padding:1rem;gap:1rem;justify-content:space-between}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-content){width:100%;max-height:200px}",u=h,m={hours:"hour",days:"day",weeks:"week",months:"month"},l=class{constructor(e){n.registerInstance(this,e),this.timePeriodChanged=n.createEvent(this,"timePeriodChanged",7),this.timePeriods=["hour","day","week","month"],this.defaultSelectedPeriod="hour",this.defaultSelectedNumber=1,this.selectedPeriod=this.defaultSelectedPeriod,this.selectedNumber=this.defaultSelectedNumber,this.numberOptions=this.calculateOptions(this.defaultSelectedPeriod||"hour").map(t=>({label:t.toString(),value:t.toString()})),this.timePeriodOptions=this.timePeriods.map(t=>({label:t,value:t}))}defaultSelectedPeriodChangedHandler(e){this.selectedPeriod=e;const t=m[e]??e;this.updateNumberOptionsAndSelectedNumber(t)}defaultSelectedNumberChangedHandler(e){this.selectedNumber=e}timePeriodsChangedHandler(e){this.timePeriodOptions=e.map(t=>({label:t,value:t}))}calculateOptions(e){switch(e){case"hour":return Array.from({length:23},(t,i)=>i+1);case"minute":return Array.from({length:13},(t,i)=>i*5);case"day":return Array.from({length:30},(t,i)=>i+1);case"week":return Array.from({length:4},(t,i)=>i+1);case"month":return Array.from({length:12},(t,i)=>i+1);default:return[]}}inputOptionChangedHandler(e){n.debug("time-period-selector","inputOptionChangedHandler",e.detail);const{value:t,name:i}=e.detail;i==="time-number"&&(this.selectedNumber=parseInt(t));const o={number:this.selectedNumber,period:this.selectedPeriod};this.timePeriodChanged.emit(o)}nylasFormDropdownChangedHandler(e){n.debug("time-period-selector","nylasFormDropdownChangedHandler",e.detail);const{value:t,name:i}=e.detail;i==="time-period"?(this.selectedPeriod=t,this.updateNumberOptionsAndSelectedNumber(t)):i==="time-number"&&(this.selectedNumber=parseInt(t));const o={number:this.selectedNumber,period:this.selectedPeriod};this.timePeriodChanged.emit(o)}updateNumberOptionsAndSelectedNumber(e){const t=this.calculateOptions(e);this.numberOptions=t.map(i=>({label:i.toString(),value:i.toString()})),this.selectedNumber=parseInt(this.numberOptions[0].value)}render(){return n.h("div",{key:"89f218f22905064cadac4d109b631ec138b461ef",class:"time-period-selector"},n.h("input-dropdown",{key:"2b86597d92716df5196e696a82ef813d895688dc",id:"time-number",name:"time-number",inputValue:this.selectedNumber.toString(),exportparts:"sd_dropdown: tps__number-dropdown, sd_dropdown-button: tps__number-dropdown-button, sd_dropdown-content: tps__number-dropdown-content",options:this.numberOptions,defaultInputOption:this.numberOptions.find(e=>e.value==this.selectedNumber.toString())??this.numberOptions[0]}),n.h("select-dropdown",{key:"7283a087443a6c3827f41f0276e1c8024025eeca",id:"time-period",name:"time-period",options:this.timePeriodOptions,exportparts:"sd_dropdown: tps__period-dropdown, sd_dropdown-button: tps__period-dropdown-button, sd_dropdown-content: tps__period-dropdown-content",pluralizedLabel:this.selectedNumber>1?"s":"",defaultSelectedOption:this.timePeriodOptions.find(e=>e.value==this.selectedPeriod)??this.timePeriodOptions[0],withSearch:!1}))}get host(){return n.getElement(this)}static get watchers(){return{defaultSelectedPeriod:["defaultSelectedPeriodChangedHandler"],defaultSelectedNumber:["defaultSelectedNumberChangedHandler"],timePeriods:["timePeriodsChangedHandler"]}}};l.style=u;exports.input_dropdown=a;exports.time_period_selector=l;
@@ -1,15 +0,0 @@
1
- import { r as a, h as e } from "./index-2d032bec.js";
2
- import "react";
3
- import "react-dom";
4
- const i = ".wave{display:flex;align-items:center;justify-content:center}.dot{width:4px;height:4px;background-color:var(--dot-color, white);border-radius:50%;margin:0 2px;animation:wave 1.5s infinite ease-in-out}.dot:nth-child(2){animation-delay:0.2s}.dot:nth-child(3){animation-delay:0.4s}@keyframes wave{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-4px)}}", n = i, o = class {
5
- constructor(t) {
6
- a(this, t), this.width = "15", this.height = "15";
7
- }
8
- render() {
9
- return e("div", { key: "451777deed2c5b92613340e5c49f2b88f3149ddb", class: "wave" }, e("div", { key: "257478c933368a352a8e24e989f00f68157dc7f5", class: "dot" }), e("div", { key: "ab49e532f4228f89de93b7486ff905762a7f1e95", class: "dot" }), e("div", { key: "61a94bdcc940aec78fc5f3379be7085ee003d96a", class: "dot" }));
10
- }
11
- };
12
- o.style = n;
13
- export {
14
- o as loading_icon
15
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-9c04361d.cjs");require("react");require("react-dom");const i=".wave{display:flex;align-items:center;justify-content:center}.dot{width:4px;height:4px;background-color:var(--dot-color, white);border-radius:50%;margin:0 2px;animation:wave 1.5s infinite ease-in-out}.dot:nth-child(2){animation-delay:0.2s}.dot:nth-child(3){animation-delay:0.4s}@keyframes wave{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-4px)}}",n=i,t=class{constructor(a){e.registerInstance(this,a),this.width="15",this.height="15"}render(){return e.h("div",{key:"451777deed2c5b92613340e5c49f2b88f3149ddb",class:"wave"},e.h("div",{key:"257478c933368a352a8e24e989f00f68157dc7f5",class:"dot"}),e.h("div",{key:"ab49e532f4228f89de93b7486ff905762a7f1e95",class:"dot"}),e.h("div",{key:"61a94bdcc940aec78fc5f3379be7085ee003d96a",class:"dot"}))}};t.style=n;exports.loading_icon=t;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-9c04361d.cjs"),c=require("./register-component-a5a9ca5d-1fbb27d2.cjs");require("react");require("react-dom");const y=':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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-additional-participants__title{color:var(--nylas-base-nylas-base-900-aaa, #101323);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_wrapper{display:flex;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-300)}.nylas-additional-participants__input_wrapper button{padding:12px;border:none;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{background:var(--nylas-base-50)}.nylas-additional-participants__input{flex:1;padding:12px 16px;border-right:1px solid var(--nylas-base-300)}.nylas-additional-participants__input input{border:none;outline:none;background:none;width:100%}.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)}',u=y;var _=function(a,i,n,s){var r=arguments.length,e=r<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,n):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(a,i,n,s);else for(var p=a.length-1;p>=0;p--)(l=a[p])&&(e=(r<3?l(e):r>3?l(i,n,e):l(i,n))||e);return r>3&&e&&Object.defineProperty(i,n,e),e},d=function(a,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(a,i)};const o=class{constructor(a){t.registerInstance(this,a),a.$hostElement$["s-ei"]?this.internals=a.$hostElement$["s-ei"]:(this.internals=a.$hostElement$.attachInternals(),a.$hostElement$["s-ei"]=this.internals),this.name="participants",this.eventParticipants=void 0,this.participants=this.eventParticipants??[],this.participantsValid=!0}elementNameChangedHandler(a){t.debug("nylas-additional-participants","elementNameChangedHandler",a),this.host.setAttribute("name",a)}connectedCallback(){t.debug("nylas-additional-participants","connectedCallback")}componentWillLoad(){t.debug("nylas-additional-participants","componentWillLoad"),this.host.setAttribute("name",this.name)}componentDidLoad(){t.debug("nylas-additional-participants","componentDidLoad"),this.internals.setFormValue(JSON.stringify(this.participants),"participants")}disconnectedCallback(){t.debug("nylas-additional-participants","disconnectedCallback")}onParticipantChange(a,i){t.debug("nylas-additional-participants","onParticipantChange"),this.participants[i].email=a.target.value,this.internals.setFormValue(JSON.stringify(this.participants),"participants")}addParticipant(){t.debug("nylas-additional-participants","addParticipant"),this.participants=[...this.participants,{email:"",is_organizer:!1,availability:{calendar_ids:["primary"]}}],this.internals.setFormValue(JSON.stringify(this.participants),"participants")}removeParticipant(a){t.debug("nylas-additional-participants","addParticipant"),this.participants=this.participants.filter(i=>i.email!==a),this.internals.setFormValue(JSON.stringify(this.participants),"participants")}validate(a,i){t.debug("nylas-additional-participants","validate");const s=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(a).toLowerCase());this.participants[i].is_valid=s,this.internals.setFormValue(JSON.stringify(this.participants),"participants")}render(){return t.h(t.Host,{key:"91518d593ecd43e88105d3137746e9d95653e0e7"},t.h("nylas-form-card",{key:"d05f897f3d5109ce3b31d2aad8ca09af05793b58"},t.h("h3",{key:"fcc5ae151fb84bf60abf58e44eb8e043cd4cefac",slot:"header-title",class:"nylas-additional-participants__title",part:"nap__title"},"Additional participants"),t.h("p",{key:"7e8e8354258dc9884cef56c1e4bdbe0d1fc724c5",slot:"header-subtitle",class:"nylas-additional-participants__subtitle",part:"nap__subtitle"},"Add anyone else who would be joining for this event."),t.h("div",{key:"3376539a53c39a2e43fd4a817a83511eb852cd87",slot:"content",class:"nylas-additional-participants__content"},t.h("div",{key:"b782dad233ad8ca25030d9ea45092eea93c2f0dd"},this.participants.map((a,i)=>t.h("div",{class:"nylas-additional-participants__input_group",part:"nap__input_group"},t.h("label",null,a.is_organizer?"Organizer":`Participant ${i}`),t.h("div",{part:"nap__input_wrapper",class:`nylas-additional-participants__input_wrapper ${a.is_organizer&&"nylas-additional-participants__input_wrapper_organizer"} ${a.is_valid===!1&&"nylas-additional-participants__input_wrapper_invalid"}`},t.h("div",{class:"nylas-additional-participants__input",part:"nap__input"},t.h("input",{type:"text",value:a.email,onInput:n=>{this.onParticipantChange(n,i)},readOnly:a.is_organizer,onBlur:()=>this.validate(a.email,i)})),!a.is_organizer&&t.h("button",{onClick:()=>this.removeParticipant(a.email),part:"nap__remove-participant"},t.h("close-icon",null)))))))))}static get formAssociated(){return!0}get host(){return t.getElement(this)}static get watchers(){return{name:["elementNameChangedHandler"]}}};_([c.RegisterComponent({name:"nylas-additional-participants",eventToProps:{},fireRegisterEvent:!0}),d("design:type",Function),d("design:paramtypes",[]),d("design:returntype",void 0)],o.prototype,"render",null);o.style=u;exports.nylas_additional_participants=o;