@nylas/react 1.3.6 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/add-circle-icon_2.entry-04909861.cjs +1 -0
  2. package/dist/add-circle-icon_2.entry-0d9ba871.js +26 -0
  3. package/dist/archive-icon.entry-3d6d9d3f.js +16 -0
  4. package/dist/archive-icon.entry-88459432.cjs +1 -0
  5. package/dist/{arrow-icon.entry-9cfd86a1.js → arrow-icon.entry-789ee889.js} +3 -2
  6. package/dist/arrow-icon.entry-c35e1933.cjs +1 -0
  7. package/dist/bold-icon.entry-827e95bf.cjs +1 -0
  8. package/dist/{bold-icon.entry-eab3420d.js → bold-icon.entry-fbb382d2.js} +7 -6
  9. package/dist/{button-component_2.entry-7cd5f9c0.js → button-component_2.entry-6c012ee4.js} +10 -9
  10. package/dist/button-component_2.entry-acd13f45.cjs +1 -0
  11. package/dist/calendar-agenda-fill-icon_36.entry-1bb3b1a8.js +4689 -0
  12. package/dist/calendar-agenda-fill-icon_36.entry-fa8121df.cjs +6 -0
  13. package/dist/calendar-cancel-icon.entry-2e97f7d8.cjs +1 -0
  14. package/dist/{calendar-cancel-icon.entry-299d6fba.js → calendar-cancel-icon.entry-a4d040db.js} +6 -5
  15. package/dist/{calendar-check-icon_2.entry-08ef8d2f.js → calendar-check-icon_2.entry-a48a358d.js} +12 -11
  16. package/dist/calendar-check-icon_2.entry-bca4821d.cjs +1 -0
  17. package/dist/{calendar-icon.entry-53b54115.js → calendar-icon.entry-57727659.js} +6 -5
  18. package/dist/calendar-icon.entry-a289313a.cjs +1 -0
  19. package/dist/checkbox-component.entry-af3e7005.cjs +1 -0
  20. package/dist/checkbox-component.entry-f4f98226.js +43 -0
  21. package/dist/checkmark-icon_15.entry-dace1b62.cjs +5 -0
  22. package/dist/checkmark-icon_15.entry-f43549b3.js +1337 -0
  23. package/dist/chevron-icon_3.entry-219b42e6.cjs +1 -0
  24. package/dist/chevron-icon_3.entry-25533d13.js +148 -0
  25. package/dist/clock-icon_4.entry-3917c667.cjs +1 -0
  26. package/dist/{clock-icon_4.entry-0e809dcb.js → clock-icon_4.entry-76f29f7e.js} +9 -8
  27. package/dist/{constants-6da0ede7-49c32ba7.js → constants-3d8016e3-3c080f00.js} +110 -41
  28. package/dist/constants-3d8016e3-fd6c3848.cjs +1 -0
  29. package/dist/customParseFormat-6c652dbb-8a42d5b0.js +135 -0
  30. package/dist/customParseFormat-6c652dbb-ba81ab97.cjs +1 -0
  31. package/dist/{delete-icon.entry-802084f6.js → delete-icon.entry-3b61864e.js} +8 -7
  32. package/dist/delete-icon.entry-96420b21.cjs +1 -0
  33. package/dist/{document-refresh-icon.entry-d1604f53.js → document-refresh-icon.entry-7333b7c9.js} +6 -5
  34. package/dist/document-refresh-icon.entry-8b5c6b9b.cjs +1 -0
  35. package/dist/elements/index.d.ts +10 -0
  36. package/dist/{feedbackSync-c040f483-2b6476c4.js → feedbackSync-352aaf4a-b2b83cfa.js} +1 -1
  37. package/dist/{feedbackSync-c040f483-d6dd0560.cjs → feedbackSync-352aaf4a-ba1bf452.cjs} +1 -1
  38. package/dist/{folder-icon.entry-6c0c09ed.js → folder-icon.entry-bb5e2452.js} +5 -4
  39. package/dist/folder-icon.entry-d2e46d3a.cjs +1 -0
  40. package/dist/forward-icon.entry-1fcf5a6b.cjs +1 -0
  41. package/dist/forward-icon.entry-af8d2147.js +16 -0
  42. package/dist/globe-icon_2.entry-b4b55760.cjs +1 -0
  43. package/dist/globe-icon_2.entry-cc6d9d67.js +200 -0
  44. package/dist/google-logo-icon_6.entry-aa7b5b42.js +1484 -0
  45. package/dist/google-logo-icon_6.entry-eefdec63.cjs +2 -0
  46. package/dist/google-meet-icon_5.entry-9758e527.js +56 -0
  47. package/dist/google-meet-icon_5.entry-c545537a.cjs +1 -0
  48. package/dist/inbox-icon.entry-b9640d5a.cjs +1 -0
  49. package/dist/inbox-icon.entry-c005ebc5.js +16 -0
  50. package/dist/index-05630f15.cjs +57 -0
  51. package/dist/index-78390f2e.js +17607 -0
  52. package/dist/index.d.ts +1 -3
  53. package/dist/{index.es-2b014ec7-72557487.js → index.es-4a203e8e-cf485db5.js} +818 -804
  54. package/dist/{index.es-2b014ec7-0589e68a.cjs → index.es-4a203e8e-f668b8c2.cjs} +6 -6
  55. package/dist/info-icon_2.entry-b17298b6.js +35 -0
  56. package/dist/info-icon_2.entry-ecbc6605.cjs +1 -0
  57. package/dist/input-component.entry-24366ab8.cjs +1 -0
  58. package/dist/input-component.entry-9da5da6c.js +84 -0
  59. package/dist/input-dropdown_2.entry-0109b06c.cjs +1 -0
  60. package/dist/input-dropdown_2.entry-d65f7152.js +231 -0
  61. package/dist/italic-icon.entry-afa4332a.cjs +1 -0
  62. package/dist/{italic-icon.entry-d610e66f.js → italic-icon.entry-d0a536f2.js} +3 -2
  63. package/dist/multi-select-dropdown_2.entry-2c7a1a06.cjs +1 -0
  64. package/dist/multi-select-dropdown_2.entry-c56b5fd2.js +187 -0
  65. package/dist/notebook-store-b61693cd-0877e7a2.js +14 -0
  66. package/dist/notebook-store-b61693cd-a7b8ae37.cjs +5 -0
  67. package/dist/nylas-booked-event-card_12.entry-827c7fb4.cjs +1 -0
  68. package/dist/nylas-booked-event-card_12.entry-960fdfe2.js +1422 -0
  69. package/dist/nylas-call-summary.entry-1cce1446.js +16 -0
  70. package/dist/nylas-call-summary.entry-f10f3c54.cjs +1 -0
  71. package/dist/nylas-event-calendar_3.entry-8bb08ed3.js +9705 -0
  72. package/dist/nylas-event-calendar_3.entry-b656237b.cjs +6 -0
  73. package/dist/nylas-form-card.entry-62578338.cjs +1 -0
  74. package/dist/nylas-form-card.entry-7455b8f1.js +58 -0
  75. package/dist/nylas-if-state.entry-0897dc70.cjs +1 -0
  76. package/dist/{nylas-if-state.entry-ee7d92b0.js → nylas-if-state.entry-7fa6d392.js} +4 -3
  77. package/dist/nylas-key-points.entry-449e1be0.js +29 -0
  78. package/dist/nylas-key-points.entry-693f33a1.cjs +1 -0
  79. package/dist/nylas-login.entry-36544dc8.cjs +1 -0
  80. package/dist/{nylas-login.entry-265f9d0f.js → nylas-login.entry-d7082306.js} +4 -3
  81. package/dist/{nylas-provider.entry-5605a3e0.js → nylas-provider.entry-a0e7ce4d.js} +6 -5
  82. package/dist/nylas-provider.entry-b93d2a62.cjs +1 -0
  83. package/dist/nylas-scheduler-editor.entry-332d27e0.cjs +2 -0
  84. package/dist/{nylas-scheduler-editor.entry-b3e085b3.js → nylas-scheduler-editor.entry-78fe5abf.js} +524 -266
  85. package/dist/nylas-scheduling.entry-1d80c349.cjs +1 -0
  86. package/dist/nylas-scheduling.entry-fa9ff55b.js +439 -0
  87. package/dist/nylas-transcript.entry-570d3abe.cjs +6 -0
  88. package/dist/nylas-transcript.entry-b129565c.js +128 -0
  89. package/dist/nylas-video-player.entry-9c7c9792.cjs +1 -0
  90. package/dist/nylas-video-player.entry-e208d443.js +39 -0
  91. package/dist/nylas-video-preview.entry-a3f542ad.js +16 -0
  92. package/dist/nylas-video-preview.entry-bd9bdda7.cjs +1 -0
  93. package/dist/{person-icon.entry-85660f98.js → person-icon.entry-82fbc43e.js} +8 -7
  94. package/dist/person-icon.entry-e4d11400.cjs +1 -0
  95. package/dist/play-icon.entry-68bc660a.js +16 -0
  96. package/dist/play-icon.entry-9cab598b.cjs +1 -0
  97. package/dist/radio-button-group.entry-6a2adf11.cjs +1 -0
  98. package/dist/radio-button-group.entry-f7679911.js +47 -0
  99. package/dist/react.cjs +1 -1
  100. package/dist/react.js +134 -125
  101. package/dist/refresh-icon.entry-0f1e5f20.cjs +1 -0
  102. package/dist/{refresh-icon.entry-d8644f5d.js → refresh-icon.entry-394b0814.js} +6 -5
  103. package/dist/{register-component-e9c10e19-80bbc4dd.cjs → register-component-1027b769-62812558.cjs} +1 -1
  104. package/dist/{register-component-e9c10e19-099fb50f.js → register-component-1027b769-dd21b16d.js} +1 -1
  105. package/dist/{reply-all-icon.entry-f209daeb.js → reply-all-icon.entry-0fad8f2f.js} +5 -4
  106. package/dist/reply-all-icon.entry-1680f1e5.cjs +1 -0
  107. package/dist/{reply-icon.entry-d37a129b.js → reply-icon.entry-5f4b7837.js} +5 -4
  108. package/dist/reply-icon.entry-77342442.cjs +1 -0
  109. package/dist/scheduler-config-store-d6729d8d-06a3a314.cjs +1 -0
  110. package/dist/{scheduler-config-store-ed4a8dfd-35ec90c6.js → scheduler-config-store-d6729d8d-854b5da8.js} +4 -1
  111. package/dist/scheduler-store-f3e2a26f-7cee436f.cjs +1 -0
  112. package/dist/scheduler-store-f3e2a26f-85df53f7.js +533 -0
  113. package/dist/sent-icon.entry-20a8945d.cjs +1 -0
  114. package/dist/sent-icon.entry-2d122865.js +16 -0
  115. package/dist/spam-icon.entry-86178cc5.cjs +1 -0
  116. package/dist/spam-icon.entry-9e374d44.js +16 -0
  117. package/dist/star-icon.entry-1b94c861.cjs +1 -0
  118. package/dist/{star-icon.entry-9b22bb32.js → star-icon.entry-bb1b517d.js} +7 -6
  119. package/dist/stop-icon.entry-7b21833b.cjs +1 -0
  120. package/dist/{stop-icon.entry-1f7918b2.js → stop-icon.entry-e4d3526d.js} +3 -2
  121. package/dist/textarea-component.entry-ba3c9311.js +39 -0
  122. package/dist/textarea-component.entry-fdba933d.cjs +1 -0
  123. package/dist/toggle-switch.entry-4a980d1d.js +34 -0
  124. package/dist/toggle-switch.entry-9142a3d3.cjs +1 -0
  125. package/dist/{translate-icon.entry-8cffa646.js → translate-icon.entry-1657aa04.js} +5 -4
  126. package/dist/translate-icon.entry-b4908cf3.cjs +1 -0
  127. package/dist/trash-fill-icon.entry-a6791185.cjs +1 -0
  128. package/dist/trash-fill-icon.entry-c9e1769e.js +16 -0
  129. package/dist/{underline-icon.entry-afd9c78b.js → underline-icon.entry-1ba4d923.js} +5 -4
  130. package/dist/underline-icon.entry-d1f91e63.cjs +1 -0
  131. package/dist/warning-icon.entry-b1480f57.cjs +1 -0
  132. package/dist/{warning-icon.entry-53441175.js → warning-icon.entry-fe155c15.js} +5 -4
  133. package/package.json +12 -4
  134. package/dist/add-circle-icon.entry-25aecb13.js +0 -15
  135. package/dist/add-circle-icon.entry-5c49ba96.cjs +0 -1
  136. package/dist/archive-icon.entry-0a9e8ec3.cjs +0 -1
  137. package/dist/archive-icon.entry-89e31121.js +0 -15
  138. package/dist/arrow-icon.entry-19e5237c.cjs +0 -1
  139. package/dist/bold-icon.entry-d591e701.cjs +0 -1
  140. package/dist/button-component_2.entry-ce4314bf.cjs +0 -1
  141. package/dist/calendar-agenda-fill-icon_54.entry-7099138a.js +0 -5865
  142. package/dist/calendar-agenda-fill-icon_54.entry-9228dbe7.cjs +0 -8
  143. package/dist/calendar-cancel-icon.entry-6e3d20f1.cjs +0 -1
  144. package/dist/calendar-check-icon_2.entry-087dd913.cjs +0 -1
  145. package/dist/calendar-icon.entry-73f9d05b.cjs +0 -1
  146. package/dist/checkbox-component_3.entry-bc9768dd.cjs +0 -1
  147. package/dist/checkbox-component_3.entry-d828eb1d.js +0 -149
  148. package/dist/chevron-icon_3.entry-783588a9.js +0 -147
  149. package/dist/chevron-icon_3.entry-e956d78c.cjs +0 -1
  150. package/dist/clock-icon_4.entry-60d41dfd.cjs +0 -1
  151. package/dist/close-icon.entry-1b5d25c5.cjs +0 -1
  152. package/dist/close-icon.entry-fef4f624.js +0 -15
  153. package/dist/constants-6da0ede7-151395ad.cjs +0 -1
  154. package/dist/copy-icon.entry-25699ab8.js +0 -15
  155. package/dist/copy-icon.entry-ab6530e0.cjs +0 -1
  156. package/dist/core-js-38e53e34.cjs +0 -4
  157. package/dist/core-js-a9d3b6e1.js +0 -3297
  158. package/dist/delete-icon.entry-e99e1f82.cjs +0 -1
  159. package/dist/document-refresh-icon.entry-065a59f5.cjs +0 -1
  160. package/dist/dom-68f08be9.cjs +0 -15
  161. package/dist/dom-86e17616.js +0 -664
  162. package/dist/folder-icon.entry-351e61fc.cjs +0 -1
  163. package/dist/forward-icon.entry-0ccfb600.js +0 -15
  164. package/dist/forward-icon.entry-6b7af9cd.cjs +0 -1
  165. package/dist/globe-icon.entry-2b75b66b.cjs +0 -1
  166. package/dist/globe-icon.entry-5ddcd2cb.js +0 -15
  167. package/dist/google-logo-icon_4.entry-04174684.js +0 -790
  168. package/dist/google-logo-icon_4.entry-a685ff91.cjs +0 -1
  169. package/dist/inbox-icon.entry-0ad18b3f.js +0 -15
  170. package/dist/inbox-icon.entry-425d1ded.cjs +0 -1
  171. package/dist/index-7e7c24f1.js +0 -16837
  172. package/dist/index-81719cc6.cjs +0 -81
  173. package/dist/info-icon_2.entry-7ec02802.cjs +0 -1
  174. package/dist/info-icon_2.entry-a6d0e842.js +0 -34
  175. package/dist/input-color-picker.entry-d98d06ca.js +0 -48
  176. package/dist/input-color-picker.entry-ed9a1c07.cjs +0 -1
  177. package/dist/input-component.entry-2e57b00e.cjs +0 -1
  178. package/dist/input-component.entry-f3aa3419.js +0 -70
  179. package/dist/input-dropdown_2.entry-0d9c8475.js +0 -228
  180. package/dist/input-dropdown_2.entry-6fc7df16.cjs +0 -1
  181. package/dist/italic-icon.entry-7a8712f2.cjs +0 -1
  182. package/dist/multi-select-dropdown.entry-b31d9f11.js +0 -116
  183. package/dist/multi-select-dropdown.entry-eaa268b4.cjs +0 -1
  184. package/dist/nylas-booked-event-card_12.entry-45514813.js +0 -1378
  185. package/dist/nylas-booked-event-card_12.entry-498de30a.cjs +0 -1
  186. package/dist/nylas-form-card.entry-67aec298.js +0 -57
  187. package/dist/nylas-form-card.entry-fdb3c114.cjs +0 -1
  188. package/dist/nylas-if-state.entry-76b38c9c.cjs +0 -1
  189. package/dist/nylas-login.entry-589e45d0.cjs +0 -1
  190. package/dist/nylas-provider.entry-cfb9627c.cjs +0 -1
  191. package/dist/nylas-scheduler-editor.entry-6fdfb9b5.cjs +0 -2
  192. package/dist/nylas-scheduling.entry-8cc5c353.cjs +0 -1
  193. package/dist/nylas-scheduling.entry-bc00beba.js +0 -424
  194. package/dist/nylas-time-window-picker.entry-a77c1d67.cjs +0 -1
  195. package/dist/nylas-time-window-picker.entry-c421303e.js +0 -316
  196. package/dist/person-icon.entry-36b21e95.cjs +0 -1
  197. package/dist/play-icon.entry-953b1bc8.js +0 -15
  198. package/dist/play-icon.entry-c35ade8a.cjs +0 -1
  199. package/dist/refresh-icon.entry-038501ca.cjs +0 -1
  200. package/dist/reply-all-icon.entry-ead9d0ba.cjs +0 -1
  201. package/dist/reply-icon.entry-b7f35ecd.cjs +0 -1
  202. package/dist/scheduler-config-store-ed4a8dfd-0d4408cf.cjs +0 -1
  203. package/dist/scheduler-store-dc3a7958-7c73f5e2.js +0 -487
  204. package/dist/scheduler-store-dc3a7958-99c6bdf6.cjs +0 -1
  205. package/dist/sent-icon.entry-b662ef5b.cjs +0 -1
  206. package/dist/sent-icon.entry-ec433cec.js +0 -15
  207. package/dist/spam-icon.entry-3a553ae4.js +0 -15
  208. package/dist/spam-icon.entry-a79819fd.cjs +0 -1
  209. package/dist/star-icon.entry-47ea44e7.cjs +0 -1
  210. package/dist/stop-icon.entry-26e2e633.cjs +0 -1
  211. package/dist/textarea-component.entry-6939d0fc.js +0 -38
  212. package/dist/textarea-component.entry-da0a861e.cjs +0 -1
  213. package/dist/toggle-switch.entry-5ae5ba46.js +0 -33
  214. package/dist/toggle-switch.entry-c5fd3e33.cjs +0 -1
  215. package/dist/translate-icon.entry-72e0369e.cjs +0 -1
  216. package/dist/trash-fill-icon.entry-815859c6.js +0 -15
  217. package/dist/trash-fill-icon.entry-8620c28f.cjs +0 -1
  218. package/dist/underline-icon.entry-ba1a9e87.cjs +0 -1
  219. package/dist/warning-icon.entry-7cbede6b.cjs +0 -1
@@ -1,12 +1,15 @@
1
- var O = Object.defineProperty;
2
- var P = (r, t, n) => t in r ? O(r, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[t] = n;
3
- var S = (r, t, n) => (P(r, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { p as process, b as commonjsGlobal, r as registerInstance, c as createEvent, d as debug, N as NylasIdentityRequestWrapper, i as instance, h, H as Host, g as getElement, B as Buffer, F as Fragment, e as dataResponse } from "./index-7e7c24f1.js";
5
- import { N as NylasBaseProvider, X as Xr } from "./index.es-2b014ec7-72557487.js";
6
- import { C as CreateNylasSchedulerConfigStore } from "./scheduler-config-store-ed4a8dfd-35ec90c6.js";
7
- import { L as LANGUAGE_CODE, a as LANGUAGE_MAP } from "./constants-6da0ede7-49c32ba7.js";
1
+ var _e = Object.defineProperty;
2
+ var be = (r, t, n) => t in r ? _e(r, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[t] = n;
3
+ var P = (r, t, n) => (be(r, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import { b as dayjs, u as utc, t as timezone, p as process, e as commonjsGlobal, r as registerInstance, c as createEvent, d as debug, N as NylasIdentityRequestWrapper, i as instance, h, H as Host, g as getElement, B as Buffer, F as Fragment, f as dataResponse, j as getCalendarRange } from "./index-78390f2e.js";
5
+ import { N as NylasBaseProvider, X as Xr } from "./index.es-4a203e8e-cf485db5.js";
6
+ import { C as CreateNylasSchedulerConfigStore } from "./scheduler-config-store-d6729d8d-854b5da8.js";
7
+ import { L as LANGUAGE_CODE, a as LANGUAGE_MAP, C as CONFIGURATION_EVENT_TYPE, E as EXPERIMENTAL_FEATURES } from "./constants-3d8016e3-3c080f00.js";
8
8
  import "react";
9
+ import "react/jsx-runtime";
9
10
  import "react-dom";
11
+ dayjs.extend(utc);
12
+ dayjs.extend(timezone);
10
13
  class NylasSchedulerConfigAPIConnector {
11
14
  constructor({ nylasApiRequest: t, nylasSchedulerConfigStore: n }) {
12
15
  this.nylasApiRequest = t, this.nylasSchedulerConfigStore = n;
@@ -31,44 +34,72 @@ class NylasSchedulerConfigAPIConnector {
31
34
  }) : (this.nylasSchedulerConfigStore.state.calendars = t.data, dataResponse(t.data));
32
35
  }
33
36
  async getConfigurationById(t, n = !1) {
34
- var a;
37
+ var l;
35
38
  if (!this.nylasApiRequest)
36
39
  return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
37
40
  message: "Error fetching configuration: Nylas API Request is not initialized"
38
41
  });
39
42
  if (!n) {
40
- const d = this.nylasSchedulerConfigStore.state.configurations.find((l) => l.id === t);
43
+ const d = this.nylasSchedulerConfigStore.state.configurations.find((c) => c.id === t);
41
44
  if (d)
42
45
  return this.nylasSchedulerConfigStore.state.selectedConfiguration = d, dataResponse(d);
43
46
  }
44
- const [s, c] = await this.nylasApiRequest.request({
47
+ const [s, a] = await this.nylasApiRequest.request({
45
48
  method: "GET",
46
49
  path: `scheduling/configurations/${t}`
47
50
  });
48
- return c ? dataResponse(null, {
49
- message: "Error fetching configuration: " + c.message
51
+ return a ? dataResponse(null, {
52
+ message: "Error fetching configuration: " + a.message
50
53
  }) : Xr(s) ? dataResponse(null, {
51
- message: "Error fetching configuration: " + ((a = s.error) == null ? void 0 : a.message)
54
+ message: "Error fetching configuration: " + ((l = s.error) == null ? void 0 : l.message)
52
55
  }) : (this.nylasSchedulerConfigStore.state.selectedConfiguration = s.data, this.nylasSchedulerConfigStore.state.configurations.find((d) => d.id === t) ? this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.map((d) => d.id === t ? s.data : d) : this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, s.data], dataResponse(s.data));
53
56
  }
54
57
  async getConfigurations(t) {
55
- var a;
58
+ var l;
56
59
  if (!this.nylasApiRequest)
57
60
  return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
58
61
  message: "Error fetching configurations: Nylas API Request is not initialized"
59
62
  });
60
- const n = 50, [s, c] = await this.nylasApiRequest.request({
63
+ const n = 50, [s, a] = await this.nylasApiRequest.request({
61
64
  method: "GET",
62
65
  path: `scheduling/configurations?limit=${n}${t ? `&page_token=${t}` : ""}`
63
66
  });
64
- return c ? dataResponse(null, {
65
- message: "Error fetching configurations: " + c.message
67
+ return a ? dataResponse(null, {
68
+ message: "Error fetching configurations: " + a.message
66
69
  }) : Xr(s) ? dataResponse(null, {
67
- message: "Error fetching configurations: " + ((a = s.error) == null ? void 0 : a.message)
70
+ message: "Error fetching configurations: " + ((l = s.error) == null ? void 0 : l.message)
68
71
  }) : (this.nylasSchedulerConfigStore.state.configurations = s.data, this.nylasSchedulerConfigStore.state.listConfigurationsNextCursor = s.next_cursor || null, dataResponse(s.data));
69
72
  }
73
+ async getMasterEventById(t) {
74
+ var u, f;
75
+ if (!this.nylasApiRequest)
76
+ return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
77
+ message: "Error fetching master event: Nylas API Request is not initialized"
78
+ });
79
+ const n = this.nylasSchedulerConfigStore.state.selectedGroupEvent, s = (u = n == null ? void 0 : n.event) == null ? void 0 : u.calendar_id;
80
+ if (!s)
81
+ return console.warn("Calendar ID is not present"), dataResponse(null, {
82
+ message: "Error fetching master event: Calendar ID is not present"
83
+ });
84
+ const a = new URLSearchParams();
85
+ a.append("calendar_id", s);
86
+ const [l, d] = await this.nylasApiRequest.request({
87
+ method: "GET",
88
+ path: `events/${t}?${a.toString()}`
89
+ });
90
+ if (d)
91
+ return dataResponse(null, {
92
+ message: "Error fetching master event: " + d.message
93
+ });
94
+ if (Xr(l))
95
+ return dataResponse(null, {
96
+ message: "Error fetching master event: " + ((f = l.error) == null ? void 0 : f.message)
97
+ });
98
+ const c = this.nylasSchedulerConfigStore.state.masterGroupEvents;
99
+ return c[t] ? this.nylasSchedulerConfigStore.state.masterGroupEvents[t] = l.data : this.nylasSchedulerConfigStore.state.masterGroupEvents = { ...c, [t]: l.data }, dataResponse(l.data);
100
+ }
70
101
  async createConfiguration(t) {
71
- var c;
102
+ var a;
72
103
  if (!this.nylasApiRequest)
73
104
  return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
74
105
  message: "Error creating configuration: Nylas API Request is not initialized"
@@ -81,11 +112,11 @@ class NylasSchedulerConfigAPIConnector {
81
112
  return s ? dataResponse(null, {
82
113
  message: "Error creating configuration: " + s.message
83
114
  }) : Xr(n) ? dataResponse(null, {
84
- message: "Error creating configuration: " + ((c = n.error) == null ? void 0 : c.message)
115
+ message: "Error creating configuration: " + ((a = n.error) == null ? void 0 : a.message)
85
116
  }) : (this.nylasSchedulerConfigStore.state.selectedConfiguration = n.data, this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, n.data], dataResponse(n.data));
86
117
  }
87
118
  async updateConfiguration(t) {
88
- var c;
119
+ var a;
89
120
  if (!this.nylasApiRequest)
90
121
  return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
91
122
  message: "Error updating configuration: Nylas API Request is not initialized"
@@ -98,11 +129,11 @@ class NylasSchedulerConfigAPIConnector {
98
129
  return s ? dataResponse(null, {
99
130
  message: "Error updating configuration: " + s.message
100
131
  }) : Xr(n) ? dataResponse(null, {
101
- message: "Error updating configuration: " + ((c = n.error) == null ? void 0 : c.message)
102
- }) : (this.nylasSchedulerConfigStore.state.selectedConfiguration = n.data, this.nylasSchedulerConfigStore.state.configurations.find((a) => a.id === t.id) ? this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.map((a) => a.id === t.id ? n.data : a) : this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, n.data], dataResponse(n.data));
132
+ message: "Error updating configuration: " + ((a = n.error) == null ? void 0 : a.message)
133
+ }) : (this.nylasSchedulerConfigStore.state.selectedConfiguration = n.data, this.nylasSchedulerConfigStore.state.configurations.find((l) => l.id === t.id) ? this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.map((l) => l.id === t.id ? n.data : l) : this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, n.data], dataResponse(n.data));
103
134
  }
104
135
  async deleteConfiguration(t) {
105
- var c, a;
136
+ var a, l;
106
137
  if (!this.nylasApiRequest)
107
138
  return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
108
139
  message: "Error deleting configuration: Nylas API Request is not initialized"
@@ -114,8 +145,178 @@ class NylasSchedulerConfigAPIConnector {
114
145
  return s ? dataResponse(null, {
115
146
  message: "Error deleting configuration: " + s.message
116
147
  }) : Xr(n) ? dataResponse(null, {
117
- message: "Error deleting configuration: " + ((c = n.error) == null ? void 0 : c.message)
118
- }) : (this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.filter((d) => d.id !== t), ((a = this.nylasSchedulerConfigStore.state.selectedConfiguration) == null ? void 0 : a.id) === t && this.nylasSchedulerConfigStore.resetSelectedConfiguration(), dataResponse(n.data));
148
+ message: "Error deleting configuration: " + ((a = n.error) == null ? void 0 : a.message)
149
+ }) : (this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.filter((d) => d.id !== t), ((l = this.nylasSchedulerConfigStore.state.selectedConfiguration) == null ? void 0 : l.id) === t && this.nylasSchedulerConfigStore.resetSelectedConfiguration(), dataResponse(n.data));
150
+ }
151
+ async createGroupEvent(t, n) {
152
+ var l;
153
+ if (this.nylasSchedulerConfigStore.state.isLoading = !0, !this.nylasApiRequest)
154
+ return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
155
+ message: "Error creating group event: Nylas API Request is not initialized"
156
+ });
157
+ const [s, a] = await this.nylasApiRequest.request({
158
+ method: "POST",
159
+ path: `scheduling/configurations/${n}/group-events`,
160
+ body: t
161
+ });
162
+ return a ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
163
+ message: "Error creating group event: " + a.message
164
+ })) : Xr(s) ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
165
+ message: "Error creating group event: " + ((l = s.error) == null ? void 0 : l.message)
166
+ })) : (this.nylasSchedulerConfigStore.state.selectedGroupEvent = s.data, await this.getGroupEvents(n), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(s.data));
167
+ }
168
+ async getGroupEvents(t) {
169
+ var c, u, f;
170
+ if (!this.nylasApiRequest)
171
+ return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
172
+ message: "Error fetching group events: Nylas API Request is not initialized"
173
+ });
174
+ const n = new URLSearchParams();
175
+ n.append("show_all", "true");
176
+ const s = this.nylasSchedulerConfigStore.state.calendarViewDateRange;
177
+ if (s)
178
+ n.append("start_time", s.start_time), n.append("end_time", s.end_time);
179
+ else {
180
+ const { startTime: p, endTime: g } = getCalendarRange((/* @__PURE__ */ new Date()).toISOString(), "week");
181
+ n.append("start_time", p.toString()), n.append("end_time", g.toString());
182
+ }
183
+ const a = (u = (c = this.nylasSchedulerConfigStore.state.selectedConfiguration) == null ? void 0 : c.group_booking) == null ? void 0 : u.calendar_id;
184
+ a && n.append("calendar_id", a);
185
+ const [l, d] = await this.nylasApiRequest.request({
186
+ method: "GET",
187
+ path: `scheduling/configurations/${t}/group-events?${n.toString()}`
188
+ });
189
+ return d ? dataResponse(null, {
190
+ message: "Error fetching group events: " + d.message
191
+ }) : Xr(l) ? dataResponse(null, {
192
+ message: "Error fetching group events: " + ((f = l.error) == null ? void 0 : f.message)
193
+ }) : (this.nylasSchedulerConfigStore.state.groupEvents = l.data, dataResponse(l.data));
194
+ }
195
+ async updateGroupEventById(t, n) {
196
+ var d;
197
+ if (this.nylasSchedulerConfigStore.state.isLoading = !0, !this.nylasApiRequest)
198
+ return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
199
+ message: "Error updating group event: Nylas API Request is not initialized"
200
+ });
201
+ const s = t.id;
202
+ delete t.id;
203
+ const [a, l] = await this.nylasApiRequest.request({
204
+ method: "PATCH",
205
+ path: `scheduling/configurations/${n}/group-events/${s}`,
206
+ body: t
207
+ });
208
+ return l ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
209
+ message: "Error updating group event: " + l.message
210
+ })) : Xr(a) ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
211
+ message: "Error updating group event: " + ((d = a.error) == null ? void 0 : d.message)
212
+ })) : (this.nylasSchedulerConfigStore.state.selectedGroupEvent = a.data, await this.getGroupEvents(n), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(a.data));
213
+ }
214
+ async updateGroupEvent(t, n, s) {
215
+ var g, m, y, w, b, x, R, A, k, U, N, O, I, T;
216
+ this.nylasSchedulerConfigStore.state.isLoading = !0;
217
+ const a = this.nylasSchedulerConfigStore.state.selectedGroupEvent, l = (g = a == null ? void 0 : a.event) == null ? void 0 : g.master_event_id, d = (m = a == null ? void 0 : a.event) == null ? void 0 : m.id, c = (w = (y = a == null ? void 0 : a.event) == null ? void 0 : y.when) == null ? void 0 : w.start_time, u = (x = (b = a == null ? void 0 : a.group_event_info) == null ? void 0 : b.rrule) == null ? void 0 : x[0], f = u ? u.split(";").filter((S) => !S.startsWith("UNTIL")).join(";") : "", p = c ? dayjs(c * 1e3).subtract(1, "minute").format("YYYYMMDDTHHmmss[Z]") : "";
218
+ if (n === "this")
219
+ return this.updateGroupEventById({
220
+ ...t,
221
+ id: d,
222
+ recurrence: l ? void 0 : t.recurrence
223
+ }, s);
224
+ if (n === "future" && l) {
225
+ const S = await this.createGroupEvent(t, s), v = {
226
+ location: (R = a == null ? void 0 : a.event) == null ? void 0 : R.location,
227
+ conferencing: (A = a == null ? void 0 : a.event) == null ? void 0 : A.conferencing,
228
+ title: (k = a == null ? void 0 : a.event) == null ? void 0 : k.title,
229
+ description: (U = a == null ? void 0 : a.event) == null ? void 0 : U.description,
230
+ capacity: (N = a == null ? void 0 : a.group_event_info) == null ? void 0 : N.capacity,
231
+ calendar_id: (O = a == null ? void 0 : a.event) == null ? void 0 : O.calendar_id,
232
+ recurrence: f ? [f + ";UNTIL=" + p] : [`RRULE:FREQ=DAILY;UNTIL=${p}`]
233
+ };
234
+ return await this.updateGroupEventById({
235
+ ...v,
236
+ id: l
237
+ }, s), [v, S];
238
+ } else if (n === "all") {
239
+ const S = t == null ? void 0 : t.when, v = (I = a == null ? void 0 : a.event) == null ? void 0 : I.when, L = (T = this.nylasSchedulerConfigStore.state.masterGroupEvents) == null ? void 0 : T[l];
240
+ let _ = L == null ? void 0 : L.when;
241
+ return (S == null ? void 0 : S.start_time) !== (v == null ? void 0 : v.start_time) && (_ = {
242
+ ..._,
243
+ start_time: (S == null ? void 0 : S.start_time) || (_ == null ? void 0 : _.start_time)
244
+ }), (S == null ? void 0 : S.end_time) !== (v == null ? void 0 : v.end_time) && (_ = {
245
+ ..._,
246
+ end_time: (S == null ? void 0 : S.end_time) || (_ == null ? void 0 : _.end_time)
247
+ }), (S == null ? void 0 : S.start_timezone) !== (v == null ? void 0 : v.start_timezone) && (_ = {
248
+ ..._,
249
+ start_timezone: (S == null ? void 0 : S.start_timezone) || (_ == null ? void 0 : _.start_timezone)
250
+ }), (S == null ? void 0 : S.end_timezone) !== (v == null ? void 0 : v.end_timezone) && (_ = {
251
+ ..._,
252
+ end_timezone: (S == null ? void 0 : S.end_timezone) || (_ == null ? void 0 : _.end_timezone)
253
+ }), this.updateGroupEventById({
254
+ ...t,
255
+ when: _,
256
+ id: l
257
+ }, s);
258
+ }
259
+ throw this.nylasSchedulerConfigStore.state.isLoading = !1, new Error("Invalid option");
260
+ }
261
+ async deleteGroupEvent(t, n, s) {
262
+ var m, y, w, b, x, R, A, k, U, N, O, I;
263
+ this.nylasSchedulerConfigStore.state.isLoading = !0;
264
+ const a = this.nylasSchedulerConfigStore.state.selectedGroupEvent, l = (m = a == null ? void 0 : a.event) == null ? void 0 : m.master_event_id, d = (y = a == null ? void 0 : a.event) == null ? void 0 : y.id, c = (b = (w = a == null ? void 0 : a.event) == null ? void 0 : w.when) == null ? void 0 : b.start_time, u = (R = (x = a == null ? void 0 : a.group_event_info) == null ? void 0 : x.rrule) == null ? void 0 : R[0], f = u ? u.split(";").filter((T) => !T.startsWith("UNTIL")).join(";") : "", p = c ? dayjs(c * 1e3).format("YYYYMMDDTHHmmss[Z]") : "", g = {
265
+ location: (A = a == null ? void 0 : a.event) == null ? void 0 : A.location,
266
+ conferencing: (k = a == null ? void 0 : a.event) == null ? void 0 : k.conferencing,
267
+ title: (U = a == null ? void 0 : a.event) == null ? void 0 : U.title,
268
+ description: (N = a == null ? void 0 : a.event) == null ? void 0 : N.description,
269
+ capacity: (O = a == null ? void 0 : a.group_event_info) == null ? void 0 : O.capacity,
270
+ calendar_id: (I = a == null ? void 0 : a.event) == null ? void 0 : I.calendar_id,
271
+ recurrence: f ? [f + ";UNTIL=" + p] : [`RRULE:UNTIL=${p}`]
272
+ };
273
+ if (n === "this" && d)
274
+ return this.deleteGroupEventById(d, s);
275
+ if (n === "future" && l && d)
276
+ return await this.deleteGroupEventById(d, s), await this.updateGroupEventById({
277
+ ...g,
278
+ id: l
279
+ }, s);
280
+ if (n === "all" && l)
281
+ return this.deleteGroupEventById(l, s);
282
+ throw this.nylasSchedulerConfigStore.state.isLoading = !1, new Error("Invalid option");
283
+ }
284
+ async deleteGroupEventById(t, n) {
285
+ var c, u, f;
286
+ if (this.nylasSchedulerConfigStore.state.isLoading = !0, !this.nylasApiRequest)
287
+ return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
288
+ message: "Error deleting group event: Nylas API Request is not initialized"
289
+ });
290
+ const s = new URLSearchParams(), a = (u = (c = this.nylasSchedulerConfigStore.state.selectedConfiguration) == null ? void 0 : c.group_booking) == null ? void 0 : u.calendar_id;
291
+ a && s.append("calendar_id", a);
292
+ const [l, d] = await this.nylasApiRequest.request({
293
+ method: "DELETE",
294
+ path: `scheduling/configurations/${n}/group-events/${t}?calendar_id=${a}`
295
+ });
296
+ return d ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
297
+ message: "Error deleting group event: " + d.message
298
+ })) : Xr(l) ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
299
+ message: "Error deleting group event: " + ((f = l.error) == null ? void 0 : f.message)
300
+ })) : (await this.getGroupEvents(n), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(l.data));
301
+ }
302
+ async importGroupEvent(t, n) {
303
+ var c, u, f, p, g;
304
+ if (this.nylasSchedulerConfigStore.state.isLoading = !0, !this.nylasApiRequest)
305
+ return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
306
+ message: "Error importing group event: Nylas API Request is not initialized"
307
+ });
308
+ const s = new URLSearchParams(), a = (u = (c = this.nylasSchedulerConfigStore.state.selectedConfiguration) == null ? void 0 : c.group_booking) == null ? void 0 : u.calendar_id;
309
+ a && s.append("calendar_id", a);
310
+ const [l, d] = await this.nylasApiRequest.request({
311
+ method: "POST",
312
+ path: `scheduling/configurations/${n}/import-group-events?${s.toString()}`,
313
+ body: t
314
+ });
315
+ return d ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
316
+ message: "Error importing group event: " + d.message
317
+ })) : Xr(l) ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
318
+ message: "Error importing group event: " + ((f = l.error) == null ? void 0 : f.message)
319
+ })) : (((g = (p = l.data) == null ? void 0 : p.imported_events) == null ? void 0 : g.length) > 0 && await this.getGroupEvents(n), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(l.data));
119
320
  }
120
321
  }
121
322
  class NylasSchedulerConfigConnector {
@@ -162,7 +363,7 @@ class LocalStorage {
162
363
  const PKCE_KEY = "pkce", GRANT_KEY = "grant", USER_KEY = "user";
163
364
  class Storage {
164
365
  constructor(t) {
165
- S(this, "Storage", new LocalStorage());
366
+ P(this, "Storage", new LocalStorage());
166
367
  if (t) {
167
368
  this.Storage = t;
168
369
  return;
@@ -200,12 +401,12 @@ class Storage {
200
401
  async setUserToken(t) {
201
402
  const n = await this.getUserTokens();
202
403
  if (n)
203
- if (n.find((c) => c.sub === t.sub)) {
204
- const c = n.map((a) => (a.sub === t.sub && (a = t), a));
205
- this.Storage.set(USER_KEY, c);
404
+ if (n.find((a) => a.sub === t.sub)) {
405
+ const a = n.map((l) => (l.sub === t.sub && (l = t), l));
406
+ this.Storage.set(USER_KEY, a);
206
407
  } else {
207
- const c = [...n, t];
208
- this.Storage.set(USER_KEY, c);
408
+ const a = [...n, t];
409
+ this.Storage.set(USER_KEY, a);
209
410
  }
210
411
  else
211
412
  this.Storage.set(USER_KEY, [t]);
@@ -213,7 +414,7 @@ class Storage {
213
414
  // getUserToken is used to retrieve a specific IDToken from storage
214
415
  async getUserToken(t = "") {
215
416
  const n = await this.Storage.get(USER_KEY);
216
- return n ? t === "" ? n[0] : n.find((c) => c.sub === t) : null;
417
+ return n ? t === "" ? n[0] : n.find((a) => a.sub === t) : null;
217
418
  }
218
419
  // getUserTokens is used to retrieve all IDTokens from storage
219
420
  async getUserTokens() {
@@ -226,7 +427,7 @@ class Storage {
226
427
  }
227
428
  // removeUserToken is used to remove a specific IDToken from storage
228
429
  async removeUserToken(t) {
229
- const n = await this.getUserTokens(), s = n == null ? void 0 : n.filter((c) => c.sub !== t);
430
+ const n = await this.getUserTokens(), s = n == null ? void 0 : n.filter((a) => a.sub !== t);
230
431
  this.Storage.set(USER_KEY, s);
231
432
  }
232
433
  async clearSession() {
@@ -238,59 +439,59 @@ class Storage {
238
439
  }
239
440
  class IndexedDBStorage {
240
441
  constructor() {
241
- S(this, "databaseName", "identity-db");
242
- S(this, "storeName", "identity");
442
+ P(this, "databaseName", "identity-db");
443
+ P(this, "storeName", "identity");
243
444
  }
244
445
  get(t) {
245
446
  const n = this;
246
- return new Promise((s, c) => {
247
- n.openDatabase().then(function(a) {
248
- const d = a.transaction(n.storeName, "readwrite"), u = d.objectStore(n.storeName).get(t);
447
+ return new Promise((s, a) => {
448
+ n.openDatabase().then(function(l) {
449
+ const d = l.transaction(n.storeName, "readwrite"), u = d.objectStore(n.storeName).get(t);
249
450
  u.onsuccess = () => {
250
451
  s(u.result);
251
452
  }, u.onerror = () => {
252
- c(u.error);
453
+ a(u.error);
253
454
  }, d.oncomplete = () => {
254
- a.close();
455
+ l.close();
255
456
  };
256
457
  });
257
458
  });
258
459
  }
259
460
  async remove(t) {
260
461
  const n = this;
261
- return new Promise((s, c) => {
262
- const a = indexedDB.open(this.databaseName);
263
- a.onupgradeneeded = function(d) {
462
+ return new Promise((s, a) => {
463
+ const l = indexedDB.open(this.databaseName);
464
+ l.onupgradeneeded = function(d) {
264
465
  d.target.result.createObjectStore(n.storeName);
265
- }, a.onerror = () => {
266
- c(a.error);
267
- }, a.onsuccess = (d) => {
268
- const l = d.target.result, u = l.transaction(this.storeName, "readwrite"), y = u.objectStore(this.storeName).delete(t);
269
- y.onsuccess = () => {
466
+ }, l.onerror = () => {
467
+ a(l.error);
468
+ }, l.onsuccess = (d) => {
469
+ const c = d.target.result, u = c.transaction(this.storeName, "readwrite"), p = u.objectStore(this.storeName).delete(t);
470
+ p.onsuccess = () => {
270
471
  s(null);
271
- }, y.onerror = () => {
272
- c(y.error);
472
+ }, p.onerror = () => {
473
+ a(p.error);
273
474
  }, u.oncomplete = () => {
274
- l.close();
475
+ c.close();
275
476
  };
276
477
  };
277
478
  });
278
479
  }
279
480
  set(t, n) {
280
- return new Promise((s, c) => {
281
- const a = indexedDB.open(this.databaseName);
282
- a.onerror = () => {
283
- c(a.error);
284
- }, a.onupgradeneeded = (d) => {
481
+ return new Promise((s, a) => {
482
+ const l = indexedDB.open(this.databaseName);
483
+ l.onerror = () => {
484
+ a(l.error);
485
+ }, l.onupgradeneeded = (d) => {
285
486
  d.target.result.createObjectStore(this.storeName);
286
- }, a.onsuccess = (d) => {
287
- const l = d.target.result, u = l.transaction(this.storeName, "readwrite"), y = u.objectStore(this.storeName).put(n, t);
288
- y.onsuccess = () => {
487
+ }, l.onsuccess = (d) => {
488
+ const c = d.target.result, u = c.transaction(this.storeName, "readwrite"), p = u.objectStore(this.storeName).put(n, t);
489
+ p.onsuccess = () => {
289
490
  s(n);
290
- }, y.onerror = () => {
291
- c(y.error);
491
+ }, p.onerror = () => {
492
+ a(p.error);
292
493
  }, u.oncomplete = () => {
293
- l.close();
494
+ c.close();
294
495
  };
295
496
  };
296
497
  });
@@ -298,13 +499,13 @@ class IndexedDBStorage {
298
499
  openDatabase() {
299
500
  const t = this;
300
501
  return new Promise(function(n, s) {
301
- const c = indexedDB.open(t.databaseName, 2);
302
- c.onupgradeneeded = function(a) {
303
- a.target.result.createObjectStore(t.storeName);
304
- }, c.onsuccess = function(a) {
305
- n(a.target.result);
306
- }, c.onerror = function(a) {
307
- s(a.error);
502
+ const a = indexedDB.open(t.databaseName, 2);
503
+ a.onupgradeneeded = function(l) {
504
+ l.target.result.createObjectStore(t.storeName);
505
+ }, a.onsuccess = function(l) {
506
+ n(l.target.result);
507
+ }, a.onerror = function(l) {
508
+ s(l.error);
308
509
  };
309
510
  });
310
511
  }
@@ -395,8 +596,8 @@ var sha256 = { exports: {} };
395
596
  var t = createOutputMethod("hex", r);
396
597
  NODE_JS && (t = nodeWrap(t, r)), t.create = function() {
397
598
  return new Sha256(r);
398
- }, t.update = function(c) {
399
- return t.create().update(c);
599
+ }, t.update = function(a) {
600
+ return t.create().update(a);
400
601
  };
401
602
  for (var n = 0; n < OUTPUT_TYPES.length; ++n) {
402
603
  var s = OUTPUT_TYPES[n];
@@ -418,10 +619,10 @@ var sha256 = { exports: {} };
418
619
  };
419
620
  }, createHmacMethod = function(r) {
420
621
  var t = createHmacOutputMethod("hex", r);
421
- t.create = function(c) {
422
- return new HmacSha256(c, r);
423
- }, t.update = function(c, a) {
424
- return t.create(c).update(a);
622
+ t.create = function(a) {
623
+ return new HmacSha256(a, r);
624
+ }, t.update = function(a, l) {
625
+ return t.create(a).update(l);
425
626
  };
426
627
  for (var n = 0; n < OUTPUT_TYPES.length; ++n) {
427
628
  var s = OUTPUT_TYPES[n];
@@ -447,14 +648,14 @@ var sha256 = { exports: {} };
447
648
  throw new Error(ERROR);
448
649
  t = !0;
449
650
  }
450
- for (var s, c = 0, a, d = r.length, l = this.blocks; c < d; ) {
451
- if (this.hashed && (this.hashed = !1, l[0] = this.block, l[16] = l[1] = l[2] = l[3] = l[4] = l[5] = l[6] = l[7] = l[8] = l[9] = l[10] = l[11] = l[12] = l[13] = l[14] = l[15] = 0), t)
452
- for (a = this.start; c < d && a < 64; ++c)
453
- l[a >> 2] |= r[c] << SHIFT[a++ & 3];
651
+ for (var s, a = 0, l, d = r.length, c = this.blocks; a < d; ) {
652
+ if (this.hashed && (this.hashed = !1, c[0] = this.block, c[16] = c[1] = c[2] = c[3] = c[4] = c[5] = c[6] = c[7] = c[8] = c[9] = c[10] = c[11] = c[12] = c[13] = c[14] = c[15] = 0), t)
653
+ for (l = this.start; a < d && l < 64; ++a)
654
+ c[l >> 2] |= r[a] << SHIFT[l++ & 3];
454
655
  else
455
- for (a = this.start; c < d && a < 64; ++c)
456
- s = r.charCodeAt(c), s < 128 ? l[a >> 2] |= s << SHIFT[a++ & 3] : s < 2048 ? (l[a >> 2] |= (192 | s >> 6) << SHIFT[a++ & 3], l[a >> 2] |= (128 | s & 63) << SHIFT[a++ & 3]) : s < 55296 || s >= 57344 ? (l[a >> 2] |= (224 | s >> 12) << SHIFT[a++ & 3], l[a >> 2] |= (128 | s >> 6 & 63) << SHIFT[a++ & 3], l[a >> 2] |= (128 | s & 63) << SHIFT[a++ & 3]) : (s = 65536 + ((s & 1023) << 10 | r.charCodeAt(++c) & 1023), l[a >> 2] |= (240 | s >> 18) << SHIFT[a++ & 3], l[a >> 2] |= (128 | s >> 12 & 63) << SHIFT[a++ & 3], l[a >> 2] |= (128 | s >> 6 & 63) << SHIFT[a++ & 3], l[a >> 2] |= (128 | s & 63) << SHIFT[a++ & 3]);
457
- this.lastByteIndex = a, this.bytes += a - this.start, a >= 64 ? (this.block = l[16], this.start = a - 64, this.hash(), this.hashed = !0) : this.start = a;
656
+ for (l = this.start; a < d && l < 64; ++a)
657
+ s = r.charCodeAt(a), s < 128 ? c[l >> 2] |= s << SHIFT[l++ & 3] : s < 2048 ? (c[l >> 2] |= (192 | s >> 6) << SHIFT[l++ & 3], c[l >> 2] |= (128 | s & 63) << SHIFT[l++ & 3]) : s < 55296 || s >= 57344 ? (c[l >> 2] |= (224 | s >> 12) << SHIFT[l++ & 3], c[l >> 2] |= (128 | s >> 6 & 63) << SHIFT[l++ & 3], c[l >> 2] |= (128 | s & 63) << SHIFT[l++ & 3]) : (s = 65536 + ((s & 1023) << 10 | r.charCodeAt(++a) & 1023), c[l >> 2] |= (240 | s >> 18) << SHIFT[l++ & 3], c[l >> 2] |= (128 | s >> 12 & 63) << SHIFT[l++ & 3], c[l >> 2] |= (128 | s >> 6 & 63) << SHIFT[l++ & 3], c[l >> 2] |= (128 | s & 63) << SHIFT[l++ & 3]);
658
+ this.lastByteIndex = l, this.bytes += l - this.start, l >= 64 ? (this.block = c[16], this.start = l - 64, this.hash(), this.hashed = !0) : this.start = l;
458
659
  }
459
660
  return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;
460
661
  }
@@ -465,19 +666,19 @@ var sha256 = { exports: {} };
465
666
  r[16] = this.block, r[t >> 2] |= EXTRA[t & 3], this.block = r[16], t >= 56 && (this.hashed || this.hash(), r[0] = this.block, r[16] = r[1] = r[2] = r[3] = r[4] = r[5] = r[6] = r[7] = r[8] = r[9] = r[10] = r[11] = r[12] = r[13] = r[14] = r[15] = 0), r[14] = this.hBytes << 3 | this.bytes >>> 29, r[15] = this.bytes << 3, this.hash();
466
667
  }
467
668
  }, Sha256.prototype.hash = function() {
468
- var r = this.h0, t = this.h1, n = this.h2, s = this.h3, c = this.h4, a = this.h5, d = this.h6, l = this.h7, u = this.blocks, f, y, g, m, p, w, b, v, x, _, A;
669
+ var r = this.h0, t = this.h1, n = this.h2, s = this.h3, a = this.h4, l = this.h5, d = this.h6, c = this.h7, u = this.blocks, f, p, g, m, y, w, b, x, R, A, k;
469
670
  for (f = 16; f < 64; ++f)
470
- p = u[f - 15], y = (p >>> 7 | p << 25) ^ (p >>> 18 | p << 14) ^ p >>> 3, p = u[f - 2], g = (p >>> 17 | p << 15) ^ (p >>> 19 | p << 13) ^ p >>> 10, u[f] = u[f - 16] + y + u[f - 7] + g << 0;
471
- for (A = t & n, f = 0; f < 64; f += 4)
472
- this.first ? (this.is224 ? (v = 300032, p = u[0] - 1413257819, l = p - 150054599 << 0, s = p + 24177077 << 0) : (v = 704751109, p = u[0] - 210244248, l = p - 1521486534 << 0, s = p + 143694565 << 0), this.first = !1) : (y = (r >>> 2 | r << 30) ^ (r >>> 13 | r << 19) ^ (r >>> 22 | r << 10), g = (c >>> 6 | c << 26) ^ (c >>> 11 | c << 21) ^ (c >>> 25 | c << 7), v = r & t, m = v ^ r & n ^ A, b = c & a ^ ~c & d, p = l + g + b + K[f] + u[f], w = y + m, l = s + p << 0, s = p + w << 0), y = (s >>> 2 | s << 30) ^ (s >>> 13 | s << 19) ^ (s >>> 22 | s << 10), g = (l >>> 6 | l << 26) ^ (l >>> 11 | l << 21) ^ (l >>> 25 | l << 7), x = s & r, m = x ^ s & t ^ v, b = l & c ^ ~l & a, p = d + g + b + K[f + 1] + u[f + 1], w = y + m, d = n + p << 0, n = p + w << 0, y = (n >>> 2 | n << 30) ^ (n >>> 13 | n << 19) ^ (n >>> 22 | n << 10), g = (d >>> 6 | d << 26) ^ (d >>> 11 | d << 21) ^ (d >>> 25 | d << 7), _ = n & s, m = _ ^ n & r ^ x, b = d & l ^ ~d & c, p = a + g + b + K[f + 2] + u[f + 2], w = y + m, a = t + p << 0, t = p + w << 0, y = (t >>> 2 | t << 30) ^ (t >>> 13 | t << 19) ^ (t >>> 22 | t << 10), g = (a >>> 6 | a << 26) ^ (a >>> 11 | a << 21) ^ (a >>> 25 | a << 7), A = t & n, m = A ^ t & s ^ _, b = a & d ^ ~a & l, p = c + g + b + K[f + 3] + u[f + 3], w = y + m, c = r + p << 0, r = p + w << 0;
473
- this.h0 = this.h0 + r << 0, this.h1 = this.h1 + t << 0, this.h2 = this.h2 + n << 0, this.h3 = this.h3 + s << 0, this.h4 = this.h4 + c << 0, this.h5 = this.h5 + a << 0, this.h6 = this.h6 + d << 0, this.h7 = this.h7 + l << 0;
671
+ y = u[f - 15], p = (y >>> 7 | y << 25) ^ (y >>> 18 | y << 14) ^ y >>> 3, y = u[f - 2], g = (y >>> 17 | y << 15) ^ (y >>> 19 | y << 13) ^ y >>> 10, u[f] = u[f - 16] + p + u[f - 7] + g << 0;
672
+ for (k = t & n, f = 0; f < 64; f += 4)
673
+ this.first ? (this.is224 ? (x = 300032, y = u[0] - 1413257819, c = y - 150054599 << 0, s = y + 24177077 << 0) : (x = 704751109, y = u[0] - 210244248, c = y - 1521486534 << 0, s = y + 143694565 << 0), this.first = !1) : (p = (r >>> 2 | r << 30) ^ (r >>> 13 | r << 19) ^ (r >>> 22 | r << 10), g = (a >>> 6 | a << 26) ^ (a >>> 11 | a << 21) ^ (a >>> 25 | a << 7), x = r & t, m = x ^ r & n ^ k, b = a & l ^ ~a & d, y = c + g + b + K[f] + u[f], w = p + m, c = s + y << 0, s = y + w << 0), p = (s >>> 2 | s << 30) ^ (s >>> 13 | s << 19) ^ (s >>> 22 | s << 10), g = (c >>> 6 | c << 26) ^ (c >>> 11 | c << 21) ^ (c >>> 25 | c << 7), R = s & r, m = R ^ s & t ^ x, b = c & a ^ ~c & l, y = d + g + b + K[f + 1] + u[f + 1], w = p + m, d = n + y << 0, n = y + w << 0, p = (n >>> 2 | n << 30) ^ (n >>> 13 | n << 19) ^ (n >>> 22 | n << 10), g = (d >>> 6 | d << 26) ^ (d >>> 11 | d << 21) ^ (d >>> 25 | d << 7), A = n & s, m = A ^ n & r ^ R, b = d & c ^ ~d & a, y = l + g + b + K[f + 2] + u[f + 2], w = p + m, l = t + y << 0, t = y + w << 0, p = (t >>> 2 | t << 30) ^ (t >>> 13 | t << 19) ^ (t >>> 22 | t << 10), g = (l >>> 6 | l << 26) ^ (l >>> 11 | l << 21) ^ (l >>> 25 | l << 7), k = t & n, m = k ^ t & s ^ A, b = l & d ^ ~l & c, y = a + g + b + K[f + 3] + u[f + 3], w = p + m, a = r + y << 0, r = y + w << 0;
674
+ this.h0 = this.h0 + r << 0, this.h1 = this.h1 + t << 0, this.h2 = this.h2 + n << 0, this.h3 = this.h3 + s << 0, this.h4 = this.h4 + a << 0, this.h5 = this.h5 + l << 0, this.h6 = this.h6 + d << 0, this.h7 = this.h7 + c << 0;
474
675
  }, Sha256.prototype.hex = function() {
475
676
  this.finalize();
476
- var r = this.h0, t = this.h1, n = this.h2, s = this.h3, c = this.h4, a = this.h5, d = this.h6, l = this.h7, u = HEX_CHARS[r >> 28 & 15] + HEX_CHARS[r >> 24 & 15] + HEX_CHARS[r >> 20 & 15] + HEX_CHARS[r >> 16 & 15] + HEX_CHARS[r >> 12 & 15] + HEX_CHARS[r >> 8 & 15] + HEX_CHARS[r >> 4 & 15] + HEX_CHARS[r & 15] + HEX_CHARS[t >> 28 & 15] + HEX_CHARS[t >> 24 & 15] + HEX_CHARS[t >> 20 & 15] + HEX_CHARS[t >> 16 & 15] + HEX_CHARS[t >> 12 & 15] + HEX_CHARS[t >> 8 & 15] + HEX_CHARS[t >> 4 & 15] + HEX_CHARS[t & 15] + HEX_CHARS[n >> 28 & 15] + HEX_CHARS[n >> 24 & 15] + HEX_CHARS[n >> 20 & 15] + HEX_CHARS[n >> 16 & 15] + HEX_CHARS[n >> 12 & 15] + HEX_CHARS[n >> 8 & 15] + HEX_CHARS[n >> 4 & 15] + HEX_CHARS[n & 15] + HEX_CHARS[s >> 28 & 15] + HEX_CHARS[s >> 24 & 15] + HEX_CHARS[s >> 20 & 15] + HEX_CHARS[s >> 16 & 15] + HEX_CHARS[s >> 12 & 15] + HEX_CHARS[s >> 8 & 15] + HEX_CHARS[s >> 4 & 15] + HEX_CHARS[s & 15] + HEX_CHARS[c >> 28 & 15] + HEX_CHARS[c >> 24 & 15] + HEX_CHARS[c >> 20 & 15] + HEX_CHARS[c >> 16 & 15] + HEX_CHARS[c >> 12 & 15] + HEX_CHARS[c >> 8 & 15] + HEX_CHARS[c >> 4 & 15] + HEX_CHARS[c & 15] + HEX_CHARS[a >> 28 & 15] + HEX_CHARS[a >> 24 & 15] + HEX_CHARS[a >> 20 & 15] + HEX_CHARS[a >> 16 & 15] + HEX_CHARS[a >> 12 & 15] + HEX_CHARS[a >> 8 & 15] + HEX_CHARS[a >> 4 & 15] + HEX_CHARS[a & 15] + HEX_CHARS[d >> 28 & 15] + HEX_CHARS[d >> 24 & 15] + HEX_CHARS[d >> 20 & 15] + HEX_CHARS[d >> 16 & 15] + HEX_CHARS[d >> 12 & 15] + HEX_CHARS[d >> 8 & 15] + HEX_CHARS[d >> 4 & 15] + HEX_CHARS[d & 15];
477
- return this.is224 || (u += HEX_CHARS[l >> 28 & 15] + HEX_CHARS[l >> 24 & 15] + HEX_CHARS[l >> 20 & 15] + HEX_CHARS[l >> 16 & 15] + HEX_CHARS[l >> 12 & 15] + HEX_CHARS[l >> 8 & 15] + HEX_CHARS[l >> 4 & 15] + HEX_CHARS[l & 15]), u;
677
+ var r = this.h0, t = this.h1, n = this.h2, s = this.h3, a = this.h4, l = this.h5, d = this.h6, c = this.h7, u = HEX_CHARS[r >> 28 & 15] + HEX_CHARS[r >> 24 & 15] + HEX_CHARS[r >> 20 & 15] + HEX_CHARS[r >> 16 & 15] + HEX_CHARS[r >> 12 & 15] + HEX_CHARS[r >> 8 & 15] + HEX_CHARS[r >> 4 & 15] + HEX_CHARS[r & 15] + HEX_CHARS[t >> 28 & 15] + HEX_CHARS[t >> 24 & 15] + HEX_CHARS[t >> 20 & 15] + HEX_CHARS[t >> 16 & 15] + HEX_CHARS[t >> 12 & 15] + HEX_CHARS[t >> 8 & 15] + HEX_CHARS[t >> 4 & 15] + HEX_CHARS[t & 15] + HEX_CHARS[n >> 28 & 15] + HEX_CHARS[n >> 24 & 15] + HEX_CHARS[n >> 20 & 15] + HEX_CHARS[n >> 16 & 15] + HEX_CHARS[n >> 12 & 15] + HEX_CHARS[n >> 8 & 15] + HEX_CHARS[n >> 4 & 15] + HEX_CHARS[n & 15] + HEX_CHARS[s >> 28 & 15] + HEX_CHARS[s >> 24 & 15] + HEX_CHARS[s >> 20 & 15] + HEX_CHARS[s >> 16 & 15] + HEX_CHARS[s >> 12 & 15] + HEX_CHARS[s >> 8 & 15] + HEX_CHARS[s >> 4 & 15] + HEX_CHARS[s & 15] + HEX_CHARS[a >> 28 & 15] + HEX_CHARS[a >> 24 & 15] + HEX_CHARS[a >> 20 & 15] + HEX_CHARS[a >> 16 & 15] + HEX_CHARS[a >> 12 & 15] + HEX_CHARS[a >> 8 & 15] + HEX_CHARS[a >> 4 & 15] + HEX_CHARS[a & 15] + HEX_CHARS[l >> 28 & 15] + HEX_CHARS[l >> 24 & 15] + HEX_CHARS[l >> 20 & 15] + HEX_CHARS[l >> 16 & 15] + HEX_CHARS[l >> 12 & 15] + HEX_CHARS[l >> 8 & 15] + HEX_CHARS[l >> 4 & 15] + HEX_CHARS[l & 15] + HEX_CHARS[d >> 28 & 15] + HEX_CHARS[d >> 24 & 15] + HEX_CHARS[d >> 20 & 15] + HEX_CHARS[d >> 16 & 15] + HEX_CHARS[d >> 12 & 15] + HEX_CHARS[d >> 8 & 15] + HEX_CHARS[d >> 4 & 15] + HEX_CHARS[d & 15];
678
+ return this.is224 || (u += HEX_CHARS[c >> 28 & 15] + HEX_CHARS[c >> 24 & 15] + HEX_CHARS[c >> 20 & 15] + HEX_CHARS[c >> 16 & 15] + HEX_CHARS[c >> 12 & 15] + HEX_CHARS[c >> 8 & 15] + HEX_CHARS[c >> 4 & 15] + HEX_CHARS[c & 15]), u;
478
679
  }, Sha256.prototype.toString = Sha256.prototype.hex, Sha256.prototype.digest = function() {
479
680
  this.finalize();
480
- var r = this.h0, t = this.h1, n = this.h2, s = this.h3, c = this.h4, a = this.h5, d = this.h6, l = this.h7, u = [
681
+ var r = this.h0, t = this.h1, n = this.h2, s = this.h3, a = this.h4, l = this.h5, d = this.h6, c = this.h7, u = [
481
682
  r >> 24 & 255,
482
683
  r >> 16 & 255,
483
684
  r >> 8 & 255,
@@ -494,33 +695,33 @@ var sha256 = { exports: {} };
494
695
  s >> 16 & 255,
495
696
  s >> 8 & 255,
496
697
  s & 255,
497
- c >> 24 & 255,
498
- c >> 16 & 255,
499
- c >> 8 & 255,
500
- c & 255,
501
698
  a >> 24 & 255,
502
699
  a >> 16 & 255,
503
700
  a >> 8 & 255,
504
701
  a & 255,
702
+ l >> 24 & 255,
703
+ l >> 16 & 255,
704
+ l >> 8 & 255,
705
+ l & 255,
505
706
  d >> 24 & 255,
506
707
  d >> 16 & 255,
507
708
  d >> 8 & 255,
508
709
  d & 255
509
710
  ];
510
- return this.is224 || u.push(l >> 24 & 255, l >> 16 & 255, l >> 8 & 255, l & 255), u;
711
+ return this.is224 || u.push(c >> 24 & 255, c >> 16 & 255, c >> 8 & 255, c & 255), u;
511
712
  }, Sha256.prototype.array = Sha256.prototype.digest, Sha256.prototype.arrayBuffer = function() {
512
713
  this.finalize();
513
714
  var r = new ArrayBuffer(this.is224 ? 28 : 32), t = new DataView(r);
514
715
  return t.setUint32(0, this.h0), t.setUint32(4, this.h1), t.setUint32(8, this.h2), t.setUint32(12, this.h3), t.setUint32(16, this.h4), t.setUint32(20, this.h5), t.setUint32(24, this.h6), this.is224 || t.setUint32(28, this.h7), r;
515
716
  };
516
717
  function HmacSha256(r, t, n) {
517
- var s, c = typeof r;
518
- if (c === "string") {
519
- var a = [], d = r.length, l = 0, u;
718
+ var s, a = typeof r;
719
+ if (a === "string") {
720
+ var l = [], d = r.length, c = 0, u;
520
721
  for (s = 0; s < d; ++s)
521
- u = r.charCodeAt(s), u < 128 ? a[l++] = u : u < 2048 ? (a[l++] = 192 | u >> 6, a[l++] = 128 | u & 63) : u < 55296 || u >= 57344 ? (a[l++] = 224 | u >> 12, a[l++] = 128 | u >> 6 & 63, a[l++] = 128 | u & 63) : (u = 65536 + ((u & 1023) << 10 | r.charCodeAt(++s) & 1023), a[l++] = 240 | u >> 18, a[l++] = 128 | u >> 12 & 63, a[l++] = 128 | u >> 6 & 63, a[l++] = 128 | u & 63);
522
- r = a;
523
- } else if (c === "object") {
722
+ u = r.charCodeAt(s), u < 128 ? l[c++] = u : u < 2048 ? (l[c++] = 192 | u >> 6, l[c++] = 128 | u & 63) : u < 55296 || u >= 57344 ? (l[c++] = 224 | u >> 12, l[c++] = 128 | u >> 6 & 63, l[c++] = 128 | u & 63) : (u = 65536 + ((u & 1023) << 10 | r.charCodeAt(++s) & 1023), l[c++] = 240 | u >> 18, l[c++] = 128 | u >> 12 & 63, l[c++] = 128 | u >> 6 & 63, l[c++] = 128 | u & 63);
723
+ r = l;
724
+ } else if (a === "object") {
524
725
  if (r === null)
525
726
  throw new Error(ERROR);
526
727
  if (ARRAY_BUFFER && r.constructor === ArrayBuffer)
@@ -530,12 +731,12 @@ var sha256 = { exports: {} };
530
731
  } else
531
732
  throw new Error(ERROR);
532
733
  r.length > 64 && (r = new Sha256(t, !0).update(r).array());
533
- var f = [], y = [];
734
+ var f = [], p = [];
534
735
  for (s = 0; s < 64; ++s) {
535
736
  var g = r[s] || 0;
536
- f[s] = 92 ^ g, y[s] = 54 ^ g;
737
+ f[s] = 92 ^ g, p[s] = 54 ^ g;
537
738
  }
538
- Sha256.call(this, t, n), this.update(y), this.oKeyPad = f, this.inner = !0, this.sharedMemory = n;
739
+ Sha256.call(this, t, n), this.update(p), this.oKeyPad = f, this.inner = !0, this.sharedMemory = n;
539
740
  }
540
741
  HmacSha256.prototype = new Sha256(), HmacSha256.prototype.finalize = function() {
541
742
  if (Sha256.prototype.finalize.call(this), this.inner) {
@@ -572,8 +773,8 @@ function v4(r, t, n) {
572
773
  var s = r.random || (r.rng || rng)();
573
774
  if (s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, t) {
574
775
  n = n || 0;
575
- for (var c = 0; c < 16; ++c)
576
- t[n + c] = s[c];
776
+ for (var a = 0; a < 16; ++a)
777
+ t[n + a] = s[a];
577
778
  return t;
578
779
  }
579
780
  return stringify(s);
@@ -585,21 +786,21 @@ async function getBytes(r, t) {
585
786
  t(s.value);
586
787
  }
587
788
  function getLines(r) {
588
- let t, n, s, c = !1;
789
+ let t, n, s, a = !1;
589
790
  return function(d) {
590
791
  t === void 0 ? (t = d, n = 0, s = -1) : t = concat(t, d);
591
- const l = t.length;
792
+ const c = t.length;
592
793
  let u = 0;
593
- for (; n < l; ) {
594
- c && (t[n] === 10 && (u = ++n), c = !1);
794
+ for (; n < c; ) {
795
+ a && (t[n] === 10 && (u = ++n), a = !1);
595
796
  let f = -1;
596
- for (; n < l && f === -1; ++n)
797
+ for (; n < c && f === -1; ++n)
597
798
  switch (t[n]) {
598
799
  case 58:
599
800
  s === -1 && (s = n - u);
600
801
  break;
601
802
  case 13:
602
- c = !0;
803
+ a = !0;
603
804
  case 10:
604
805
  f = n;
605
806
  break;
@@ -608,30 +809,30 @@ function getLines(r) {
608
809
  break;
609
810
  r(t.subarray(u, f), s), u = n, s = -1;
610
811
  }
611
- u === l ? t = void 0 : u !== 0 && (t = t.subarray(u), n -= u);
812
+ u === c ? t = void 0 : u !== 0 && (t = t.subarray(u), n -= u);
612
813
  };
613
814
  }
614
815
  function getMessages(r, t, n) {
615
816
  let s = newMessage();
616
- const c = new TextDecoder();
617
- return function(d, l) {
817
+ const a = new TextDecoder();
818
+ return function(d, c) {
618
819
  if (d.length === 0)
619
820
  n == null || n(s), s = newMessage();
620
- else if (l > 0) {
621
- const u = c.decode(d.subarray(0, l)), f = l + (d[l + 1] === 32 ? 2 : 1), y = c.decode(d.subarray(f));
821
+ else if (c > 0) {
822
+ const u = a.decode(d.subarray(0, c)), f = c + (d[c + 1] === 32 ? 2 : 1), p = a.decode(d.subarray(f));
622
823
  switch (u) {
623
824
  case "data":
624
825
  s.data = s.data ? s.data + `
625
- ` + y : y;
826
+ ` + p : p;
626
827
  break;
627
828
  case "event":
628
- s.event = y;
829
+ s.event = p;
629
830
  break;
630
831
  case "id":
631
- r(s.id = y);
832
+ r(s.id = p);
632
833
  break;
633
834
  case "retry":
634
- const g = parseInt(y, 10);
835
+ const g = parseInt(p, 10);
635
836
  isNaN(g) || t(s.retry = g);
636
837
  break;
637
838
  }
@@ -655,50 +856,50 @@ var __rest = function(r, t) {
655
856
  for (var s in r)
656
857
  Object.prototype.hasOwnProperty.call(r, s) && t.indexOf(s) < 0 && (n[s] = r[s]);
657
858
  if (r != null && typeof Object.getOwnPropertySymbols == "function")
658
- for (var c = 0, s = Object.getOwnPropertySymbols(r); c < s.length; c++)
659
- t.indexOf(s[c]) < 0 && Object.prototype.propertyIsEnumerable.call(r, s[c]) && (n[s[c]] = r[s[c]]);
859
+ for (var a = 0, s = Object.getOwnPropertySymbols(r); a < s.length; a++)
860
+ t.indexOf(s[a]) < 0 && Object.prototype.propertyIsEnumerable.call(r, s[a]) && (n[s[a]] = r[s[a]]);
660
861
  return n;
661
862
  };
662
863
  const EventStreamContentType = "text/event-stream", DefaultRetryInterval = 1e3, LastEventId = "last-event-id";
663
864
  function fetchEventSource(r, t) {
664
- var { signal: n, headers: s, onopen: c, onmessage: a, onclose: d, onerror: l, openWhenHidden: u, fetch: f } = t, y = __rest(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
865
+ var { signal: n, headers: s, onopen: a, onmessage: l, onclose: d, onerror: c, openWhenHidden: u, fetch: f } = t, p = __rest(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
665
866
  return new Promise((g, m) => {
666
- const p = Object.assign({}, s);
667
- p.accept || (p.accept = EventStreamContentType);
867
+ const y = Object.assign({}, s);
868
+ y.accept || (y.accept = EventStreamContentType);
668
869
  let w;
669
870
  function b() {
670
- w.abort(), document.hidden || T();
871
+ w.abort(), document.hidden || N();
671
872
  }
672
873
  u || document.addEventListener("visibilitychange", b);
673
- let v = DefaultRetryInterval, x = 0;
674
- function _() {
675
- document.removeEventListener("visibilitychange", b), window.clearTimeout(x), w.abort();
874
+ let x = DefaultRetryInterval, R = 0;
875
+ function A() {
876
+ document.removeEventListener("visibilitychange", b), window.clearTimeout(R), w.abort();
676
877
  }
677
878
  n == null || n.addEventListener("abort", () => {
678
- _(), g();
879
+ A(), g();
679
880
  });
680
- const A = f ?? window.fetch, U = c ?? defaultOnOpen;
681
- async function T() {
682
- var R;
881
+ const k = f ?? window.fetch, U = a ?? defaultOnOpen;
882
+ async function N() {
883
+ var O;
683
884
  w = new AbortController();
684
885
  try {
685
- const I = await A(r, Object.assign(Object.assign({}, y), { headers: p, signal: w.signal }));
686
- await U(I), await getBytes(I.body, getLines(getMessages((k) => {
687
- k ? p[LastEventId] = k : delete p[LastEventId];
688
- }, (k) => {
689
- v = k;
690
- }, a))), d == null || d(), _(), g();
886
+ const I = await k(r, Object.assign(Object.assign({}, p), { headers: y, signal: w.signal }));
887
+ await U(I), await getBytes(I.body, getLines(getMessages((T) => {
888
+ T ? y[LastEventId] = T : delete y[LastEventId];
889
+ }, (T) => {
890
+ x = T;
891
+ }, l))), d == null || d(), A(), g();
691
892
  } catch (I) {
692
893
  if (!w.signal.aborted)
693
894
  try {
694
- const k = (R = l == null ? void 0 : l(I)) !== null && R !== void 0 ? R : v;
695
- window.clearTimeout(x), x = window.setTimeout(T, k);
696
- } catch (k) {
697
- _(), m(k);
895
+ const T = (O = c == null ? void 0 : c(I)) !== null && O !== void 0 ? O : x;
896
+ window.clearTimeout(R), R = window.setTimeout(N, T);
897
+ } catch (T) {
898
+ A(), m(T);
698
899
  }
699
900
  }
700
901
  }
701
- T();
902
+ N();
702
903
  });
703
904
  }
704
905
  function defaultOnOpen(r) {
@@ -720,7 +921,7 @@ var r$1 = typeof window < "u" && window.atob && window.atob.bind(window) || func
720
921
  var t = String(r).replace(/=+$/, "");
721
922
  if (t.length % 4 == 1)
722
923
  throw new e("'atob' failed: The string to be decoded is not correctly encoded.");
723
- for (var n, s, c = 0, a = 0, d = ""; s = t.charAt(a++); ~s && (n = c % 4 ? 64 * n + s : s, c++ % 4) ? d += String.fromCharCode(255 & n >> (-2 * c & 6)) : 0)
924
+ for (var n, s, a = 0, l = 0, d = ""; s = t.charAt(l++); ~s && (n = a % 4 ? 64 * n + s : s, a++ % 4) ? d += String.fromCharCode(255 & n >> (-2 * a & 6)) : 0)
724
925
  s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);
725
926
  return d;
726
927
  };
@@ -740,9 +941,9 @@ function t$1(r) {
740
941
  }
741
942
  try {
742
943
  return function(n) {
743
- return decodeURIComponent(r$1(n).replace(/(.)/g, function(s, c) {
744
- var a = c.charCodeAt(0).toString(16).toUpperCase();
745
- return a.length < 2 && (a = "0" + a), "%" + a;
944
+ return decodeURIComponent(r$1(n).replace(/(.)/g, function(s, a) {
945
+ var l = a.charCodeAt(0).toString(16).toUpperCase();
946
+ return l.length < 2 && (l = "0" + l), "%" + l;
746
947
  }));
747
948
  }(t);
748
949
  } catch {
@@ -765,15 +966,15 @@ function o(r, t) {
765
966
  n$1.prototype = new Error(), n$1.prototype.name = "InvalidTokenError";
766
967
  class NylasSessions {
767
968
  constructor(t) {
768
- S(this, "clientId");
769
- S(this, "redirectUri");
770
- S(this, "accessType", "online");
771
- S(this, "domain", "http://api.nylas.com");
772
- S(this, "versioned", !1);
773
- S(this, "Storage");
774
- S(this, "hosted", !1);
775
- S(this, "multiAccount", !1);
776
- S(this, "loginId", "");
969
+ P(this, "clientId");
970
+ P(this, "redirectUri");
971
+ P(this, "accessType", "online");
972
+ P(this, "domain", "http://api.nylas.com");
973
+ P(this, "versioned", !1);
974
+ P(this, "Storage");
975
+ P(this, "hosted", !1);
976
+ P(this, "multiAccount", !1);
977
+ P(this, "loginId", "");
777
978
  if (this.clientId = t.clientId, this.redirectUri = t.redirectUri, t.domain && (this.domain = t.domain, this.domain.substring(this.domain.length - 3).includes("/v") && (this.versioned = !0)), t.multiAccount && (this.multiAccount = t.multiAccount), t.sw) {
778
979
  const n = new IndexedDBStorage();
779
980
  this.Storage = new Storage(n);
@@ -802,10 +1003,10 @@ class NylasSessions {
802
1003
  return !1;
803
1004
  const { id_token: s } = n;
804
1005
  try {
805
- const c = await fetch(`${this.domain}/connect/tokeninfo?id_token=${s}`, {
1006
+ const a = await fetch(`${this.domain}/connect/tokeninfo?id_token=${s}`, {
806
1007
  method: "GET"
807
1008
  });
808
- return !(c.status !== 200 || !(await c.json()).data);
1009
+ return !(a.status !== 200 || !(await a.json()).data);
809
1010
  } catch {
810
1011
  return !1;
811
1012
  }
@@ -834,9 +1035,9 @@ class NylasSessions {
834
1035
  async generateReauthURL(t, n) {
835
1036
  if (!t)
836
1037
  throw new Error("Grant ID is required");
837
- const s = await this.Storage.getUserToken(t), c = await this.getCodeChallege();
838
- let a = `${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;
839
- return c && (a += `&code_challenge=${c}&code_challenge_method=S256&options=rotate_refresh_token`), s != null && s.provider && (a += `&provider=${s.provider}`), s != null && s.email && (a += `&login_hint=${s.email}`), n && (a += `&scope=${n.join(" ")}`), a;
1038
+ const s = await this.Storage.getUserToken(t), a = await this.getCodeChallege();
1039
+ let l = `${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;
1040
+ return a && (l += `&code_challenge=${a}&code_challenge_method=S256&options=rotate_refresh_token`), s != null && s.provider && (l += `&provider=${s.provider}`), s != null && s.email && (l += `&login_hint=${s.email}`), n && (l += `&scope=${n.join(" ")}`), l;
840
1041
  }
841
1042
  // Generates UUID code challenge
842
1043
  async generateCodeChallenge() {
@@ -986,10 +1187,10 @@ class NylasSessions {
986
1187
  async codeExchange(t) {
987
1188
  let n = new URLSearchParams(window.location.search);
988
1189
  t && (n = new URLSearchParams(t));
989
- const s = n.get("code"), c = n.get("state"), a = n.get("error"), d = n.get("error_description"), l = n.get("error_code");
990
- if (a && d && l) {
1190
+ const s = n.get("code"), a = n.get("state"), l = n.get("error"), d = n.get("error_description"), c = n.get("error_code");
1191
+ if (l && d && c) {
991
1192
  const f = {
992
- detail: { error: a, error_description: d, error_code: l }
1193
+ detail: { error: l, error_description: d, error_code: c }
993
1194
  };
994
1195
  return window.dispatchEvent(new CustomEvent("onLoginFail", f)), window.history.pushState({}, document.title, window.location.pathname), !1;
995
1196
  }
@@ -1014,23 +1215,23 @@ class NylasSessions {
1014
1215
  })).json();
1015
1216
  if (g) {
1016
1217
  if (g.error) {
1017
- const p = { detail: g };
1018
- return window.dispatchEvent(new CustomEvent("onLoginFail", p)), !0;
1218
+ const y = { detail: g };
1219
+ return window.dispatchEvent(new CustomEvent("onLoginFail", y)), !0;
1019
1220
  }
1020
1221
  const m = await this.handleCodeExchangeResponse(g);
1021
1222
  if (m.valid) {
1022
- c && (m.data.state = c);
1023
- const p = { detail: m.data };
1024
- window.dispatchEvent(new CustomEvent("onLoginSuccess", p)), window.history.pushState({}, document.title, window.location.pathname);
1223
+ a && (m.data.state = a);
1224
+ const y = { detail: m.data };
1225
+ window.dispatchEvent(new CustomEvent("onLoginSuccess", y)), window.history.pushState({}, document.title, window.location.pathname);
1025
1226
  } else {
1026
- const p = { detail: m.data };
1027
- return window.dispatchEvent(new CustomEvent("onLoginFail", p)), !0;
1227
+ const y = { detail: m.data };
1228
+ return window.dispatchEvent(new CustomEvent("onLoginFail", y)), !0;
1028
1229
  }
1029
1230
  }
1030
1231
  return this.Storage.removePKCE(), !0;
1031
1232
  } catch (f) {
1032
- const y = { detail: f };
1033
- return window.dispatchEvent(new CustomEvent("onLoginFail", y)), window.history.pushState({}, document.title, window.location.pathname), !1;
1233
+ const p = { detail: f };
1234
+ return window.dispatchEvent(new CustomEvent("onLoginFail", p)), window.history.pushState({}, document.title, window.location.pathname), !1;
1034
1235
  }
1035
1236
  }
1036
1237
  // Token Exchange for session maintenece
@@ -1040,7 +1241,7 @@ class NylasSessions {
1040
1241
  return !1;
1041
1242
  const s = n.refresh_token;
1042
1243
  try {
1043
- const c = {
1244
+ const a = {
1044
1245
  client_id: this.clientId,
1045
1246
  redirect_uri: this.redirectUri,
1046
1247
  refresh_token: s,
@@ -1048,25 +1249,25 @@ class NylasSessions {
1048
1249
  }, d = await (await fetch(`${this.domain}/connect/token`, {
1049
1250
  method: "POST",
1050
1251
  headers: new Headers({ "content-type": "application/json" }),
1051
- body: JSON.stringify(c)
1252
+ body: JSON.stringify(a)
1052
1253
  })).json();
1053
1254
  if (d) {
1054
1255
  if (d.error) {
1055
- const y = { detail: d };
1056
- return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", y)), !0;
1256
+ const p = { detail: d };
1257
+ return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", p)), !0;
1057
1258
  }
1058
- const l = getTimestamp();
1059
- if (d.expires_in = l + d.expires_in, this.Storage.setGrant(d, this.multiAccount), !await this.validateIDToken(t)) {
1060
- const y = { detail: d };
1061
- return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", y)), !0;
1259
+ const c = getTimestamp();
1260
+ if (d.expires_in = c + d.expires_in, this.Storage.setGrant(d, this.multiAccount), !await this.validateIDToken(t)) {
1261
+ const p = { detail: d };
1262
+ return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", p)), !0;
1062
1263
  }
1063
1264
  const f = { detail: d };
1064
1265
  return window.dispatchEvent(new CustomEvent("onTokenRefreshSuccess", f)), !0;
1065
1266
  }
1066
1267
  this.Storage.removePKCE();
1067
- } catch (c) {
1068
- const a = { detail: c };
1069
- return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", a)), !1;
1268
+ } catch (a) {
1269
+ const l = { detail: a };
1270
+ return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", l)), !1;
1070
1271
  }
1071
1272
  }
1072
1273
  // Handles the response of code exchange
@@ -1078,8 +1279,8 @@ class NylasSessions {
1078
1279
  };
1079
1280
  const s = getTimestamp();
1080
1281
  t.expires_in = s + t.expires_in, this.Storage.setGrant(t, this.multiAccount);
1081
- const c = o(t.id_token);
1082
- return c.status = "authenticated", this.Storage.setUserToken(c), await this.validateIDToken(c.sub) ? {
1282
+ const a = o(t.id_token);
1283
+ return a.status = "authenticated", this.Storage.setUserToken(a), await this.validateIDToken(a.sub) ? {
1083
1284
  data: t,
1084
1285
  valid: !0
1085
1286
  } : {
@@ -1089,23 +1290,23 @@ class NylasSessions {
1089
1290
  }
1090
1291
  // Regulates POPUP behaivior
1091
1292
  async popUp(t) {
1092
- const c = window.screenX + (window.outerWidth - 500) / 2, a = window.screenY + (window.outerHeight - 600) / 2.5, d = "uas-popup", l = t, u = window.open(l, d, `width=500,height=600,left=${c},top=${a}`);
1293
+ const a = window.screenX + (window.outerWidth - 500) / 2, l = window.screenY + (window.outerHeight - 600) / 2.5, d = "uas-popup", c = t, u = window.open(c, d, `width=500,height=600,left=${a},top=${l}`);
1093
1294
  if (!u)
1094
1295
  return;
1095
1296
  const f = setInterval(async () => {
1096
1297
  if (u.closed) {
1097
- const y = {
1298
+ const p = {
1098
1299
  detail: { error_description: "OAuth provider window closed" }
1099
1300
  };
1100
- window.dispatchEvent(new CustomEvent("onLoginFail", y)), f && clearInterval(f);
1301
+ window.dispatchEvent(new CustomEvent("onLoginFail", p)), f && clearInterval(f);
1101
1302
  return;
1102
1303
  }
1103
1304
  try {
1104
- const y = u.location.href.split("?");
1105
- if (!y[0])
1305
+ const p = u.location.href.split("?");
1306
+ if (!p[0])
1106
1307
  return;
1107
1308
  const g = u.location.search;
1108
- if (u.history.pushState({}, document.title, window.location.pathname), y[0] === this.redirectUri && y.length > 1) {
1309
+ if (u.history.pushState({}, document.title, window.location.pathname), p[0] === this.redirectUri && p.length > 1) {
1109
1310
  const m = await this.codeExchange(g);
1110
1311
  u.close(), m && location.reload(), f && clearInterval(f);
1111
1312
  return;
@@ -1120,45 +1321,45 @@ class NylasSessions {
1120
1321
  const n = getTimestamp(), s = await this.Storage.getGrant(t, this.multiAccount);
1121
1322
  if (!s)
1122
1323
  return null;
1123
- const { access_token: c, expires_in: a } = s, d = c;
1124
- return d && a && a > getTimestamp() && a - n > 30 ? d : (await this.tokenExchange(t), (await this.Storage.getGrant(t, this.multiAccount)).access_token);
1324
+ const { access_token: a, expires_in: l } = s, d = a;
1325
+ return d && l && l > getTimestamp() && l - n > 30 ? d : (await this.tokenExchange(t), (await this.Storage.getGrant(t, this.multiAccount)).access_token);
1125
1326
  }
1126
1327
  async sse(t, n) {
1127
- const s = n.headers || {}, c = s["Grant-ID"];
1128
- let a = "";
1328
+ const s = n.headers || {}, a = s["Grant-ID"];
1329
+ let l = "";
1129
1330
  if (this.multiAccount) {
1130
- if (!c)
1331
+ if (!a)
1131
1332
  throw this.logout(), new Error("Grant ID is required for multi account calls");
1132
- a = await this.getAccessToken(c);
1333
+ l = await this.getAccessToken(a);
1133
1334
  } else
1134
- a = await this.getAccessToken();
1135
- return delete s["Grant-ID"], s.Authorization = `Bearer ${a}`, s["content-type"] || (s["content-type"] = "application/json"), fetchEventSource(`${this.domain}/${t}`, {
1335
+ l = await this.getAccessToken();
1336
+ return delete s["Grant-ID"], s.Authorization = `Bearer ${l}`, s["content-type"] || (s["content-type"] = "application/json"), fetchEventSource(`${this.domain}/${t}`, {
1136
1337
  ...n,
1137
1338
  headers: s
1138
1339
  });
1139
1340
  }
1140
1341
  // Used to call Nylas API endpoints
1141
- async fetch(t, n, s = !0, c) {
1142
- let a = "", d = 1;
1342
+ async fetch(t, n, s = !0, a) {
1343
+ let l = "", d = 1;
1143
1344
  if (this.multiAccount) {
1144
1345
  if (!n.grant_id)
1145
1346
  throw this.logout(), new Error("Grant ID is required for multi account calls");
1146
1347
  const u = await this.getProfiles();
1147
- d = u ? u.length : 1, a = await this.getAccessToken(n.grant_id);
1348
+ d = u ? u.length : 1, l = await this.getAccessToken(n.grant_id);
1148
1349
  } else
1149
- a = await this.getAccessToken();
1150
- if (!a)
1350
+ l = await this.getAccessToken();
1351
+ if (!l)
1151
1352
  throw new Error("Access token not found");
1152
- let l = n.headers;
1153
- Headers.prototype.isPrototypeOf(l) ? (l.append("Authorization", `Bearer ${a}`), l.has("content-type") || l.append("content-type", "application/json")) : l = new Headers({
1154
- Authorization: `Bearer ${a}`,
1353
+ let c = n.headers;
1354
+ Headers.prototype.isPrototypeOf(c) ? (c.append("Authorization", `Bearer ${l}`), c.has("content-type") || c.append("content-type", "application/json")) : c = new Headers({
1355
+ Authorization: `Bearer ${l}`,
1155
1356
  "content-type": "application/json"
1156
1357
  });
1157
1358
  try {
1158
1359
  n != null && n.body && (n.body = JSON.stringify(n == null ? void 0 : n.body));
1159
- const u = await fetch(`${c || this.domain}/${t}`, {
1360
+ const u = await fetch(`${a || this.domain}/${t}`, {
1160
1361
  ...n,
1161
- headers: l
1362
+ headers: c
1162
1363
  });
1163
1364
  if (!s)
1164
1365
  return u;
@@ -1187,13 +1388,13 @@ class NylasSessions {
1187
1388
  throw u;
1188
1389
  }
1189
1390
  }
1190
- async fetchRequest(t, n, s, c = !0, a, d) {
1191
- const l = await this.isLoggedIn(), u = new URL(t, a ?? this.domain), f = new Headers();
1192
- if (f.append("Accept", "application/json"), f.append("Content-Type", "application/json"), f.append("User-Agent", "nylas-identity"), l) {
1391
+ async fetchRequest(t, n, s, a = !0, l, d) {
1392
+ const c = await this.isLoggedIn(), u = new URL(t, l ?? this.domain), f = new Headers();
1393
+ if (f.append("Accept", "application/json"), f.append("Content-Type", "application/json"), f.append("User-Agent", "nylas-identity"), c) {
1193
1394
  const m = await this.getAccessToken();
1194
1395
  f.append("Authorization", `Bearer ${m}`);
1195
1396
  }
1196
- const y = await fetch(u.toString(), {
1397
+ const p = await fetch(u.toString(), {
1197
1398
  method: n || "GET",
1198
1399
  headers: f,
1199
1400
  mode: "cors",
@@ -1201,7 +1402,7 @@ class NylasSessions {
1201
1402
  body: s ? JSON.stringify(s) : void 0,
1202
1403
  ...d || {}
1203
1404
  });
1204
- return c ? await y.json() : y.body;
1405
+ return a ? await p.json() : p.body;
1205
1406
  }
1206
1407
  // Checks if the response is not 401
1207
1408
  async isAuthenticatedResponse(t, n) {
@@ -1303,43 +1504,90 @@ const LoginRequired = ({ authenticationUrl: r }) => h(
1303
1504
  h("small", { class: "disclaimer-text", part: "nse__login-required-disclaimer-text" }, "* You will be redirected to authenticate your account.")
1304
1505
  )
1305
1506
  );
1306
- function ExpressFlow({ currentUser: r, calendars: t }) {
1307
- const n = (t == null ? void 0 : t.find((s) => s.is_primary)) || (t == null ? void 0 : t[0]);
1308
- return h(
1309
- Fragment,
1310
- null,
1311
- h(
1312
- "nylas-event-info",
1313
- null,
1314
- h(
1315
- "div",
1316
- { slot: "inputs" },
1317
- h("nylas-event-title", null),
1318
- h("nylas-event-duration", null),
1319
- h("nylas-event-location", { userProvider: r.provider })
1320
- )
1321
- ),
1322
- h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: n == null ? void 0 : n.id }),
1323
- h("nylas-scheduling-method", { exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
1324
- h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" })
1325
- );
1507
+ function ExpressFlow({ currentUser: r, calendars: t, selectedEventType: n, experimentalFeatures: s }) {
1508
+ const a = (t == null ? void 0 : t.find((d) => d.is_primary)) || (t == null ? void 0 : t[0]), l = (s == null ? void 0 : s[EXPERIMENTAL_FEATURES.group_events]) || !1;
1509
+ switch (n) {
1510
+ case CONFIGURATION_EVENT_TYPE.one_on_one:
1511
+ case CONFIGURATION_EVENT_TYPE.max_availability:
1512
+ case CONFIGURATION_EVENT_TYPE.max_fairness:
1513
+ return h(
1514
+ Fragment,
1515
+ null,
1516
+ h(
1517
+ "nylas-event-info",
1518
+ null,
1519
+ h(
1520
+ "div",
1521
+ { slot: "inputs" },
1522
+ h("nylas-event-title", null),
1523
+ h("nylas-event-duration", null),
1524
+ h("nylas-event-location", { userProvider: r.provider })
1525
+ )
1526
+ ),
1527
+ h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: a == null ? void 0 : a.id }),
1528
+ !l && h("nylas-scheduling-method", { exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
1529
+ h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" })
1530
+ );
1531
+ case CONFIGURATION_EVENT_TYPE.collective:
1532
+ return h(
1533
+ Fragment,
1534
+ null,
1535
+ h(
1536
+ "nylas-event-info",
1537
+ null,
1538
+ h(
1539
+ "div",
1540
+ { slot: "inputs" },
1541
+ h("nylas-event-title", null),
1542
+ h("nylas-event-duration", null),
1543
+ h("nylas-event-location", { userProvider: r.provider })
1544
+ )
1545
+ ),
1546
+ h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: a == null ? void 0 : a.id }),
1547
+ !l && h("nylas-scheduling-method", { exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
1548
+ h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
1549
+ h("nylas-additional-participants", { name: "participants", eventParticipants: [{ name: (r == null ? void 0 : r.name) || (r == null ? void 0 : r.email), email: (r == null ? void 0 : r.email) || "", is_organizer: !0 }], exportparts: "nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant" })
1550
+ );
1551
+ case CONFIGURATION_EVENT_TYPE.group:
1552
+ return h(
1553
+ Fragment,
1554
+ null,
1555
+ h(
1556
+ "nylas-event-info",
1557
+ null,
1558
+ h(
1559
+ "div",
1560
+ { slot: "inputs" },
1561
+ h("nylas-event-title", null),
1562
+ h("nylas-event-description", { hideAutoPopulateButton: !0 }),
1563
+ h("nylas-event-location", { userProvider: r.provider }),
1564
+ h("nylas-event-timeslot", { name: "event-timeslot" }),
1565
+ h("nylas-event-capacity", null)
1566
+ )
1567
+ ),
1568
+ h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: a == null ? void 0 : a.id }),
1569
+ h("nylas-additional-participants", { name: "participants", eventParticipants: [{ name: (r == null ? void 0 : r.name) || (r == null ? void 0 : r.email), email: (r == null ? void 0 : r.email) || "", is_organizer: !0 }], exportparts: "nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant" }),
1570
+ h("nylas-page-name", { requirePageName: !0, pageName: "Group events page" }),
1571
+ h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" })
1572
+ );
1573
+ }
1326
1574
  }
1327
- const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 0px 6px -2px rgba(0, 0, 0, 0.05), 0px 5px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{width:-moz-available;width:-webkit-fill-available;width:fill-available;min-width:325px}}div.scheduler-editor-content{height:610px}@media screen and (max-width: 768px){div.scheduler-editor-content{height:auto}}div.scheduler-editor-header{display:grid;grid-template-columns:1fr auto auto;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900);width:924px}@media screen and (max-width: 768px){div.scheduler-editor-header{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;margin:0;font-size:18px;line-height:24px;font-weight:600}div.scheduler-editor-header button{background:transparent;border:none;cursor:pointer}div.scheduler-editor-header button:hover,div.scheduler-editor-header button:active{color:var(--nylas-primary)}div.scheduler-editor-header button:disabled{cursor:not-allowed}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button){border:none;padding:4px;margin-right:8px}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button):hover{outline:none;color:var(--nylas-primary)}@media screen and (max-width: 768px){div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-content){width:-webkit-fill-available;width:fill-available;width:-moz-available}}nylas-editor-tabs{width:auto;height:inherit}nylas-editor-tabs .composable{height:inherit;overflow:auto}nylas-editor-tabs nylas-event-info div[slot=inputs],nylas-editor-tabs nylas-event-limits div[slot=inputs]{display:flex;flex-direction:column;gap:1rem}.card{display:flex;flex-direction:column;padding:2rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;max-width:fit-content;align-self:center}.login-required{height:inherit;overflow-y:auto;display:flex;flex-direction:column;justify-content:center;padding:2rem 1rem;background-color:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.login-required{height:auto}}.login-required p{margin:0 0 1rem}.login-required .microsoft-button,.login-required .google-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;margin-bottom:1rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;justify-content:center;gap:0.5rem;align-items:center}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;border:0;background-color:var(--nylas-base-0);height:48px;margin-bottom:1rem;font-size:0.95rem;justify-content:center;gap:0.25rem;align-items:center}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button svg{transform:rotate(180deg)}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .disclaimer-text{font-size:0.75rem;color:var(--nylas-base-600);align-self:center}.list-configurations{padding:2rem;height:inherit;background:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.list-configurations{height:auto;padding:2rem 1rem}}.list-configurations nylas-list-configurations{height:inherit;display:flex;flex-direction:column}', NylasSchedulerEditorStyle0 = nylasSchedulerEditorCss, NylasSchedulerEditor = class {
1575
+ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 0px 6px -2px rgba(0, 0, 0, 0.05), 0px 5px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}@media screen and (max-width: 768px){:host{width:-moz-available;width:-webkit-fill-available;width:fill-available;min-width:325px}}div.scheduler-editor-content{height:610px}div.scheduler-editor-content.scheduler-editor-content--group_feature_enabled{height:900px}@media screen and (max-width: 768px){div.scheduler-editor-content.scheduler-editor-content--group_feature_enabled{height:auto}}@media screen and (max-width: 768px){div.scheduler-editor-content{height:auto}}div.scheduler-editor-content--group{height:900px}@media screen and (max-width: 768px){div.scheduler-editor-content--group{height:auto}}div.scheduler-editor-header{display:grid;grid-template-columns:1fr auto auto;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900);min-width:924px}@media screen and (max-width: 768px){div.scheduler-editor-header{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;margin:0;font-size:18px;line-height:24px;font-weight:600}div.scheduler-editor-header button{background:transparent;border:none;cursor:pointer}div.scheduler-editor-header button:hover,div.scheduler-editor-header button:active{color:var(--nylas-primary);background-color:transparent}div.scheduler-editor-header button:disabled{cursor:not-allowed}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button){border:none;padding:4px;margin-right:8px}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button):hover{outline:none;color:var(--nylas-primary)}@media screen and (max-width: 768px){div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-content){width:-webkit-fill-available;width:fill-available;width:-moz-available}}nylas-select-event-type{height:inherit;width:calc(924px + 2rem)}@media screen and (max-width: 768px){nylas-select-event-type{width:auto}}nylas-editor-tabs,nylas-editor-tabs-group{width:auto;height:inherit}nylas-editor-tabs .row,nylas-editor-tabs-group .row{display:flex;gap:1rem}nylas-editor-tabs .composable,nylas-editor-tabs-group .composable{height:inherit;overflow:auto}nylas-editor-tabs nylas-event-info div[slot=inputs],nylas-editor-tabs nylas-event-limits div[slot=inputs],nylas-editor-tabs-group nylas-event-info div[slot=inputs],nylas-editor-tabs-group nylas-event-limits div[slot=inputs]{display:flex;flex-direction:column;gap:1rem}.card{display:flex;flex-direction:column;padding:2rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;max-width:fit-content;align-self:center}.login-required{height:inherit;overflow-y:auto;display:flex;flex-direction:column;justify-content:center;padding:2rem 1rem;background-color:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.login-required{height:auto}}.login-required p{margin:0 0 1rem}.login-required .microsoft-button,.login-required .google-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;margin-bottom:1rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;justify-content:center;gap:0.5rem;align-items:center}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;border:0;background-color:var(--nylas-base-0);height:48px;margin-bottom:1rem;font-size:0.95rem;justify-content:center;gap:0.25rem;align-items:center}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button svg{transform:rotate(180deg)}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .disclaimer-text{font-size:0.75rem;color:var(--nylas-base-600);align-self:center}.list-configurations{padding:2rem;height:inherit;background:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.list-configurations{height:auto;padding:2rem 1rem}}.list-configurations nylas-list-configurations{height:inherit;display:flex;flex-direction:column}', NylasSchedulerEditorStyle0 = nylasSchedulerEditorCss, NylasSchedulerEditor = class {
1328
1576
  constructor(r) {
1329
1577
  registerInstance(this, r), this.init = createEvent(this, "init", 7), this.loggedIn = createEvent(this, "loggedIn", 7), this.loggedOut = createEvent(this, "loggedOut", 7), this.schedulerConfigCloseClicked = createEvent(this, "schedulerConfigCloseClicked", 7), this.handleSchedulerConfigCloseClicked = (t) => {
1330
1578
  const n = this.schedulerConfigCloseClicked.emit(this.host);
1331
1579
  "schedulerConfigCloseClicked" in this.eventOverrides && this.eventOverrides.schedulerConfigCloseClicked(n, this.nylasSchedulerConfigConnector), n.defaultPrevented || (localStorage.removeItem("grant"), localStorage.removeItem("user"), window.location.reload());
1332
- }, this.authenticationUrl = async (t) => this.nylasApiRequest ? await this.nylasApiRequest.authenticationUrl({ provider: t }) || "" : (console.error("[nylas-scheduler-editor] Nylas API Request is not initialized."), ""), this.configurationId = void 0, this.nylasApiRequest = void 0, this.nylasSessionsConfig = void 0, this.defaultAuthArgs = void 0, this.eventOverrides = {}, this.schedulerPreviewLink = "", this.defaultSchedulerConfigState = void 0, this.mode = "app", this.additionalParticipants = void 0, this.hideEditorTabs = [], this.conferenceProviders = void 0, this.requiresSlug = !1, this.enableUserFeedback = !0, this.defaultLanguage = void 0, this.localization = void 0, this.nylasBranding = !0, this.automaticComponentRegistration = !0, this.selectedLanguage = this.defaultLanguage || LANGUAGE_CODE.en, this.langVersion = 0;
1580
+ }, this.authenticationUrl = async (t) => this.nylasApiRequest ? await this.nylasApiRequest.authenticationUrl({ provider: t }) || "" : (console.error("[nylas-scheduler-editor] Nylas API Request is not initialized."), ""), this.configurationId = void 0, this.nylasApiRequest = void 0, this.nylasSessionsConfig = void 0, this.defaultAuthArgs = void 0, this.eventOverrides = {}, this.schedulerPreviewLink = "", this.defaultSchedulerConfigState = void 0, this.mode = "app", this.additionalParticipants = void 0, this.hideEditorTabs = [], this.conferenceProviders = void 0, this.requiresSlug = !1, this.enableUserFeedback = !0, this.defaultLanguage = void 0, this.localization = void 0, this.nylasBranding = !0, this.experimentalFeatures = void 0, this.automaticComponentRegistration = !0, this.selectedLanguage = this.defaultLanguage || LANGUAGE_CODE.en, this.langVersion = 0;
1333
1581
  }
1334
1582
  connectedCallback() {
1335
1583
  debug("[nylas-scheduler-editor] connectedCallback");
1336
1584
  }
1337
1585
  async componentWillLoad() {
1338
- var s, c, a, d, l, u, f, y;
1586
+ var s, a, l, d, c, u, f, p;
1339
1587
  debug("[nylas-scheduler-editor] componentWillLoad");
1340
1588
  const r = (s = this.additionalParticipants) == null ? void 0 : s.filter((g) => {
1341
- var p;
1342
- const m = ((p = g.calendars) == null ? void 0 : p.length) > 0 ? g.calendars.filter((w) => w.id && w.name) : [];
1589
+ var y;
1590
+ const m = ((y = g.calendars) == null ? void 0 : y.length) > 0 ? g.calendars.filter((w) => w.id && w.name) : [];
1343
1591
  if (g.name && g.email && m.length > 0)
1344
1592
  return {
1345
1593
  name: g.name,
@@ -1354,20 +1602,21 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
1354
1602
  conferenceProviders: this.conferenceProviders,
1355
1603
  requiresSlug: this.requiresSlug,
1356
1604
  selectedLanguage: this.defaultLanguage || LANGUAGE_CODE.en,
1357
- nylasBranding: this.nylasBranding
1605
+ nylasBranding: this.nylasBranding,
1606
+ experimentalFeatures: this.experimentalFeatures
1358
1607
  })
1359
1608
  }, !this.nylasApiRequest && this.nylasSessionsConfig) {
1360
1609
  const g = new NylasSessions(this.nylasSessionsConfig);
1361
1610
  await g.isLoggedIn(), g.onLoginSuccess(async () => {
1362
- var p, w;
1363
- const m = await ((w = (p = this.nylasSchedulerConfigConnector) == null ? void 0 : p.schedulerConfig) == null ? void 0 : w.currentUser());
1611
+ var y, w;
1612
+ const m = await ((w = (y = this.nylasSchedulerConfigConnector) == null ? void 0 : y.schedulerConfig) == null ? void 0 : w.currentUser());
1364
1613
  if (m) {
1365
1614
  const b = this.loggedIn.emit(this.host);
1366
1615
  "loggedIn" in this.eventOverrides && await this.eventOverrides.loggedIn(b, this.nylasSchedulerConfigConnector), b.defaultPrevented || await this.loggedInHandler(m);
1367
1616
  }
1368
1617
  }), g.onLoginFail(async () => {
1369
- var p, w;
1370
- (w = (p = this.stores) == null ? void 0 : p.schedulerConfig) == null || w.set("currentUser", null);
1618
+ var y, w;
1619
+ (w = (y = this.stores) == null ? void 0 : y.schedulerConfig) == null || w.set("currentUser", null);
1371
1620
  const m = this.loggedOut.emit(this.host);
1372
1621
  "loggedOut" in this.eventOverrides && (await this.eventOverrides.loggedOut(m, this.nylasSchedulerConfigConnector), m.defaultPrevented);
1373
1622
  }), this.nylasApiRequest = new NylasIdentityRequestWrapper(g);
@@ -1380,12 +1629,12 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
1380
1629
  });
1381
1630
  const n = this.init.emit(this.host);
1382
1631
  if ("init" in this.eventOverrides && await this.eventOverrides.init(n, this.nylasSchedulerConfigConnector), !n.defaultPrevented) {
1383
- const g = await ((a = (c = this.nylasSchedulerConfigConnector) == null ? void 0 : c.schedulerConfig) == null ? void 0 : a.currentUser());
1632
+ const g = await ((l = (a = this.nylasSchedulerConfigConnector) == null ? void 0 : a.schedulerConfig) == null ? void 0 : l.currentUser());
1384
1633
  if (g) {
1385
1634
  const m = this.loggedIn.emit(this.host);
1386
1635
  "loggedIn" in this.eventOverrides && await this.eventOverrides.loggedIn(m, this.nylasSchedulerConfigConnector), m.defaultPrevented || await this.loggedInHandler(g);
1387
1636
  } else {
1388
- (l = (d = this.stores) == null ? void 0 : d.schedulerConfig) == null || l.set("currentUser", null);
1637
+ (c = (d = this.stores) == null ? void 0 : d.schedulerConfig) == null || c.set("currentUser", null);
1389
1638
  const m = this.loggedOut.emit(this.host);
1390
1639
  if ("loggedOut" in this.eventOverrides && (await this.eventOverrides.loggedOut(m, this.nylasSchedulerConfigConnector), m.defaultPrevented))
1391
1640
  return;
@@ -1393,7 +1642,7 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
1393
1642
  }
1394
1643
  (f = (u = this.stores) == null ? void 0 : u.schedulerConfig) == null || f.onChange("selectedConfiguration", async (g) => {
1395
1644
  g && g.id && (this.configurationId = g.id);
1396
- }), (y = this.baseProvider) == null || y.componentWillLoad(this.nylasSchedulerConfigConnector);
1645
+ }), (p = this.baseProvider) == null || p.componentWillLoad(this.nylasSchedulerConfigConnector);
1397
1646
  }
1398
1647
  async componentDidLoad() {
1399
1648
  var r;
@@ -1404,8 +1653,8 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
1404
1653
  await ((r = this.baseProvider) == null ? void 0 : r.componentDisconnected());
1405
1654
  }
1406
1655
  async configurationIdChanged(r) {
1407
- var t, n, s, c, a, d, l, u;
1408
- r ? (await ((n = (t = this.nylasSchedulerConfigConnector) == null ? void 0 : t.schedulerConfig) == null ? void 0 : n.getConfigurationById(r)), (c = (s = this.stores) == null ? void 0 : s.schedulerConfig) == null || c.set("action", "edit")) : ((d = (a = this.stores) == null ? void 0 : a.schedulerConfig) == null || d.set("selectedConfiguration", {}), (u = (l = this.stores) == null ? void 0 : l.schedulerConfig) == null || u.set("action", null));
1656
+ var t, n, s, a, l, d, c, u;
1657
+ r ? (await ((n = (t = this.nylasSchedulerConfigConnector) == null ? void 0 : t.schedulerConfig) == null ? void 0 : n.getConfigurationById(r)), (a = (s = this.stores) == null ? void 0 : s.schedulerConfig) == null || a.set("action", "edit")) : ((d = (l = this.stores) == null ? void 0 : l.schedulerConfig) == null || d.set("selectedConfiguration", {}), (u = (c = this.stores) == null ? void 0 : c.schedulerConfig) == null || u.set("action", null));
1409
1658
  }
1410
1659
  updateLocalization(r) {
1411
1660
  r && (Object.keys(r).forEach((t) => {
@@ -1416,6 +1665,10 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
1416
1665
  var t, n;
1417
1666
  (n = (t = this.stores) == null ? void 0 : t.schedulerConfig) == null || n.set("nylasBranding", r);
1418
1667
  }
1668
+ updateExperimentalFeatures(r) {
1669
+ var t, n;
1670
+ (n = (t = this.stores) == null ? void 0 : t.schedulerConfig) == null || n.set("experimentalFeatures", r);
1671
+ }
1419
1672
  async store() {
1420
1673
  var r;
1421
1674
  return (r = this.stores) == null ? void 0 : r.schedulerConfig;
@@ -1432,26 +1685,30 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
1432
1685
  (t = this.baseProvider) == null || t.unregisterComponent(r.detail);
1433
1686
  }
1434
1687
  nylasFormDropdownChangedHandler(r) {
1435
- var s, c;
1688
+ var s, a;
1436
1689
  const { name: t, value: n } = r.detail;
1437
- t === "language" && (this.selectedLanguage = LANGUAGE_CODE[n], instance.changeLanguage(this.selectedLanguage), (c = (s = this.stores) == null ? void 0 : s.schedulerConfig) == null || c.set("selectedLanguage", this.selectedLanguage));
1690
+ t === "language" && (this.selectedLanguage = LANGUAGE_CODE[n], instance.changeLanguage(this.selectedLanguage), (a = (s = this.stores) == null ? void 0 : s.schedulerConfig) == null || a.set("selectedLanguage", this.selectedLanguage));
1438
1691
  }
1439
1692
  async loggedInHandler(r) {
1440
- var t, n, s, c, a, d, l;
1693
+ var t, n, s, a, l, d, c;
1441
1694
  if ((n = (t = this.stores) == null ? void 0 : t.schedulerConfig) == null || n.set("currentUser", r), !!this.nylasSchedulerConfigConnector && (await ((s = this.nylasSchedulerConfigConnector.schedulerConfig) == null ? void 0 : s.getCalendars()), this.configurationId)) {
1442
- const u = await ((c = this.nylasSchedulerConfigConnector.schedulerConfig) == null ? void 0 : c.getConfigurationById(this.configurationId));
1443
- u && ((a = u[0]) != null && a.id) && ((l = (d = this.stores) == null ? void 0 : d.schedulerConfig) == null || l.set("action", "edit"));
1695
+ const u = await ((a = this.nylasSchedulerConfigConnector.schedulerConfig) == null ? void 0 : a.getConfigurationById(this.configurationId));
1696
+ u && ((l = u[0]) != null && l.id) && ((c = (d = this.stores) == null ? void 0 : d.schedulerConfig) == null || c.set("action", "edit"));
1444
1697
  }
1445
1698
  }
1446
1699
  render() {
1447
- var s, c, a, d, l, u, f, y, g, m, p, w, b, v, x, _, A, U, T;
1448
- const r = this.host.querySelector('[slot="custom-page-style-inputs"]'), t = (a = (c = (s = this.stores) == null ? void 0 : s.schedulerConfig) == null ? void 0 : c.state.selectedConfiguration) == null ? void 0 : a.id, n = Object.keys(LANGUAGE_MAP).map((R) => ({
1449
- label: LANGUAGE_MAP[R],
1450
- value: R
1451
- }));
1452
- return h(Host, { key: "4a5d426a8bb92632cc65b16f66bd36b284a8f0fa" }, h("div", { key: "6abc1fbb5f0b0eb71dfc34914df1fe271fb3e033", class: "scheduler-editor-header", part: "nse__header" }, h("h1", { key: "c9487da70861e87c350af53ab70aa52baa718e57", class: "scheduler-editor-title", part: "nse__title" }, h("calendar-icon", { key: "71210ff60cebbcfb99e4d67a42c60d1ea0712bf0", width: "18", height: "18" }), instance.t("schedulerEditorTitle")), h("div", { key: "794f5e2f73f5cdce75b20e3e1f67b74dba2e3a4d", class: {
1700
+ var a, l, d, c, u, f, p, g, m, y, w, b, x, R, A, k, U, N, O, I, T, S, v, L, _, X, $, j, z, Y, M, V, J, W, Z, Q, ee, te, ne, se, re, ie, oe, ae, le, ce, de, he, ue, fe, ge, pe, ye, me, we, Se;
1701
+ const r = this.host.querySelector('[slot="custom-page-style-inputs"]'), t = (d = (l = (a = this.stores) == null ? void 0 : a.schedulerConfig) == null ? void 0 : l.state.selectedConfiguration) == null ? void 0 : d.id, n = Object.keys(LANGUAGE_MAP).map((q) => ({
1702
+ label: LANGUAGE_MAP[q],
1703
+ value: q
1704
+ })), s = ((u = (c = this.stores) == null ? void 0 : c.schedulerConfig) == null ? void 0 : u.state.selectedEventType) === CONFIGURATION_EVENT_TYPE.group || ((g = (p = (f = this.stores) == null ? void 0 : f.schedulerConfig) == null ? void 0 : p.state.selectedConfiguration) == null ? void 0 : g.type) === CONFIGURATION_EVENT_TYPE.group;
1705
+ return h(Host, { key: "0053ea345fb1297974b68e859adc7caf738f0f35" }, h("div", { key: "e3059c866be7f1d804b451fb54e01a5c219019b1", class: "scheduler-editor-header", part: "nse__header" }, h("h1", { key: "56712052dd6fe1b8ff8a428c8ad3f0f491beac23", class: "scheduler-editor-title", part: "nse__title" }, h("calendar-icon", { key: "dfe74ae46374c05c480b419124ba2055606b400a", width: "18", height: "18" }), instance.t("schedulerEditorTitle")), h("div", { key: "f4ba96f86e1e6e79d720273e0808d87528d74fc1", class: {
1453
1706
  language: !0
1454
- }, part: "nse__language" }, h("select-dropdown", { key: "2e9624288c11367d2414406c19f2cc3a6a412162", name: "language", options: n, withChevron: !1, defaultSelectedOption: n.find((R) => R.value == this.selectedLanguage), exportparts: "sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label" }, h("span", { key: "b6afaf6377e0976155cbfbb42d23a6480cb38329", slot: "select-icon" }, h("translate-icon", { key: "655d8430bd76f195b80a8a2b7bf9047c041132fa", width: "20", height: "20" })))), h("button", { key: "9b92580aae06ba970d224f50b3fe70c841220358", class: "scheduler-editor-close", title: "logout", onClick: (R) => this.handleSchedulerConfigCloseClicked(R), part: "nse__close-button" }, h("close-icon", { key: "9a97237ee81b6b0838f78bbdf0ee0ddc8cd28578", width: "18", height: "18" }))), h("div", { key: "5b30c0bc1ce1a86a1e2003df1a319a41a6cf71a3", class: "scheduler-editor-content", part: "nse__content" }, ((l = (d = this.stores) == null ? void 0 : d.schedulerConfig) == null ? void 0 : l.state.currentUser) && this.stores.schedulerConfig.state.action === null && h("div", { class: "list-configurations", part: "nse__list-configurations" }, h("nylas-list-configurations", { exportparts: "nlc__create-new-cta" })), ((f = (u = this.stores) == null ? void 0 : u.schedulerConfig) == null ? void 0 : f.state.currentUser) && this.stores.schedulerConfig.state.action === "create" && h("nylas-editor-tabs", { mode: "composable" }, h(ExpressFlow, { currentUser: (g = (y = this.stores) == null ? void 0 : y.schedulerConfig) == null ? void 0 : g.state.currentUser, calendars: (w = (p = (m = this.stores) == null ? void 0 : m.schedulerConfig) == null ? void 0 : p.state) == null ? void 0 : w.calendars, selectedConfiguration: (x = (v = (b = this.stores) == null ? void 0 : b.schedulerConfig) == null ? void 0 : v.state) == null ? void 0 : x.selectedConfiguration })), ((A = (_ = this.stores) == null ? void 0 : _.schedulerConfig) == null ? void 0 : A.state.currentUser) && this.stores.schedulerConfig.state.action === "edit" && h("nylas-editor-tabs", { key: t, mode: this.mode }, this.mode === "composable" && h("slot", null), this.mode === "app" && r && h("div", { style: { display: "none" }, slot: "custom-page-style-inputs", key: t }, h("slot", { name: "custom-page-style-inputs" }))), !((T = (U = this.stores) == null ? void 0 : U.schedulerConfig) != null && T.state.currentUser) && h("slot", { name: "login-required" }, h(LoginRequired, { authenticationUrl: this.authenticationUrl }))));
1707
+ }, part: "nse__language" }, h("select-dropdown", { key: "3bfe4634f550553f0e2002aa5fec9b39b1cd9e75", name: "language", options: n, withChevron: !1, defaultSelectedOption: n.find((q) => q.value == this.selectedLanguage), exportparts: "sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label" }, h("span", { key: "9926723981f56a7606ff94f213215e93bf51c472", slot: "select-icon" }, h("translate-icon", { key: "d22a01ac1cef04ff5f2015c2cc73932c6fd7885c", width: "20", height: "20" })))), h("button", { key: "8f256e2b3978b33a0887bd3af8c987ab2b6b5782", class: "scheduler-editor-close", title: "logout", onClick: (q) => this.handleSchedulerConfigCloseClicked(q), part: "nse__close-button" }, h("close-icon", { key: "acd07b2fc1509f11440f4ad5047d20b3693e0750", width: "18", height: "18" }))), h("div", { key: "d39be68578574cbba4993ca63d2a8f087cecff04", class: {
1708
+ "scheduler-editor-content": !0,
1709
+ "scheduler-editor-content--group_feature_enabled": !!((w = (y = (m = this.stores) == null ? void 0 : m.schedulerConfig) == null ? void 0 : y.state.experimentalFeatures) != null && w[EXPERIMENTAL_FEATURES.group_events]),
1710
+ "scheduler-editor-content--group": s
1711
+ }, part: "nse__content" }, ((x = (b = this.stores) == null ? void 0 : b.schedulerConfig) == null ? void 0 : x.state.currentUser) && this.stores.schedulerConfig.state.action === null && h("div", { class: "list-configurations", part: "nse__list-configurations" }, h("nylas-list-configurations", { exportparts: "nlc__create-new-cta, actions__dropdown, actions__dropdown-button, actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete" })), ((A = (R = this.stores) == null ? void 0 : R.schedulerConfig) == null ? void 0 : A.state.currentUser) && this.stores.schedulerConfig.state.action === "create-select" && ((N = (U = (k = this.stores) == null ? void 0 : k.schedulerConfig) == null ? void 0 : U.state.experimentalFeatures) == null ? void 0 : N[EXPERIMENTAL_FEATURES.group_events]) && h("nylas-select-event-type", null), ((I = (O = this.stores) == null ? void 0 : O.schedulerConfig) == null ? void 0 : I.state.currentUser) && this.stores.schedulerConfig.state.action === "create" && s && h("nylas-editor-tabs-group", { mode: "composable" }, h(ExpressFlow, { experimentalFeatures: (v = (S = (T = this.stores) == null ? void 0 : T.schedulerConfig) == null ? void 0 : S.state) == null ? void 0 : v.experimentalFeatures, selectedEventType: ((X = (_ = (L = this.stores) == null ? void 0 : L.schedulerConfig) == null ? void 0 : _.state) == null ? void 0 : X.selectedEventType) || CONFIGURATION_EVENT_TYPE.one_on_one, currentUser: (j = ($ = this.stores) == null ? void 0 : $.schedulerConfig) == null ? void 0 : j.state.currentUser, calendars: (M = (Y = (z = this.stores) == null ? void 0 : z.schedulerConfig) == null ? void 0 : Y.state) == null ? void 0 : M.calendars, selectedConfiguration: (W = (J = (V = this.stores) == null ? void 0 : V.schedulerConfig) == null ? void 0 : J.state) == null ? void 0 : W.selectedConfiguration })), ((Q = (Z = this.stores) == null ? void 0 : Z.schedulerConfig) == null ? void 0 : Q.state.currentUser) && this.stores.schedulerConfig.state.action === "create" && !s && h("nylas-editor-tabs", { mode: "composable" }, h(ExpressFlow, { experimentalFeatures: (ne = (te = (ee = this.stores) == null ? void 0 : ee.schedulerConfig) == null ? void 0 : te.state) == null ? void 0 : ne.experimentalFeatures, selectedEventType: ((ie = (re = (se = this.stores) == null ? void 0 : se.schedulerConfig) == null ? void 0 : re.state) == null ? void 0 : ie.selectedEventType) || CONFIGURATION_EVENT_TYPE.one_on_one, currentUser: (ae = (oe = this.stores) == null ? void 0 : oe.schedulerConfig) == null ? void 0 : ae.state.currentUser, calendars: (de = (ce = (le = this.stores) == null ? void 0 : le.schedulerConfig) == null ? void 0 : ce.state) == null ? void 0 : de.calendars, selectedConfiguration: (fe = (ue = (he = this.stores) == null ? void 0 : he.schedulerConfig) == null ? void 0 : ue.state) == null ? void 0 : fe.selectedConfiguration })), ((pe = (ge = this.stores) == null ? void 0 : ge.schedulerConfig) == null ? void 0 : pe.state.currentUser) && this.stores.schedulerConfig.state.action === "edit" && s && h("nylas-editor-tabs-group", { key: t, mode: this.mode }, this.mode === "composable" && h("slot", null), this.mode === "app" && r && h("div", { style: { display: "none" }, slot: "custom-page-style-inputs", key: t }, h("slot", { name: "custom-page-style-inputs" }))), ((me = (ye = this.stores) == null ? void 0 : ye.schedulerConfig) == null ? void 0 : me.state.currentUser) && this.stores.schedulerConfig.state.action === "edit" && !s && h("nylas-editor-tabs", { key: t, mode: this.mode }, this.mode === "composable" && h("slot", null), this.mode === "app" && r && h("div", { style: { display: "none" }, slot: "custom-page-style-inputs", key: t }, h("slot", { name: "custom-page-style-inputs" }))), !((Se = (we = this.stores) == null ? void 0 : we.schedulerConfig) != null && Se.state.currentUser) && h("slot", { name: "login-required" }, h(LoginRequired, { authenticationUrl: this.authenticationUrl }))));
1455
1712
  }
1456
1713
  get host() {
1457
1714
  return getElement(this);
@@ -1460,7 +1717,8 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
1460
1717
  return {
1461
1718
  configurationId: ["configurationIdChanged"],
1462
1719
  localization: ["updateLocalization"],
1463
- nylasBranding: ["updateNylasBranding"]
1720
+ nylasBranding: ["updateNylasBranding"],
1721
+ experimentalFeatures: ["updateExperimentalFeatures"]
1464
1722
  };
1465
1723
  }
1466
1724
  };