@nylas/react 2.1.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/cjs/connect.js +1 -0
  2. package/dist/cjs/elements.js +1 -0
  3. package/dist/cjs/index.js +1 -0
  4. package/dist/cjs/notetaker.js +62 -0
  5. package/dist/cjs/utils.js +11 -0
  6. package/dist/connect.d.ts +1 -0
  7. package/dist/elements.d.ts +1 -0
  8. package/dist/es/connect.js +279 -0
  9. package/dist/es/elements.js +1319 -0
  10. package/dist/es/index.js +281 -0
  11. package/dist/es/notetaker.js +5784 -0
  12. package/dist/es/utils.js +12396 -0
  13. package/dist/lib/connect/types.d.ts +1 -1
  14. package/dist/lib/connect/useNylasConnect.d.ts +2 -2
  15. package/dist/lib/connect.d.ts +1 -0
  16. package/dist/lib/elements/components.d.ts +975 -0
  17. package/dist/lib/elements.d.ts +1 -0
  18. package/dist/lib/index.d.ts +3 -6
  19. package/dist/lib/notetaker.d.ts +1 -0
  20. package/dist/lib/utils.d.ts +2 -0
  21. package/dist/notetaker.d.ts +1 -0
  22. package/dist/utils.d.ts +1 -0
  23. package/package.json +36 -16
  24. package/dist/add-circle-icon_2.entry-8c3bb0bb.cjs +0 -1
  25. package/dist/add-circle-icon_2.entry-a3daf6c4.js +0 -28
  26. package/dist/archive-icon.entry-46ad0ff3.cjs +0 -1
  27. package/dist/archive-icon.entry-d5141486.js +0 -18
  28. package/dist/arrow-icon.entry-1b89ce78.js +0 -18
  29. package/dist/arrow-icon.entry-f696de4f.cjs +0 -1
  30. package/dist/bold-icon.entry-7827cd4e.cjs +0 -1
  31. package/dist/bold-icon.entry-c117b4cf.js +0 -18
  32. package/dist/button-component_2.entry-8cd4c5f3.cjs +0 -1
  33. package/dist/button-component_2.entry-e68caa9b.js +0 -29
  34. package/dist/calendar-agenda-fill-icon_37.entry-52bdc8b3.js +0 -5234
  35. package/dist/calendar-agenda-fill-icon_37.entry-8c592cfa.cjs +0 -6
  36. package/dist/calendar-cancel-icon.entry-7facfa05.cjs +0 -1
  37. package/dist/calendar-cancel-icon.entry-f5f1d499.js +0 -18
  38. package/dist/calendar-check-icon.entry-55320137.js +0 -18
  39. package/dist/calendar-check-icon.entry-72108702.cjs +0 -1
  40. package/dist/calendar-icon.entry-afea361e.js +0 -18
  41. package/dist/calendar-icon.entry-f5c6730f.cjs +0 -1
  42. package/dist/checkbox-component.entry-5722d263.cjs +0 -1
  43. package/dist/checkbox-component.entry-89fa6edd.js +0 -54
  44. package/dist/checkbox-group_4.entry-30e8af17.cjs +0 -28
  45. package/dist/checkbox-group_4.entry-51f03009.js +0 -10014
  46. package/dist/checkmark-circle-icon.entry-ae11049d.cjs +0 -1
  47. package/dist/checkmark-circle-icon.entry-dfe67e22.js +0 -18
  48. package/dist/checkmark-icon_15.entry-4c3979db.js +0 -1415
  49. package/dist/checkmark-icon_15.entry-e59c0f53.cjs +0 -5
  50. package/dist/chevron-icon_3.entry-1f3c3ca6.js +0 -159
  51. package/dist/chevron-icon_3.entry-ea791750.cjs +0 -1
  52. package/dist/clock-icon_4.entry-172fed74.cjs +0 -1
  53. package/dist/clock-icon_4.entry-78878cb8.js +0 -48
  54. package/dist/constants-f51538ef-cd2a67c4.cjs +0 -1
  55. package/dist/constants-f51538ef-e0a5f026.js +0 -876
  56. package/dist/customParseFormat-b5d95b34-a6b6fcba.cjs +0 -1
  57. package/dist/customParseFormat-b5d95b34-ce80820c.js +0 -135
  58. package/dist/delete-icon.entry-a8c0bf03.cjs +0 -1
  59. package/dist/delete-icon.entry-cebdc90f.js +0 -18
  60. package/dist/document-refresh-icon.entry-2d9a529d.cjs +0 -1
  61. package/dist/document-refresh-icon.entry-8780a2b8.js +0 -18
  62. package/dist/feedbackSync-92220b42-fbebe1f9.cjs +0 -448
  63. package/dist/feedbackSync-92220b42-fd5f5610.js +0 -6048
  64. package/dist/folder-icon.entry-3e61ccca.cjs +0 -1
  65. package/dist/folder-icon.entry-6ffd5191.js +0 -18
  66. package/dist/forward-icon.entry-c7d88db8.cjs +0 -1
  67. package/dist/forward-icon.entry-c9c4bf5b.js +0 -18
  68. package/dist/globe-icon.entry-0b93cab8.cjs +0 -1
  69. package/dist/globe-icon.entry-7c0dca7b.js +0 -18
  70. package/dist/google-logo-icon_6.entry-deef91ee.js +0 -1765
  71. package/dist/google-logo-icon_6.entry-e25ce3e7.cjs +0 -2
  72. package/dist/google-meet-icon_5.entry-214347f0.cjs +0 -1
  73. package/dist/google-meet-icon_5.entry-f8b5a92a.js +0 -58
  74. package/dist/inbox-icon.entry-873062c3.js +0 -18
  75. package/dist/inbox-icon.entry-f08f2fd5.cjs +0 -1
  76. package/dist/index-025be398.js +0 -7187
  77. package/dist/index-c510313d-1318f67a.js +0 -289
  78. package/dist/index-c510313d-b0508eee.cjs +0 -1
  79. package/dist/index-f42fe591.cjs +0 -65
  80. package/dist/index.es-488bc919-d02dd50a.cjs +0 -7
  81. package/dist/index.es-488bc919-ea63a7e9.js +0 -2724
  82. package/dist/info-icon_2.entry-442b9097.cjs +0 -1
  83. package/dist/info-icon_2.entry-60fb8648.js +0 -37
  84. package/dist/input-component.entry-5898a52e.js +0 -96
  85. package/dist/input-component.entry-7274fd28.cjs +0 -1
  86. package/dist/input-dropdown_2.entry-4534436c.js +0 -255
  87. package/dist/input-dropdown_2.entry-9b72f637.cjs +0 -1
  88. package/dist/italic-icon.entry-62052cd8.js +0 -18
  89. package/dist/italic-icon.entry-9bdbbd37.cjs +0 -1
  90. package/dist/lib/elements/index.d.ts +0 -133
  91. package/dist/lib/elements/react-component-lib/createComponent.d.ts +0 -10
  92. package/dist/lib/elements/react-component-lib/createOverlayComponent.d.ts +0 -21
  93. package/dist/lib/elements/react-component-lib/index.d.ts +0 -2
  94. package/dist/lib/elements/react-component-lib/interfaces.d.ts +0 -29
  95. package/dist/lib/elements/react-component-lib/utils/attachProps.d.ts +0 -9
  96. package/dist/lib/elements/react-component-lib/utils/case.d.ts +0 -2
  97. package/dist/lib/elements/react-component-lib/utils/dev.d.ts +0 -2
  98. package/dist/lib/elements/react-component-lib/utils/index.d.ts +0 -10
  99. package/dist/multi-select-dropdown.entry-77752d46.cjs +0 -1
  100. package/dist/multi-select-dropdown.entry-9c9d05c1.js +0 -133
  101. package/dist/nylas-booked-event-card_11.entry-32b2e9f1.js +0 -1410
  102. package/dist/nylas-booked-event-card_11.entry-4aba5146.cjs +0 -1
  103. package/dist/nylas-date-component_2.entry-6b058796.cjs +0 -1
  104. package/dist/nylas-date-component_2.entry-a869519f.js +0 -310
  105. package/dist/nylas-form-card.entry-5390459f.js +0 -75
  106. package/dist/nylas-form-card.entry-c2f34d73.cjs +0 -1
  107. package/dist/nylas-notification_2.entry-054392cf.cjs +0 -1
  108. package/dist/nylas-notification_2.entry-f46e88e5.js +0 -88
  109. package/dist/nylas-scheduler-editor.entry-40a48f47.js +0 -1854
  110. package/dist/nylas-scheduler-editor.entry-e29fdf07.cjs +0 -2
  111. package/dist/nylas-scheduling.entry-115b1752.js +0 -1002
  112. package/dist/nylas-scheduling.entry-79cb1d9c.cjs +0 -1
  113. package/dist/person-icon.entry-2cae306c.cjs +0 -1
  114. package/dist/person-icon.entry-fd668b89.js +0 -18
  115. package/dist/play-icon.entry-7fc3c0fd.js +0 -18
  116. package/dist/play-icon.entry-9989a520.cjs +0 -1
  117. package/dist/radio-button-group.entry-03385b5f.cjs +0 -1
  118. package/dist/radio-button-group.entry-9df82cd0.js +0 -58
  119. package/dist/react.cjs +0 -1
  120. package/dist/react.js +0 -164
  121. package/dist/refresh-icon.entry-310954ba.cjs +0 -1
  122. package/dist/refresh-icon.entry-c56e5623.js +0 -18
  123. package/dist/register-component-3acd57e7-5a79a90a.cjs +0 -1
  124. package/dist/register-component-3acd57e7-cb09c05e.js +0 -110
  125. package/dist/reply-all-icon.entry-32e0e000.js +0 -18
  126. package/dist/reply-all-icon.entry-68388f97.cjs +0 -1
  127. package/dist/reply-icon.entry-3ac2e736.js +0 -18
  128. package/dist/reply-icon.entry-e616a9a4.cjs +0 -1
  129. package/dist/sent-icon.entry-0622ed04.js +0 -18
  130. package/dist/sent-icon.entry-543eb3c4.cjs +0 -1
  131. package/dist/spam-icon.entry-74bcfd4f.js +0 -18
  132. package/dist/spam-icon.entry-e341ee3e.cjs +0 -1
  133. package/dist/star-icon.entry-864d2bf9.js +0 -18
  134. package/dist/star-icon.entry-c90d40f6.cjs +0 -1
  135. package/dist/stop-icon.entry-835908c5.js +0 -18
  136. package/dist/stop-icon.entry-ffc46b42.cjs +0 -1
  137. package/dist/textarea-component.entry-6adcf6a6.js +0 -58
  138. package/dist/textarea-component.entry-dae8eb5c.cjs +0 -1
  139. package/dist/toggle-switch.entry-5ee29867.cjs +0 -1
  140. package/dist/toggle-switch.entry-ff2ccb75.js +0 -51
  141. package/dist/translate-icon.entry-372dd808.js +0 -18
  142. package/dist/translate-icon.entry-5606067d.cjs +0 -1
  143. package/dist/trash-fill-icon.entry-01b4379e.js +0 -18
  144. package/dist/trash-fill-icon.entry-daed6c0a.cjs +0 -1
  145. package/dist/underline-icon.entry-2020ee64.cjs +0 -1
  146. package/dist/underline-icon.entry-464b900d.js +0 -18
  147. package/dist/utils-31933f5d-15041585.js +0 -17878
  148. package/dist/utils-31933f5d-1d4c81ab.cjs +0 -54
@@ -1,1765 +0,0 @@
1
- import { r as te, h as n, c as m, H as ce, g as pe, F as le } from "./index-025be398.js";
2
- import { R as be } from "./register-component-3acd57e7-cb09c05e.js";
3
- import { b, i as r, m as _e, l as de, g as at } from "./utils-31933f5d-15041585.js";
4
- import { n as _ } from "./index.es-488bc919-ea63a7e9.js";
5
- import { C as I, D as $e, e as ot, b as st } from "./constants-f51538ef-e0a5f026.js";
6
- import { E as v, i as Je, a as Ve, c as Ze, b as We, f as qe } from "./feedbackSync-92220b42-fd5f5610.js";
7
- import "@nylas/web-elements";
8
- import "react";
9
- import "@nylas/connect";
10
- import "react/jsx-runtime";
11
- import "react-dom";
12
- const it = ".sc-google-logo-icon-h{display:flex}", rt = it, lt = class {
13
- constructor(e) {
14
- te(this, e), this.width = "24", this.height = "24";
15
- }
16
- render() {
17
- return n("svg", { key: "eb0615e5875a4d560edb09dd85fcf0b8bbeb5458", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("g", { key: "7d040d5b5bc8cf89eabff2ed2695f99bea692b4e", "clip-path": "url(#clip0_959_12452)" }, n("path", { key: "4ddc28c0799291a0c23538444f1c7f5a35959cac", 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: "d5b051bacfa0110b66c99273ba6fd591a68237d1", 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: "6fc0685305b1c96ce35fbf87ccab73f161d648c0", 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: "5946c791195dd03d48b4938d8698ba8e01a7a0b3", 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: "9d33e98420dbd0f952496686fd02f41894ab49f4" }, n("clipPath", { key: "dd192b07d7651bbd74375c1a31e0f3027d9b9a10", id: "clip0_959_12452" }, n("rect", { key: "98c2344df7d506d2579cd793d89fb42feeace8fd", width: 24, height: 24, fill: "white" }))));
18
- }
19
- };
20
- lt.style = rt;
21
- const dt = ".sc-microsoft-logo-icon-h{display:flex}", ct = dt, pt = class {
22
- constructor(e) {
23
- te(this, e), this.width = "22", this.height = "22";
24
- }
25
- render() {
26
- return n("svg", { key: "a6a6af29ed81710f3f493d849c90871991e0be0f", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("path", { key: "025c40cab8337a37897481fb47580f219b3ad528", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), n("path", { key: "d7e67a46de5217cfa54f8973616616a9fd4fb474", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), n("path", { key: "2f4162db32fb29afb4f88c3070e59e8dc574a732", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), n("path", { key: "4ec074b89f50e66765e199ae112d063ca21b541a", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
27
- }
28
- };
29
- pt.style = ct;
30
- var u;
31
- (function(e) {
32
- e.EventInfo = "eventInfo", e.Availability = "availability", e.BookingOptions = "bookingOptions", e.Communications = "communications", e.Participants = "participants", e.BookingForm = "bookingForm", e.PageStyles = "pageStyles";
33
- })(u || (u = {}));
34
- function bt({ id: e, formState: t, activeTab: a }, s) {
35
- return n(
36
- le,
37
- null,
38
- n(
39
- "div",
40
- { key: `event-info-${e}`, class: { hide: a !== u.EventInfo } },
41
- n(
42
- "nylas-event-info",
43
- null,
44
- n(
45
- "div",
46
- { slot: "inputs" },
47
- n("nylas-event-title", { name: "title", exportparts: "net, net__title, net__dropdown-content" }),
48
- n("nylas-event-duration", { name: "duration", exportparts: "ned, ned__error, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
49
- n("nylas-event-location", { name: "location", exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
50
- n("nylas-event-description", { name: "description", exportparts: "nedesc, nedesc__textarea" })
51
- )
52
- )
53
- ),
54
- n(
55
- "div",
56
- { key: `availability-${e}`, class: { hide: a !== u.Availability } },
57
- n("nylas-participant-booking-calendars", { participants: t.participants, name: "participant-booking-calendars", exportparts: "npbc, npbc__header, npbc__content, npbc__participant-container, npbc__participant-title" }),
58
- n("nylas-connected-calendars", { participants: t.participants, name: "connected-calendars", exportparts: "nccals, nccals__header, nccals__content, nccals__container, nccals__title, nccals__toggle-container, npbc__participant-toggle-container" }),
59
- n("nylas-availability-picker", { name: "availability", exportparts: "nap, 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" })
60
- ),
61
- n(
62
- "div",
63
- { key: `booking-options-${e}`, class: { hide: a !== u.BookingOptions } },
64
- n("nylas-scheduling-method", { name: "availability-method", readOnly: !0, exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
65
- n(
66
- "nylas-custom-booking-flow",
67
- { exportparts: "ncbflow, ncbflow__header, ncbflow__title, ncbflow__content" },
68
- n(
69
- "div",
70
- { slot: "inputs" },
71
- n("nylas-booking-confirmation-type", { name: "confirmation-type", exportparts: "nbct, nbct__header, nbct__dropdown, nbct__dropdown-button, nbct__dropdown-content" }),
72
- n("nylas-booking-confirmation-redirect", { name: "confirmation-redirect", exportparts: "nbcr, nbcr__header, nbcr__dropdown, nbcr__dropdown-button, nbcr__dropdown-content, nbcr__input-textfield" })
73
- )
74
- ),
75
- n("nylas-buffer-time", { name: "buffer-time", 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" }),
76
- n(
77
- "nylas-event-limits",
78
- null,
79
- n(
80
- "div",
81
- { slot: "inputs" },
82
- n("nylas-min-booking-notice", { name: "min-booking-notice", exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
83
- n("nylas-limit-future-bookings", { name: "limit-future-bookings", exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
84
- n("nylas-min-cancellation-notice", { name: "min-cancellation-notice", exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
85
- n("nylas-cancellation-policy", { name: "cancellation-policy", exportparts: "ncpolicy, ncpolicy__textarea" })
86
- )
87
- ),
88
- n("nylas-timeslot-interval", { name: "timeslot-interval", exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
89
- 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" })
90
- ),
91
- n(
92
- "div",
93
- { key: `communications-${e}`, class: { hide: a !== u.Communications } },
94
- n("nylas-disable-emails", { name: "disable-emails", exportparts: "nde, nde__toggle-label, nde_toggle-input, nde_toggle-slider" }),
95
- !(t != null && t.disableEmails) && n(
96
- le,
97
- null,
98
- n("nylas-confirmation-email", { name: "confirmation-email-template", exportparts: "nce, nce__tab-heading, nce__header, nce__body, nce__confirmation-email-toggle--container, nce__summary, nce__reminder-input_dropdown, nce__reminder-input_dropdown-input, nce__reminder-input_dropdown-content" }),
99
- n("nylas-reminder-emails", { name: "reminder-overrides", exportparts: "nre, nre__tab-heading, nre__header, nre__body, nre__confirmation-email-toggle--container, nre__summary, nrt, nrt__number-dropdown, nrt__number-dropdown-button, nrt__number-dropdown-content, nrt__period-dropdown, nrt__period-dropdown-button, nrt__period-dropdown-content, nrt__time-period-selector" })
100
- )
101
- ),
102
- n(
103
- "div",
104
- { key: `participants-${e}`, class: { hide: a !== u.Participants } },
105
- n("nylas-additional-participants", { name: "participants", exportparts: "nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant" }),
106
- n("nylas-participants-custom-availability", { participants: t.participants, name: "participant-custom-availability", exportparts: "npca, npca__header, npca__content, npca__participant-container, npca__participant-title, npca__participant-toggle--container, npca__toggle-label, npca__toggle-input, npca__toggle-slider" })
107
- ),
108
- n(
109
- "div",
110
- { key: `page-styles-${e}`, class: { hide: a !== u.PageStyles } },
111
- n("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
112
- n("nylas-page-name", { name: "page-name", exportparts: "npn, npn__body, npn__header, npn__drawer-toggle--container, npn__input-textfield" }),
113
- n("nylas-page-styling", { name: "page-styling", exportparts: "nps, nps__header, nps__drawer-toggle--container, nps__body, nps__title-input-textfield, nps__company-logo-input-textfield, nps__color-picker, nps__color-picker-button, nps__color-picker-button-label, nps__color-picker-selected-label, nps__submit-button-label-input-textfield, nps__message-textarea" }, s)
114
- ),
115
- n(
116
- "div",
117
- { key: `booking-form-${e}`, class: { hide: a !== u.BookingForm } },
118
- n("nylas-booking-form-config", { name: "additional-fields", exportparts: "nbfc, nbfc__header, nbfc__add_field, nbfc__add_field-button, nbfc__add_field-content, nbfc__static_fields, nbfc__additional_fields, nbfc__form-field, nbfc__form-field-header, nbfc__form-field-content" })
119
- )
120
- );
121
- }
122
- const ut = '.sc-nylas-editor-tabs-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column;height:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:calc(100% - 80px);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)}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{border-right:none}}.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;text-align:left;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.sc-nylas-editor-tabs:last-of-type{margin-bottom: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 .tabs.sc-nylas-editor-tabs .tab.hide.sc-nylas-editor-tabs{display:none}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto;overflow-x:hidden;transition:opacity 0.05s ease-in;opacity:0}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.fadeIn.sc-nylas-editor-tabs{opacity:1}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .hide.sc-nylas-editor-tabs{display:none}.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}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs{display:flex;flex-direction:column;margin:1rem 1rem 0.5rem;row-gap:4px}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs h3.sc-nylas-editor-tabs{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{margin:0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.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:16px;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}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.save-changes.sc-nylas-editor-tabs{min-width:140px}button-component#report-issue.sc-nylas-editor-tabs{width:auto}nylas-feedback-form.sc-nylas-editor-tabs{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}', ht = ut;
123
- var yt = function(e, t, a, s) {
124
- var l = arguments.length, i = l < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, o;
125
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
126
- i = Reflect.decorate(e, t, a, s);
127
- else
128
- for (var d = e.length - 1; d >= 0; d--)
129
- (o = e[d]) && (i = (l < 3 ? o(i) : l > 3 ? o(t, a, i) : o(t, a)) || i);
130
- return l > 3 && i && Object.defineProperty(t, a, i), i;
131
- }, ye = function(e, t) {
132
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
133
- return Reflect.metadata(e, t);
134
- };
135
- const Ke = class {
136
- constructor(e) {
137
- te(this, e), this.schedulerConfigChanged = m(this, "schedulerConfigChanged", 7), this.schedulerConfigCreated = m(this, "schedulerConfigCreated", 7), this.cancelButtonClick = m(this, "cancelButtonClick", 7), this.formSubmitted = m(this, "formSubmitted", 7), this.previewButtonClicked = m(this, "previewButtonClicked", 7), this.schedulerEditorFormUpdated = m(this, "schedulerEditorFormUpdated", 7), this.nylasSchedulerError = m(this, "nylasSchedulerError", 6), this.dismissNotification = m(this, "dismissNotification", 7), this.formSubmissionHandler = async (t) => {
138
- var ve, Ce, we, ke, xe, Ee, Se, Te, Le, Fe, Oe, Be, Pe, He, Ne, ze, Ie;
139
- t.preventDefault();
140
- const a = await this.formSubmitted.emit();
141
- if (b("[nylas-editor-tabs]", "formSubmissionHandler", a), !this.formRef.checkValidity() || a.defaultPrevented) {
142
- this.setError({
143
- message: this.formRef.validationMessage || r.t("fixFormErrors"),
144
- type: _.Error,
145
- category: v.Component,
146
- title: r.t("nylasEditorTabs.formErrorTitle")
147
- });
148
- return;
149
- }
150
- this.isLoading = !0, this.hasUnsavedChanges = !1;
151
- const l = this.updateFormState();
152
- b("[nylas-editor-tabs]", "formState", l);
153
- const { title: i, description: o, duration: d, availability: c, bookingCalendar: p, location: h, bookingType: f, buffer: w, availableDaysInFuture: T, minCancellationNotice: O, minBookingNotice: U, cancellationPolicy: N, timeslotInterval: L, additionalGuestsHidden: z, hideCancellationOptions: D, hideReschedulingOptions: R, participants: F, participantOpenHours: E, participantSpecificTimeAvailability: B, additionalFields: C, participantCalendars: k, conferencing: A, participantBookingCalendars: S, reminders: $, emailTemplate: j, redirectUrl: G, availabilityMethod: J, slug: Z, appearance: Y, name: q, disableEmails: Q, organizerLocale: X } = l, x = ((Ce = (ve = this.selectedConfiguration) == null ? void 0 : ve.participants) == null ? void 0 : Ce.find((y) => y.is_organizer)) || (F == null ? void 0 : F.find((y) => y.is_organizer)), V = k && (x != null && x.email) ? k[x == null ? void 0 : x.email] : [], P = ((we = x == null ? void 0 : x.booking) == null ? void 0 : we.calendar_id) || p, H = d ? parseInt(d) : 30, M = F && (F == null ? void 0 : F.length) > 0 ? F : [
154
- {
155
- name: (x == null ? void 0 : x.name) ?? ((ke = this.currentUser) == null ? void 0 : ke.name) ?? "",
156
- email: (x == null ? void 0 : x.email) ?? ((xe = this.currentUser) == null ? void 0 : xe.email) ?? "",
157
- is_organizer: !0,
158
- timezone: (c == null ? void 0 : c.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
159
- availability: {
160
- calendar_ids: p && p !== "" ? [p] : ["primary"],
161
- open_hours: []
162
- },
163
- booking: {
164
- calendar_id: p && p !== "" ? p : "primary"
165
- }
166
- }
167
- ];
168
- let K = J || (((Te = (Se = (Ee = this.selectedConfiguration) == null ? void 0 : Ee.availability) == null ? void 0 : Se.availability_rules) == null ? void 0 : Te.availability_method) ?? "collective");
169
- this.selectedEventType && this.selectedEventType !== I.group && (K = this.selectedEventType === I.one_on_one ? I.collective : this.selectedEventType);
170
- const ne = {
171
- ...((Le = this.selectedConfiguration) == null ? void 0 : Le.id) && { id: this.selectedConfiguration.id },
172
- version: ((Fe = this.selectedConfiguration) == null ? void 0 : Fe.version) ?? "1.0.0",
173
- slug: Z,
174
- name: q,
175
- availability: {
176
- duration_minutes: H,
177
- interval_minutes: (L == null ? void 0 : L.interval) ?? H,
178
- round_to: L == null ? void 0 : L.roundTo,
179
- availability_rules: {
180
- availability_method: K,
181
- buffer: w || { before: 0, after: 0 },
182
- default_open_hours: (c == null ? void 0 : c.openHours) ?? ((Pe = (Be = (Oe = this.selectedConfiguration) == null ? void 0 : Oe.availability) == null ? void 0 : Be.availability_rules) == null ? void 0 : Pe.default_open_hours) ?? $e,
183
- round_robin_group_id: ((ze = (Ne = (He = this.selectedConfiguration) == null ? void 0 : He.availability) == null ? void 0 : Ne.availability_rules) == null ? void 0 : ze.round_robin_group_id) ?? ""
184
- }
185
- },
186
- participants: [
187
- ...M ? M.map((y) => {
188
- var Ge, Ue, De, Re, je, Me;
189
- let ee = (c == null ? void 0 : c.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
190
- if ((Ge = E == null ? void 0 : E[y.email]) != null && Ge.length && (ee = (De = (Ue = E == null ? void 0 : E[y.email]) == null ? void 0 : Ue[0]) == null ? void 0 : De.timezone), y.is_organizer) {
191
- const Ae = S != null && S[y.email] ? S == null ? void 0 : S[y.email] : P || "primary", he = k != null && k[y.email] ? k == null ? void 0 : k[y.email] : V != null && V.length ? V : ["primary"], nt = he.length === 1 && he[0] === "primary";
192
- return {
193
- name: y.name ?? "",
194
- email: y.email,
195
- is_organizer: !0,
196
- timezone: ee,
197
- availability: {
198
- calendar_ids: nt ? [Ae] : he,
199
- open_hours: (E == null ? void 0 : E[y.email]) ?? ((Re = y.availability) == null ? void 0 : Re.open_hours) ?? []
200
- },
201
- specific_time_availability: (B == null ? void 0 : B[y.email]) ?? y.specific_time_availability ?? [],
202
- booking: {
203
- calendar_id: Ae
204
- }
205
- };
206
- }
207
- const ae = S != null && S[y.email] ? { calendar_id: S == null ? void 0 : S[y.email] } : (y == null ? void 0 : y.booking) ?? void 0, ue = (k == null ? void 0 : k[y.email]) ?? ((je = y.availability) == null ? void 0 : je.calendar_ids) ?? ["primary"], tt = ue.length === 1 && ue[0] === "primary";
208
- return {
209
- ...y,
210
- timezone: ee,
211
- availability: y.availability ? {
212
- calendar_ids: tt && typeof ae < "u" ? [ae == null ? void 0 : ae.calendar_id] : ue,
213
- open_hours: (E == null ? void 0 : E[y.email]) ?? ((Me = y.availability) == null ? void 0 : Me.open_hours) ?? []
214
- } : void 0,
215
- booking: ae,
216
- specific_time_availability: (B == null ? void 0 : B[y.email]) ?? y.specific_time_availability ?? []
217
- };
218
- }) : []
219
- ],
220
- event_booking: {
221
- title: (i == null ? void 0 : i.toString()) ?? "",
222
- description: (o == null ? void 0 : o.toString()) ?? "",
223
- location: (h == null ? void 0 : h.toString()) ?? "",
224
- booking_type: (f == null ? void 0 : f.toString()) ?? "booking",
225
- timezone: (c == null ? void 0 : c.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
226
- conferencing: A,
227
- reminders: $,
228
- disable_emails: typeof Q == "boolean" ? Q : !1
229
- },
230
- scheduler: {
231
- cancellation_policy: N ?? "",
232
- available_days_in_future: T ?? 30,
233
- min_cancellation_notice: O ?? 0,
234
- min_booking_notice: U ?? 60,
235
- hide_additional_guests: z ?? !1,
236
- hide_cancellation_options: D ?? !1,
237
- hide_rescheduling_options: R ?? !1,
238
- additional_fields: C,
239
- email_template: j ? {
240
- ...j,
241
- organizer_locale: X || "en",
242
- logo: j.logo || ""
243
- } : void 0,
244
- confirmation_redirect_url: G
245
- },
246
- appearance: Y
247
- }, oe = _e(this.selectedConfiguration, ne || {}), W = this.action === "create" ? oe : ne;
248
- this.isConfigRoundRobin(W) && (W.participants = W.participants.map((y) => ({ ...y, is_organizer: void 0 })));
249
- const se = (y) => {
250
- this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
251
- this.changesSaved = !1;
252
- }, 5e3);
253
- }, ie = this.checkForBookingFormErrors(W), re = ((Ie = this.configurations) == null ? void 0 : Ie.find((y) => {
254
- var ee;
255
- return y.id === ((ee = this.selectedConfiguration) == null ? void 0 : ee.id);
256
- })) || {}, et = this.checkForOrganizerConfirmationError(_e(W, re));
257
- ie || et || this.schedulerConfigChanged.emit({ config: W, resetLoadingState: se, action: this.action, host: this.host });
258
- }, this.isConfigRoundRobin = (t) => {
259
- var a, s, l, i;
260
- return ((s = (a = t == null ? void 0 : t.availability) == null ? void 0 : a.availability_rules) == null ? void 0 : s.availability_method) === "max-availability" || ((i = (l = t.availability) == null ? void 0 : l.availability_rules) == null ? void 0 : i.availability_method) === "max-fairness";
261
- }, this.checkForOrganizerConfirmationError = (t) => {
262
- var o, d;
263
- let a = !1, s = "";
264
- const l = ((o = t.event_booking) == null ? void 0 : o.booking_type) === "organizer-confirmation", i = (d = t.scheduler) == null ? void 0 : d.organizer_confirmation_url;
265
- return l && !i && (s += "Organizer confirmation URL is required when using organizer confirmation booking type.", a = !0), a && (this.isLoading = !1, this.host.setError({
266
- message: s,
267
- type: _.Error,
268
- category: v.Component,
269
- title: "Error:"
270
- })), a;
271
- }, this.checkForBookingFormErrors = (t) => {
272
- var i;
273
- let a = !1, s = "";
274
- const l = (i = t.scheduler) == null ? void 0 : i.additional_fields;
275
- return l && (s = "", Object.entries(l).forEach((o) => {
276
- const d = o[1];
277
- if (d.label === "") {
278
- s += r.t("nylasEditorTabs.bookingFormError_label", { type: d.type }), a = !0;
279
- return;
280
- }
281
- if (d.options) {
282
- for (const c of d.options)
283
- if (c.trim() === "") {
284
- s += r.t("nylasEditorTabs.bookingFormError_option", { label: d.label, type: d.type }), a = !0;
285
- break;
286
- }
287
- }
288
- })), a && (this.isLoading = !1, this.host.setError({
289
- message: s,
290
- type: _.Error,
291
- category: v.Component,
292
- title: r.t("nylasEditorTabs.bookingFormError")
293
- })), a;
294
- }, this.calendars = void 0, this.selectedConfiguration = void 0, this.configurations = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.hideEditorTabs = [], this.enableUserFeedback = !0, this.selectedLanguage = void 0, this.selectedEventType = void 0, this.themeConfig = void 0, this.action = "create", this.showFeedbackModal = !1, this.activeTab = u.EventInfo, this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.loaded = !1, this.formState = {}, this.error = {
295
- message: "",
296
- type: _.Error,
297
- category: v.Component,
298
- title: ""
299
- };
300
- }
301
- configChangedHandler(e) {
302
- b("[nylas-editor-tabs]", "configChangedHandler", e, this.selectedConfiguration), this.formState = {
303
- ...this.getFormStateFromConfig(e)
304
- }, e != null && e.id ? this.action = "edit" : this.action = "create";
305
- }
306
- userChangedHandler(e) {
307
- b("[nylas-editor-tabs]", "userChangedHandler", e), e && (this.formState = {
308
- ...this.getFormStateFromConfig(this.selectedConfiguration)
309
- });
310
- }
311
- selectedLanguageChangedHandler(e, t) {
312
- e !== t && (r.changeLanguage(e), this.error && this.error.message && (this.error = {
313
- ...this.error,
314
- message: r.t("fixFormErrors")
315
- }, this.showErrorNotification(this.error)));
316
- }
317
- themeConfigChangedHandler(e, t) {
318
- e !== t && this.applyThemeConfig(e);
319
- }
320
- applyThemeConfig(e) {
321
- if (e)
322
- for (const [t, a] of Object.entries(e))
323
- this.host.style.setProperty(`${t}`, a);
324
- }
325
- async schedulerConfigCreatedEventHandler(e) {
326
- return this.schedulerConfigCreated.emit(e);
327
- }
328
- async setError(e) {
329
- var t;
330
- this.error = {
331
- message: e.message,
332
- type: e.type,
333
- category: e.category,
334
- title: e.title || r.t("genericErrorTitle")
335
- }, (t = this.error) != null && t.message && this.showErrorNotification(this.error);
336
- }
337
- async resetError() {
338
- var e, t;
339
- (e = this.error) != null && e.message && this.dismissNotification.emit({ id: (t = this.error) == null ? void 0 : t.message.split(" ").join("-"), host: this.host }), this.error = {
340
- message: "",
341
- type: _.Error,
342
- category: v.Component,
343
- title: ""
344
- };
345
- }
346
- connectedCallback() {
347
- b("[nylas-editor-tabs]", "connectedCallback");
348
- }
349
- componentWillLoad() {
350
- b("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
351
- }
352
- componentDidLoad() {
353
- var t, a;
354
- b("[nylas-editor-tabs]", "componentDidLoad"), this.enableUserFeedback && !Je() && Ve({
355
- dsn: "https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",
356
- release: "2.1.0",
357
- integrations: (s) => [
358
- ...s.filter((l) => !1),
359
- qe({
360
- colorScheme: "system",
361
- autoInject: !1
362
- })
363
- ],
364
- autoSessionTracking: !1,
365
- beforeSend: () => null
366
- }), (t = this.selectedConfiguration) != null && t.id && this.configChangedHandler(this.selectedConfiguration);
367
- const e = (a = this.host.querySelector("button.tab:not(.hide)")) == null ? void 0 : a.name;
368
- e && (this.activeTab = e), this.loaded = !0;
369
- }
370
- disconnectedCallback() {
371
- b("[nylas-editor-tabs]", "disconnectedCallback");
372
- }
373
- handleValueChanged(e) {
374
- b("[nylas-editor-tabs]", "handleValueChanged", e);
375
- const { name: t, value: a } = e.detail;
376
- console.debug("name", t, "value", a), this.setFormState(a, t), this.formState = { ...this.formState }, this.resetError(), ot.includes(t) && (this.hasUnsavedChanges = !0), this.schedulerEditorFormUpdated.emit({
377
- value: e.detail.value,
378
- name: e.detail.name
379
- });
380
- }
381
- feedbackModalClosedHandler() {
382
- this.showFeedbackModal = !1;
383
- }
384
- feedbackSubmittedHandler(e) {
385
- var s, l, i, o, d, c;
386
- const a = {
387
- eventId: Ze("Scheduler Editor User Feedback", {
388
- extra: {
389
- configId: (s = this.selectedConfiguration) == null ? void 0 : s.id,
390
- slug: (l = this.selectedConfiguration) == null ? void 0 : l.slug
391
- }
392
- }),
393
- message: e.detail.feedback
394
- };
395
- We(a, {
396
- includeReplay: !0,
397
- captureContext: {
398
- tags: {
399
- "nylas-web-element": "nylas-scheduler-editor",
400
- "nylas-web-element-version": "2.1.0",
401
- "nylas-config-id": (i = this.selectedConfiguration) == null ? void 0 : i.id,
402
- "nylas-slug": (o = this.selectedConfiguration) == null ? void 0 : o.slug,
403
- "host-url": window.location.href
404
- },
405
- extra: {
406
- configId: (d = this.selectedConfiguration) == null ? void 0 : d.id,
407
- slug: (c = this.selectedConfiguration) == null ? void 0 : c.slug
408
- }
409
- }
410
- }), this.showFeedbackModal = !1;
411
- }
412
- showErrorNotification(e) {
413
- e.message && this.nylasSchedulerError.emit({
414
- notification: {
415
- title: e.title,
416
- category: e.category || v.Component,
417
- type: e.type || _.Error,
418
- description: e.message,
419
- id: e.message.split(" ").join("-"),
420
- ttl: "none"
421
- },
422
- host: this.host
423
- });
424
- }
425
- getFormStateFromConfig(e) {
426
- var a, s, l, i, o, d, c, p, h, f, w, T, O, U, N, L, z, D, R, F, E, B, C, k, A, S, $, j, G, J, Z, Y, q, Q, X, x, V;
427
- let t = (a = e == null ? void 0 : e.participants) == null ? void 0 : a.find((P) => P.is_organizer);
428
- return !t && ((l = (s = e == null ? void 0 : e.availability) == null ? void 0 : s.availability_rules) == null ? void 0 : l.availability_method) !== "collective" && (t = (i = e == null ? void 0 : e.participants) == null ? void 0 : i.find((P) => {
429
- var H;
430
- return P.email === ((H = this.currentUser) == null ? void 0 : H.email);
431
- }), t && (t.is_organizer = !0)), e != null && e.appearance && console.info("Appearance settings have been returned from the given configuration; please remember to grab them from the configSettingsLoaded event and apply them as desired."), {
432
- title: ((o = e == null ? void 0 : e.event_booking) == null ? void 0 : o.title) ?? "",
433
- description: ((d = e == null ? void 0 : e.event_booking) == null ? void 0 : d.description) ?? "",
434
- duration: ((p = (c = e == null ? void 0 : e.availability) == null ? void 0 : c.duration_minutes) == null ? void 0 : p.toString()) ?? "30",
435
- availability: {
436
- timezone: ((h = e == null ? void 0 : e.event_booking) == null ? void 0 : h.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
437
- openHours: ((w = (f = e == null ? void 0 : e.availability) == null ? void 0 : f.availability_rules) == null ? void 0 : w.default_open_hours) ?? $e
438
- },
439
- additionalFields: ((T = e == null ? void 0 : e.scheduler) == null ? void 0 : T.additional_fields) ?? {},
440
- conferencing: ((O = e == null ? void 0 : e.event_booking) == null ? void 0 : O.conferencing) ?? {},
441
- calendarIds: ((U = t == null ? void 0 : t.availability) == null ? void 0 : U.calendar_ids) ?? [],
442
- participants: (e == null ? void 0 : e.participants) ?? [],
443
- bookingCalendar: ((N = t == null ? void 0 : t.booking) == null ? void 0 : N.calendar_id) ?? (t == null ? void 0 : t.email) ?? "",
444
- location: ((L = e == null ? void 0 : e.event_booking) == null ? void 0 : L.location) ?? "",
445
- bookingType: ((z = e == null ? void 0 : e.event_booking) == null ? void 0 : z.booking_type) ?? "booking",
446
- buffer: ((R = (D = e == null ? void 0 : e.availability) == null ? void 0 : D.availability_rules) == null ? void 0 : R.buffer) ?? { before: 0, after: 0 },
447
- cancellationPolicy: ((F = e == null ? void 0 : e.scheduler) == null ? void 0 : F.cancellation_policy) ?? "",
448
- availableDaysInFuture: ((E = e == null ? void 0 : e.scheduler) == null ? void 0 : E.available_days_in_future) ?? 30,
449
- minCancellationNotice: ((B = e == null ? void 0 : e.scheduler) == null ? void 0 : B.min_cancellation_notice) ?? 0,
450
- minBookingNotice: ((C = e == null ? void 0 : e.scheduler) == null ? void 0 : C.min_booking_notice) ?? 60,
451
- timeslotInterval: {
452
- interval: ((k = e == null ? void 0 : e.availability) == null ? void 0 : k.interval_minutes) ?? ((A = e == null ? void 0 : e.availability) == null ? void 0 : A.duration_minutes),
453
- roundTo: (S = e == null ? void 0 : e.availability) == null ? void 0 : S.round_to
454
- },
455
- additionalGuestsHidden: (($ = e == null ? void 0 : e.scheduler) == null ? void 0 : $.hide_additional_guests) ?? !1,
456
- hideCancellationOptions: ((j = e == null ? void 0 : e.scheduler) == null ? void 0 : j.hide_cancellation_options) ?? !1,
457
- hideReschedulingOptions: ((G = e == null ? void 0 : e.scheduler) == null ? void 0 : G.hide_rescheduling_options) ?? !1,
458
- participantBookingCalendars: ((J = e == null ? void 0 : e.participants) == null ? void 0 : J.reduce((P, H) => {
459
- var M, K;
460
- return (M = H.booking) != null && M.calendar_id && (P[H.email] = (K = H.booking) == null ? void 0 : K.calendar_id), P;
461
- })) ?? {},
462
- participantCalendars: ((Z = e == null ? void 0 : e.participants) == null ? void 0 : Z.reduce((P, H) => {
463
- var M;
464
- return P[H.email] = (M = H.availability) == null ? void 0 : M.calendar_ids, P;
465
- }, {})) ?? {},
466
- reminders: (Y = e == null ? void 0 : e.event_booking) == null ? void 0 : Y.reminders,
467
- emailTemplate: (q = e == null ? void 0 : e.scheduler) == null ? void 0 : q.email_template,
468
- redirectUrl: (Q = e == null ? void 0 : e.scheduler) == null ? void 0 : Q.confirmation_redirect_url,
469
- slug: e == null ? void 0 : e.slug,
470
- appearance: e == null ? void 0 : e.appearance,
471
- name: e == null ? void 0 : e.name,
472
- disableEmails: (X = e == null ? void 0 : e.event_booking) == null ? void 0 : X.disable_emails,
473
- organizerLocale: (V = (x = e == null ? void 0 : e.scheduler) == null ? void 0 : x.email_template) == null ? void 0 : V.organizer_locale
474
- };
475
- }
476
- setFormState(e, t) {
477
- switch (t) {
478
- case "title":
479
- this.formState.title = e.toString();
480
- break;
481
- case "description":
482
- this.formState.description = e.toString();
483
- break;
484
- case "duration":
485
- this.formState.duration = e.toString();
486
- break;
487
- case "availability":
488
- this.formState.availability = JSON.parse(e.toString());
489
- break;
490
- case "participants":
491
- this.formState.participants = JSON.parse(e.toString());
492
- break;
493
- case "booking-calendar":
494
- this.formState.bookingCalendar = e.toString();
495
- break;
496
- case "participant-booking-calendars":
497
- this.formState.participantBookingCalendars = JSON.parse(e.toString());
498
- break;
499
- case "location":
500
- this.formState.location = e.toString();
501
- break;
502
- case "conference":
503
- this.formState.conferencing = JSON.parse(e.toString());
504
- break;
505
- case "confirmation-type":
506
- this.formState.bookingType = e.toString();
507
- break;
508
- case "buffer-time":
509
- this.formState.buffer = JSON.parse(e.toString());
510
- break;
511
- case "limit-future-bookings":
512
- this.formState.availableDaysInFuture = parseInt(e.toString());
513
- break;
514
- case "min-cancellation-notice":
515
- this.formState.minCancellationNotice = parseInt(e.toString());
516
- break;
517
- case "min-booking-notice":
518
- this.formState.minBookingNotice = parseInt(e.toString());
519
- break;
520
- case "cancellation-policy":
521
- this.formState.cancellationPolicy = e.toString();
522
- break;
523
- case "timeslot-interval":
524
- this.formState.timeslotInterval = JSON.parse(e.toString());
525
- break;
526
- case "customize-booking-settings": {
527
- const a = JSON.parse(e.toString());
528
- this.formState.additionalGuestsHidden = a.additionalGuestsHidden, this.formState.hideCancellationOptions = a.hideCancellationOptions, this.formState.hideReschedulingOptions = a.hideReschedulingOptions;
529
- break;
530
- }
531
- case "participant-custom-availability": {
532
- const a = JSON.parse(e.toString());
533
- this.formState.participantOpenHours = a;
534
- break;
535
- }
536
- case "participant-custom-availability-specific-time": {
537
- const a = JSON.parse(e.toString());
538
- this.formState.participantSpecificTimeAvailability = a;
539
- break;
540
- }
541
- case "additional-fields":
542
- this.formState.additionalFields = JSON.parse(e.toString());
543
- break;
544
- case "connected-calendars":
545
- this.formState.participantCalendars = JSON.parse(e.toString());
546
- break;
547
- case "confirmation-email-template":
548
- this.formState.emailTemplate = JSON.parse(e.toString());
549
- break;
550
- case "disable-emails": {
551
- const { disableEmails: a, organizerLocale: s } = JSON.parse(e.toString());
552
- this.formState.disableEmails = a, this.formState.organizerLocale = s;
553
- break;
554
- }
555
- case "reminder-overrides":
556
- this.formState.reminders = JSON.parse(e.toString());
557
- break;
558
- case "confirmation-redirect":
559
- this.formState.redirectUrl = e.toString();
560
- break;
561
- case "availability-method":
562
- this.formState.availabilityMethod = e.toString();
563
- break;
564
- case "custom-event-slug":
565
- this.formState.slug = JSON.parse(e.toString());
566
- break;
567
- case "page-styling":
568
- this.formState.appearance = JSON.parse(e.toString());
569
- break;
570
- case "page-name":
571
- this.formState.name = JSON.parse(e.toString());
572
- break;
573
- }
574
- this.schedulerEditorFormUpdated.emit({
575
- value: e,
576
- name: t
577
- });
578
- }
579
- updateFormState() {
580
- return new FormData(this.formRef).forEach((t, a) => {
581
- this.setFormState(t, a);
582
- }), this.formState = { ...this.formState }, this.formState;
583
- }
584
- setActiveTab(e, t) {
585
- e.preventDefault(), this.updateFormState(), this.activeTab = t;
586
- }
587
- hideTab(e) {
588
- var t;
589
- return ((t = this.hideEditorTabs) == null ? void 0 : t.includes(e)) || !1;
590
- }
591
- onFeedbackClick(e) {
592
- e.preventDefault(), this.showFeedbackModal = !0;
593
- }
594
- render() {
595
- var e, t, a, s, l, i;
596
- return b("[nylas-editor-tabs]", "render", this.formState), n(ce, { key: "d6de6e647a438f943144dcf2a18b8ea02346e0bc" }, n("nylas-notification", { key: "795d417d7862ff3158056ac723f391aa0df9ba58" }), n("form", { key: "b3885ab861807c55e0afe513bbab779c3d1852fb", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (o) => this.formRef = o, noValidate: !0 }, this.mode === "app" ? n("div", { class: "form-contents", part: "editor__form-contents net__form-contents" }, n("div", { class: "tabs", part: "editor__tabs net__tabs" }, n("button", { name: u.EventInfo, class: { tab: !0, active: this.activeTab == u.EventInfo, hide: this.hideTab(u.EventInfo) }, part: "editortab__event-info net__tab-event-info", onClick: (o) => this.setActiveTab(o, u.EventInfo) }, n("calendar-info-icon", { width: "16", height: "16" }), r.t("eventInfoTab")), n("button", { name: u.Availability, class: { tab: !0, active: this.activeTab == u.Availability, hide: this.hideTab(u.Availability) }, part: "editortab__availability net__tab-availability", onClick: (o) => this.setActiveTab(o, u.Availability) }, n("calendar-patterns-icon", { width: "16", height: "16" }), r.t("availabilityTab")), n("button", { name: u.Participants, class: { tab: !0, active: this.activeTab == u.Participants, hide: this.hideTab(u.Participants) }, part: "editortab__participants net__tab-participants", onClick: (o) => this.setActiveTab(o, u.Participants) }, n("people-icon", { width: "16", height: "16" }), r.t("participantsTab")), n("button", { name: u.BookingOptions, class: { tab: !0, active: this.activeTab == u.BookingOptions, hide: this.hideTab(u.BookingOptions) }, part: "editortab__booking-options net__tab-booking-options", onClick: (o) => this.setActiveTab(o, u.BookingOptions) }, n("flow-icon", { width: "16", height: "16" }), r.t("bookingOptionsTab")), n("button", { name: u.BookingForm, class: { tab: !0, active: this.activeTab == "bookingForm", hide: this.hideTab(u.BookingForm) }, part: "editortab__booking-form net__tab-booking-form", onClick: (o) => this.setActiveTab(o, u.BookingForm) }, this.activeTab == u.BookingForm ? n("calendar-agenda-fill-icon", { width: "16", height: "16" }) : n("calendar-agenda-icon", { width: "16", height: "16" }), r.t("bookingFormTab")), n("button", { name: u.Communications, class: { tab: !0, active: this.activeTab == "communications", hide: this.hideTab(u.Communications) }, onClick: (o) => this.setActiveTab(o, u.Communications), part: "editortab__communications net__tab-communications" }, this.activeTab == u.Communications ? n("envelope-fill-icon", { width: "16", height: "16" }) : n("envelope-icon", { width: "16", height: "16" }), r.t("communicationsTab")), n("button", { name: u.PageStyles, class: { tab: !0, active: this.activeTab == "pageStyles", hide: this.hideTab(u.PageStyles) }, onClick: (o) => this.setActiveTab(o, u.PageStyles), part: "editortab__page-styles net__tab-page-styles" }, this.activeTab == u.PageStyles ? n("paintbrush-fill-icon", { width: "16", height: "16" }) : n("paintbrush-icon", { width: "16", height: "16" }), r.t("pageStylesTab"))), n("div", { class: {
597
- "tab-content": !0,
598
- fadeIn: this.loaded
599
- }, part: "editor__tab-content net__tab-content" }, n(bt, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((e = this.selectedConfiguration) == null ? void 0 : e.id) ?? "new", i18next: r }))) : n("div", { class: "composable", key: (t = this.selectedConfiguration) == null ? void 0 : t.id }, n("slot", null)), n("div", { key: "a7611ff8dc0c82d3c6d9f3d3d3c9f8b34f0d30c3", class: "footer", part: "editor__footer net__footer" }, n("div", { key: "2e448c950a6278a1c9864c8ceb61adf42a0eff81", class: "preview", part: "editor__footer-preview net__footer-preview" }, this.enableUserFeedback && n("button-component", { title: "Share your feedback", id: "report-issue", variant: "basic", onClick: (o) => this.onFeedbackClick(o) }, n("feedback-icon", null))), n("div", { key: "7580eeb4b356093c1bdc69fbc108db7f05abeed9", class: "buttons", part: "editor__footer-buttons net__footer-buttons" }, n("p", { key: "14f425d8a5b78602c03459959cb138f3ca0d8acd", class: {
600
- "unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
601
- "saved-changes": this.changesSaved,
602
- error: ((a = this.error) == null ? void 0 : a.message) !== "",
603
- "error-full-width": ((s = this.error) == null ? void 0 : s.message) !== "" && this.action === "create"
604
- } }, ((l = this.error) == null ? void 0 : l.message) == "" && this.hasUnsavedChanges && !this.changesSaved ? r.t("unsavedChangesLabel") : ((i = this.error) == null ? void 0 : i.message) == "" && this.changesSaved ? `${r.t("changesSavedLabel")}!` : ""), this.schedulerPreviewLink !== "" && this.action === "edit" && n("button-component", { title: "Preview", type: "button", disabled: this.isLoading, clickHandler: (o) => {
605
- o.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(de(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
606
- }, variant: "basic" }, n("eye-icon", null)), n("button-component", { key: "eee37b3b9ff4fcff14891a681f544e7b617cb22d", type: "button", disabled: this.isLoading, clickHandler: (o) => {
607
- o.preventDefault(), this.cancelButtonClick.emit(), this.host.resetError();
608
- }, variant: "basic", part: "editor__footer-cancel net__footer-cancel" }, r.t("cancelButton")), n("button-component", { key: "e4a8bc0a8d3af872005595f2581a388ce3eac659", class: { "save-changes": this.action === "edit" }, type: "submit", disabled: this.isLoading, part: "editor__footer-cta, net__footer-cta" }, this.isLoading ? n("span", null, r.t("savingButtonText"), n("loading-icon", null), " ") : this.action === "create" ? `${r.t("createButtonText")}` : `${r.t("saveChangesButtonText")}`)))), this.showFeedbackModal && n("nylas-feedback-form", null));
609
- }
610
- get host() {
611
- return pe(this);
612
- }
613
- static get watchers() {
614
- return {
615
- selectedConfiguration: ["configChangedHandler"],
616
- currentUser: ["userChangedHandler"],
617
- selectedLanguage: ["selectedLanguageChangedHandler"],
618
- themeConfig: ["themeConfigChangedHandler"]
619
- };
620
- }
621
- };
622
- yt([
623
- be({
624
- name: "nylas-editor-tabs",
625
- stateToProps: /* @__PURE__ */ new Map([
626
- ["schedulerConfig.calendars", "calendars"],
627
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
628
- ["schedulerConfig.currentUser", "currentUser"],
629
- ["schedulerConfig.configurations", "configurations"],
630
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
631
- ["schedulerConfig.selectedEventType", "selectedEventType"],
632
- ["schedulerConfig.themeConfig", "themeConfig"]
633
- ]),
634
- eventToProps: {
635
- schedulerConfigChanged: async (e, t) => {
636
- const { resetLoadingState: a, host: s, action: l, config: i } = e.detail, o = (d, c) => {
637
- const [p, h] = d;
638
- !p && h ? s.setError({
639
- message: h.message || r.t("genericErrorTitle"),
640
- type: _.Error,
641
- category: v.Component,
642
- title: c
643
- }) : p && !h && l === "create" && (s.schedulerConfigCreatedEventHandler({ config: p, action: l, host: s }), t.schedulerConfigStore.set("selectedEventType", void 0)), a && a(e);
644
- };
645
- if (l === "edit") {
646
- const d = await t.schedulerConfig.updateConfiguration(i);
647
- o(d, r.t("nylasEditorTabs.updateConfigError"));
648
- } else {
649
- const d = await t.schedulerConfig.createConfiguration(i);
650
- o(d, r.t("nylasEditorTabs.createConfigError"));
651
- }
652
- },
653
- cancelButtonClick: async (e, t) => {
654
- t.schedulerConfigStore.state.action = null, t.schedulerConfigStore.set("selectedEventType", void 0);
655
- },
656
- previewButtonClicked: async (e, t) => {
657
- b("[nylas-editor-tabs]", "previewButtonClicked", t);
658
- },
659
- formSubmitted: async (e, t) => {
660
- b("[nylas-editor-tabs]", "formSubmitted", t);
661
- },
662
- schedulerEditorFormUpdated: async (e, t) => {
663
- b("[nylas-editor-tabs]", "schedulerEditorFormUpdated", e);
664
- },
665
- schedulerConfigCreated: async (e, t) => {
666
- b("[nylas-editor-tabs]", "schedulerConfigCreated", e);
667
- }
668
- },
669
- localPropsToProp: /* @__PURE__ */ new Map([
670
- ["schedulerPreviewLink", "schedulerPreviewLink"],
671
- ["enableUserFeedback", "enableUserFeedback"],
672
- ["hideEditorTabs", "hideEditorTabs"]
673
- ]),
674
- fireRegisterEvent: !0
675
- }),
676
- ye("design:type", Function),
677
- ye("design:paramtypes", []),
678
- ye("design:returntype", void 0)
679
- ], Ke.prototype, "render", null);
680
- Ke.style = ht;
681
- var g;
682
- (function(e) {
683
- e.BookingOptions = "bookingOptions", e.Communications = "communications", e.BookingForm = "bookingForm", e.PageStyles = "pageStyles", e.CalendarView = "calendarView";
684
- })(g || (g = {}));
685
- function gt({ id: e, formState: t, activeTab: a }, s) {
686
- return n(
687
- le,
688
- null,
689
- a === g.CalendarView && n(
690
- "div",
691
- { key: `calendar-view-${e}`, class: { hide: a !== g.CalendarView, "calendar-view": !0 } },
692
- n("nylas-event-calendar", null)
693
- ),
694
- n(
695
- "div",
696
- { key: `booking-options-${e}`, class: { hide: a !== g.BookingOptions } },
697
- n("nylas-scheduling-method", { name: "availability-method", readOnly: !0, exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
698
- n(
699
- "nylas-custom-booking-flow",
700
- { exportparts: "ncbflow, ncbflow__header, ncbflow__title, ncbflow__content" },
701
- n(
702
- "div",
703
- { slot: "inputs" },
704
- n("nylas-booking-confirmation-type", { name: "confirmation-type", showComponent: !1, exportparts: "nbct, nbct__header, nbct__dropdown, nbct__dropdown-button, nbct__dropdown-content" }),
705
- n("nylas-booking-confirmation-redirect", { name: "confirmation-redirect", exportparts: "nbcr, nbcr__header, nbcr__dropdown, nbcr__dropdown-button, nbcr__dropdown-content, nbcr__input-textfield" })
706
- )
707
- ),
708
- n(
709
- "nylas-event-limits",
710
- null,
711
- n(
712
- "div",
713
- { slot: "inputs" },
714
- n("nylas-min-booking-notice", { name: "min-booking-notice", exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
715
- n("nylas-min-cancellation-notice", { name: "min-cancellation-notice", exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
716
- n("nylas-cancellation-policy", { name: "cancellation-policy", exportparts: "ncpolicy, ncpolicy__textarea" })
717
- )
718
- ),
719
- n("nylas-customize-booking-settings", { showSettings: ["hideCancellationOptions", "hideReschedulingOptions"], name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
720
- ),
721
- n(
722
- "div",
723
- { key: `communications-${e}`, class: { hide: a !== g.Communications } },
724
- n("nylas-disable-emails", { name: "disable-emails", exportparts: "nde, nde__toggle-label, nde_toggle-input, nde_toggle-slider" }),
725
- !(t != null && t.disableEmails) && n(
726
- le,
727
- null,
728
- n("nylas-confirmation-email", { name: "confirmation-email-template", exportparts: "nce, nce__tab-heading, nce__header, nce__body, nce__confirmation-email-toggle--container, nce__summary, nce__reminder-input_dropdown, nce__reminder-input_dropdown-input, nce__reminder-input_dropdown-content" }),
729
- n("nylas-reminder-emails", { name: "reminder-overrides", exportparts: "nre, nre__tab-heading, nre__header, nre__body, nre__confirmation-email-toggle--container, nre__summary, nrt, nrt__number-dropdown, nrt__number-dropdown-button, nrt__number-dropdown-content, nrt__period-dropdown, nrt__period-dropdown-button, nrt__period-dropdown-content, nrt__time-period-selector" })
730
- )
731
- ),
732
- n(
733
- "div",
734
- { key: `page-styles-${e}`, class: { hide: a !== g.PageStyles } },
735
- n("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
736
- n("nylas-page-name", { name: "page-name", requirePageName: !0, exportparts: "npn, npn__body, npn__header, npn__drawer-toggle--container, npn__input-textfield" }),
737
- n("nylas-page-styling", { name: "page-styling", exportparts: "nps, nps__header, nps__drawer-toggle--container, nps__body, nps__title-input-textfield, nps__company-logo-input-textfield, nps__color-picker, nps__color-picker-button, nps__color-picker-button-label, nps__color-picker-selected-label, nps__submit-button-label-input-textfield, nps__message-textarea" }, s)
738
- ),
739
- n(
740
- "div",
741
- { key: `booking-form-${e}`, class: { hide: a !== g.BookingForm } },
742
- n("nylas-booking-form-config", { name: "additional-fields", exportparts: "nbfc, nbfc__header, nbfc__add_field, nbfc__add_field-button, nbfc__add_field-content, nbfc__static_fields, nbfc__additional_fields, nbfc__form-field, nbfc__form-field-header, nbfc__form-field-content" })
743
- )
744
- );
745
- }
746
- const ft = '.sc-nylas-editor-tabs-group-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.scheduler-editor.sc-nylas-editor-tabs-group{display:flex;flex-direction:column;height:inherit;position:relative}.scheduler-editor.sc-nylas-editor-tabs-group div.return-to-calendar-view.sc-nylas-editor-tabs-group{display:flex;border-bottom:1px solid var(--nylas-base-200)}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group{display:grid;grid-template-columns:minmax(224px, 25%) 1fr;height:auto;overflow-y:auto;min-height:calc(100% - 80px - 48px)}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group{display:table-column-group;height:auto;min-height:calc(100% - 80px - 196px - 48px)}}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group{border-right:none}}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.sc-nylas-editor-tabs-group{display:flex;align-items:center;text-align:left;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-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.sc-nylas-editor-tabs-group:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.sc-nylas-editor-tabs-group:last-of-type{margin-bottom:0.25rem}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.active.sc-nylas-editor-tabs-group{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-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.hide.sc-nylas-editor-tabs-group{display:none}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group{max-width:692px;overflow-y:auto;overflow-x:hidden}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .hide.sc-nylas-editor-tabs-group{display:none}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .calendar-view.sc-nylas-editor-tabs-group{position:absolute;top:0;left:0;height:calc(100% - 80px);width:-webkit-fill-available;background:var(--nylas-base-0)}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-info.sc-nylas-editor-tabs-group,.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-limits.sc-nylas-editor-tabs-group{width:inherit}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-info.sc-nylas-editor-tabs-group div[slot=inputs].sc-nylas-editor-tabs-group,.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-limits.sc-nylas-editor-tabs-group div[slot=inputs].sc-nylas-editor-tabs-group{display:flex;flex-direction:column;gap:1rem}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .tab-header.sc-nylas-editor-tabs-group{display:flex;flex-direction:column;margin:1rem 1rem 0.5rem;row-gap:4px}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .tab-header.sc-nylas-editor-tabs-group h3.sc-nylas-editor-tabs-group{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .tab-header.sc-nylas-editor-tabs-group p.sc-nylas-editor-tabs-group{margin:0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.footer.sc-nylas-editor-tabs-group{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-group{flex-direction:column;height:auto;z-index:2}}.footer.sc-nylas-editor-tabs-group .preview.sc-nylas-editor-tabs-group{display:flex;gap:16px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .preview.sc-nylas-editor-tabs-group{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs-group .preview.sc-nylas-editor-tabs-group button-component.page-settings-button.sc-nylas-editor-tabs-group{min-width:140px}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group{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-group .buttons.sc-nylas-editor-tabs-group{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group .footer-buttons__row.sc-nylas-editor-tabs-group{display:flex;gap:16px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group .footer-buttons__row.sc-nylas-editor-tabs-group{width:100%}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group .footer-buttons__row.sc-nylas-editor-tabs-group button-component[title=Preview].sc-nylas-editor-tabs-group{width:48px}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.sc-nylas-editor-tabs-group{max-width:524px}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.unsaved-changes.sc-nylas-editor-tabs-group{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.saved-changes.sc-nylas-editor-tabs-group{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.error.sc-nylas-editor-tabs-group{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.error-full-width.sc-nylas-editor-tabs-group{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button-component.sc-nylas-editor-tabs-group{width:100%}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group span.sc-nylas-editor-tabs-group{display:flex;align-items:center;justify-content:center;gap:0.5rem}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button-component.save-changes.sc-nylas-editor-tabs-group{min-width:140px}button-component#report-issue.sc-nylas-editor-tabs-group{width:auto}nylas-feedback-form.sc-nylas-editor-tabs-group{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}', mt = ft;
747
- var _t = function(e, t, a, s) {
748
- var l = arguments.length, i = l < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, o;
749
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
750
- i = Reflect.decorate(e, t, a, s);
751
- else
752
- for (var d = e.length - 1; d >= 0; d--)
753
- (o = e[d]) && (i = (l < 3 ? o(i) : l > 3 ? o(t, a, i) : o(t, a)) || i);
754
- return l > 3 && i && Object.defineProperty(t, a, i), i;
755
- }, ge = function(e, t) {
756
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
757
- return Reflect.metadata(e, t);
758
- };
759
- const Ye = class {
760
- constructor(e) {
761
- te(this, e), this.schedulerConfigChanged = m(this, "schedulerConfigChanged", 7), this.schedulerConfigCreated = m(this, "schedulerConfigCreated", 7), this.cancelButtonClick = m(this, "cancelButtonClick", 7), this.formSubmitted = m(this, "formSubmitted", 7), this.previewButtonClicked = m(this, "previewButtonClicked", 7), this.schedulerEditorFormUpdated = m(this, "schedulerEditorFormUpdated", 7), this.groupEventCreateTriggered = m(this, "groupEventCreateTriggered", 7), this.groupEventUpdateTriggered = m(this, "groupEventUpdateTriggered", 7), this.groupEventDeleteTriggered = m(this, "groupEventDeleteTriggered", 7), this.groupEventImportTriggered = m(this, "groupEventImportTriggered", 7), this.saveGroupEventChangesError = m(this, "saveGroupEventChangesError", 7), this.nylasSchedulerError = m(this, "nylasSchedulerError", 6), this.dismissNotification = m(this, "dismissNotification", 6), this.formSubmissionHandler = async (t) => {
762
- var x, V, P, H, M, K, ne, oe, W, se, ie;
763
- t.preventDefault();
764
- const a = await this.formSubmitted.emit();
765
- if (b("[nylas-editor-tabs-group]", "formSubmissionHandler", a), !this.formRef.checkValidity() || a.defaultPrevented) {
766
- await this.host.setError({
767
- message: this.formRef.validationMessage || r.t("fixFormErrors"),
768
- type: _.Error,
769
- category: v.Component,
770
- title: r.t("nylasEditorTabs.formErrorTitle")
771
- });
772
- return;
773
- }
774
- this.isLoading = !0, this.hasUnsavedChanges = !1;
775
- const l = this.updateFormState();
776
- b("[nylas-editor-tabs-group]", "formState", l);
777
- const { title: i, description: o, bookingCalendar: d, location: c, bookingType: p, minCancellationNotice: h, minBookingNotice: f, cancellationPolicy: w, hideCancellationOptions: T, hideReschedulingOptions: O, additionalFields: U, conferencing: N, reminders: L, emailTemplate: z, redirectUrl: D, slug: R, appearance: F, name: E, eventCapacity: B, eventTimeslot: C, participants: k, disableEmails: A, organizerLocale: S } = l, $ = {
778
- ...((x = this.selectedConfiguration) == null ? void 0 : x.id) && { id: this.selectedConfiguration.id },
779
- slug: R,
780
- name: E,
781
- type: this.selectedEventType === I.group ? I.group : void 0,
782
- scheduler: {
783
- cancellation_policy: w ?? "",
784
- min_cancellation_notice: h ?? 0,
785
- min_booking_notice: f ?? 60,
786
- hide_cancellation_options: T ?? !1,
787
- hide_rescheduling_options: O ?? !1,
788
- additional_fields: U,
789
- email_template: z ? {
790
- ...z,
791
- organizer_locale: S || "en",
792
- logo: z.logo || ""
793
- } : void 0,
794
- confirmation_redirect_url: D
795
- },
796
- appearance: F,
797
- group_booking: {
798
- booking_type: p || "booking",
799
- disable_emails: typeof A == "boolean" ? A : !1,
800
- reminders: L,
801
- conferencing: N,
802
- calendar_id: d || "primary",
803
- default_capacity: B || 10
804
- }
805
- }, j = _e(this.selectedConfiguration, $ || {}), G = this.action === "create" ? j : $;
806
- delete G.availability, delete G.participants, delete G.event_booking;
807
- const J = (re) => {
808
- this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
809
- this.changesSaved = !1;
810
- }, 3e3);
811
- };
812
- if (this.checkForBookingFormErrors(G))
813
- return;
814
- const Y = {
815
- name: ((V = this.currentUser) == null ? void 0 : V.name) ?? ((P = this.currentUser) == null ? void 0 : P.email) ?? "",
816
- email: ((H = this.currentUser) == null ? void 0 : H.email) ?? ""
817
- }, q = ((M = this.calendars) == null ? void 0 : M.find((re) => re.is_primary)) ?? ((K = this.calendars) == null ? void 0 : K[0]), Q = [{ ...Y, is_organizer: !0 }], X = (ne = this.selectedConfiguration) != null && ne.id ? void 0 : {
818
- title: i,
819
- description: o,
820
- location: N ? void 0 : c,
821
- conferencing: c ? void 0 : N,
822
- when: {
823
- start_time: ((oe = C == null ? void 0 : C.when) == null ? void 0 : oe.start_time) ?? 0,
824
- end_time: ((W = C == null ? void 0 : C.when) == null ? void 0 : W.end_time) ?? 0,
825
- start_timezone: ((se = C == null ? void 0 : C.when) == null ? void 0 : se.start_timezone) ?? "",
826
- end_timezone: ((ie = C == null ? void 0 : C.when) == null ? void 0 : ie.end_timezone) ?? ""
827
- },
828
- recurrence: (C == null ? void 0 : C.recurrence) ?? [],
829
- calendar_id: d || (q == null ? void 0 : q.id) || "primary",
830
- participants: k != null && k.length ? k : Q,
831
- organizer: Y,
832
- capacity: B || 10
833
- };
834
- this.schedulerConfigChanged.emit({ groupEvent: X || void 0, config: G, resetLoadingState: J, action: this.action, host: this.host });
835
- }, this.checkForBookingFormErrors = (t) => {
836
- var i;
837
- let a = !1, s = "";
838
- const l = (i = t.scheduler) == null ? void 0 : i.additional_fields;
839
- return l && (s = "", Object.entries(l).forEach((o) => {
840
- const d = o[1];
841
- if (d.label === "") {
842
- s += r.t("nylasEditorTabs.bookingFormError_label", { type: d.type }), a = !0;
843
- return;
844
- }
845
- if (d.options) {
846
- for (const c of d.options)
847
- if (c.trim() === "") {
848
- s += r.t("nylasEditorTabs.bookingFormError_option", { label: d.label, type: d.type }), a = !0;
849
- break;
850
- }
851
- }
852
- })), a && (this.isLoading = !1, this.host.setError({
853
- message: s,
854
- type: _.Error,
855
- category: v.Component,
856
- title: r.t("nylasEditorTabs.bookingFormError")
857
- })), a;
858
- }, this.calendars = void 0, this.selectedConfiguration = void 0, this.configurations = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.hideEditorTabs = [], this.enableUserFeedback = !0, this.selectedLanguage = void 0, this.selectedEventType = void 0, this.selectedGroupEvent = void 0, this.themeConfig = void 0, this.action = "create", this.showFeedbackModal = !1, this.activeTab = g.CalendarView, this.isLoading = !1, this.componentLoaded = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = {
859
- message: "",
860
- type: _.Error,
861
- category: v.Component,
862
- title: ""
863
- };
864
- }
865
- configChangedHandler(e) {
866
- b("[nylas-editor-tabs-group]", "configChangedHandler", e, this.selectedConfiguration), this.formState = {
867
- ...this.getFormStateFromConfig(e)
868
- }, e != null && e.id ? this.action = "edit" : this.action = "create";
869
- }
870
- selectedGroupEventChangedHandler(e) {
871
- var t, a, s, l, i, o, d, c, p, h, f, w, T, O, U, N, L, z, D, R, F, E, B, C, k, A, S, $, j, G, J;
872
- b("[nylas-editor-tabs-group]", "selectedGroupEventChangedHandler", e, this.selectedConfiguration), this.formState = {
873
- ...this.formState,
874
- title: (a = (t = this.selectedGroupEvent) == null ? void 0 : t.event) == null ? void 0 : a.title,
875
- description: (l = (s = this.selectedGroupEvent) == null ? void 0 : s.event) == null ? void 0 : l.description,
876
- location: (o = (i = this.selectedGroupEvent) == null ? void 0 : i.event) == null ? void 0 : o.location,
877
- conferencing: (c = (d = this.selectedGroupEvent) == null ? void 0 : d.event) == null ? void 0 : c.conferencing,
878
- eventCapacity: (h = (p = this.selectedGroupEvent) == null ? void 0 : p.group_event_info) == null ? void 0 : h.capacity,
879
- participants: (T = (w = (f = this.selectedGroupEvent) == null ? void 0 : f.group_event_info) == null ? void 0 : w.participants) == null ? void 0 : T.map((Z) => ({
880
- name: Z.name,
881
- email: Z.email,
882
- is_organizer: !!Z.is_organizer
883
- })),
884
- eventTimeslot: (U = (O = this.selectedGroupEvent) == null ? void 0 : O.event) != null && U.when ? {
885
- when: {
886
- start_time: (z = (L = (N = this.selectedGroupEvent) == null ? void 0 : N.event) == null ? void 0 : L.when) == null ? void 0 : z.start_time,
887
- end_time: (F = (R = (D = this.selectedGroupEvent) == null ? void 0 : D.event) == null ? void 0 : R.when) == null ? void 0 : F.end_time,
888
- start_timezone: (C = (B = (E = this.selectedGroupEvent) == null ? void 0 : E.event) == null ? void 0 : B.when) == null ? void 0 : C.start_timezone,
889
- end_timezone: (S = (A = (k = this.selectedGroupEvent) == null ? void 0 : k.event) == null ? void 0 : A.when) == null ? void 0 : S.end_timezone
890
- },
891
- recurrence: (j = ($ = this.selectedGroupEvent) == null ? void 0 : $.group_event_info) != null && j.rrule ? (J = (G = this.selectedGroupEvent) == null ? void 0 : G.group_event_info) == null ? void 0 : J.rrule : []
892
- } : void 0
893
- };
894
- }
895
- userChangedHandler(e) {
896
- b("[nylas-editor-tabs-group]", "userChangedHandler", e), e && (this.formState = {
897
- ...this.getFormStateFromConfig(this.selectedConfiguration)
898
- });
899
- }
900
- selectedLanguageChangedHandler(e, t) {
901
- e !== t && (r.changeLanguage(e), this.error && this.error.message && (this.error = {
902
- ...this.error,
903
- message: r.t("fixFormErrors")
904
- }, this.showErrorNotification(this.error)));
905
- }
906
- themeConfigChangedHandler(e, t) {
907
- e !== t && this.applyThemeConfig(e);
908
- }
909
- applyThemeConfig(e) {
910
- if (e)
911
- for (const [t, a] of Object.entries(e))
912
- this.host.style.setProperty(`${t}`, a);
913
- }
914
- async schedulerConfigCreatedEventHandler(e) {
915
- return this.schedulerConfigCreated.emit(e);
916
- }
917
- async setError(e) {
918
- var t;
919
- this.error = {
920
- message: e.message,
921
- type: e.type,
922
- category: e.category,
923
- title: e.title || r.t("genericErrorTitle")
924
- }, (t = this.error) != null && t.message && this.showErrorNotification(this.error);
925
- }
926
- async resetError() {
927
- var e, t;
928
- (e = this.error) != null && e.message && this.dismissNotification.emit({ id: (t = this.error) == null ? void 0 : t.message.split(" ").join("-"), host: this.host }), this.error = {
929
- message: "",
930
- type: _.Error,
931
- category: v.Component,
932
- title: ""
933
- };
934
- }
935
- connectedCallback() {
936
- b("[nylas-editor-tabs-group]", "connectedCallback");
937
- }
938
- componentWillLoad() {
939
- b("[nylas-editor-tabs-group]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
940
- }
941
- componentDidLoad() {
942
- var t, a, s;
943
- b("[nylas-editor-tabs-group]", "componentDidLoad"), this.enableUserFeedback && !Je() && Ve({
944
- dsn: "https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",
945
- release: "2.1.0",
946
- integrations: (l) => [
947
- ...l.filter((i) => !1),
948
- qe({
949
- colorScheme: "system",
950
- autoInject: !1
951
- })
952
- ],
953
- autoSessionTracking: !1,
954
- beforeSend: () => null
955
- }), (t = this.selectedConfiguration) != null && t.id && this.configChangedHandler(this.selectedConfiguration);
956
- const e = (a = this.host.querySelector("button.tab:not(.hide)")) == null ? void 0 : a.name;
957
- e && ((s = this.hideEditorTabs) != null && s.includes(this.activeTab)) && (this.activeTab = e), this.updateFormState(), this.componentLoaded = !0;
958
- }
959
- disconnectedCallback() {
960
- b("[nylas-editor-tabs-group]", "disconnectedCallback");
961
- }
962
- handleValueChanged(e) {
963
- b("[nylas-editor-tabs-group]", "handleValueChanged", e);
964
- const { name: t, value: a } = e.detail;
965
- console.log("name", t, "value", a), this.setFormState(a, t), this.formState = { ...this.formState }, st.includes(t) && (this.hasUnsavedChanges = !0), this.host.resetError(), this.schedulerEditorFormUpdated.emit({
966
- value: e.detail.value,
967
- name: e.detail.name
968
- });
969
- }
970
- feedbackModalClosedHandler() {
971
- this.showFeedbackModal = !1;
972
- }
973
- feedbackSubmittedHandler(e) {
974
- var s, l;
975
- const a = {
976
- eventId: Ze("Scheduler Editor User Feedback"),
977
- message: e.detail.feedback
978
- };
979
- We(a, {
980
- includeReplay: !0,
981
- captureContext: {
982
- tags: {
983
- "nylas-web-element": "nylas-scheduler-editor",
984
- "nylas-web-element-version": "2.1.0"
985
- },
986
- extra: {
987
- configId: (s = this.selectedConfiguration) == null ? void 0 : s.id,
988
- slug: (l = this.selectedConfiguration) == null ? void 0 : l.slug
989
- }
990
- }
991
- }), this.showFeedbackModal = !1;
992
- }
993
- importGroupEventHandler(e) {
994
- var t;
995
- this.groupEventImportTriggered.emit({ groupEvent: e.detail, configId: ((t = this.selectedConfiguration) == null ? void 0 : t.id) ?? "", host: this.host });
996
- }
997
- saveGroupEventChangesHandler(e) {
998
- var s, l, i, o, d, c, p, h, f;
999
- b("saveGroupEventChangesHandler", e.detail, this.selectedGroupEvent);
1000
- const t = this.formRef.checkValidity(), a = this.getGroupEventDetailsFromFormState();
1001
- if (this.resetError(), a.title || this.setError({
1002
- message: r.t("nylasEditorTabsGroup.eventTitleRequired"),
1003
- type: _.Error,
1004
- category: v.Component,
1005
- title: r.t("nylasEditorTabs.formErrorTitle")
1006
- }), (!((s = a.when) != null && s.start_time) || !((l = a.when) != null && l.end_time)) && this.setError({
1007
- message: r.t("nylasEditorTabsGroup.eventTimeRequired"),
1008
- type: _.Error,
1009
- category: v.Component,
1010
- title: r.t("nylasEditorTabs.formErrorTitle")
1011
- }), (i = a.participants) != null && i.length || this.setError({
1012
- message: r.t("nylasEditorTabsGroup.participantsRequired"),
1013
- type: _.Error,
1014
- category: v.Component,
1015
- title: r.t("nylasEditorTabs.formErrorTitle")
1016
- }), (o = a.participants) != null && o.length && ((d = a.participants) != null && d.some((w) => !w.email)) && this.setError({
1017
- message: r.t("nylasEditorTabsGroup.participantEmailRequired"),
1018
- type: _.Error,
1019
- category: v.Component,
1020
- title: r.t("nylasEditorTabs.formErrorTitle")
1021
- }), ((c = this.error) == null ? void 0 : c.message) !== "" || !t) {
1022
- this.saveGroupEventChangesError.emit({
1023
- error: ((p = this.error) == null ? void 0 : p.message) ?? r.t("nylasEditorTabsGroup.errorOccured"),
1024
- configId: ((h = this.selectedConfiguration) == null ? void 0 : h.id) ?? "",
1025
- host: this.host
1026
- });
1027
- return;
1028
- }
1029
- this.groupEventUpdateTriggered.emit({
1030
- groupEvent: a,
1031
- chosenOption: e.detail.action,
1032
- configId: ((f = this.selectedConfiguration) == null ? void 0 : f.id) ?? "",
1033
- host: this.host
1034
- });
1035
- }
1036
- deleteGroupEventHandler(e) {
1037
- var a;
1038
- b("deleteGroupEventHandler", e.detail);
1039
- const t = this.getGroupEventDetailsFromFormState();
1040
- this.groupEventDeleteTriggered.emit({
1041
- groupEvent: t,
1042
- chosenOption: e.detail.action,
1043
- configId: ((a = this.selectedConfiguration) == null ? void 0 : a.id) ?? "",
1044
- host: this.host
1045
- });
1046
- }
1047
- createGroupEventHandler(e) {
1048
- var o, d, c, p, h, f, w;
1049
- const t = e.detail, a = {
1050
- name: ((o = this.currentUser) == null ? void 0 : o.name) ?? ((d = this.currentUser) == null ? void 0 : d.email) ?? "",
1051
- email: ((c = this.currentUser) == null ? void 0 : c.email) ?? ""
1052
- }, s = ((p = this.calendars) == null ? void 0 : p.find((T) => T.is_primary)) ?? ((h = this.calendars) == null ? void 0 : h[0]), l = ((f = this.formState) == null ? void 0 : f.conferencing) || t.conferencing, i = {
1053
- title: t.title,
1054
- description: t.description,
1055
- location: l ? void 0 : t.location,
1056
- participants: t.participants,
1057
- organizer: a,
1058
- conferencing: t.location ? {} : l,
1059
- when: t.eventTimeslot.when,
1060
- recurrence: t.eventTimeslot.recurrence,
1061
- calendar_id: (s == null ? void 0 : s.id) || "primary",
1062
- capacity: t.eventCapacity
1063
- };
1064
- this.groupEventCreateTriggered.emit({ groupEvent: i, configId: ((w = this.selectedConfiguration) == null ? void 0 : w.id) ?? "", host: this.host });
1065
- }
1066
- showErrorNotification(e) {
1067
- this.nylasSchedulerError.emit({
1068
- notification: {
1069
- title: e.title,
1070
- category: e.category || v.Component,
1071
- type: e.type || _.Error,
1072
- description: e.message,
1073
- id: e.message.split(" ").join("-"),
1074
- ttl: "none"
1075
- },
1076
- host: this.host
1077
- });
1078
- }
1079
- getGroupEventDetailsFromFormState() {
1080
- var f, w, T, O, U, N, L, z, D;
1081
- const e = ((f = this.calendars) == null ? void 0 : f.find((R) => R.is_primary)) ?? ((w = this.calendars) == null ? void 0 : w[0]), t = {
1082
- name: ((T = this.currentUser) == null ? void 0 : T.name) ?? ((O = this.currentUser) == null ? void 0 : O.email) ?? "",
1083
- email: ((U = this.currentUser) == null ? void 0 : U.email) ?? ""
1084
- }, a = [{ ...t, is_organizer: !0 }], { title: s, description: l, bookingCalendar: i, location: o, conferencing: d, eventCapacity: c, eventTimeslot: p, participants: h } = this.formState;
1085
- return {
1086
- title: s,
1087
- description: l,
1088
- location: d ? void 0 : o,
1089
- conferencing: o ? void 0 : d,
1090
- when: {
1091
- start_time: ((N = p == null ? void 0 : p.when) == null ? void 0 : N.start_time) ?? 0,
1092
- end_time: ((L = p == null ? void 0 : p.when) == null ? void 0 : L.end_time) ?? 0,
1093
- start_timezone: ((z = p == null ? void 0 : p.when) == null ? void 0 : z.start_timezone) ?? "",
1094
- end_timezone: ((D = p == null ? void 0 : p.when) == null ? void 0 : D.end_timezone) ?? ""
1095
- },
1096
- recurrence: (p == null ? void 0 : p.recurrence) ?? [],
1097
- calendar_id: i || (e == null ? void 0 : e.id) || "primary",
1098
- participants: h != null && h.length ? h : a,
1099
- organizer: t,
1100
- capacity: c || 10
1101
- };
1102
- }
1103
- getFormStateFromConfig(e) {
1104
- var t, a, s, l, i, o, d, c, p, h, f, w, T, O;
1105
- return e != null && e.appearance && console.info("Appearance settings have been returned from the given configuration; please remember to grab them from the configSettingsLoaded event and apply them as desired."), {
1106
- additionalFields: ((t = e == null ? void 0 : e.scheduler) == null ? void 0 : t.additional_fields) ?? {},
1107
- bookingType: ((a = e == null ? void 0 : e.group_booking) == null ? void 0 : a.booking_type) ?? "booking",
1108
- cancellationPolicy: ((s = e == null ? void 0 : e.scheduler) == null ? void 0 : s.cancellation_policy) ?? "",
1109
- minCancellationNotice: ((l = e == null ? void 0 : e.scheduler) == null ? void 0 : l.min_cancellation_notice) ?? 0,
1110
- minBookingNotice: ((i = e == null ? void 0 : e.scheduler) == null ? void 0 : i.min_booking_notice) ?? 60,
1111
- hideCancellationOptions: ((o = e == null ? void 0 : e.scheduler) == null ? void 0 : o.hide_cancellation_options) ?? !1,
1112
- hideReschedulingOptions: ((d = e == null ? void 0 : e.scheduler) == null ? void 0 : d.hide_rescheduling_options) ?? !1,
1113
- reminders: (c = e == null ? void 0 : e.group_booking) == null ? void 0 : c.reminders,
1114
- emailTemplate: (p = e == null ? void 0 : e.scheduler) == null ? void 0 : p.email_template,
1115
- redirectUrl: (h = e == null ? void 0 : e.scheduler) == null ? void 0 : h.confirmation_redirect_url,
1116
- slug: e == null ? void 0 : e.slug,
1117
- appearance: e == null ? void 0 : e.appearance,
1118
- name: e == null ? void 0 : e.name,
1119
- bookingCalendar: (f = e == null ? void 0 : e.group_booking) == null ? void 0 : f.calendar_id,
1120
- disableEmails: (w = e == null ? void 0 : e.group_booking) == null ? void 0 : w.disable_emails,
1121
- organizerLocale: (O = (T = e == null ? void 0 : e.scheduler) == null ? void 0 : T.email_template) == null ? void 0 : O.organizer_locale
1122
- };
1123
- }
1124
- setFormState(e, t) {
1125
- switch (t) {
1126
- case "title":
1127
- this.formState.title = e.toString();
1128
- break;
1129
- case "description":
1130
- this.formState.description = e.toString();
1131
- break;
1132
- case "location":
1133
- this.formState.location = e.toString();
1134
- break;
1135
- case "conference":
1136
- this.formState.conferencing = JSON.parse(e.toString());
1137
- break;
1138
- case "confirmation-type":
1139
- this.formState.bookingType = e.toString();
1140
- break;
1141
- case "min-cancellation-notice":
1142
- this.formState.minCancellationNotice = parseInt(e.toString());
1143
- break;
1144
- case "min-booking-notice":
1145
- this.formState.minBookingNotice = parseInt(e.toString());
1146
- break;
1147
- case "cancellation-policy":
1148
- this.formState.cancellationPolicy = e.toString();
1149
- break;
1150
- case "customize-booking-settings": {
1151
- const a = JSON.parse(e.toString());
1152
- this.formState.hideCancellationOptions = a.hideCancellationOptions, this.formState.hideReschedulingOptions = a.hideReschedulingOptions;
1153
- break;
1154
- }
1155
- case "booking-calendar":
1156
- this.formState.bookingCalendar = e.toString();
1157
- break;
1158
- case "event-capacity":
1159
- this.formState.eventCapacity = parseInt(String(e));
1160
- break;
1161
- case "additional-fields":
1162
- this.formState.additionalFields = JSON.parse(e.toString());
1163
- break;
1164
- case "confirmation-email-template":
1165
- this.formState.emailTemplate = JSON.parse(e.toString());
1166
- break;
1167
- case "reminder-overrides":
1168
- this.formState.reminders = JSON.parse(e.toString());
1169
- break;
1170
- case "confirmation-redirect":
1171
- this.formState.redirectUrl = e.toString();
1172
- break;
1173
- case "custom-event-slug":
1174
- console.debug("custom-event-slug", e), this.formState.slug = JSON.parse(e.toString());
1175
- break;
1176
- case "page-styling":
1177
- this.formState.appearance = JSON.parse(e.toString());
1178
- break;
1179
- case "page-name":
1180
- this.formState.name = JSON.parse(e.toString());
1181
- break;
1182
- case "participants": {
1183
- const a = JSON.parse(e.toString());
1184
- this.formState.participants = a.map((s) => ({
1185
- name: s.name,
1186
- email: s.email,
1187
- is_organizer: s.is_organizer
1188
- }));
1189
- break;
1190
- }
1191
- case "event-timeslot":
1192
- this.formState.eventTimeslot = JSON.parse(e.toString());
1193
- break;
1194
- case "disable-emails": {
1195
- const { disableEmails: a, organizerLocale: s } = JSON.parse(e.toString());
1196
- this.formState.disableEmails = a, this.formState.organizerLocale = s;
1197
- break;
1198
- }
1199
- }
1200
- this.schedulerEditorFormUpdated.emit({
1201
- value: e,
1202
- name: t
1203
- });
1204
- }
1205
- updateFormState() {
1206
- return new FormData(this.formRef).forEach((t, a) => {
1207
- this.setFormState(t, a);
1208
- }), this.formState = { ...this.formState }, this.formState;
1209
- }
1210
- setActiveTab(e, t) {
1211
- e.preventDefault(), this.updateFormState(), this.activeTab = t;
1212
- }
1213
- hideTab(e) {
1214
- var t;
1215
- return ((t = this.hideEditorTabs) == null ? void 0 : t.includes(e)) || !1;
1216
- }
1217
- onFeedbackClick(e) {
1218
- e.preventDefault(), this.showFeedbackModal = !0;
1219
- }
1220
- render() {
1221
- var e, t, a, s, l, i;
1222
- return b("[nylas-editor-tabs-group]", "render", this.formState), n(ce, { key: "76c493a97bfd6a0ba5a98233a2d4fecd29e73f4f" }, n("nylas-notification", { key: "28d9095c59ca8eb5a8bc2a10358263dd8b478657" }), n("form", { key: "70d81a11affc5eaa0d493f71a7da42588b7d2ea2", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (o) => this.formRef = o, noValidate: !0 }, this.mode === "app" ? n("div", { class: "return-to-calendar-view", part: "editor__return-to-calendar-view net__return-to-calendar-view" }, n("button-component", { id: "return-to-calendar-view-button", variant: "invisible", part: "nset__header__back-button", type: "button", onClick: (o) => {
1223
- this.setActiveTab(o, g.CalendarView);
1224
- } }, n("chevron-icon", { width: "16", height: "16" }), n("span", null, r.t("returnToCalendarView")))) : null, this.mode === "app" ? n("div", { class: "form-contents", part: "editor__form-contents net__form-contents" }, n("div", { class: "tabs", part: "editor__tabs net__tabs" }, n("button", { name: g.BookingOptions, class: { tab: !0, active: this.activeTab == g.BookingOptions, hide: this.hideTab(g.BookingOptions) }, part: "editortab__booking-options net__tab-booking-options", onClick: (o) => this.setActiveTab(o, g.BookingOptions) }, n("flow-icon", { width: "16", height: "16" }), r.t("bookingOptionsTab")), n("button", { name: g.BookingForm, class: { tab: !0, active: this.activeTab == g.BookingForm, hide: this.hideTab(g.BookingForm) }, part: "editortab__booking-form net__tab-booking-form", onClick: (o) => this.setActiveTab(o, g.BookingForm) }, this.activeTab == g.BookingForm ? n("calendar-agenda-fill-icon", { width: "16", height: "16" }) : n("calendar-agenda-icon", { width: "16", height: "16" }), r.t("bookingFormTab")), n("button", { name: g.Communications, class: { tab: !0, active: this.activeTab == g.Communications, hide: this.hideTab(g.Communications) }, onClick: (o) => this.setActiveTab(o, g.Communications), part: "editortab__communications net__tab-communications" }, this.activeTab == g.Communications ? n("envelope-fill-icon", { width: "16", height: "16" }) : n("envelope-icon", { width: "16", height: "16" }), r.t("communicationsTab")), n("button", { name: g.PageStyles, class: { tab: !0, active: this.activeTab == g.PageStyles, hide: this.hideTab(g.PageStyles) }, onClick: (o) => this.setActiveTab(o, g.PageStyles), part: "editortab__page-styles net__tab-page-styles" }, this.activeTab == g.PageStyles ? n("paintbrush-fill-icon", { width: "16", height: "16" }) : n("paintbrush-icon", { width: "16", height: "16" }), r.t("pageStylesTab"))), n("div", { class: "tab-content", part: "editor__tab-content net__tab-content" }, n(gt, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((e = this.selectedConfiguration) == null ? void 0 : e.id) ?? "new", i18next: r }))) : n("div", { class: "composable", key: (t = this.selectedConfiguration) == null ? void 0 : t.id }, n("slot", null)), n("div", { key: "dd5ef485c1aa6955264379915867a5bda111a2b5", class: "footer", part: "editor__footer net__footer" }, n("div", { key: "5431c3dd9e45ee66cbd22c038546f6e97b82aff1", class: "preview", part: "editor__footer-preview net__footer-preview" }, this.enableUserFeedback && n("button-component", { title: "Share your feedback", id: "report-issue", variant: "basic", onClick: (o) => this.onFeedbackClick(o) }, n("feedback-icon", null)), this.activeTab === g.CalendarView && n("button-component", { class: "page-settings-button", title: "Go to page settings", id: "page-settings", variant: "basic", onClick: (o) => this.setActiveTab(o, g.BookingOptions) }, r.t("pageSettingsButton"))), n("div", { key: "c2369b6564211918ab7aa31123e01cb4f98d943d", class: "buttons", part: "editor__footer-buttons net__footer-buttons" }, n("p", { key: "ffbd97cdaa59620c641c5a2adac0af76633ff043", class: {
1225
- "unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
1226
- "saved-changes": this.changesSaved,
1227
- error: ((a = this.error) == null ? void 0 : a.message) !== "",
1228
- "error-full-width": ((s = this.error) == null ? void 0 : s.message) !== "" && this.action === "create"
1229
- } }, ((l = this.error) == null ? void 0 : l.message) == "" && this.hasUnsavedChanges && !this.changesSaved && this.activeTab !== g.CalendarView ? r.t("unsavedChangesLabel") : ((i = this.error) == null ? void 0 : i.message) == "" && this.changesSaved ? `${r.t("changesSavedLabel")}!` : ""), n("div", { key: "4edf752dbbf6dd86f97da5cf285afde1f56f900f", class: "footer-buttons__row" }, this.schedulerPreviewLink !== "" && this.action === "edit" && n("button-component", { title: "Preview", type: "button", disabled: this.isLoading, clickHandler: (o) => {
1230
- o.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(de(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
1231
- }, variant: "basic" }, n("eye-icon", null)), n("button-component", { key: "8fc79265e7819c0aeeba204f9f4e1ed6502ce5a1", type: "button", disabled: this.isLoading, clickHandler: (o) => {
1232
- o.preventDefault(), this.cancelButtonClick.emit(), this.host.resetError();
1233
- }, variant: "basic", part: "editor__footer-cancel net__footer-cancel" }, r.t("cancelButton")), n("button-component", { key: "04509263358df45457a593c11f6b5625aedba833", class: { "save-changes": this.action === "edit" }, type: "submit", disabled: this.isLoading, part: "editor__footer-cta, net__footer-cta" }, this.componentLoaded ? this.isLoading ? n("span", null, r.t("savingButtonText"), n("loading-icon", null), " ") : this.action === "create" ? `${r.t("createButtonText")}` : `${r.t("saveChangesButtonText")}` : n("span", null, n("loading-icon", null), " ")))))), this.showFeedbackModal && n("nylas-feedback-form", null));
1234
- }
1235
- get host() {
1236
- return pe(this);
1237
- }
1238
- static get watchers() {
1239
- return {
1240
- selectedConfiguration: ["configChangedHandler"],
1241
- selectedGroupEvent: ["selectedGroupEventChangedHandler"],
1242
- currentUser: ["userChangedHandler"],
1243
- selectedLanguage: ["selectedLanguageChangedHandler"],
1244
- themeConfig: ["themeConfigChangedHandler"]
1245
- };
1246
- }
1247
- };
1248
- _t([
1249
- be({
1250
- name: "nylas-editor-tabs-group",
1251
- stateToProps: /* @__PURE__ */ new Map([
1252
- ["schedulerConfig.calendars", "calendars"],
1253
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
1254
- ["schedulerConfig.currentUser", "currentUser"],
1255
- ["schedulerConfig.configurations", "configurations"],
1256
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
1257
- ["schedulerConfig.selectedEventType", "selectedEventType"],
1258
- ["schedulerConfig.selectedGroupEvent", "selectedGroupEvent"],
1259
- ["schedulerConfig.themeConfig", "themeConfig"]
1260
- ]),
1261
- eventToProps: {
1262
- schedulerConfigChanged: async (e, t) => {
1263
- const { resetLoadingState: a, host: s, action: l, config: i, groupEvent: o } = e.detail, d = (c, p) => {
1264
- const [h, f] = c;
1265
- !h && f ? s.setError({
1266
- message: f.message || r.t("genericErrorTitle"),
1267
- type: _.Error,
1268
- category: v.Component,
1269
- title: p
1270
- }) : h && !f && l === "create" && s.schedulerConfigCreatedEventHandler({ config: h, action: l, host: s });
1271
- };
1272
- if (l === "edit") {
1273
- const c = await t.schedulerConfig.updateConfiguration(i);
1274
- d(c, r.t("nylasEditorTabs.updateConfigError")), a && a(e);
1275
- } else {
1276
- const c = await t.schedulerConfig.createConfiguration(i);
1277
- d(c, r.t("nylasEditorTabs.createConfigError"));
1278
- const [p, h] = c, f = p == null ? void 0 : p.id;
1279
- if (f && o) {
1280
- const w = await t.schedulerConfig.createGroupEvent(o, f);
1281
- d(w, r.t("nylasEditorTabsGroup.createGroupEventError"));
1282
- }
1283
- a && a(e);
1284
- }
1285
- },
1286
- cancelButtonClick: async (e, t) => {
1287
- t.schedulerConfigStore.state.action = null, t.schedulerConfigStore.set("selectedEventType", void 0), t.schedulerConfigStore.set("selectedGroupEvent", void 0), t.schedulerConfigStore.set("groupEvents", []);
1288
- },
1289
- previewButtonClicked: async (e, t) => {
1290
- b("[nylas-editor-tabs-group]", "previewButtonClicked", t);
1291
- },
1292
- formSubmitted: async (e, t) => {
1293
- b("[nylas-editor-tabs-group]", "formSubmitted", t);
1294
- },
1295
- schedulerEditorFormUpdated: async (e, t) => {
1296
- b("[nylas-editor-tabs-group]", "schedulerEditorFormUpdated", e);
1297
- },
1298
- schedulerConfigCreated: async (e, t) => {
1299
- b("[nylas-editor-tabs-group]", "schedulerConfigCreated", e);
1300
- },
1301
- groupEventUpdateTriggered: async (e, t) => {
1302
- const { groupEvent: a, host: s, chosenOption: l, configId: i } = e.detail, o = await t.schedulerConfig.updateGroupEvent(a, l, i), [d, c] = o;
1303
- !d && c && s.setError({
1304
- message: c.message || r.t("genericErrorTitle"),
1305
- type: _.Error,
1306
- category: v.Component,
1307
- title: r.t("nylasEditorTabsGroup.updateGroupEventError")
1308
- });
1309
- },
1310
- groupEventDeleteTriggered: async (e, t) => {
1311
- const { groupEvent: a, chosenOption: s, configId: l, host: i } = e.detail, o = await t.schedulerConfig.deleteGroupEvent(a, s, l), [d, c] = o;
1312
- !d && c && i.setError({
1313
- message: c.message || r.t("genericErrorTitle"),
1314
- type: _.Error,
1315
- category: v.Component,
1316
- title: r.t("nylasEditorTabsGroup.deleteGroupEventError")
1317
- });
1318
- },
1319
- groupEventCreateTriggered: async (e, t) => {
1320
- const { groupEvent: a, configId: s, host: l } = e.detail, i = await t.schedulerConfig.createGroupEvent(a, s), [o, d] = i;
1321
- !o && d && l.setError({
1322
- message: d.message || r.t("genericErrorTitle"),
1323
- type: _.Error,
1324
- category: v.Component,
1325
- title: r.t("nylasEditorTabsGroup.createGroupEventError")
1326
- });
1327
- },
1328
- groupEventImportTriggered: async (e, t) => {
1329
- const { groupEvent: a, configId: s, host: l } = e.detail, i = await t.schedulerConfig.importGroupEvent([a], s), [o, d] = i;
1330
- if (!o && d && l.setError({
1331
- message: d.message || r.t("genericErrorTitle"),
1332
- type: _.Error,
1333
- category: v.Component,
1334
- title: r.t("nylasEditorTabsGroup.importGroupEventError")
1335
- }), o && o.import_failed && o.import_failed.length > 0) {
1336
- const c = o.import_failed.map((p) => p.reason).join(`
1337
- `);
1338
- l.setError({
1339
- message: c,
1340
- type: _.Error,
1341
- category: v.Component,
1342
- title: r.t("nylasEditorTabsGroup.importGroupEventError")
1343
- }), setTimeout(() => {
1344
- l.resetError();
1345
- }, 5e3);
1346
- }
1347
- },
1348
- saveGroupEventChangesError: async (e, t) => {
1349
- const { error: a, host: s } = e.detail;
1350
- b("[nylas-editor-tabs-group]", "saveGroupEventChangesError", a, s);
1351
- }
1352
- },
1353
- localPropsToProp: /* @__PURE__ */ new Map([
1354
- ["schedulerPreviewLink", "schedulerPreviewLink"],
1355
- ["enableUserFeedback", "enableUserFeedback"],
1356
- ["hideEditorTabs", "hideEditorTabs"]
1357
- ]),
1358
- fireRegisterEvent: !0
1359
- }),
1360
- ge("design:type", Function),
1361
- ge("design:paramtypes", []),
1362
- ge("design:returntype", void 0)
1363
- ], Ye.prototype, "render", null);
1364
- Ye.style = mt;
1365
- const vt = ':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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:16px;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;flex-direction:column;position:relative;overflow-y:hidden}.configurations .table-container{overflow-y:auto;flex:1}@media screen and (max-width: 768px){.configurations .table-container{min-height:624px}}.configurations .table-container table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations .table-container table.no-configurations{height:100%}.configurations .table-container table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations .table-container table tr.hide{display:none}.configurations .table-container table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations .table-container 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-container table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations .table-container table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations .table-container table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations .table-container table th,.configurations .table-container table td{text-align:left;padding:1rem;font-family:inherit}.configurations .table-container table .actions{display:flex;justify-content:flex-end;gap:1rem;text-align:right}.configurations .table-container table .actions button-component.edit-button{min-width:98px}@media screen and (max-width: 768px){.configurations .table-container table .actions{flex-direction:column;gap:0.5rem}}.configurations .table-container table .actions select-dropdown.last::part(sd_dropdown-content){bottom:54px}.configurations .table-container table .title{width:100%;max-width:300px}@media screen and (max-width: 768px){.configurations .table-container table .title{max-width:96px}}.configurations .table-container table .title div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.configurations .table-container table .title div.config-event-title{font-weight:600}.configurations .table-container table .title div.config-event-description{font-size:0.75rem}.configurations .pagination{padding:1rem;position:sticky;top:100%;display:flex;justify-content:flex-end;gap:0.5rem;background:var(--nylas-base-0);width:calc(100% - 2rem);z-index:2}.configurations .pagination td.arrows{display:flex;justify-content:flex-end;gap:0.5rem}.configurations .pagination button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background-color:transparent;color:var(--nylas-base-800);cursor:pointer}.configurations .pagination button:hover:not(:disabled){border:1px solid var(--nylas-primary)}.configurations .pagination button:active{border:1px solid var(--nylas-base-800)}.configurations .pagination button:disabled{border:1px solid var(--nylas-base-100);background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.configurations .pagination button.right{transform:rotate(180deg)}.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}select-dropdown{width:auto;color:inherit}select-dropdown::part(sd_dropdown-button){display:block;height:48px;padding:0px 16px 8px}@media screen and (max-width: 768px){select-dropdown::part(sd_dropdown-button){width:92px}}select-dropdown::part(sd_dropdown-content){width:120px;right:0}select-dropdown::part(sd_dropdown-labelhtml){display:flex;gap:0.5rem;align-items:center;color:var(--nylas-base-900)}select-dropdown::part(sd_dropdown-labelhtml):hover{color:var(--nylas-primary)}.card-wrapper{position:absolute;top:0;left:0;height:calc(100% + 4rem);width:-webkit-fill-available;width:-moz-available;width:fill-available;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.card-wrapper{justify-content:start;height:100%}}.card-modal{background:var(--nylas-base-0);display:flex;flex-direction:column;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);padding:32px;width:562px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.card-modal{width:auto;border-radius:0px}}.description.title-desc{margin-bottom:2rem}.description p{margin:0;font-size:18px;color:var(--nylas-base-600)}.footer{margin-top:1rem;padding-top:1rem;display:flex;justify-content:flex-end;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.close-button{width:100%;display:flex;justify-content:flex-end}.close-button button-component button{padding:0;height:auto}.close-button button-component button:hover{background-color:transparent !important}button-component{--dot-color:var(--nylas-base-700)}', Ct = vt;
1366
- var wt = function(e, t, a, s) {
1367
- var l = arguments.length, i = l < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, o;
1368
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1369
- i = Reflect.decorate(e, t, a, s);
1370
- else
1371
- for (var d = e.length - 1; d >= 0; d--)
1372
- (o = e[d]) && (i = (l < 3 ? o(i) : l > 3 ? o(t, a, i) : o(t, a)) || i);
1373
- return l > 3 && i && Object.defineProperty(t, a, i), i;
1374
- }, fe = function(e, t) {
1375
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1376
- return Reflect.metadata(e, t);
1377
- };
1378
- const Qe = class {
1379
- constructor(e) {
1380
- te(this, e), this.initListConfigurations = m(this, "initListConfigurations", 7), this.createButtonClick = m(this, "createButtonClick", 7), this.editButtonClick = m(this, "editButtonClick", 7), this.deleteButtonClick = m(this, "deleteButtonClick", 7), this.nylasSchedulerError = m(this, "nylasSchedulerError", 6), this.dismissNotification = m(this, "dismissNotification", 6), this.configurations = [], this.selectedLanguage = void 0, this.schedulerPreviewLink = "", this.listConfigurationsNextCursor = void 0, this.themeConfig = void 0, this.state = "loading", this.error = {
1381
- message: "",
1382
- type: _.Error,
1383
- category: v.Component,
1384
- title: ""
1385
- }, this.currentCursor = null, this.previousCursors = [], this.disableNextPageButton = !1, this.deleteConfigurationId = "", this.showDeleteButtonLoading = !1, this.editButtonLoadingId = "";
1386
- }
1387
- listConfigurationsNextCursorChangedHandler(e, t) {
1388
- if (!e || e === t) {
1389
- e === null && (this.disableNextPageButton = !0);
1390
- return;
1391
- }
1392
- this.disableNextPageButton = !1, this.currentCursor = e;
1393
- }
1394
- selectedLanguageChangedHandler(e, t) {
1395
- e !== t && r.changeLanguage(e);
1396
- }
1397
- themeConfigChangedHandler(e, t) {
1398
- e !== t && this.applyThemeConfig(e);
1399
- }
1400
- connectedCallback() {
1401
- b("[nylas-list-configurations]", "connectedCallback");
1402
- }
1403
- componentWillLoad() {
1404
- b("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
1405
- }
1406
- componentDidLoad() {
1407
- b("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit({
1408
- host: this.host
1409
- });
1410
- }
1411
- disconnectedCallback() {
1412
- b("[nylas-list-configurations]", "disconnectedCallback");
1413
- }
1414
- applyThemeConfig(e) {
1415
- if (e)
1416
- for (const [t, a] of Object.entries(e))
1417
- this.host.style.setProperty(`${t}`, a);
1418
- }
1419
- async handleNylasFormDropdownChanged(e) {
1420
- var l;
1421
- b("[nylas-list-configurations]", "handleNylasFormDropdownChanged", e.detail);
1422
- const { value: t } = e.detail, [a, s] = t.split("-");
1423
- switch (e.preventDefault(), a) {
1424
- case "delete":
1425
- this.deleteConfigurationId = (l = this.configurations[s]) == null ? void 0 : l.id;
1426
- break;
1427
- case "preview":
1428
- window.open(de(this.schedulerPreviewLink, this.configurations[s]), "_blank");
1429
- break;
1430
- case "copy":
1431
- await navigator.clipboard.writeText(de(this.schedulerPreviewLink, this.configurations[s]));
1432
- break;
1433
- }
1434
- }
1435
- async registerCallback() {
1436
- this.initListConfigurations.emit({
1437
- host: this.host
1438
- });
1439
- }
1440
- async getState() {
1441
- return this.state;
1442
- }
1443
- async setState(e) {
1444
- this.state = e;
1445
- }
1446
- async setError(e) {
1447
- var t;
1448
- this.error = {
1449
- message: e.message,
1450
- type: e.type,
1451
- category: e.category,
1452
- title: e.title || r.t("genericErrorTitle")
1453
- }, (t = this.error) != null && t.message && this.showErrorNotification(this.error);
1454
- }
1455
- async hideDeleteConfirmation() {
1456
- this.deleteConfigurationId = "", this.showDeleteButtonLoading = !1;
1457
- }
1458
- async hideEditButtonLoading() {
1459
- this.editButtonLoadingId = "";
1460
- }
1461
- showErrorNotification(e) {
1462
- this.nylasSchedulerError.emit({
1463
- notification: {
1464
- id: e.message.split(" ").join("-"),
1465
- type: e.type || _.Error,
1466
- title: e.title,
1467
- category: e.category || v.Component,
1468
- description: e.message,
1469
- ttl: "none"
1470
- },
1471
- host: this.host
1472
- });
1473
- }
1474
- closeModal(e) {
1475
- e.preventDefault(), this.deleteConfigurationId = "";
1476
- }
1477
- handleConfirmDeleteButtonClicked(e) {
1478
- e.preventDefault(), this.showDeleteButtonLoading = !0;
1479
- const t = this.configurations.find((a) => a.id === this.deleteConfigurationId);
1480
- t && (t != null && t.id) && this.deleteButtonClick.emit({ host: this.host, configuration: t });
1481
- }
1482
- getDurationString(e) {
1483
- if (!e)
1484
- return "—";
1485
- const t = Math.floor(e / 60), a = e % 60;
1486
- return `${t || ""} ${t ? `${t > 1 ? "hours" : "hour"}` : ""} ${a || ""} ${a ? `${a > 1 ? "mins" : "min"}` : ""}`;
1487
- }
1488
- getActionLabelHTML(e) {
1489
- const t = {
1490
- display: "inline-flex",
1491
- alignItems: "center",
1492
- gap: "0.5rem"
1493
- }, a = {
1494
- color: "var(--nylas-error)"
1495
- };
1496
- switch (e) {
1497
- case "preview":
1498
- return n("span", { style: t }, n("eye-icon", { width: "16", height: "16" }), r.t("nylasListConfigurations.previewButtonText"));
1499
- case "copy":
1500
- return n("span", { style: t }, n("copy-icon", { width: "16", height: "16" }), r.t("nylasListConfigurations.copyLinkButtonText"));
1501
- case "delete":
1502
- return n("span", { style: { ...t, ...a } }, n("delete-icon", { width: "15", height: "17" }), r.t("nylasListConfigurations.deleteButtonText"));
1503
- default:
1504
- return "";
1505
- }
1506
- }
1507
- previousPageClickedHandler() {
1508
- if (this.previousCursors.length === 0)
1509
- return;
1510
- this.currentCursor = this.previousCursors.pop() || null;
1511
- const e = this.previousCursors[this.previousCursors.length - 1] || void 0;
1512
- this.initListConfigurations.emit({
1513
- host: this.host,
1514
- cursor: e
1515
- });
1516
- }
1517
- nextPageClickedHandler() {
1518
- this.currentCursor && (this.previousCursors = [...this.previousCursors, this.currentCursor], this.initListConfigurations.emit({
1519
- host: this.host,
1520
- cursor: this.currentCursor
1521
- }));
1522
- }
1523
- render() {
1524
- var e;
1525
- return n(ce, null, n("nylas-notification", null), n("div", { class: "header" }, n("div", { class: "description" }, n("h2", null, r.t("allSchedulingPages")), n("p", null, r.t("createAndManageSchedulingPages"))), this.configurations && this.configurations.length > 0 && n("div", { class: "actions" }, n("button-component", { part: "nlc__create-new-cta", clickHandler: () => {
1526
- this.createButtonClick.emit(this.host);
1527
- } }, r.t("createNewSchedulingPageButtonText")))), n("div", { class: "configurations" }, n("div", { class: "table-container" }, n("table", { class: {
1528
- "no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
1529
- } }, n("tr", { class: {
1530
- hide: this.state === "loading" || this.configurations && this.configurations.length === 0
1531
- } }, n("th", null, r.t("pageTitle")), n("th", null, r.t("durationTitle")), n("th", null)), this.state === "loading" && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("h3", null, r.t("loading"), "..."), n("p", null, r.t("loadingPagesDescription"))))), 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, r.t("noSchedulingPages")), n("p", null, r.t("createFirstSchedulingPage")), n("button-component", { part: "nlc__create-new-cta", clickHandler: () => {
1532
- this.createButtonClick.emit(this.host);
1533
- } }, r.t("createNewSchedulingPageButtonText"))))), this.state !== "loading" && ((e = this.configurations) == null ? void 0 : e.map((t, a) => {
1534
- var o, d, c, p;
1535
- const s = (a === this.configurations.length - 1 || a === this.configurations.length - 2) && this.configurations.length > 3, l = t, i = t;
1536
- return n("tr", { key: t == null ? void 0 : t.id }, n("td", null, n("div", { class: "title" }, n("div", { class: "config-event-title", title: (o = i == null ? void 0 : i.event_booking) == null ? void 0 : o.title }, ((d = i == null ? void 0 : i.event_booking) == null ? void 0 : d.title) || (l == null ? void 0 : l.name)), n("div", { class: "config-event-description" }, (c = i == null ? void 0 : i.event_booking) == null ? void 0 : c.description))), n("td", null, n("div", { class: "duration" }, this.getDurationString((p = i == null ? void 0 : i.availability) == null ? void 0 : p.duration_minutes))), n("td", null, n("div", { class: "actions" }, n("button-component", { class: "edit-button", variant: "basic", key: `edit-${a}`, disabled: this.editButtonLoadingId === `edit-${a}`, isLoading: this.editButtonLoadingId === `edit-${a}`, clickHandler: (h) => {
1537
- h.preventDefault(), this.editButtonLoadingId = `edit-${a}`, this.editButtonClick.emit({ host: this.host, configuration: t });
1538
- } }, this.editButtonLoadingId === `edit-${a}` ? null : n("edit-icon", { width: "16", height: "16" }), r.t("editSchedulingPageButtonText")), n("select-dropdown", { class: {
1539
- last: s
1540
- }, name: "actions", options: [
1541
- { value: `preview-${a}`, label: "Preview", labelHTML: this.getActionLabelHTML("preview") },
1542
- { value: `copy-${a}`, label: "Copy link", labelHTML: this.getActionLabelHTML("copy") },
1543
- { value: `delete-${a}`, label: "Delete", labelHTML: this.getActionLabelHTML("delete") }
1544
- ], defaultSelectedOption: { value: "", label: "" }, dropdownButtonText: "...", withSearch: !1, withChevron: !1, themeConfig: this.themeConfig, exportparts: "sd_dropdown: actions__dropdown, sd_dropdown-button: actions__dropdown-button, sd_dropdown-content: actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete" }))));
1545
- })))), n("div", { class: "pagination" }, n("button", { class: "arrow left", onClick: () => this.previousPageClickedHandler(), disabled: this.previousCursors.length <= 0 }, n("chevron-icon", null)), n("button", { class: "arrow right", onClick: () => this.nextPageClickedHandler(), disabled: this.disableNextPageButton }, n("chevron-icon", null)))), !!this.deleteConfigurationId && n("div", { class: "card-wrapper" }, n("div", { class: "card-modal" }, n("div", { class: "close-button" }, n("button-component", { tooltip: "Close", id: "close", variant: "invisible", onClick: (t) => this.closeModal(t), part: "nfbf__close-button" }, n("close-icon", null))), n("div", { class: "header" }, n("h2", { slot: "card-title", part: "nfbf__title" }, r.t("deleteSchedulingPageTitle"))), n("div", { class: "description title-desc" }, n("p", null, r.t("deleteSchedulingPageDescription"))), n("div", { class: {
1546
- footer: !0
1547
- } }, n("button-component", { variant: "basic", onClick: (t) => this.closeModal(t), part: "nfbf__button-outline nfbf__cancel-cta" }, `${r.t("deleteSchedulingPageCancelButton")}`), n("button-component", { variant: "destructive", onClick: (t) => this.handleConfirmDeleteButtonClicked(t), disabled: this.showDeleteButtonLoading, isLoading: this.showDeleteButtonLoading, part: "nfbf__button-outline nfbf__reschedule-cta" }, `${r.t("deleteSchedulingPageConfirmButton")}`)))));
1548
- }
1549
- get host() {
1550
- return pe(this);
1551
- }
1552
- static get watchers() {
1553
- return {
1554
- listConfigurationsNextCursor: ["listConfigurationsNextCursorChangedHandler"],
1555
- selectedLanguage: ["selectedLanguageChangedHandler"],
1556
- themeConfig: ["themeConfigChangedHandler"]
1557
- };
1558
- }
1559
- };
1560
- wt([
1561
- be({
1562
- name: "nylas-list-configurations",
1563
- stateToProps: /* @__PURE__ */ new Map([
1564
- ["schedulerConfig.configurations", "configurations"],
1565
- ["schedulerConfig.listConfigurationsNextCursor", "listConfigurationsNextCursor"],
1566
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
1567
- ["schedulerConfig.themeConfig", "themeConfig"]
1568
- ]),
1569
- localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
1570
- eventToProps: {
1571
- initListConfigurations: async (e, t) => {
1572
- const { host: a, cursor: s } = e.detail;
1573
- await a.setState("loading");
1574
- const [l, i] = await t.schedulerConfig.getConfigurations(s);
1575
- if (!l && i && i.message) {
1576
- await a.setState("error"), await a.setError({
1577
- message: i.message,
1578
- type: _.Error,
1579
- category: v.Component,
1580
- title: r.t("nylasEditorTabs.getConfigsError")
1581
- });
1582
- return;
1583
- }
1584
- await a.setState("loaded");
1585
- },
1586
- createButtonClick: async (e, t) => {
1587
- t.schedulerConfigStore.resetSelectedConfiguration();
1588
- const a = Object.entries(t.schedulerConfigStore.state.enableEventTypes || {}).filter(([s, l]) => l);
1589
- a.length === 1 ? (t.schedulerConfigStore.state.action = "create", t.schedulerConfigStore.state.selectedEventType = I[a[0][0]]) : t.schedulerConfigStore.state.action = "create-select";
1590
- },
1591
- deleteButtonClick: async (e, t) => {
1592
- const { host: a, configuration: s } = e.detail, [l, i] = await t.schedulerConfig.deleteConfiguration(s.id);
1593
- !l && i && i.message && (await a.setState("error"), await a.setError({
1594
- message: i.message,
1595
- type: _.Error,
1596
- category: v.Component,
1597
- title: r.t("nylasEditorTabs.deleteConfigError")
1598
- })), await a.hideDeleteConfirmation();
1599
- },
1600
- editButtonClick: async (e, t) => {
1601
- const { host: a, configuration: s } = e.detail;
1602
- if (s.type === "group") {
1603
- const { startTime: l, endTime: i } = at((/* @__PURE__ */ new Date()).toISOString(), "week");
1604
- t.schedulerConfigStore.state.calendarViewDateRange = {
1605
- start_time: l.toString(),
1606
- end_time: i.toString()
1607
- };
1608
- const [o, d] = await t.schedulerConfig.getGroupEvents(s.id, s);
1609
- if (!o && d && d.message) {
1610
- await a.setError({
1611
- message: d.message,
1612
- type: _.Error,
1613
- category: v.Component,
1614
- title: r.t("nylasEditorTabsGroup.getGroupEventsError")
1615
- }), a.hideEditButtonLoading();
1616
- return;
1617
- }
1618
- }
1619
- t.schedulerConfigStore.state.action = "edit", t.schedulerConfigStore.state.selectedConfiguration = s, a.hideEditButtonLoading();
1620
- }
1621
- },
1622
- fireRegisterEvent: !0
1623
- }),
1624
- fe("design:type", Function),
1625
- fe("design:paramtypes", []),
1626
- fe("design:returntype", void 0)
1627
- ], Qe.prototype, "render", null);
1628
- Qe.style = Ct;
1629
- const kt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-select-event-type{height:inherit;overflow-y:auto}.nylas-select-event-type div.header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--nylas-base-200)}.nylas-select-event-type div.header h2{font-size:18px;padding:0 24px;line-height:24px;margin:0;font-weight:600;color:var(--nylas-base-800)}.nylas-select-event-type div.header button-component button{background:transparent;border:none;cursor:pointer}.nylas-select-event-type div.header button-component button:hover,.nylas-select-event-type div.header button-component button:active{color:var(--nylas-primary);background-color:transparent}.nylas-select-event-type div.header button-component button:disabled{cursor:not-allowed}.nylas-select-event-type div.content{padding:40px}.nylas-select-event-type div.content h3{margin:0 0 32px 0;font-size:18px;line-height:24px;font-weight:600}.nylas-select-event-type div.content div.event-type{display:flex;flex-direction:column;gap:8px}.nylas-select-event-type div.content div.event-type div.event-type-option{padding:16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-3x);width:inherit;cursor:pointer;display:flex;flex-direction:column;gap:8px}.nylas-select-event-type div.content div.event-type div.event-type-option h4{margin:0;font-size:16px;line-height:24px;font-weight:600;color:var(--nylas-base-900)}.nylas-select-event-type div.content div.event-type div.event-type-option p{margin:0;font-size:14px;line-height:21px;font-weight:400;color:var(--nylas-base-800)}', xt = kt;
1630
- var Et = function(e, t, a, s) {
1631
- var l = arguments.length, i = l < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, o;
1632
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1633
- i = Reflect.decorate(e, t, a, s);
1634
- else
1635
- for (var d = e.length - 1; d >= 0; d--)
1636
- (o = e[d]) && (i = (l < 3 ? o(i) : l > 3 ? o(t, a, i) : o(t, a)) || i);
1637
- return l > 3 && i && Object.defineProperty(t, a, i), i;
1638
- }, me = function(e, t) {
1639
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1640
- return Reflect.metadata(e, t);
1641
- };
1642
- const Xe = class {
1643
- constructor(e) {
1644
- te(this, e), this.returnToAllSchedulingPagesEvent = m(this, "returnToAllSchedulingPagesEvent", 7), this.createEventTypeSelected = m(this, "createEventTypeSelected", 7), this.participantOptions = void 0, this.name = "select-event-type", this.selectedLanguage = void 0, this.enableEventTypes = {
1645
- one_on_one: !0,
1646
- collective: !0,
1647
- max_fairness: !0,
1648
- max_availability: !0,
1649
- group: !0
1650
- }, this.themeConfig = void 0;
1651
- }
1652
- connectedCallback() {
1653
- b("nylas-select-event-type", "connectedCallback");
1654
- }
1655
- disconnectedCallback() {
1656
- b("nylas-select-event-type", "disconnectedCallback");
1657
- }
1658
- componentWillLoad() {
1659
- b("nylas-select-event-type", "componentWillLoad"), this.host.setAttribute("name", this.name);
1660
- }
1661
- componentDidLoad() {
1662
- b("nylas-select-event-type", "componentDidLoad");
1663
- }
1664
- elementNameChangedHandler(e) {
1665
- b("nylas-select-event-type", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1666
- }
1667
- selectedLanguageChangedHandler(e, t) {
1668
- e !== t && r.changeLanguage(e);
1669
- }
1670
- themeConfigChangedHandler(e, t) {
1671
- e !== t && this.applyThemeConfig(e);
1672
- }
1673
- applyThemeConfig(e) {
1674
- if (e)
1675
- for (const [t, a] of Object.entries(e))
1676
- this.host.style.setProperty(`${t}`, a);
1677
- }
1678
- render() {
1679
- var i;
1680
- const e = {
1681
- "one-on-one": "one_on_one",
1682
- collective: "collective",
1683
- "max-fairness": "max_fairness",
1684
- "max-availability": "max_availability",
1685
- group: "group"
1686
- }, t = [
1687
- {
1688
- label: r.t("nylasSelectEventType.eventTypeOptions.oneOnOne.label"),
1689
- value: I.one_on_one,
1690
- description: r.t("nylasSelectEventType.eventTypeOptions.oneOnOne.desc")
1691
- },
1692
- {
1693
- label: r.t("nylasSelectEventType.eventTypeOptions.collective.label"),
1694
- value: I.collective,
1695
- description: r.t("nylasSelectEventType.eventTypeOptions.collective.desc")
1696
- },
1697
- {
1698
- label: r.t("nylasSelectEventType.eventTypeOptions.maxFairness.label"),
1699
- value: I.max_fairness,
1700
- description: r.t("nylasSelectEventType.eventTypeOptions.maxFairness.desc")
1701
- },
1702
- {
1703
- label: r.t("nylasSelectEventType.eventTypeOptions.maxAvailability.label"),
1704
- value: I.max_availability,
1705
- description: r.t("nylasSelectEventType.eventTypeOptions.maxAvailability.desc")
1706
- },
1707
- {
1708
- label: r.t("nylasSelectEventType.eventTypeOptions.group.label"),
1709
- value: I.group,
1710
- description: r.t("nylasSelectEventType.eventTypeOptions.group.desc")
1711
- }
1712
- ], a = [I.collective, I.max_availability, I.max_fairness], s = this.participantOptions && ((i = this.participantOptions) == null ? void 0 : i.length) > 0 && !!this.participantOptions[0].email && !!this.participantOptions[0].name && !!this.participantOptions[0].calendars && this.participantOptions[0].calendars.length > 0, l = this.enableEventTypes ? t.filter((o) => {
1713
- const d = o.value, c = e[d];
1714
- return console.log("key", d, this.enableEventTypes ? this.enableEventTypes[c] : "no enableEventTypes"), a.includes(d) && !s ? !1 : this.enableEventTypes && this.enableEventTypes[c];
1715
- }) : t;
1716
- return n(ce, null, n("div", { class: "nylas-select-event-type", part: "nset" }, n("div", { class: "header", part: "nset__header" }, n("h2", null, r.t("nylasSelectEventType.createEventHeaderTitle")), n("button-component", { variant: "invisible", part: "nset__header__back-button", onClick: (o) => {
1717
- this.returnToAllSchedulingPagesEvent.emit();
1718
- } }, n("chevron-icon", { width: "16", height: "16" }), n("span", null, r.t("nylasSelectEventType.returnToAllSchedulingPages")))), n("div", { class: "content", part: "nset__content" }, n("h3", null, r.t("nylasSelectEventType.eventTypeHeaderTitle")), n("div", { class: "event-type", part: "nset__content__event-type" }, l.length === 0 && n("p", null, r.t("nylasSelectEventType.noEventTypesEnabled")), l.map((o) => n("div", { class: "event-type-option", onClick: (d) => {
1719
- this.createEventTypeSelected.emit({ eventType: o.value });
1720
- }, part: `nset__content__event-type-option-${o.value}` }, n("h4", null, o.label), n("p", null, o.description)))))));
1721
- }
1722
- get host() {
1723
- return pe(this);
1724
- }
1725
- static get watchers() {
1726
- return {
1727
- name: ["elementNameChangedHandler"],
1728
- selectedLanguage: ["selectedLanguageChangedHandler"],
1729
- themeConfig: ["themeConfigChangedHandler"]
1730
- };
1731
- }
1732
- };
1733
- Et([
1734
- be({
1735
- name: "nylas-select-event-type",
1736
- stateToProps: /* @__PURE__ */ new Map([
1737
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
1738
- ["schedulerConfig.additionalParticipants", "participantOptions"],
1739
- ["schedulerConfig.enableEventTypes", "enableEventTypes"],
1740
- ["schedulerConfig.themeConfig", "themeConfig"]
1741
- ]),
1742
- eventToProps: {
1743
- returnToAllSchedulingPagesEvent: async (e, t) => {
1744
- t.schedulerConfigStore.state.action = null, t.schedulerConfigStore.set("selectedEventType", void 0);
1745
- },
1746
- createEventTypeSelected: async (e, t) => {
1747
- const { eventType: a } = e.detail;
1748
- t.schedulerConfigStore.state.action = "create", t.schedulerConfigStore.state.selectedEventType = a;
1749
- }
1750
- },
1751
- fireRegisterEvent: !0
1752
- }),
1753
- me("design:type", Function),
1754
- me("design:paramtypes", []),
1755
- me("design:returntype", void 0)
1756
- ], Xe.prototype, "render", null);
1757
- Xe.style = xt;
1758
- export {
1759
- lt as google_logo_icon,
1760
- pt as microsoft_logo_icon,
1761
- Ke as nylas_editor_tabs,
1762
- Ye as nylas_editor_tabs_group,
1763
- Qe as nylas_list_configurations,
1764
- Xe as nylas_select_event_type
1765
- };