@nylas/react 1.1.3 → 1.1.5

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 (173) hide show
  1. package/dist/add-circle-icon_2.entry-1e899552.js +25 -0
  2. package/dist/add-circle-icon_2.entry-31acee1d.cjs +1 -0
  3. package/dist/archive-icon.entry-b5f307e8.js +15 -0
  4. package/dist/archive-icon.entry-e932c9e6.cjs +1 -0
  5. package/dist/arrow-icon.entry-aae2e22d.js +15 -0
  6. package/dist/{arrow-icon.entry-2dfd8319.cjs → arrow-icon.entry-e35a6cad.cjs} +1 -1
  7. package/dist/bold-icon.entry-1e3c9b1f.cjs +1 -0
  8. package/dist/bold-icon.entry-d5d86b3f.js +15 -0
  9. package/dist/{button-component_2.entry-697bf5ac.js → button-component_2.entry-5284316e.js} +6 -6
  10. package/dist/{button-component_2.entry-27a504d9.cjs → button-component_2.entry-a86f8dca.cjs} +1 -1
  11. package/dist/{calendar-agenda-fill-icon_51.entry-52b5bf31.js → calendar-agenda-fill-icon_54.entry-5672c589.js} +1944 -1639
  12. package/dist/calendar-agenda-fill-icon_54.entry-702b29cc.cjs +10 -0
  13. package/dist/{calendar-cancel-icon.entry-e6a433a2.js → calendar-cancel-icon.entry-7f81de9d.js} +4 -4
  14. package/dist/{calendar-cancel-icon.entry-c6e2eed6.cjs → calendar-cancel-icon.entry-e9792eaa.cjs} +1 -1
  15. package/dist/{calendar-check-icon_2.entry-d88307d6.js → calendar-check-icon_2.entry-84db1700.js} +3 -3
  16. package/dist/{calendar-check-icon_2.entry-45cad6f1.cjs → calendar-check-icon_2.entry-ad055b37.cjs} +1 -1
  17. package/dist/{calendar-icon.entry-b2fffd21.cjs → calendar-icon.entry-019f7feb.cjs} +1 -1
  18. package/dist/{calendar-icon.entry-2badc962.js → calendar-icon.entry-45db1630.js} +4 -4
  19. package/dist/{checkbox-component_2.entry-3926b644.cjs → checkbox-component_2.entry-8325ff88.cjs} +1 -1
  20. package/dist/{checkbox-component_2.entry-5ab55050.js → checkbox-component_2.entry-84a053ff.js} +3 -3
  21. package/dist/{chevron-icon_3.entry-1fe5d097.cjs → chevron-icon_3.entry-0edde2a6.cjs} +1 -1
  22. package/dist/{chevron-icon_3.entry-664fae5d.js → chevron-icon_3.entry-ec894a13.js} +4 -4
  23. package/dist/{clock-icon_4.entry-f11f9dad.js → clock-icon_4.entry-8ec9c29b.js} +15 -15
  24. package/dist/{clock-icon_4.entry-efec2c08.cjs → clock-icon_4.entry-935fe48d.cjs} +1 -1
  25. package/dist/constants-c549b12b-7ea4c7f5.js +763 -0
  26. package/dist/constants-c549b12b-c85413b1.cjs +1 -0
  27. package/dist/copy-icon.entry-5a2030da.cjs +1 -0
  28. package/dist/{copy-icon.entry-70131e8e.js → copy-icon.entry-d9405510.js} +6 -6
  29. package/dist/{delete-icon.entry-e003695d.js → delete-icon.entry-1b0a3ba4.js} +4 -4
  30. package/dist/{delete-icon.entry-5d067fef.cjs → delete-icon.entry-3f3d1ffb.cjs} +1 -1
  31. package/dist/document-refresh-icon.entry-59a18097.cjs +1 -0
  32. package/dist/document-refresh-icon.entry-fab58d33.js +15 -0
  33. package/dist/elements/index.d.ts +0 -11
  34. package/dist/feedbackSync-b56b29ed-7a1f1f75.js +6035 -0
  35. package/dist/feedbackSync-b56b29ed-b6f352f3.cjs +448 -0
  36. package/dist/folder-icon.entry-b5a123d0.js +15 -0
  37. package/dist/folder-icon.entry-e85383b6.cjs +1 -0
  38. package/dist/forward-icon.entry-7c8ed4c3.cjs +1 -0
  39. package/dist/forward-icon.entry-88ab1a85.js +15 -0
  40. package/dist/{globe-icon.entry-6fc456c7.js → globe-icon.entry-6fb414ca.js} +5 -5
  41. package/dist/{globe-icon.entry-8c3c9e48.cjs → globe-icon.entry-b1253516.cjs} +1 -1
  42. package/dist/google-logo-icon_4.entry-ae09d065.cjs +1 -0
  43. package/dist/{google-logo-icon_4.entry-d6e0c4c0.js → google-logo-icon_4.entry-fe627741.js} +221 -207
  44. package/dist/inbox-icon.entry-7dce836e.cjs +1 -0
  45. package/dist/inbox-icon.entry-cec35da1.js +15 -0
  46. package/dist/{index-a282e817.js → index-3fd31877.js} +4194 -4123
  47. package/dist/index-bd6fdc8c.cjs +81 -0
  48. package/dist/index.d.ts +1 -1
  49. package/dist/{index.es-ab9affcc-18263b66.cjs → index.es-c7ca1bad-0a324dca.cjs} +5 -5
  50. package/dist/{index.es-ab9affcc-30461b18.js → index.es-c7ca1bad-b895d84b.js} +125 -131
  51. package/dist/{info-icon_2.entry-e582ac10.cjs → info-icon_2.entry-1dab6311.cjs} +1 -1
  52. package/dist/{info-icon_2.entry-d20b975c.js → info-icon_2.entry-f7e6b4aa.js} +3 -3
  53. package/dist/{input-color-picker.entry-27f4288f.js → input-color-picker.entry-30cda4e2.js} +3 -3
  54. package/dist/{input-color-picker.entry-c6a28671.cjs → input-color-picker.entry-b6e53c29.cjs} +1 -1
  55. package/dist/{input-component.entry-744fcec1.cjs → input-component.entry-1f1f8e00.cjs} +1 -1
  56. package/dist/{input-component.entry-b6f1c417.js → input-component.entry-7a04bc8b.js} +3 -3
  57. package/dist/{input-dropdown.entry-f13234d7.cjs → input-dropdown.entry-5e5b67be.cjs} +1 -1
  58. package/dist/{input-dropdown.entry-18744def.js → input-dropdown.entry-abf134a8.js} +2 -2
  59. package/dist/italic-icon.entry-4631c594.js +15 -0
  60. package/dist/italic-icon.entry-c793243b.cjs +1 -0
  61. package/dist/{multi-select-dropdown.entry-dde671d7.cjs → multi-select-dropdown.entry-2b8728d5.cjs} +1 -1
  62. package/dist/{multi-select-dropdown.entry-924809e1.js → multi-select-dropdown.entry-9a93da56.js} +2 -2
  63. package/dist/nylas-booked-event-card_12.entry-8d502a3c.cjs +1 -0
  64. package/dist/{nylas-booked-event-card_12.entry-52c3111d.js → nylas-booked-event-card_12.entry-f13f3f54.js} +294 -288
  65. package/dist/{nylas-form-card.entry-b0a2403f.js → nylas-form-card.entry-862519b4.js} +20 -20
  66. package/dist/nylas-form-card.entry-af179b96.cjs +1 -0
  67. package/dist/{nylas-if-state.entry-523fdc6b.js → nylas-if-state.entry-8803a762.js} +3 -3
  68. package/dist/{nylas-if-state.entry-53883c36.cjs → nylas-if-state.entry-c1c1282d.cjs} +1 -1
  69. package/dist/{nylas-login.entry-d9bf3974.js → nylas-login.entry-3e12f747.js} +3 -3
  70. package/dist/{nylas-login.entry-05e1df3e.cjs → nylas-login.entry-65f8f046.cjs} +1 -1
  71. package/dist/nylas-provider.entry-9626b113.cjs +1 -0
  72. package/dist/nylas-provider.entry-e3501bd1.js +264 -0
  73. package/dist/{nylas-scheduler-editor.entry-1a2f3ee0.cjs → nylas-scheduler-editor.entry-17cd1514.cjs} +2 -2
  74. package/dist/{nylas-scheduler-editor.entry-b434b526.js → nylas-scheduler-editor.entry-6df45b05.js} +25 -25
  75. package/dist/{nylas-scheduling.entry-b71080c8.js → nylas-scheduling.entry-08051ba3.js} +136 -124
  76. package/dist/nylas-scheduling.entry-b1fafd91.cjs +1 -0
  77. package/dist/{nylas-time-window-picker.entry-a6d1c648.cjs → nylas-time-window-picker.entry-4989d421.cjs} +1 -1
  78. package/dist/{nylas-time-window-picker.entry-c1ee860a.js → nylas-time-window-picker.entry-bdc8c6ea.js} +16 -16
  79. package/dist/{person-icon.entry-8833e3cc.js → person-icon.entry-d62a16b4.js} +2 -2
  80. package/dist/{person-icon.entry-80c9022e.cjs → person-icon.entry-fb7efa8f.cjs} +1 -1
  81. package/dist/play-icon.entry-01b95392.js +15 -0
  82. package/dist/play-icon.entry-f485a2c8.cjs +1 -0
  83. package/dist/react.cjs +1 -1
  84. package/dist/react.js +92 -103
  85. package/dist/{refresh-icon.entry-4d6791bd.js → refresh-icon.entry-1ff4b39f.js} +4 -4
  86. package/dist/{refresh-icon.entry-d4cc16b7.cjs → refresh-icon.entry-5f997e86.cjs} +1 -1
  87. package/dist/{register-component-a7ea27ad-fa2c4b17.js → register-component-3444af44-854971ad.js} +1 -1
  88. package/dist/{register-component-a7ea27ad-2343f3df.cjs → register-component-3444af44-9053e8c3.cjs} +1 -1
  89. package/dist/reply-all-icon.entry-1dad6514.cjs +1 -0
  90. package/dist/reply-all-icon.entry-cbafb8a0.js +15 -0
  91. package/dist/reply-icon.entry-162d9945.cjs +1 -0
  92. package/dist/reply-icon.entry-a43bc252.js +15 -0
  93. package/dist/{scheduler-config-store-2a3b403d-5176cd45.js → scheduler-config-store-ed4a8dfd-22db9285.js} +1 -2
  94. package/dist/scheduler-config-store-ed4a8dfd-eeaeaa50.cjs +1 -0
  95. package/dist/{scheduler-store-33ab8dea-9801357a.js → scheduler-store-d4784b24-9a5f5734.js} +134 -126
  96. package/dist/scheduler-store-d4784b24-aed474e8.cjs +1 -0
  97. package/dist/sent-icon.entry-a05486d5.js +15 -0
  98. package/dist/sent-icon.entry-a1aec7e9.cjs +1 -0
  99. package/dist/spam-icon.entry-473f11af.js +15 -0
  100. package/dist/spam-icon.entry-b481a04b.cjs +1 -0
  101. package/dist/star-icon.entry-12fdc345.js +15 -0
  102. package/dist/star-icon.entry-6b1fe3cf.cjs +1 -0
  103. package/dist/stop-icon.entry-4bd609f7.js +15 -0
  104. package/dist/stop-icon.entry-72481153.cjs +1 -0
  105. package/dist/{textarea-component.entry-174089bc.js → textarea-component.entry-47e1b2e6.js} +2 -2
  106. package/dist/{textarea-component.entry-019e75d0.cjs → textarea-component.entry-f330a755.cjs} +1 -1
  107. package/dist/{time-period-selector.entry-62c854d1.js → time-period-selector.entry-a4899368.js} +4 -4
  108. package/dist/{time-period-selector.entry-8466d0f2.cjs → time-period-selector.entry-c7611563.cjs} +1 -1
  109. package/dist/{translate-icon.entry-7d5cf4b8.cjs → translate-icon.entry-40dfa8c9.cjs} +1 -1
  110. package/dist/{translate-icon.entry-73f7127b.js → translate-icon.entry-4517838d.js} +2 -2
  111. package/dist/trash-fill-icon.entry-86ca3055.cjs +1 -0
  112. package/dist/trash-fill-icon.entry-d7e960eb.js +15 -0
  113. package/dist/underline-icon.entry-352970f5.js +15 -0
  114. package/dist/underline-icon.entry-f16d4943.cjs +1 -0
  115. package/dist/{warning-icon.entry-abf896c3.js → warning-icon.entry-63987dad.js} +5 -5
  116. package/dist/{warning-icon.entry-92638eeb.cjs → warning-icon.entry-79ef75b2.cjs} +1 -1
  117. package/package.json +3 -3
  118. package/dist/add-circle-icon_2.entry-b77120e5.cjs +0 -1
  119. package/dist/add-circle-icon_2.entry-fbc1e82b.js +0 -25
  120. package/dist/archive-icon_7.entry-30962e70.js +0 -75
  121. package/dist/archive-icon_7.entry-dd8c7642.cjs +0 -1
  122. package/dist/arrow-icon.entry-5b436054.js +0 -15
  123. package/dist/bold-icon_3.entry-5120a9c8.js +0 -35
  124. package/dist/bold-icon_3.entry-da2d1270.cjs +0 -1
  125. package/dist/calendar-agenda-fill-icon_51.entry-a25262b3.cjs +0 -7
  126. package/dist/constants-50c3e067-33cf0ffe.js +0 -3883
  127. package/dist/constants-50c3e067-5ec3f879.cjs +0 -15
  128. package/dist/copy-icon.entry-3965f206.cjs +0 -1
  129. package/dist/document-refresh-icon.entry-30c974df.cjs +0 -1
  130. package/dist/document-refresh-icon.entry-b4e01cd4.js +0 -15
  131. package/dist/elements-dc5b338e-55823d00.js +0 -28031
  132. package/dist/elements-dc5b338e-6883a39e.cjs +0 -16516
  133. package/dist/feedbackSync-81d4c4d8-dd4d2e32.js +0 -11735
  134. package/dist/feedbackSync-81d4c4d8-f4e78902.cjs +0 -455
  135. package/dist/flow-40ff9cea-6f8c30e2.cjs +0 -9
  136. package/dist/flow-40ff9cea-ee70fdf5.js +0 -505
  137. package/dist/focus-visible-e8093c16-431bbe59.cjs +0 -1
  138. package/dist/focus-visible-e8093c16-f403fee8.js +0 -84
  139. package/dist/forward-icon_6.entry-3bb91d58.js +0 -953
  140. package/dist/forward-icon_6.entry-ceec2371.cjs +0 -3
  141. package/dist/google-logo-icon_4.entry-4eb16cd2.cjs +0 -1
  142. package/dist/index-11f33e47.cjs +0 -82
  143. package/dist/mailbox-store-affca6de-9451094e.cjs +0 -1
  144. package/dist/mailbox-store-affca6de-d601dc6b.js +0 -380
  145. package/dist/nylas-booked-event-card_12.entry-d89c1f9d.cjs +0 -1
  146. package/dist/nylas-form-card.entry-ab61fdc5.cjs +0 -1
  147. package/dist/nylas-list-folders.entry-4ef6cb3d.cjs +0 -1
  148. package/dist/nylas-list-folders.entry-e37d069f.js +0 -120
  149. package/dist/nylas-list-threads.entry-3be623e9.cjs +0 -1
  150. package/dist/nylas-list-threads.entry-8ba62db8.js +0 -70
  151. package/dist/nylas-mailbox-pagination.entry-3dd05cf4.cjs +0 -1
  152. package/dist/nylas-mailbox-pagination.entry-50d9d9e3.js +0 -101
  153. package/dist/nylas-mailbox-toolbar-button.entry-9a77d137.js +0 -82
  154. package/dist/nylas-mailbox-toolbar-button.entry-d87b55de.cjs +0 -1
  155. package/dist/nylas-mailbox.entry-cb7d1031.js +0 -134
  156. package/dist/nylas-mailbox.entry-f7db9aa8.cjs +0 -1
  157. package/dist/nylas-provider.entry-1716bf48.cjs +0 -1
  158. package/dist/nylas-provider.entry-7aa46ea2.js +0 -145
  159. package/dist/nylas-reminder-emails.entry-88a862cd.cjs +0 -4
  160. package/dist/nylas-reminder-emails.entry-a86231b7.js +0 -129
  161. package/dist/nylas-reminder-time_2.entry-9589d5f2.js +0 -105
  162. package/dist/nylas-reminder-time_2.entry-bc76d4ab.cjs +0 -1
  163. package/dist/nylas-scheduling.entry-59e5e8c1.cjs +0 -1
  164. package/dist/nylas-threads-refresh.entry-544ca90a.js +0 -74
  165. package/dist/nylas-threads-refresh.entry-7ada7b2d.cjs +0 -1
  166. package/dist/nylas-threads-search.entry-181ba46a.js +0 -69
  167. package/dist/nylas-threads-search.entry-f1cb19e4.cjs +0 -1
  168. package/dist/nylas-view-thread.entry-6ae8dd64.cjs +0 -1
  169. package/dist/nylas-view-thread.entry-c066f522.js +0 -203
  170. package/dist/play-icon_2.entry-801c85bc.cjs +0 -1
  171. package/dist/play-icon_2.entry-efca8f00.js +0 -25
  172. package/dist/scheduler-config-store-2a3b403d-2263f999.cjs +0 -1
  173. package/dist/scheduler-store-33ab8dea-a0b39d36.cjs +0 -1
@@ -1,4 +1,4 @@
1
- import { e as i } from "./index-a282e817.js";
1
+ import { a as i } from "./index-3fd31877.js";
2
2
  function s(n = {}) {
3
3
  const o = {
4
4
  selectedConfiguration: {},
@@ -8,7 +8,6 @@ function s(n = {}) {
8
8
  currentUser: null,
9
9
  action: null,
10
10
  additionalParticipants: [],
11
- hideEditorTabs: [],
12
11
  requiresSlug: !1,
13
12
  ...n
14
13
  }, e = i(o);
@@ -0,0 +1 @@
1
+ "use strict";const o=require("./index-bd6fdc8c.cjs");function s(n={}){const r={selectedConfiguration:{},configurations:[],listConfigurationsNextCursor:null,calendars:[],currentUser:null,action:null,additionalParticipants:[],requiresSlug:!1,...n},e=o.createStore(r);function t(){e.set("selectedConfiguration",{...n.selectedConfiguration})}return e.onChange("action",async i=>{i||t()}),{...e,resetSelectedConfiguration:t}}exports.CreateNylasSchedulerConfigStore=s;
@@ -1,20 +1,20 @@
1
- import { d as b, e as $, k as d, m as R } from "./index-a282e817.js";
2
- var w;
1
+ import { d as L, a as F, i as c, j as R } from "./index-3fd31877.js";
2
+ var B;
3
3
  (function(a) {
4
4
  a.Component = "component", a.Api = "api", a.Auth = "auth";
5
- })(w || (w = {}));
6
- var D;
5
+ })(B || (B = {}));
6
+ var M;
7
7
  (function(a) {
8
8
  a.endtime_not_in_future = "endtime_not_in_future", a.no_booking_info = "no_booking_info", a.no_timeslot_selected = "no_timeslot_selected", a.no_timezone_selected = "no_timezone_selected", a.no_booking_id = "no_booking_id", a.no_salt = "no_salt", a.invalid_start_time = "invalid_start_time", a.invalid_end_time = "invalid_end_time", a.invalid_timezone = "invalid_timezone";
9
- })(D || (D = {}));
10
- var A;
9
+ })(M || (M = {}));
10
+ var P;
11
11
  (function(a) {
12
12
  a.invalid_session = "invalid_session", a.general_error = "general_error", a.internal_error = "internal_error", a.invalid_request_error = "invalid_request_error", a.timeslot_not_available = "timeslot_not_available", a.provider_error = "provider_error", a.not_found_error = "not_found_error";
13
- })(A || (A = {}));
13
+ })(P || (P = {}));
14
14
  class C {
15
15
  constructor() {
16
16
  this.component = (e) => {
17
- const t = w.Component, s = `${e} Error`;
17
+ const t = B.Component, s = `${e} Error`;
18
18
  return {
19
19
  endtime_not_in_future: (i = '"endtime" can not be in the future') => ({
20
20
  title: s,
@@ -63,7 +63,7 @@ class C {
63
63
  })
64
64
  };
65
65
  }, this.api = (e) => {
66
- const t = w.Api, s = `${e} Error`;
66
+ const t = B.Api, s = `${e} Error`;
67
67
  return {
68
68
  invalid_session: (i) => ({
69
69
  title: s,
@@ -104,7 +104,7 @@ class C {
104
104
  };
105
105
  }
106
106
  }
107
- class U {
107
+ class O {
108
108
  constructor({ schedulerAPIURL: e, schedulerStore: t, sessionId: s, configId: i, slug: n, clientId: r }) {
109
109
  this.errors = new C(), this.schedulerStore = t, this.schedulerAPIURL = e, this.sessionId = s, this.configId = i, this.slug = n, this.clientId = r;
110
110
  }
@@ -153,7 +153,7 @@ class U {
153
153
  this.schedulerStore.set("selectedTimezone", e);
154
154
  }
155
155
  selectLanguage(e) {
156
- this.schedulerStore.set("selectedLanguage", e), d.changeLanguage(e);
156
+ this.schedulerStore.set("selectedLanguage", e), c.changeLanguage(e);
157
157
  }
158
158
  async toggleAdditionalData(e) {
159
159
  e || await this.refetchAvailability(), this.schedulerStore.set("showBookingForm", e);
@@ -212,48 +212,52 @@ class U {
212
212
  return this.schedulerStore.set("organizerConfirmationBookingId", ""), this.schedulerStore.set("confirmedEventInfo", void 0), e;
213
213
  }
214
214
  async bookTimeslot(e) {
215
- var v;
215
+ var I;
216
216
  this.schedulerStore.set("isLoading", !0);
217
217
  const { selectedTimeslot: t, selectedTimezone: s, bookingInfo: i, selectedLanguage: n } = this.schedulerStore.state;
218
218
  if (!e && !i)
219
- return { error: this.errors.component(d.t("createBookingErrorTitle")).no_booking_info() };
219
+ return { error: this.errors.component(c.t("createBookingErrorTitle")).no_booking_info() };
220
220
  const r = (e == null ? void 0 : e.timeslot) || t;
221
221
  if (!r)
222
- return { error: this.errors.component(d.t("createBookingErrorTitle")).no_timeslot_selected() };
223
- const o = e && (e != null && e.timezone) ? e == null ? void 0 : e.timezone : s;
222
+ return { error: this.errors.component(c.t("createBookingErrorTitle")).no_timeslot_selected() };
223
+ const o = e && (e != null && e.timezone) ? e == null ? void 0 : e.timezone : s, m = n || "en-US";
224
224
  if (!o)
225
- return { error: this.errors.component(d.t("createBookingErrorTitle")).no_timezone_selected() };
226
- const u = this.schedulerStore.get("availabilityOrderEmails");
227
- let m = "";
228
- if (u.length > 0) {
229
- const S = (r == null ? void 0 : r.emails) || [];
230
- for (let h = 0; h < u.length; h++)
231
- if (S.includes(u[h])) {
232
- m = u[h];
225
+ return { error: this.errors.component(c.t("createBookingErrorTitle")).no_timezone_selected() };
226
+ const h = this.schedulerStore.get("availabilityOrderEmails");
227
+ let l = "";
228
+ if (h.length > 0) {
229
+ const k = (r == null ? void 0 : r.emails) || [];
230
+ for (let f = 0; f < h.length; f++)
231
+ if (k.includes(h[f])) {
232
+ l = h[f];
233
233
  break;
234
234
  }
235
235
  }
236
- const c = e ? e == null ? void 0 : e.primaryParticipant : i == null ? void 0 : i.primaryParticipant, g = e ? (e == null ? void 0 : e.guests) || [] : (i == null ? void 0 : i.guests) || [], f = e ? e == null ? void 0 : e.additionalFields : i == null ? void 0 : i.additionalFields, _ = this.getHeaders(), I = `/v3/scheduling/bookings${!this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : ""}`, l = await this.makeAPIRequest(decodeURIComponent(I), "POST", JSON.stringify({
237
- participants: m ? [{ email: m }] : void 0,
238
- additional_fields: f,
239
- additional_guests: g,
240
- guest: { ...c },
236
+ const d = {};
237
+ Object.entries((i == null ? void 0 : i.additionalFields) || {}).forEach(([k, f]) => {
238
+ d[k] = f.value;
239
+ });
240
+ const _ = e ? e == null ? void 0 : e.primaryParticipant : i == null ? void 0 : i.primaryParticipant, S = e ? (e == null ? void 0 : e.guests) || [] : (i == null ? void 0 : i.guests) || [], p = e ? e == null ? void 0 : e.additionalFields : d, T = this.getHeaders(), v = `/v3/scheduling/bookings${!this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : ""}`, u = await this.makeAPIRequest(decodeURIComponent(v), "POST", JSON.stringify({
241
+ participants: l ? [{ email: l }] : void 0,
242
+ additional_fields: p,
243
+ additional_guests: S,
244
+ guest: { ..._ },
241
245
  start_time: r.start_time.getTime() / 1e3,
242
246
  end_time: r.end_time.getTime() / 1e3,
243
247
  timezone: o,
244
- email_language: this.getTwoLetterLanguageCode(n)
245
- }), _);
246
- if ("error" in l) {
248
+ email_language: this.getTwoLetterLanguageCode(m)
249
+ }), T);
250
+ if ("error" in u) {
247
251
  this.schedulerStore.set("isLoading", !1);
248
- const S = (v = l.error) == null ? void 0 : v.type;
249
- let h = l.error;
250
- if (S && S in this.errors.api("Create Booking")) {
251
- const L = this.getErrorMessage(h);
252
- h = this.errors.api("Create Booking")[S](L);
252
+ const k = (I = u.error) == null ? void 0 : I.type;
253
+ let f = u.error;
254
+ if (k && k in this.errors.api("Create Booking")) {
255
+ const E = this.getErrorMessage(f);
256
+ f = this.errors.api("Create Booking")[k](E);
253
257
  }
254
- return { error: h };
258
+ return { error: f };
255
259
  }
256
- return "data" in l && this.schedulerStore.set("eventInfo", l == null ? void 0 : l.data), this.schedulerStore.set("isLoading", !1), l;
260
+ return "data" in u && this.schedulerStore.set("eventInfo", u == null ? void 0 : u.data), this.schedulerStore.set("isLoading", !1), u;
257
261
  }
258
262
  async getUISettings() {
259
263
  var n;
@@ -263,7 +267,7 @@ class U {
263
267
  this.schedulerStore.set("isLoading", !1);
264
268
  const r = (n = i.error) == null ? void 0 : n.type;
265
269
  let o = i.error;
266
- return r && r in this.errors.api(d.t("getUISettingErrorTitle")) && (o = this.errors.api(d.t("getUISettingErrorTitle"))[r]((o == null ? void 0 : o.message) || (o == null ? void 0 : o.title) || "Something went wrong")), { error: o };
270
+ return r && r in this.errors.api(c.t("getUISettingErrorTitle")) && (o = this.errors.api(c.t("getUISettingErrorTitle"))[r]((o == null ? void 0 : o.message) || (o == null ? void 0 : o.title) || "Something went wrong")), { error: o };
267
271
  }
268
272
  return "data" in i && this.schedulerStore.set("configSettings", i.data), this.schedulerStore.set("isLoading", !1), i;
269
273
  }
@@ -284,151 +288,155 @@ class U {
284
288
  return Math.min(i, e);
285
289
  }
286
290
  async getAvailability(e = 0, t = 0) {
287
- var f, _, p, I;
291
+ var _, S, p, T;
288
292
  this.schedulerStore.set("isLoading", !0);
289
293
  const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(), n = i.getTime();
290
294
  if (t && t < n / 1e3)
291
- return this.schedulerStore.set("isLoading", !1), { error: this.errors.component(d.t("getAvailabilityErrorTitle")).endtime_not_in_future() };
295
+ return this.schedulerStore.set("isLoading", !1), { error: this.errors.component(c.t("getAvailabilityErrorTitle")).endtime_not_in_future() };
292
296
  if (!e) {
293
- const l = new Date(i.getFullYear(), i.getMonth(), 1);
294
- e = Math.floor(l.getTime() / 1e3);
297
+ const g = new Date(i.getFullYear(), i.getMonth(), 1);
298
+ e = Math.floor(g.getTime() / 1e3);
295
299
  }
296
300
  if (!t) {
297
- const l = new Date(i.getFullYear(), i.getMonth() + 1, 0);
298
- t = Math.floor(l.getTime() / 1e3);
301
+ const g = new Date(i.getFullYear(), i.getMonth() + 1, 0);
302
+ t = Math.floor(g.getTime() / 1e3);
299
303
  }
300
304
  t = this.getEndTimeForAvailableDaysInFuture(t);
301
305
  const r = this.getStartTimeWithMinBookingNotice(e);
302
306
  e = r, t = r > t ? r + 1 : t, s.append("start_time", encodeURIComponent(e.toString())), s.append("end_time", encodeURIComponent(t.toString())), this.configId && !this.sessionId ? s.append("configuration_id", encodeURIComponent(this.configId)) : this.slug && this.clientId && !this.sessionId && (s.append("slug", encodeURIComponent(this.slug)), s.append("client_id", encodeURIComponent(this.clientId)));
303
307
  const o = this.schedulerStore.get("rescheduleBookingId");
304
308
  o && s.append("booking_id", encodeURIComponent(o));
305
- const u = s.toString(), m = `/v3/scheduling/availability${u ? `?${u}` : ""}`, c = this.getHeaders(), g = await this.makeAPIRequest(decodeURIComponent(m), "GET", void 0, c);
306
- if ("error" in g) {
309
+ const m = s.toString(), h = `/v3/scheduling/availability${m ? `?${m}` : ""}`, l = this.getHeaders(), d = await this.makeAPIRequest(decodeURIComponent(h), "GET", void 0, l);
310
+ if ("error" in d) {
307
311
  this.schedulerStore.set("availability", []), this.schedulerStore.set("isLoading", !1);
308
- const l = (f = g.error) == null ? void 0 : f.type;
309
- let v = g.error;
310
- if (l && l in this.errors.api(d.t("getAvailabilityErrorTitle"))) {
311
- const S = this.getErrorMessage(v);
312
- v = this.errors.api(d.t("getAvailabilityErrorTitle"))[l](S);
312
+ const g = (_ = d.error) == null ? void 0 : _.type;
313
+ let v = d.error;
314
+ if (g && g in this.errors.api(c.t("getAvailabilityErrorTitle"))) {
315
+ const u = this.getErrorMessage(v);
316
+ v = this.errors.api(c.t("getAvailabilityErrorTitle"))[g](u);
313
317
  }
314
318
  return { error: v };
315
319
  }
316
- if ("data" in g) {
317
- const v = (((p = (_ = g.data) == null ? void 0 : _.time_slots) == null ? void 0 : p.map((h) => ({
318
- ...h,
319
- start_time: new Date(h.start_time * 1e3),
320
- end_time: new Date(h.end_time * 1e3)
321
- }))) || []).filter((h) => h.start_time.getTime() > n);
320
+ if ("data" in d) {
321
+ const v = (((p = (S = d.data) == null ? void 0 : S.time_slots) == null ? void 0 : p.map((I) => ({
322
+ ...I,
323
+ start_time: new Date(I.start_time * 1e3),
324
+ end_time: new Date(I.end_time * 1e3)
325
+ }))) || []).filter((I) => I.start_time.getTime() > n);
322
326
  this.schedulerStore.set("availability", v);
323
- const S = ((I = g.data) == null ? void 0 : I.order) || [];
324
- this.schedulerStore.set("availabilityOrderEmails", S);
327
+ const u = ((T = d.data) == null ? void 0 : T.order) || [];
328
+ this.schedulerStore.set("availabilityOrderEmails", u);
325
329
  }
326
- return this.schedulerStore.set("isLoading", !1), g;
330
+ return this.schedulerStore.set("isLoading", !1), d;
327
331
  }
328
332
  async cancelBooking(e, t) {
329
333
  var o;
330
334
  if (this.schedulerStore.set("isLoading", !0), !e)
331
- return { error: this.errors.component(d.t("cancelBookingErrorTitle")).no_booking_id() };
335
+ return { error: this.errors.component(c.t("cancelBookingErrorTitle")).no_booking_id() };
332
336
  const s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", i = `/v3/scheduling/bookings/${e}${s}`, n = this.getHeaders(), r = await this.makeAPIRequest(decodeURIComponent(i), "DELETE", JSON.stringify({
333
337
  action: "cancel",
334
338
  cancellation_reason: t
335
339
  }), n);
336
340
  if ("error" in r) {
337
341
  this.schedulerStore.set("isLoading", !1);
338
- const u = (o = r.error) == null ? void 0 : o.type;
339
- let m = r.error;
340
- if (u && u in this.errors.api(d.t("cancelBookingErrorTitle"))) {
341
- const c = this.getErrorMessage(m);
342
- m = this.errors.api(d.t("cancelBookingErrorTitle"))[u](c);
342
+ const m = (o = r.error) == null ? void 0 : o.type;
343
+ let h = r.error;
344
+ if (m && m in this.errors.api(c.t("cancelBookingErrorTitle"))) {
345
+ const l = this.getErrorMessage(h);
346
+ h = this.errors.api(c.t("cancelBookingErrorTitle"))[m](l);
343
347
  }
344
- return { error: m };
348
+ return { error: h };
345
349
  }
346
350
  return this.schedulerStore.set("cancelledEventInfo", {
347
351
  booking_id: e
348
352
  }), this.schedulerStore.set("rescheduleBookingId", ""), this.schedulerStore.set("isLoading", !1), r;
349
353
  }
350
354
  async rescheduleBooking(e, t) {
351
- var E;
355
+ var A;
352
356
  if (this.schedulerStore.set("isLoading", !0), !e)
353
- return { error: this.errors.component(d.t("rescheduleBookingErrorTitle")).no_booking_id() };
354
- const s = this.errors.api(d.t("rescheduleBookingErrorTitle")), i = this.errors.component(d.t("rescheduleBookingErrorTitle")), { bookingInfo: n, selectedTimeslot: r, selectedTimezone: o, selectedLanguage: u } = this.schedulerStore.state, { startTime: m, endTime: c, timezone: g } = t, f = m || (r == null ? void 0 : r.start_time);
355
- if (!f)
356
- return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
357
- const _ = c || (r == null ? void 0 : r.end_time);
357
+ return { error: this.errors.component(c.t("rescheduleBookingErrorTitle")).no_booking_id() };
358
+ const s = this.errors.api(c.t("rescheduleBookingErrorTitle")), i = this.errors.component(c.t("rescheduleBookingErrorTitle")), { bookingInfo: n, selectedTimeslot: r, selectedTimezone: o, selectedLanguage: m } = this.schedulerStore.state, { startTime: h, endTime: l, timezone: d } = t, _ = h || (r == null ? void 0 : r.start_time);
358
359
  if (!_)
360
+ return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
361
+ const S = l || (r == null ? void 0 : r.end_time);
362
+ if (!S)
359
363
  return { error: i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
360
364
  const p = this.schedulerStore.get("availabilityOrderEmails");
361
- let I = "";
365
+ let T = "";
362
366
  if (p.length > 0) {
363
- const T = (r == null ? void 0 : r.emails) || [];
364
- for (let k = 0; k < p.length; k++)
365
- if (T.includes(p[k])) {
366
- I = p[k];
367
+ const b = (r == null ? void 0 : r.emails) || [];
368
+ for (let y = 0; y < p.length; y++)
369
+ if (b.includes(p[y])) {
370
+ T = p[y];
367
371
  break;
368
372
  }
369
373
  }
370
- const l = g || o;
371
- if (!l)
374
+ const g = d || o;
375
+ if (!g)
372
376
  return { error: i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.') };
373
- const v = t ? t == null ? void 0 : t.primaryParticipant : n == null ? void 0 : n.primaryParticipant, S = t ? (t == null ? void 0 : t.guests) || [] : (n == null ? void 0 : n.guests) || [], h = t ? t == null ? void 0 : t.additionalFields : n == null ? void 0 : n.additionalFields, L = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", M = `/v3/scheduling/bookings/${e}${L}`, P = this.getHeaders(), y = await this.makeAPIRequest(decodeURIComponent(M), "PATCH", JSON.stringify({
374
- start_time: f.getTime() / 1e3,
375
- end_time: _.getTime() / 1e3,
376
- timezone: l,
377
- additional_fields: h,
378
- guest: { ...v },
379
- additional_guests: S,
380
- participants: I ? [{ email: I }] : void 0,
381
- email_language: this.getTwoLetterLanguageCode(u)
382
- }), P);
383
- if ("error" in y) {
377
+ const v = {};
378
+ Object.entries((n == null ? void 0 : n.additionalFields) || {}).forEach(([b, y]) => {
379
+ v[b] = y.value;
380
+ });
381
+ const u = t ? t == null ? void 0 : t.primaryParticipant : n == null ? void 0 : n.primaryParticipant, I = t ? (t == null ? void 0 : t.guests) || [] : (n == null ? void 0 : n.guests) || [], k = t ? t == null ? void 0 : t.additionalFields : v, f = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", E = `/v3/scheduling/bookings/${e}${f}`, z = this.getHeaders(), w = await this.makeAPIRequest(decodeURIComponent(E), "PATCH", JSON.stringify({
382
+ start_time: _.getTime() / 1e3,
383
+ end_time: S.getTime() / 1e3,
384
+ timezone: g,
385
+ additional_fields: k,
386
+ guest: { ...u },
387
+ additional_guests: I,
388
+ participants: T ? [{ email: T }] : void 0,
389
+ email_language: this.getTwoLetterLanguageCode(m)
390
+ }), z);
391
+ if ("error" in w) {
384
392
  this.schedulerStore.set("isLoading", !1);
385
- const T = (E = y.error) == null ? void 0 : E.type;
386
- let k = y.error;
387
- if (T && T in s) {
388
- const z = this.getErrorMessage(k);
389
- k = s[T](z);
393
+ const b = (A = w.error) == null ? void 0 : A.type;
394
+ let y = w.error;
395
+ if (b && b in s) {
396
+ const $ = this.getErrorMessage(y);
397
+ y = s[b]($);
390
398
  }
391
- return { error: k };
399
+ return { error: y };
392
400
  }
393
- const B = this.schedulerStore.get("reschedulingEventInfo");
394
- if ("data" in y)
395
- this.schedulerStore.set("eventInfo", y == null ? void 0 : y.data);
396
- else if (B)
397
- this.schedulerStore.set("eventInfo", B);
401
+ const D = this.schedulerStore.get("reschedulingEventInfo");
402
+ if ("data" in w)
403
+ this.schedulerStore.set("eventInfo", w == null ? void 0 : w.data);
404
+ else if (D)
405
+ this.schedulerStore.set("eventInfo", D);
398
406
  else {
399
- const T = {
407
+ const b = {
400
408
  booking_id: e
401
409
  };
402
- this.schedulerStore.set("eventInfo", T);
410
+ this.schedulerStore.set("eventInfo", b);
403
411
  }
404
- return this.schedulerStore.set("isLoading", !1), y;
412
+ return this.schedulerStore.set("isLoading", !1), w;
405
413
  }
406
414
  async updateBooking(e) {
407
- var g;
415
+ var d;
408
416
  this.schedulerStore.set("isLoading", !0);
409
- const { bookingId: t, status: s, reason: i } = e, n = this.schedulerStore.get("organizerConfirmationSalt"), r = s === "confirmed" ? d.t("confirmBookingErrorTitle") : d.t("rejectBookingErrorTitle");
417
+ const { bookingId: t, status: s, reason: i } = e, n = this.schedulerStore.get("organizerConfirmationSalt"), r = s === "confirmed" ? c.t("confirmBookingErrorTitle") : c.t("rejectBookingErrorTitle");
410
418
  if (!t)
411
419
  return { error: this.errors.component(r).no_booking_id() };
412
420
  if (!n)
413
421
  return { error: this.errors.component(r).no_salt() };
414
- const o = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", u = `/v3/scheduling/bookings/${t}${o}`, m = this.getHeaders(), c = await this.makeAPIRequest(decodeURIComponent(u), "PUT", JSON.stringify({
422
+ const o = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", m = `/v3/scheduling/bookings/${t}${o}`, h = this.getHeaders(), l = await this.makeAPIRequest(decodeURIComponent(m), "PUT", JSON.stringify({
415
423
  status: s,
416
424
  cancellation_reason: i,
417
425
  salt: n
418
- }), m);
419
- if ("error" in c) {
426
+ }), h);
427
+ if ("error" in l) {
420
428
  this.schedulerStore.set("isLoading", !1);
421
- const f = (g = c.error) == null ? void 0 : g.type;
422
- let _ = c.error;
423
- if (f && f in this.errors.api(r)) {
424
- const p = this.getErrorMessage(_);
425
- _ = this.errors.api(r)[f](p);
429
+ const _ = (d = l.error) == null ? void 0 : d.type;
430
+ let S = l.error;
431
+ if (_ && _ in this.errors.api(r)) {
432
+ const p = this.getErrorMessage(S);
433
+ S = this.errors.api(r)[_](p);
426
434
  }
427
- return { error: _ };
435
+ return { error: S };
428
436
  }
429
- return "data" in c && s === "confirmed" ? this.schedulerStore.set("confirmedEventInfo", c == null ? void 0 : c.data) : "request_id" in c && s === "cancelled" && this.schedulerStore.set("cancelledEventInfo", {
437
+ return "data" in l && s === "confirmed" ? this.schedulerStore.set("confirmedEventInfo", l == null ? void 0 : l.data) : "request_id" in l && s === "cancelled" && this.schedulerStore.set("cancelledEventInfo", {
430
438
  booking_id: t
431
- }), this.schedulerStore.set("organizerConfirmationBookingId", ""), this.schedulerStore.set("isLoading", !1), c;
439
+ }), this.schedulerStore.set("organizerConfirmationBookingId", ""), this.schedulerStore.set("isLoading", !1), l;
432
440
  }
433
441
  }
434
442
  function N(a = {}) {
@@ -449,17 +457,17 @@ function N(a = {}) {
449
457
  nylasBranding: !0,
450
458
  ...a
451
459
  };
452
- b("[defaultNylasStoreState]: ", e);
453
- const t = $(e);
460
+ L("[defaultNylasStoreState]: ", e);
461
+ const t = F(e);
454
462
  return t.onChange("availability", (s) => {
455
- b("[availability]: ", s);
463
+ L("[availability]: ", s);
456
464
  const i = s.map((o) => o.start_time);
457
- b("[selectableDates]: ", i), t.set("selectableDates", i);
465
+ L("[selectableDates]: ", i), t.set("selectableDates", i);
458
466
  const n = s[0];
459
467
  if (!n)
460
468
  return;
461
469
  const r = Math.floor((n.end_time.getTime() - n.start_time.getTime()) / 6e4);
462
- b("[durationMinutes]: ", r), t.set("eventDuration", r);
470
+ L("[durationMinutes]: ", r), t.set("eventDuration", r);
463
471
  }), t.reset = () => {
464
472
  for (const s in e) {
465
473
  const i = e[s];
@@ -469,6 +477,6 @@ function N(a = {}) {
469
477
  }
470
478
  export {
471
479
  N as C,
472
- w as E,
473
- U as N
480
+ B as E,
481
+ O as N
474
482
  };
@@ -0,0 +1 @@
1
+ "use strict";const l=require("./index-bd6fdc8c.cjs");exports.ErrorCategory=void 0;(function(a){a.Component="component",a.Api="api",a.Auth="auth"})(exports.ErrorCategory||(exports.ErrorCategory={}));var D;(function(a){a.endtime_not_in_future="endtime_not_in_future",a.no_booking_info="no_booking_info",a.no_timeslot_selected="no_timeslot_selected",a.no_timezone_selected="no_timezone_selected",a.no_booking_id="no_booking_id",a.no_salt="no_salt",a.invalid_start_time="invalid_start_time",a.invalid_end_time="invalid_end_time",a.invalid_timezone="invalid_timezone"})(D||(D={}));var A;(function(a){a.invalid_session="invalid_session",a.general_error="general_error",a.internal_error="internal_error",a.invalid_request_error="invalid_request_error",a.timeslot_not_available="timeslot_not_available",a.provider_error="provider_error",a.not_found_error="not_found_error"})(A||(A={}));class M{constructor(){this.component=e=>{const t=exports.ErrorCategory.Component,s=`${e} Error`;return{endtime_not_in_future:(i='"endtime" can not be in the future')=>({title:s,message:i,category:t}),no_booking_info:(i="No booking info provided")=>({title:s,message:i,category:t}),no_timeslot_selected:(i="No timeslot selected")=>({title:s,message:i,category:t}),no_timezone_selected:(i="No timezone selected")=>({title:s,message:i,category:t}),no_booking_id:(i="No booking id provided")=>({title:s,message:i,category:t}),no_salt:(i="No salt provided")=>({title:s,message:i,category:t}),invalid_start_time:(i="Invalid start time")=>({title:s,message:i,category:t}),invalid_end_time:(i="Invalid end time")=>({title:s,message:i,category:t}),invalid_timezone:(i="Invalid timezone")=>({title:s,message:i,category:t})}},this.api=e=>{const t=exports.ErrorCategory.Api,s=`${e} Error`;return{invalid_session:i=>({title:s,message:i,category:t}),general_error:i=>({title:s,message:i,category:t}),internal_error:i=>({title:s,message:i,category:t}),invalid_request_error:i=>({title:s,message:i,category:t}),timeslot_not_available:i=>({title:s,message:i,category:t}),provider_error:i=>({title:s,message:i,category:t}),not_found_error:i=>({title:s,message:i,category:t})}}}}class z{constructor({schedulerAPIURL:e,schedulerStore:t,sessionId:s,configId:i,slug:n,clientId:r}){this.errors=new M,this.schedulerStore=t,this.schedulerAPIURL=e,this.sessionId=s,this.configId=i,this.slug=n,this.clientId=r}getHeaders(){return this.sessionId?{Authorization:`Bearer ${this.sessionId}`}:{}}async makeAPIRequest(e,t,s,i={}){try{const n=new URL(this.schedulerAPIURL);return n.pathname=e,await(await fetch(decodeURIComponent(n.toString()),{method:t,headers:{"Content-Type":"application/json",Origin:window.location.origin,...i},body:s})).json()}catch(n){return{error:{message:n.message,title:"API request failed",type:"api"}}}}getErrorMessage(e){var s,i,n,r;let t=(e==null?void 0:e.message)||(e==null?void 0:e.title)||"Something went wrong";return(e==null?void 0:e.type)==="provider_error"&&(t=((i=(s=e==null?void 0:e.provider_error)==null?void 0:s.error)==null?void 0:i.message)||((r=(n=e==null?void 0:e.provider_error)==null?void 0:n.error)==null?void 0:r.title)||"Something went wrong"),t}setConfigId(e){this.configId=e}selectDate(e){this.schedulerStore.set("selectedDate",e),this.schedulerStore.set("selectedTimeslot",null)}selectTime(e){this.schedulerStore.set("selectedTimeslot",e)}selectTimezone(e){this.schedulerStore.set("selectedTimezone",e)}selectLanguage(e){this.schedulerStore.set("selectedLanguage",e),l.instance.changeLanguage(e)}async toggleAdditionalData(e){e||await this.refetchAvailability(),this.schedulerStore.set("showBookingForm",e)}setParticipantName(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t==null?void 0:t.primaryParticipant,name:e}})}setParticipantEmail(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t==null?void 0:t.primaryParticipant,email:e}})}async refetchAvailability(){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3,s=t<e.getTime()/1e3?Math.floor(e.getTime()/1e3):t,i=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;return await this.getAvailability(s,i)}async resetStoreStateAndFetchAvailability(){const e=new Date,t=await this.refetchAvailability(),s=this.schedulerStore.get("availability").find(n=>new Date(n.start_time)>new Date);let i=e;return s&&(i=s.start_time),this.schedulerStore.set("selectedDate",i),this.schedulerStore.set("eventInfo",null),this.schedulerStore.set("showBookingForm",!1),this.schedulerStore.set("selectedTimeslot",null),t}async setReschedule(e){this.schedulerStore.set("isLoading",!0);const t=this.schedulerStore.state.eventInfo;return t&&this.schedulerStore.set("reschedulingEventInfo",t),this.schedulerStore.set("rescheduleBookingId",e),await this.resetStoreStateAndFetchAvailability().finally(()=>{this.schedulerStore.set("isLoading",!1)})}async setCancel(e){this.schedulerStore.set("cancelBookingId",e)}async setReject(e){this.schedulerStore.set("rejectBookingId",e)}async resetCancel(){const e=await this.resetStoreStateAndFetchAvailability();return this.schedulerStore.set("cancelBookingId",""),this.schedulerStore.set("rejectBookingId",""),this.schedulerStore.set("cancelledEventInfo",null),e}async goBack(){this.schedulerStore.set("cancelBookingId","")}async resetConfirm(){const e=await this.resetStoreStateAndFetchAvailability();return this.schedulerStore.set("organizerConfirmationBookingId",""),this.schedulerStore.set("confirmedEventInfo",void 0),e}async bookTimeslot(e){var I;this.schedulerStore.set("isLoading",!0);const{selectedTimeslot:t,selectedTimezone:s,bookingInfo:i,selectedLanguage:n}=this.schedulerStore.state;if(!e&&!i)return{error:this.errors.component(l.instance.t("createBookingErrorTitle")).no_booking_info()};const r=(e==null?void 0:e.timeslot)||t;if(!r)return{error:this.errors.component(l.instance.t("createBookingErrorTitle")).no_timeslot_selected()};const o=e&&(e!=null&&e.timezone)?e==null?void 0:e.timezone:s,m=n||"en-US";if(!o)return{error:this.errors.component(l.instance.t("createBookingErrorTitle")).no_timezone_selected()};const h=this.schedulerStore.get("availabilityOrderEmails");let c="";if(h.length>0){const b=(r==null?void 0:r.emails)||[];for(let f=0;f<h.length;f++)if(b.includes(h[f])){c=h[f];break}}const d={};Object.entries((i==null?void 0:i.additionalFields)||{}).forEach(([b,f])=>{d[b]=f.value});const _=e?e==null?void 0:e.primaryParticipant:i==null?void 0:i.primaryParticipant,S=e?(e==null?void 0:e.guests)||[]:(i==null?void 0:i.guests)||[],p=e?e==null?void 0:e.additionalFields:d,T=this.getHeaders(),v=`/v3/scheduling/bookings${!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:""}`,u=await this.makeAPIRequest(decodeURIComponent(v),"POST",JSON.stringify({participants:c?[{email:c}]:void 0,additional_fields:p,additional_guests:S,guest:{..._},start_time:r.start_time.getTime()/1e3,end_time:r.end_time.getTime()/1e3,timezone:o,email_language:this.getTwoLetterLanguageCode(m)}),T);if("error"in u){this.schedulerStore.set("isLoading",!1);const b=(I=u.error)==null?void 0:I.type;let f=u.error;if(b&&b in this.errors.api("Create Booking")){const E=this.getErrorMessage(f);f=this.errors.api("Create Booking")[b](E)}return{error:f}}return"data"in u&&this.schedulerStore.set("eventInfo",u==null?void 0:u.data),this.schedulerStore.set("isLoading",!1),u}async getUISettings(){var n;this.schedulerStore.set("isLoading",!0);const e=this.getHeaders(),s=`/v3/scheduling/ui-settings${!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:""}`,i=await this.makeAPIRequest(s,"GET",void 0,e);if("error"in i){this.schedulerStore.set("isLoading",!1);const r=(n=i.error)==null?void 0:n.type;let o=i.error;return r&&r in this.errors.api(l.instance.t("getUISettingErrorTitle"))&&(o=this.errors.api(l.instance.t("getUISettingErrorTitle"))[r]((o==null?void 0:o.message)||(o==null?void 0:o.title)||"Something went wrong")),{error:o}}return"data"in i&&this.schedulerStore.set("configSettings",i.data),this.schedulerStore.set("isLoading",!1),i}getTwoLetterLanguageCode(e){return e.split("-")[0]}getStartTimeWithMinBookingNotice(e){var n;const t=(n=this.schedulerStore.get("configSettings"))==null?void 0:n.scheduler,s=t==null?void 0:t.min_booking_notice;if(!s)return e;const i=new Date().getTime();return e<(i+s*60*1e3)/1e3?Math.floor((i+s*60*1e3)/1e3):e}getEndTimeForAvailableDaysInFuture(e){var r,o;const t=new Date,s=(o=(r=this.schedulerStore.get("configSettings"))==null?void 0:r.scheduler)==null?void 0:o.available_days_in_future,i=Math.floor(l.addDaysToCurrentDate(t,s).getTime()/1e3);return Math.min(i,e)}async getAvailability(e=0,t=0){var _,S,p,T;this.schedulerStore.set("isLoading",!0);const s=new URLSearchParams,i=new Date,n=i.getTime();if(t&&t<n/1e3)return this.schedulerStore.set("isLoading",!1),{error:this.errors.component(l.instance.t("getAvailabilityErrorTitle")).endtime_not_in_future()};if(!e){const g=new Date(i.getFullYear(),i.getMonth(),1);e=Math.floor(g.getTime()/1e3)}if(!t){const g=new Date(i.getFullYear(),i.getMonth()+1,0);t=Math.floor(g.getTime()/1e3)}t=this.getEndTimeForAvailableDaysInFuture(t);const r=this.getStartTimeWithMinBookingNotice(e);e=r,t=r>t?r+1:t,s.append("start_time",encodeURIComponent(e.toString())),s.append("end_time",encodeURIComponent(t.toString())),this.configId&&!this.sessionId?s.append("configuration_id",encodeURIComponent(this.configId)):this.slug&&this.clientId&&!this.sessionId&&(s.append("slug",encodeURIComponent(this.slug)),s.append("client_id",encodeURIComponent(this.clientId)));const o=this.schedulerStore.get("rescheduleBookingId");o&&s.append("booking_id",encodeURIComponent(o));const m=s.toString(),h=`/v3/scheduling/availability${m?`?${m}`:""}`,c=this.getHeaders(),d=await this.makeAPIRequest(decodeURIComponent(h),"GET",void 0,c);if("error"in d){this.schedulerStore.set("availability",[]),this.schedulerStore.set("isLoading",!1);const g=(_=d.error)==null?void 0:_.type;let v=d.error;if(g&&g in this.errors.api(l.instance.t("getAvailabilityErrorTitle"))){const u=this.getErrorMessage(v);v=this.errors.api(l.instance.t("getAvailabilityErrorTitle"))[g](u)}return{error:v}}if("data"in d){const v=(((p=(S=d.data)==null?void 0:S.time_slots)==null?void 0:p.map(I=>({...I,start_time:new Date(I.start_time*1e3),end_time:new Date(I.end_time*1e3)})))||[]).filter(I=>I.start_time.getTime()>n);this.schedulerStore.set("availability",v);const u=((T=d.data)==null?void 0:T.order)||[];this.schedulerStore.set("availabilityOrderEmails",u)}return this.schedulerStore.set("isLoading",!1),d}async cancelBooking(e,t){var o;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component(l.instance.t("cancelBookingErrorTitle")).no_booking_id()};const s=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"",i=`/v3/scheduling/bookings/${e}${s}`,n=this.getHeaders(),r=await this.makeAPIRequest(decodeURIComponent(i),"DELETE",JSON.stringify({action:"cancel",cancellation_reason:t}),n);if("error"in r){this.schedulerStore.set("isLoading",!1);const m=(o=r.error)==null?void 0:o.type;let h=r.error;if(m&&m in this.errors.api(l.instance.t("cancelBookingErrorTitle"))){const c=this.getErrorMessage(h);h=this.errors.api(l.instance.t("cancelBookingErrorTitle"))[m](c)}return{error:h}}return this.schedulerStore.set("cancelledEventInfo",{booking_id:e}),this.schedulerStore.set("rescheduleBookingId",""),this.schedulerStore.set("isLoading",!1),r}async rescheduleBooking(e,t){var B;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component(l.instance.t("rescheduleBookingErrorTitle")).no_booking_id()};const s=this.errors.api(l.instance.t("rescheduleBookingErrorTitle")),i=this.errors.component(l.instance.t("rescheduleBookingErrorTitle")),{bookingInfo:n,selectedTimeslot:r,selectedTimezone:o,selectedLanguage:m}=this.schedulerStore.state,{startTime:h,endTime:c,timezone:d}=t,_=h||(r==null?void 0:r.start_time);if(!_)return{error:i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const S=c||(r==null?void 0:r.end_time);if(!S)return{error:i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const p=this.schedulerStore.get("availabilityOrderEmails");let T="";if(p.length>0){const k=(r==null?void 0:r.emails)||[];for(let y=0;y<p.length;y++)if(k.includes(p[y])){T=p[y];break}}const g=d||o;if(!g)return{error:i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')};const v={};Object.entries((n==null?void 0:n.additionalFields)||{}).forEach(([k,y])=>{v[k]=y.value});const u=t?t==null?void 0:t.primaryParticipant:n==null?void 0:n.primaryParticipant,I=t?(t==null?void 0:t.guests)||[]:(n==null?void 0:n.guests)||[],b=t?t==null?void 0:t.additionalFields:v,f=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"",E=`/v3/scheduling/bookings/${e}${f}`,P=this.getHeaders(),w=await this.makeAPIRequest(decodeURIComponent(E),"PATCH",JSON.stringify({start_time:_.getTime()/1e3,end_time:S.getTime()/1e3,timezone:g,additional_fields:b,guest:{...u},additional_guests:I,participants:T?[{email:T}]:void 0,email_language:this.getTwoLetterLanguageCode(m)}),P);if("error"in w){this.schedulerStore.set("isLoading",!1);const k=(B=w.error)==null?void 0:B.type;let y=w.error;if(k&&k in s){const C=this.getErrorMessage(y);y=s[k](C)}return{error:y}}const L=this.schedulerStore.get("reschedulingEventInfo");if("data"in w)this.schedulerStore.set("eventInfo",w==null?void 0:w.data);else if(L)this.schedulerStore.set("eventInfo",L);else{const k={booking_id:e};this.schedulerStore.set("eventInfo",k)}return this.schedulerStore.set("isLoading",!1),w}async updateBooking(e){var d;this.schedulerStore.set("isLoading",!0);const{bookingId:t,status:s,reason:i}=e,n=this.schedulerStore.get("organizerConfirmationSalt"),r=s==="confirmed"?l.instance.t("confirmBookingErrorTitle"):l.instance.t("rejectBookingErrorTitle");if(!t)return{error:this.errors.component(r).no_booking_id()};if(!n)return{error:this.errors.component(r).no_salt()};const o=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"",m=`/v3/scheduling/bookings/${t}${o}`,h=this.getHeaders(),c=await this.makeAPIRequest(decodeURIComponent(m),"PUT",JSON.stringify({status:s,cancellation_reason:i,salt:n}),h);if("error"in c){this.schedulerStore.set("isLoading",!1);const _=(d=c.error)==null?void 0:d.type;let S=c.error;if(_&&_ in this.errors.api(r)){const p=this.getErrorMessage(S);S=this.errors.api(r)[_](p)}return{error:S}}return"data"in c&&s==="confirmed"?this.schedulerStore.set("confirmedEventInfo",c==null?void 0:c.data):"request_id"in c&&s==="cancelled"&&this.schedulerStore.set("cancelledEventInfo",{booking_id:t}),this.schedulerStore.set("organizerConfirmationBookingId",""),this.schedulerStore.set("isLoading",!1),c}}function $(a={}){const e={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:!1,availabilityOrderEmails:[],selectableDates:null,availability:[],eventDuration:0,state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:!1,nylasBranding:!0,...a};l.debug("[defaultNylasStoreState]: ",e);const t=l.createStore(e);return t.onChange("availability",s=>{l.debug("[availability]: ",s);const i=s.map(o=>o.start_time);l.debug("[selectableDates]: ",i),t.set("selectableDates",i);const n=s[0];if(!n)return;const r=Math.floor((n.end_time.getTime()-n.start_time.getTime())/6e4);l.debug("[durationMinutes]: ",r),t.set("eventDuration",r)}),t.reset=()=>{for(const s in e){const i=e[s];t.set(s,i)}},t}exports.CreateNylasSchedulerStore=$;exports.NylaSchedulerAPIConnector=z;
@@ -0,0 +1,15 @@
1
+ import { r as s, h as t } from "./index-3fd31877.js";
2
+ import "react";
3
+ import "react-dom";
4
+ const o = ".sc-sent-icon-h{display:flex}", i = o, c = class {
5
+ constructor(e) {
6
+ s(this, e), this.width = "15", this.height = "15";
7
+ }
8
+ render() {
9
+ return t("svg", { key: "ca3a664814e986f46006171c0fb63441478ef5b8", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "e4d9309797e02ca60918d49c55854d51f93c1a2b", d: "M21.5 12L3.5 3.5L3.5 20.5L21.5 12Z", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "082bf637872a00ba8abe224cc7c8092dc371ea75", d: "M3.5 3.5L12 10.5", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "dd3f5647d7cdb9dfbdb480ab332917564969f546", d: "M3.5 20.5L12 13.5", stroke: "auto", "stroke-width": "1.5" }));
10
+ }
11
+ };
12
+ c.style = i;
13
+ export {
14
+ c as sent_icon
15
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-bd6fdc8c.cjs");require("react");require("react-dom");const i=".sc-sent-icon-h{display:flex}",o=i,e=class{constructor(s){t.registerInstance(this,s),this.width="15",this.height="15"}render(){return t.h("svg",{key:"ca3a664814e986f46006171c0fb63441478ef5b8",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"e4d9309797e02ca60918d49c55854d51f93c1a2b",d:"M21.5 12L3.5 3.5L3.5 20.5L21.5 12Z",stroke:"auto","stroke-width":"1.5"}),t.h("path",{key:"082bf637872a00ba8abe224cc7c8092dc371ea75",d:"M3.5 3.5L12 10.5",stroke:"auto","stroke-width":"1.5"}),t.h("path",{key:"dd3f5647d7cdb9dfbdb480ab332917564969f546",d:"M3.5 20.5L12 13.5",stroke:"auto","stroke-width":"1.5"}))}};e.style=o;exports.sent_icon=e;
@@ -0,0 +1,15 @@
1
+ import { r as e, h as t } from "./index-3fd31877.js";
2
+ import "react";
3
+ import "react-dom";
4
+ const c = ".sc-spam-icon-h{display:flex}", a = c, o = class {
5
+ constructor(s) {
6
+ e(this, s), this.width = "15", this.height = "15";
7
+ }
8
+ render() {
9
+ return t("svg", { key: "a8e87346312ed75a47b88790585e07d8c518c3e9", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "5cb3444afa08fc37a8cf2e268c62faf5c97379f5", d: "M20 3H4C2.89543 3 2 3.89543 2 5V19C2 20.1046 2.89543 21 4 21H20C21.1046 21 22 20.1046 22 19V5C22 3.89543 21.1046 3 20 3Z", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "b695c0e7aa34cf44da99cce51c17ff98b3ad8906", d: "M2 5L12 12.5L22 5", stroke: "auto", "stroke-width": "1.5" }));
10
+ }
11
+ };
12
+ o.style = a;
13
+ export {
14
+ o as spam_icon
15
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-bd6fdc8c.cjs");require("react");require("react-dom");const c=".sc-spam-icon-h{display:flex}",i=c,t=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"a8e87346312ed75a47b88790585e07d8c518c3e9",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"5cb3444afa08fc37a8cf2e268c62faf5c97379f5",d:"M20 3H4C2.89543 3 2 3.89543 2 5V19C2 20.1046 2.89543 21 4 21H20C21.1046 21 22 20.1046 22 19V5C22 3.89543 21.1046 3 20 3Z",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"b695c0e7aa34cf44da99cce51c17ff98b3ad8906",d:"M2 5L12 12.5L22 5",stroke:"auto","stroke-width":"1.5"}))}};t.style=i;exports.spam_icon=t;
@@ -0,0 +1,15 @@
1
+ import { r as e, h as t } from "./index-3fd31877.js";
2
+ import "react";
3
+ import "react-dom";
4
+ const a = ".sc-star-icon-h{display:flex}", c = a, i = class {
5
+ constructor(s) {
6
+ e(this, s), this.width = "15", this.height = "15";
7
+ }
8
+ render() {
9
+ return t("svg", { key: "acc7e88e0901acac79fd0bf4a3a355ea82b46934", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "a3a8ed61cce35a1f67c5aa22cb0aee42c965474e", d: "M9.15316 5.40838C10.4198 3.13613 11.0531 2 12 2C12.9469 2 13.5802 3.13612 14.8468 5.40837L15.1745 5.99623C15.5345 6.64193 15.7144 6.96479 15.9951 7.17781C16.2757 7.39083 16.6251 7.4699 17.3241 7.62805L17.9605 7.77203C20.4201 8.32856 21.65 8.60682 21.9426 9.54773C22.2352 10.4886 21.3968 11.4691 19.7199 13.4299L19.2861 13.9372C18.8096 14.4944 18.5713 14.773 18.4641 15.1177C18.357 15.4624 18.393 15.8341 18.465 16.5776L18.5306 17.2544C18.7841 19.8706 18.9109 21.1787 18.1449 21.7602C17.3788 22.3417 16.2273 21.8115 13.9243 20.7512L13.3285 20.4768C12.6741 20.1755 12.3469 20.0248 12 20.0248C11.6531 20.0248 11.3259 20.1755 10.6715 20.4768L10.0757 20.7512C7.77268 21.8115 6.62118 22.3417 5.85515 21.7602C5.08912 21.1787 5.21588 19.8706 5.4694 17.2544L5.53498 16.5776C5.60703 15.8341 5.64305 15.4624 5.53586 15.1177C5.42868 14.773 5.19043 14.4944 4.71392 13.9372L4.2801 13.4299C2.60325 11.4691 1.76482 10.4886 2.05742 9.54773C2.35002 8.60682 3.57986 8.32856 6.03954 7.77203L6.67589 7.62805C7.37485 7.4699 7.72433 7.39083 8.00494 7.17781C8.28555 6.96479 8.46553 6.64194 8.82547 5.99623L9.15316 5.40838Z", stroke: "auto", "stroke-width": "1.5" }));
10
+ }
11
+ };
12
+ i.style = c;
13
+ export {
14
+ i as star_icon
15
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-bd6fdc8c.cjs");require("react");require("react-dom");const i=".sc-star-icon-h{display:flex}",c=i,e=class{constructor(s){t.registerInstance(this,s),this.width="15",this.height="15"}render(){return t.h("svg",{key:"acc7e88e0901acac79fd0bf4a3a355ea82b46934",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"a3a8ed61cce35a1f67c5aa22cb0aee42c965474e",d:"M9.15316 5.40838C10.4198 3.13613 11.0531 2 12 2C12.9469 2 13.5802 3.13612 14.8468 5.40837L15.1745 5.99623C15.5345 6.64193 15.7144 6.96479 15.9951 7.17781C16.2757 7.39083 16.6251 7.4699 17.3241 7.62805L17.9605 7.77203C20.4201 8.32856 21.65 8.60682 21.9426 9.54773C22.2352 10.4886 21.3968 11.4691 19.7199 13.4299L19.2861 13.9372C18.8096 14.4944 18.5713 14.773 18.4641 15.1177C18.357 15.4624 18.393 15.8341 18.465 16.5776L18.5306 17.2544C18.7841 19.8706 18.9109 21.1787 18.1449 21.7602C17.3788 22.3417 16.2273 21.8115 13.9243 20.7512L13.3285 20.4768C12.6741 20.1755 12.3469 20.0248 12 20.0248C11.6531 20.0248 11.3259 20.1755 10.6715 20.4768L10.0757 20.7512C7.77268 21.8115 6.62118 22.3417 5.85515 21.7602C5.08912 21.1787 5.21588 19.8706 5.4694 17.2544L5.53498 16.5776C5.60703 15.8341 5.64305 15.4624 5.53586 15.1177C5.42868 14.773 5.19043 14.4944 4.71392 13.9372L4.2801 13.4299C2.60325 11.4691 1.76482 10.4886 2.05742 9.54773C2.35002 8.60682 3.57986 8.32856 6.03954 7.77203L6.67589 7.62805C7.37485 7.4699 7.72433 7.39083 8.00494 7.17781C8.28555 6.96479 8.46553 6.64194 8.82547 5.99623L9.15316 5.40838Z",stroke:"auto","stroke-width":"1.5"}))}};e.style=c;exports.star_icon=e;
@@ -0,0 +1,15 @@
1
+ import { r as s, h as t } from "./index-3fd31877.js";
2
+ import "react";
3
+ import "react-dom";
4
+ const e = ".sc-stop-icon-h{display:flex}", i = e, c = class {
5
+ constructor(o) {
6
+ s(this, o), this.width = "15", this.height = "15";
7
+ }
8
+ render() {
9
+ return t("svg", { key: "f70cc744dde889a32cc0339cf4be41ae38237d0b", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "f7bd4f78d4e2efc797932d91aac355e0f9d4f309", d: "M4 4H20V20H4V4Z", stroke: "auto", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }));
10
+ }
11
+ };
12
+ c.style = i;
13
+ export {
14
+ c as stop_icon
15
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-bd6fdc8c.cjs");require("react");require("react-dom");const s=".sc-stop-icon-h{display:flex}",i=s,e=class{constructor(o){t.registerInstance(this,o),this.width="15",this.height="15"}render(){return t.h("svg",{key:"f70cc744dde889a32cc0339cf4be41ae38237d0b",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"f7bd4f78d4e2efc797932d91aac355e0f9d4f309",d:"M4 4H20V20H4V4Z",stroke:"auto","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}};e.style=i;exports.stop_icon=e;
@@ -1,4 +1,4 @@
1
- import { r as s, c as l, E as r, h as a } from "./index-a282e817.js";
1
+ import { r as s, c as l, t as r, h as a } from "./index-3fd31877.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  const i = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0;display:flex;gap:4px;align-items:center}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}', n = i, o = class {
@@ -28,7 +28,7 @@ const i = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--n
28
28
  this.required && !e ? this.error = `${this.label} is required.` : e.length > this.maxLength ? this.error = `${this.label} cannot exceed ${this.maxLength} characters.` : this.error = "";
29
29
  }
30
30
  render() {
31
- return a("label", { key: "cdfe334fbfdda630f61a5df7d2dd7c85038ea077", part: "tc__label", class: { error: !!this.error } }, a("p", { key: "f97feab0172f0f3f85150a422ded251a001ccd0a" }, a("span", { key: "639cc8b13913855e794b9fb4bc5a23003d9ec1a5", class: "label" }, this.label), this.required && a("span", { class: "required" }, "*"), this.tooltip && a("tooltip-component", null, a("info-icon", { slot: "tooltip-icon" }), a("span", { slot: "tooltip-content" }, this.tooltip))), a("textarea", { key: "db27197c2eaad20db3f672ca038e05c4bc040c41", name: this.name, placeholder: this.placeholder, readOnly: this.readOnly, autoFocus: this.autoFocus, value: this.value, maxLength: this.maxLength, onInput: (e) => this.handleInput(e), class: { error: !!this.error }, part: "tc__textarea" }), this.error && a("span", { class: "error help-text" }, this.error));
31
+ return a("label", { key: "503a9e472a4dea351f13d8e430a0ee9ecc20e3fb", part: "tc__label", class: { error: !!this.error } }, a("p", { key: "7ce9a57c8e2dc9d0c3a88edf93ba09a3b49cf149" }, a("span", { key: "8feedbb7300d0eb20192b17a0482f9c981bba120", class: "label" }, this.label), this.required && a("span", { class: "required" }, "*"), this.tooltip && a("tooltip-component", null, a("info-icon", { slot: "tooltip-icon" }), a("span", { slot: "tooltip-content" }, this.tooltip))), a("textarea", { key: "79dd6889c5da4797b26504731583db5887c21bcb", name: this.name, placeholder: this.placeholder, readOnly: this.readOnly, autoFocus: this.autoFocus, value: this.value, maxLength: this.maxLength, onInput: (e) => this.handleInput(e), class: { error: !!this.error }, part: "tc__textarea" }), this.error && a("span", { class: "error help-text" }, this.error));
32
32
  }
33
33
  };
34
34
  o.style = n;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-11f33e47.cjs");require("react");require("react-dom");const s=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0;display:flex;gap:4px;align-items:center}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}',l=s,r=class{constructor(a){e.registerInstance(this,a),this.nylasFormInputChanged=e.createEvent(this,"nylasFormInputChanged",7),this.name="textarea",this.defaultValue=void 0,this.label="",this.placeholder="",this.required=!1,this.readOnly=!1,this.autoFocus=!1,this.maxLength=255,this.type="multi_line_text",this.tooltip="",this.value="",this.error=""}componentDidLoad(){this.value=e.sanitize(this.defaultValue||"")}handleBookingFormSubmitted(a){this.validate(this.value),this.error&&a.preventDefault()}handletriggerValidation(a){this.validate(this.value),this.error&&a.preventDefault()}handleInput(a){const t=a.target;this.value=e.sanitize(t.value),this.nylasFormInputChanged.emit({value:this.value,name:this.name,error:this.error,label:this.label,type:this.type})}validate(a){this.required&&!a?this.error=`${this.label} is required.`:a.length>this.maxLength?this.error=`${this.label} cannot exceed ${this.maxLength} characters.`:this.error=""}render(){return e.h("label",{key:"cdfe334fbfdda630f61a5df7d2dd7c85038ea077",part:"tc__label",class:{error:!!this.error}},e.h("p",{key:"f97feab0172f0f3f85150a422ded251a001ccd0a"},e.h("span",{key:"639cc8b13913855e794b9fb4bc5a23003d9ec1a5",class:"label"},this.label),this.required&&e.h("span",{class:"required"},"*"),this.tooltip&&e.h("tooltip-component",null,e.h("info-icon",{slot:"tooltip-icon"}),e.h("span",{slot:"tooltip-content"},this.tooltip))),e.h("textarea",{key:"db27197c2eaad20db3f672ca038e05c4bc040c41",name:this.name,placeholder:this.placeholder,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,maxLength:this.maxLength,onInput:a=>this.handleInput(a),class:{error:!!this.error},part:"tc__textarea"}),this.error&&e.h("span",{class:"error help-text"},this.error))}};r.style=l;exports.textarea_component=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-bd6fdc8c.cjs");require("react");require("react-dom");const s=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0;display:flex;gap:4px;align-items:center}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}',l=s,r=class{constructor(a){e.registerInstance(this,a),this.nylasFormInputChanged=e.createEvent(this,"nylasFormInputChanged",7),this.name="textarea",this.defaultValue=void 0,this.label="",this.placeholder="",this.required=!1,this.readOnly=!1,this.autoFocus=!1,this.maxLength=255,this.type="multi_line_text",this.tooltip="",this.value="",this.error=""}componentDidLoad(){this.value=e.sanitize(this.defaultValue||"")}handleBookingFormSubmitted(a){this.validate(this.value),this.error&&a.preventDefault()}handletriggerValidation(a){this.validate(this.value),this.error&&a.preventDefault()}handleInput(a){const t=a.target;this.value=e.sanitize(t.value),this.nylasFormInputChanged.emit({value:this.value,name:this.name,error:this.error,label:this.label,type:this.type})}validate(a){this.required&&!a?this.error=`${this.label} is required.`:a.length>this.maxLength?this.error=`${this.label} cannot exceed ${this.maxLength} characters.`:this.error=""}render(){return e.h("label",{key:"503a9e472a4dea351f13d8e430a0ee9ecc20e3fb",part:"tc__label",class:{error:!!this.error}},e.h("p",{key:"7ce9a57c8e2dc9d0c3a88edf93ba09a3b49cf149"},e.h("span",{key:"8feedbb7300d0eb20192b17a0482f9c981bba120",class:"label"},this.label),this.required&&e.h("span",{class:"required"},"*"),this.tooltip&&e.h("tooltip-component",null,e.h("info-icon",{slot:"tooltip-icon"}),e.h("span",{slot:"tooltip-content"},this.tooltip))),e.h("textarea",{key:"79dd6889c5da4797b26504731583db5887c21bcb",name:this.name,placeholder:this.placeholder,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,maxLength:this.maxLength,onInput:a=>this.handleInput(a),class:{error:!!this.error},part:"tc__textarea"}),this.error&&e.h("span",{class:"error help-text"},this.error))}};r.style=l;exports.textarea_component=r;