@nylas/react 1.1.0-canary.17 → 1.1.0-canary.19
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.
- package/dist/add-circle-icon_2.entry-3ca337a6.js +25 -0
- package/dist/add-circle-icon_2.entry-adde5fdf.cjs +1 -0
- package/dist/{archive-icon_7.entry-8c8317e9.cjs → archive-icon_7.entry-2b56ef80.cjs} +1 -1
- package/dist/{archive-icon_7.entry-60e900b6.js → archive-icon_7.entry-896a1054.js} +14 -14
- package/dist/{arrow-icon.entry-2d4e9572.cjs → arrow-icon.entry-0288f3fc.cjs} +1 -1
- package/dist/arrow-icon.entry-9aaa93fd.js +15 -0
- package/dist/{bold-icon_3.entry-557c6007.js → bold-icon_3.entry-0061cf1f.js} +6 -6
- package/dist/{bold-icon_3.entry-ba732761.cjs → bold-icon_3.entry-e7810620.cjs} +1 -1
- package/dist/button-component_4.entry-276606e6.js +115 -0
- package/dist/button-component_4.entry-e53a8f37.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_35.entry-a19cae9c.js +4178 -0
- package/dist/calendar-agenda-fill-icon_35.entry-fa968081.cjs +7 -0
- package/dist/{calendar-cancel-icon.entry-820cf967.js → calendar-cancel-icon.entry-71eae711.js} +5 -5
- package/dist/{calendar-cancel-icon.entry-b2657caf.cjs → calendar-cancel-icon.entry-8e8b25b6.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-b13e7cbb.cjs → calendar-check-icon_2.entry-562e98cf.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-128a5d67.js → calendar-check-icon_2.entry-6f971ca2.js} +9 -9
- package/dist/{calendar-icon.entry-d17d7cfb.cjs → calendar-icon.entry-3a59af30.cjs} +1 -1
- package/dist/{calendar-icon.entry-a43e6011.js → calendar-icon.entry-3e496896.js} +2 -2
- package/dist/{chevron-icon_3.entry-e0796c69.js → chevron-icon_3.entry-7eac0ed5.js} +37 -34
- package/dist/chevron-icon_3.entry-7ff10540.cjs +1 -0
- package/dist/{clock-icon_2.entry-e959ae50.js → clock-icon_2.entry-120d672e.js} +9 -9
- package/dist/{clock-icon_2.entry-267614c2.cjs → clock-icon_2.entry-43873262.cjs} +1 -1
- package/dist/{constants-f34b9c6e-ebc2e19c.cjs → constants-7ce66b44-a951d78c.cjs} +5 -5
- package/dist/{constants-f34b9c6e-efe2836b.js → constants-7ce66b44-e7ca66c2.js} +484 -383
- package/dist/copy-icon_4.entry-57874c4f.cjs +1 -0
- package/dist/copy-icon_4.entry-9a949d24.js +45 -0
- package/dist/{document-refresh-icon.entry-b4c217df.js → document-refresh-icon.entry-f0d95ac8.js} +5 -5
- package/dist/{document-refresh-icon.entry-b8850675.cjs → document-refresh-icon.entry-f1d3f32d.cjs} +1 -1
- package/dist/elements/index.d.ts +14 -0
- package/dist/{elements-dc5b338e-a33785e3.cjs → elements-dc5b338e-62b53496.cjs} +1 -1
- package/dist/{elements-dc5b338e-b0a290ae.js → elements-dc5b338e-974e2077.js} +1 -1
- package/dist/{focus-visible-e8093c16-5f1ae916.js → focus-visible-e8093c16-7a512fc0.js} +1 -1
- package/dist/{focus-visible-e8093c16-d2afb13d.cjs → focus-visible-e8093c16-923e1041.cjs} +1 -1
- package/dist/{forward-icon_6.entry-0009e4f0.cjs → forward-icon_6.entry-45b70066.cjs} +2 -2
- package/dist/{forward-icon_6.entry-53683e82.js → forward-icon_6.entry-675c0b73.js} +9 -9
- package/dist/{globe-icon.entry-dbb47687.js → globe-icon.entry-3296e427.js} +2 -2
- package/dist/{globe-icon.entry-df67eab8.cjs → globe-icon.entry-7ecd6221.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-aa9f8b35.js +584 -0
- package/dist/google-logo-icon_4.entry-fd734a59.cjs +1 -0
- package/dist/index-53420959-1c0d390d.js +5 -0
- package/dist/index-53420959-8e7b10db.cjs +1 -0
- package/dist/{index-5851f0a2.js → index-5efb84b8.js} +813 -793
- package/dist/{index-6d9eeb53-2f37342f.js → index-6d9eeb53-4e2a7f9f.js} +2 -2
- package/dist/{index-6d9eeb53-ded66877.cjs → index-6d9eeb53-aa1dfa96.cjs} +1 -1
- package/dist/index-d36b8fb8.cjs +42 -0
- package/dist/{index.es-9cc0eb3c-2cf4632f.js → index.es-9cc0eb3c-65f8af0c.js} +1 -1
- package/dist/{index.es-9cc0eb3c-e8de46e6.cjs → index.es-9cc0eb3c-8eefd4fc.cjs} +1 -1
- package/dist/{info-icon_2.entry-e355fb7d.cjs → info-icon_2.entry-e612f1d6.cjs} +1 -1
- package/dist/{info-icon_2.entry-c27ac645.js → info-icon_2.entry-f06c8dd0.js} +3 -3
- package/dist/{input-dropdown_2.entry-9e50060e.cjs → input-dropdown_2.entry-ad380260.cjs} +1 -1
- package/dist/{input-dropdown_2.entry-ce1da1b3.js → input-dropdown_2.entry-ccd95678.js} +3 -3
- package/dist/loading-icon.entry-678a6b3f.cjs +1 -0
- package/dist/{loading-icon.entry-4ab88ed8.js → loading-icon.entry-9e6670d5.js} +2 -2
- package/dist/{mailbox-store-64b4ef7c-ebe84c96.cjs → mailbox-store-64b4ef7c-9bd02ffd.cjs} +1 -1
- package/dist/{mailbox-store-64b4ef7c-47dac9aa.js → mailbox-store-64b4ef7c-b56d5e78.js} +2 -2
- package/dist/multi-select-dropdown.entry-5bb80d89.cjs +1 -0
- package/dist/multi-select-dropdown.entry-edf10867.js +91 -0
- package/dist/{nylas-booked-event-card_10.entry-ef9c2d62.js → nylas-booked-event-card_10.entry-92f6e85d.js} +276 -244
- package/dist/nylas-booked-event-card_10.entry-ad4671b2.cjs +1 -0
- package/dist/{nylas-custom-booking-flow.entry-f31400e2.js → nylas-custom-booking-flow.entry-b39a2bf2.js} +3 -3
- package/dist/{nylas-custom-booking-flow.entry-c59c1306.cjs → nylas-custom-booking-flow.entry-cef0041a.cjs} +1 -1
- package/dist/{nylas-form-card.entry-b189e066.js → nylas-form-card.entry-bf4545e2.js} +18 -18
- package/dist/{nylas-form-card.entry-bc048703.cjs → nylas-form-card.entry-fba5d623.cjs} +1 -1
- package/dist/{nylas-if-state.entry-5bdf8669.js → nylas-if-state.entry-2739dc10.js} +3 -3
- package/dist/{nylas-if-state.entry-933c79e0.cjs → nylas-if-state.entry-d7b818a6.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-5d1bef7f.cjs → nylas-list-folders.entry-0ec6ba20.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-f0e7ae4e.js → nylas-list-folders.entry-3197e390.js} +3 -3
- package/dist/{nylas-list-threads.entry-3e300e7e.cjs → nylas-list-threads.entry-2a7e1e84.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-3f7451ad.js → nylas-list-threads.entry-9004c490.js} +3 -3
- package/dist/{nylas-login.entry-dbf9e11f.cjs → nylas-login.entry-c2ffd6a5.cjs} +1 -1
- package/dist/{nylas-login.entry-e3b757a0.js → nylas-login.entry-f2927406.js} +7 -7
- package/dist/{nylas-mailbox-pagination.entry-0db12a01.cjs → nylas-mailbox-pagination.entry-839c9ad3.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-6c845a2a.js → nylas-mailbox-pagination.entry-e9356835.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-ec196947.js → nylas-mailbox-toolbar-button.entry-298a3c47.js} +4 -4
- package/dist/{nylas-mailbox-toolbar-button.entry-553f041a.cjs → nylas-mailbox-toolbar-button.entry-43812d51.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-1552ad11.js → nylas-mailbox.entry-aa42f6c4.js} +7 -7
- package/dist/{nylas-mailbox.entry-c0bbca56.cjs → nylas-mailbox.entry-cf13ddf5.cjs} +1 -1
- package/dist/{nylas-provider.entry-6d286e92.js → nylas-provider.entry-1a3a195f.js} +8 -8
- package/dist/{nylas-provider.entry-d4bf23c2.cjs → nylas-provider.entry-843b5593.cjs} +1 -1
- package/dist/nylas-scheduler-editor.entry-048e7a8f.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-caa1026b.js → nylas-scheduler-editor.entry-d56d6d2a.js} +138 -119
- package/dist/nylas-scheduling.entry-0ad9b1d0.cjs +1 -0
- package/dist/{nylas-scheduling.entry-19ff3d50.js → nylas-scheduling.entry-7039a890.js} +52 -52
- package/dist/{nylas-threads-refresh.entry-bc4c10ea.cjs → nylas-threads-refresh.entry-9cae6ac8.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-6acf3c2b.js → nylas-threads-refresh.entry-d951050a.js} +4 -4
- package/dist/{nylas-threads-search.entry-ee28712c.cjs → nylas-threads-search.entry-0d34c5a8.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-82fa1504.js → nylas-threads-search.entry-7a4bbc75.js} +8 -8
- package/dist/{nylas-time-window-picker.entry-131f84b4.cjs → nylas-time-window-picker.entry-062bc8c1.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-3c45d82e.js → nylas-time-window-picker.entry-210c3f1a.js} +2 -2
- package/dist/{nylas-view-thread.entry-695a7b0b.js → nylas-view-thread.entry-8b39a997.js} +6 -6
- package/dist/{nylas-view-thread.entry-0d9a4aa9.cjs → nylas-view-thread.entry-db78ed9c.cjs} +1 -1
- package/dist/play-icon_2.entry-19271982.cjs +1 -0
- package/dist/play-icon_2.entry-c53f3cac.js +25 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +115 -101
- package/dist/{refresh-icon.entry-43267155.js → refresh-icon.entry-75139a0c.js} +2 -2
- package/dist/{refresh-icon.entry-28e3ade7.cjs → refresh-icon.entry-e695cf7f.cjs} +1 -1
- package/dist/{register-component-a5a9ca5d-538c35c3.js → register-component-a5a9ca5d-d69a7a05.js} +1 -1
- package/dist/{register-component-a5a9ca5d-8b06415c.cjs → register-component-a5a9ca5d-eebf89e7.cjs} +1 -1
- package/dist/scheduler-config-store-9ccfba4d-22a58b7d.cjs +1 -0
- package/dist/{scheduler-config-store-4a50a03d-4a2e2abf.js → scheduler-config-store-9ccfba4d-fd62a421.js} +8 -6
- package/dist/{scheduler-store-f02ce045-121c1e09.js → scheduler-store-8a400448-3b007d4d.js} +125 -96
- package/dist/scheduler-store-8a400448-44e0edad.cjs +1 -0
- package/dist/{textarea-component.entry-402a369b.cjs → textarea-component.entry-48feabb3.cjs} +1 -1
- package/dist/{textarea-component.entry-1ec19adb.js → textarea-component.entry-ead5ab00.js} +7 -6
- package/dist/{translate-icon.entry-d412697e.js → translate-icon.entry-55043beb.js} +6 -6
- package/dist/{translate-icon.entry-59f4e190.cjs → translate-icon.entry-5f62bc61.cjs} +1 -1
- package/dist/{warning-icon.entry-aa6b2c2c.cjs → warning-icon.entry-2e0a80da.cjs} +1 -1
- package/dist/{warning-icon.entry-3ee1f451.js → warning-icon.entry-fa644462.js} +5 -5
- package/package.json +3 -3
- package/dist/add-circle-icon_2.entry-936fd73b.cjs +0 -1
- package/dist/add-circle-icon_2.entry-ce6aaa1d.js +0 -25
- package/dist/arrow-icon.entry-057db95a.js +0 -15
- package/dist/button-component.entry-22d0ac2e.js +0 -16
- package/dist/button-component.entry-385f9581.cjs +0 -1
- package/dist/calendar-info-icon_28.entry-b4f09bfe.cjs +0 -1
- package/dist/calendar-info-icon_28.entry-b71c23c5.js +0 -2083
- package/dist/chevron-icon_3.entry-4807a0b1.cjs +0 -1
- package/dist/google-logo-icon_4.entry-77f3b86e.js +0 -454
- package/dist/google-logo-icon_4.entry-c5db1be3.cjs +0 -1
- package/dist/index-53420959-16700a42.cjs +0 -1
- package/dist/index-53420959-f0c4f9af.js +0 -5
- package/dist/index-769f0fdd.cjs +0 -42
- package/dist/input-component.entry-a38a65da.js +0 -45
- package/dist/input-component.entry-ef2b397d.cjs +0 -1
- package/dist/loading-icon.entry-175aca19.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-6de99d57.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-00a71304.cjs +0 -2
- package/dist/nylas-scheduling.entry-f1fb67d2.cjs +0 -1
- package/dist/play-icon_2.entry-ab47588e.js +0 -25
- package/dist/play-icon_2.entry-b1167d3a.cjs +0 -1
- package/dist/scheduler-config-store-4a50a03d-40e87f35.cjs +0 -1
- package/dist/scheduler-store-f02ce045-f11cfad9.cjs +0 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { R as
|
|
3
|
-
import { T as _, g as re, L as
|
|
4
|
-
import { s as z } from "./index-6d9eeb53-
|
|
5
|
-
import "./index-53420959-
|
|
1
|
+
import { r as g, c as h, d, h as a, H as u, g as ae, l as G, z as ne, A as ie, C as x, D as oe, E as S, F as se } from "./index-5efb84b8.js";
|
|
2
|
+
import { R as C } from "./register-component-a5a9ca5d-d69a7a05.js";
|
|
3
|
+
import { T as _, g as re, L as V } from "./constants-7ce66b44-e7ca66c2.js";
|
|
4
|
+
import { s as z } from "./index-6d9eeb53-4e2a7f9f.js";
|
|
5
|
+
import "./index-53420959-1c0d390d.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "react-dom";
|
|
8
8
|
const le = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 4rem;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:16px;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;padding:8px;font-family:var(--nylas-font-family);font-weight:600;height:48px;line-height:24px}sp-button.cancel{color:var(--nylas-error)}sp-button.cancel:hover,sp-button.cancel:focus{border-color:var(--nylas-error)}sp-button.cancel:active{color:var(--nylas-error-pressed);border-color:var(--nylas-error-pressed)}sp-button.reschedule:hover,sp-button.reschedule:focus{border-color:var(--nylas-primary)}sp-button.reschedule:active{border-color:var(--nylas-base-600)}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}', ce = le;
|
|
9
|
-
var de = function(e, t,
|
|
10
|
-
var o = arguments.length,
|
|
9
|
+
var de = function(e, t, i, s) {
|
|
10
|
+
var o = arguments.length, n = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, i) : s, r;
|
|
11
11
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
12
|
-
|
|
12
|
+
n = Reflect.decorate(e, t, i, s);
|
|
13
13
|
else
|
|
14
14
|
for (var l = e.length - 1; l >= 0; l--)
|
|
15
|
-
(r = e[l]) && (
|
|
16
|
-
return o > 3 &&
|
|
15
|
+
(r = e[l]) && (n = (o < 3 ? r(n) : o > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
16
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
17
17
|
}, B = function(e, t) {
|
|
18
18
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
19
19
|
return Reflect.metadata(e, t);
|
|
20
20
|
};
|
|
21
21
|
const W = class {
|
|
22
22
|
constructor(e) {
|
|
23
|
-
|
|
24
|
-
var o;
|
|
25
|
-
const t = new Date(this.selectedTimeslot.start_time), n = (o = this.configSettings) == null ? void 0 : o.scheduler
|
|
26
|
-
t.getTime() <
|
|
23
|
+
g(this, e), this.cancelBookingButtonClicked = h(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = h(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = h(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = h(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
|
|
24
|
+
var o, n;
|
|
25
|
+
const t = new Date(this.selectedTimeslot.start_time), i = (n = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : n.min_cancellation_notice;
|
|
26
|
+
t.getTime() - i * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime() ? this.cancelBookedEventValidationError.emit({
|
|
27
27
|
error: {
|
|
28
28
|
title: "Cancellation Error",
|
|
29
|
-
message: `You cannot cancel the booking within ${
|
|
29
|
+
message: `You cannot cancel the booking within ${i} minutes of the event.`
|
|
30
30
|
}
|
|
31
31
|
}) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
|
|
32
32
|
}, this.handleRescheduleButtonClicked = () => {
|
|
33
|
-
const t = (
|
|
34
|
-
this.rescheduleBookedEventError.emit(
|
|
33
|
+
const t = (i) => {
|
|
34
|
+
this.rescheduleBookedEventError.emit(i);
|
|
35
35
|
};
|
|
36
36
|
this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: t });
|
|
37
37
|
}, this.getOrganizer = (t) => t == null ? void 0 : t.organizer, this.getPaticipantType = (t) => {
|
|
@@ -43,35 +43,36 @@ const W = class {
|
|
|
43
43
|
default:
|
|
44
44
|
return "";
|
|
45
45
|
}
|
|
46
|
-
}, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.configSettings = void 0;
|
|
46
|
+
}, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.configSettings = void 0, this.isLoading = void 0;
|
|
47
47
|
}
|
|
48
48
|
connectedCallback() {
|
|
49
49
|
}
|
|
50
50
|
disconnectedCallback() {
|
|
51
51
|
}
|
|
52
52
|
async componentWillLoad() {
|
|
53
|
-
|
|
53
|
+
d("[nylas-booked-event-card] Component will load");
|
|
54
54
|
}
|
|
55
55
|
async componentDidLoad() {
|
|
56
|
-
|
|
56
|
+
d("[nylas-booked-event-card] Component did load"), this.eventInfo || console.warn('[nylas-booked-event-card] "eventInfo" prop missing. Please provide the event info to display the event details in the booked event card component.'), this.bookingInfo || console.warn('[nylas-booked-event-card] "bookingInfo" prop missing. Please provide the booking info to display the guest details in the booked event card component.');
|
|
57
57
|
}
|
|
58
58
|
render() {
|
|
59
|
-
var e, t,
|
|
60
|
-
return a(
|
|
59
|
+
var e, t, i, s, o, n, r, l, p, b, c, f, m, v, y, k, w, $, A, q, Z;
|
|
60
|
+
return a(u, { key: "64a71090c3bb639b725195733562ad0e25a10eba", part: "nbec" }, a("sp-theme", { key: "6c8b9a6502507836aba5d3a358681b4fb55178a5", theme: "spectrum", color: "dark", scale: "medium" }, a("div", { key: "f49b01cfe925800eafd90eb1d31f5585fc43b595", class: "booked-event-timezone" }, a("globe-icon", { key: "a222a15cfeaccfc969c51eecff485bfcce18f611" }), _[this.selectedTimezone]), a("div", { key: "490c2bdea9b10c878a1746ae47e444c5ef32e07e", class: "event-card-wrapper", part: "nbec__card" }, a("div", { key: "d6e61e4633441e3d13f9560afc43622322b79e9f", class: "calendar-icon" }, a("calendar-check-icon", { key: "e761a870d25ef7c965b9c4520c44c37f55111e5d" })), a("div", { key: "0dbed416d1fcd1678fa2935c25ed96cc2e1a1c26", class: "booked-event-header" }, a("h2", { key: "7c485fa82b8cd30f6e589783b03413785b9597dc", slot: "card-title", part: "nbec__title" }, "Booking ", this.rescheduleBookingId && !this.isLoading ? "rescheduled" : "confirmed", "!"), a("div", { key: "17c4d9ad8338947d9c3e30043f0882d141576e88", part: "nbec__description" }, ((e = this.getOrganizer(this.eventInfo)) == null ? void 0 : e.name) || ((t = this.getOrganizer(this.eventInfo)) == null ? void 0 : t.email), " & ", ((s = (i = this.bookingInfo) == null ? void 0 : i.primaryParticipant) == null ? void 0 : s.name) || ((n = (o = this.bookingInfo) == null ? void 0 : o.primaryParticipant) == null ? void 0 : n.email))), a("sp-divider", { key: "c6adc37a2d0b96a4ae5f6922aadcabaa67cc10b6" }), a("div", { key: "c453be3d82ddad511771d7fd6944f0f772b7993c", class: "booking-date-time" }, a("checkmark-circle-icon", { key: "2ce7f0be037e54193904ea02c839dce1690de8d3" }), a("h3", { key: "8dad8e71df17003b3989a77fee4b03d5d6c10a54" }, "Booking date and time"), a("p", { key: "8bca1fab69c83e87e22a683ee248c9dd8864efb5" }, new Date((r = this.selectedTimeslot) == null ? void 0 : r.start_time).toLocaleDateString(void 0, { dateStyle: "full" }), " ", a("br", { key: "56e5d95797fedd1169943b8af1c119290a90a75e" }), new Date((l = this.selectedTimeslot) == null ? void 0 : l.start_time).toLocaleTimeString(void 0, { timeStyle: "short" }), " -", " ", new Date((p = this.selectedTimeslot) == null ? void 0 : p.end_time).toLocaleTimeString(void 0, { timeStyle: "short" }))), a("div", { key: "58b916f387d02bb74a39ae6d9775ad2db131e9b7", class: "booking-participants" }), a("sp-divider", { key: "be8f4ca081787cd2856a92672668f4f80dd18a74" }), a("div", { key: "09d6315a3d1ff768f03f1dea70c7de630ce2e5f6", class: {
|
|
61
61
|
footer: !0,
|
|
62
|
-
"no-footer": ((
|
|
63
|
-
"no-template-cols": ((
|
|
64
|
-
} }, !((A = ($ = this.configSettings) == null ? void 0 : $.scheduler) != null && A.hide_cancellation_options) && a("sp-button", { variant: "secondary", treatment: "outline", class: "cancel", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, "Cancel booking"), !((
|
|
62
|
+
"no-footer": ((c = (b = this.configSettings) == null ? void 0 : b.scheduler) == null ? void 0 : c.hide_cancellation_options) && ((m = (f = this.configSettings) == null ? void 0 : f.scheduler) == null ? void 0 : m.hide_rescheduling_options),
|
|
63
|
+
"no-template-cols": ((y = (v = this.configSettings) == null ? void 0 : v.scheduler) == null ? void 0 : y.hide_cancellation_options) || ((w = (k = this.configSettings) == null ? void 0 : k.scheduler) == null ? void 0 : w.hide_rescheduling_options)
|
|
64
|
+
} }, !((A = ($ = this.configSettings) == null ? void 0 : $.scheduler) != null && A.hide_cancellation_options) && a("sp-button", { variant: "secondary", treatment: "outline", class: "cancel", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, "Cancel booking"), !((Z = (q = this.configSettings) == null ? void 0 : q.scheduler) != null && Z.hide_rescheduling_options) && a("sp-button", { variant: "secondary", treatment: "outline", class: "reschedule", onClick: this.handleRescheduleButtonClicked, part: "nbec__button-outline nbec__reschedule-cta" }, "Reschedule")))));
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
de([
|
|
68
|
-
|
|
68
|
+
C({
|
|
69
69
|
name: "nylas-booked-event-card",
|
|
70
70
|
stateToProps: /* @__PURE__ */ new Map([
|
|
71
71
|
["scheduler.bookingInfo", "bookingInfo"],
|
|
72
72
|
["scheduler.rescheduleBookingId", "rescheduleBookingId"],
|
|
73
73
|
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
74
74
|
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
75
|
+
["scheduler.isLoading", "isLoading"],
|
|
75
76
|
["scheduler.configSettings", "configSettings"]
|
|
76
77
|
]),
|
|
77
78
|
eventToProps: {
|
|
@@ -79,8 +80,8 @@ de([
|
|
|
79
80
|
t.scheduler.setCancel(e.detail.bookingId);
|
|
80
81
|
},
|
|
81
82
|
rescheduleButtonClicked: async (e, t) => {
|
|
82
|
-
const
|
|
83
|
-
s && (!
|
|
83
|
+
const i = await t.scheduler.setReschedule(e.detail.bookingId), { errorHandler: s } = e.detail;
|
|
84
|
+
s && (!i || "error" in i) && s(i);
|
|
84
85
|
}
|
|
85
86
|
},
|
|
86
87
|
fireRegisterEvent: !0
|
|
@@ -90,49 +91,49 @@ de([
|
|
|
90
91
|
B("design:returntype", void 0)
|
|
91
92
|
], W.prototype, "render", null);
|
|
92
93
|
W.style = ce;
|
|
93
|
-
const
|
|
94
|
-
var he = function(e, t,
|
|
95
|
-
var o = arguments.length,
|
|
94
|
+
const fe = ':host{display:block;height:100%;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}sp-textfield{--spectrum-corner-radius-100:var(--nylas-border-radius-2x);--spectrum-textfield-border-color:var(--nylas-base-300);position:relative;width:100%;height:48px;margin-bottom:16px;color:var(--nylas-base-500)}.cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{flex-direction:column-reverse}}sp-button{background-color:transparent;color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);--button-width:50%;font-family:var(--nylas-font-family);font-size:16px;font-weight:600;border:none;height:48px;padding:14px}@media screen and (max-width: 768px){sp-button{--button-width:100%}}sp-button:hover,sp-button:focus{background-color:var(--nylas-base-100);color:var(--nylas-primary);border-radius:var(--nylas-border-radius-2x)}sp-button:active{background-color:var(--nylas-base-200);color:var(--nylas-base-800)}sp-button.back{width:var(--button-width);background-color:transparent;color:var(--nylas-base-700);outline:1px solid var(--nylas-base-300)}sp-button.back:hover,sp-button.back:focus{outline-color:var(--nylas-primary)}sp-button.back:active{outline:2px solid var(--nylas-base-600)}sp-button.book{width:var(--button-width);background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.book:hover,sp-button.book:focus{background-color:var(--nylas-base-600)}sp-button.book:active{background-color:var(--nylas-base-800)}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family);font-size:16px}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}.button-content{display:flex;gap:4px;align-items:center}sp-infield-button{--spectrum-infield-button-background-color:transparent;--spectrum-infield-button-background-color-hover:transparent;--spectrum-infield-button-background-color-active:transparent;--spectrum-infield-button-border-color:transparent;--spectrum-infield-button-border-width:1px;--spectrum-infield-button-border-radius:0;color:var(--nylas-base-600);background:transparent;border:none;outline:1px solid var(--nylas-base-300);border-radius:0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x) 0;height:52px;width:52px;display:flex;position:absolute;right:0;align-items:center;justify-content:center;cursor:pointer}sp-infield-button sp-icon-cross300{color:var(--nylas-base-600)}sp-infield-button.error{border-width:2px;border-color:var(--nylas-error)}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%}input[type=text]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}button-component.remove-guest{position:absolute;height:51px;right:0}button-component.remove-guest.error button{border-color:var(--nylas-error)}button-component.remove-guest button{height:inherit;border-top-left-radius:initial;border-bottom-left-radius:initial;border:none !important;border-left:1px solid var(--nylas-base-300) !important}button-component.remove-guest button:hover,button-component.remove-guest button:focus{outline:1px solid var(--nylas-primary) !important;color:var(--nylas-primary)}.guest-email-input{position:relative;display:flex;width:100%}', be = fe;
|
|
95
|
+
var he = function(e, t, i, s) {
|
|
96
|
+
var o = arguments.length, n = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, i) : s, r;
|
|
96
97
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
97
|
-
|
|
98
|
+
n = Reflect.decorate(e, t, i, s);
|
|
98
99
|
else
|
|
99
100
|
for (var l = e.length - 1; l >= 0; l--)
|
|
100
|
-
(r = e[l]) && (
|
|
101
|
-
return o > 3 &&
|
|
101
|
+
(r = e[l]) && (n = (o < 3 ? r(n) : o > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
102
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
102
103
|
}, L = function(e, t) {
|
|
103
104
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
104
105
|
return Reflect.metadata(e, t);
|
|
105
106
|
};
|
|
106
107
|
const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, U = class {
|
|
107
108
|
constructor(e) {
|
|
108
|
-
|
|
109
|
+
g(this, e), this.nameChanged = h(this, "nameChanged", 7), this.emailChanged = h(this, "emailChanged", 7), this.backButtonClicked = h(this, "backButtonClicked", 7), this.detailsConfirmed = h(this, "detailsConfirmed", 7), this.bookingFormError = h(this, "bookingFormError", 7), this.bookingFormSubmitted = h(this, "bookingFormSubmitted", 7), this.handleGuestChange = (t, i) => {
|
|
109
110
|
this.resetGuestEmailError(t);
|
|
110
111
|
const s = [...this.guestEmails];
|
|
111
|
-
s[t] = z(
|
|
112
|
-
}, this.handleGuestBlur = (t,
|
|
113
|
-
if (this.resetGuestEmailError(t),
|
|
112
|
+
s[t] = z(i), this.guestEmails = [...s];
|
|
113
|
+
}, this.handleGuestBlur = (t, i) => {
|
|
114
|
+
if (this.resetGuestEmailError(t), i === "") {
|
|
114
115
|
this.guestEmailErrors[t] = "Email is required";
|
|
115
116
|
return;
|
|
116
117
|
}
|
|
117
|
-
if (!E.test(
|
|
118
|
+
if (!E.test(i)) {
|
|
118
119
|
this.guestEmailErrors[t] = "Enter a valid email address";
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
121
|
-
this.handleGuestChange(t,
|
|
122
|
+
this.handleGuestChange(t, i);
|
|
122
123
|
}, this.addGuestButtonClickedHandler = (t) => {
|
|
123
124
|
t.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
|
|
124
|
-
}, this.removeGuestButtonClickHandler = (t,
|
|
125
|
-
t.preventDefault(), this.resetGuestEmailError(
|
|
125
|
+
}, this.removeGuestButtonClickHandler = (t, i) => {
|
|
126
|
+
t.preventDefault(), this.resetGuestEmailError(i);
|
|
126
127
|
const s = [...this.guestEmails];
|
|
127
|
-
s.splice(
|
|
128
|
+
s.splice(i, 1), this.guestEmails = [...s];
|
|
128
129
|
}, this.handleBackButtonClicked = () => {
|
|
129
130
|
this.backButtonClicked.emit();
|
|
130
131
|
}, this.bookButtonClickedHandler = async (t) => {
|
|
131
|
-
var l,
|
|
132
|
+
var l, p, b, c, f, m, v;
|
|
132
133
|
if (t.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
|
|
133
134
|
return;
|
|
134
|
-
|
|
135
|
-
const s = this.name || ((
|
|
135
|
+
d("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
|
|
136
|
+
const s = this.name || ((p = (l = this.bookingInfo) == null ? void 0 : l.primaryParticipant) == null ? void 0 : p.name), o = this.email || ((c = (b = this.bookingInfo) == null ? void 0 : b.primaryParticipant) == null ? void 0 : c.email);
|
|
136
137
|
if (!s || s === "") {
|
|
137
138
|
this.isNameValid = !1, this.validationError.name = "Name is required", this.bookingFormError.emit({
|
|
138
139
|
title: "Booking form error",
|
|
@@ -154,42 +155,41 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
154
155
|
});
|
|
155
156
|
return;
|
|
156
157
|
}
|
|
157
|
-
let
|
|
158
|
+
let n = [];
|
|
158
159
|
if (this.guestEmails.length > 0) {
|
|
159
|
-
let
|
|
160
|
-
if (this.guestEmails.forEach((
|
|
161
|
-
|
|
162
|
-
}),
|
|
160
|
+
let y = !1;
|
|
161
|
+
if (this.guestEmails.forEach((k, w) => {
|
|
162
|
+
k === "" ? (y = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [w]: "Email is required" }) : E.test(k) || (y = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [w]: "Enter a valid email address" });
|
|
163
|
+
}), y) {
|
|
163
164
|
this.bookingFormError.emit({
|
|
164
165
|
title: "Booking form error",
|
|
165
166
|
description: "Invalid guest email"
|
|
166
167
|
});
|
|
167
168
|
return;
|
|
168
169
|
}
|
|
169
|
-
|
|
170
|
+
n = this.guestEmails.map((k) => ({ name: k.trim(), email: k.trim() }));
|
|
170
171
|
} else
|
|
171
|
-
(
|
|
172
|
-
const r = ((
|
|
172
|
+
(f = this.bookingInfo) != null && f.guests && (n = (m = this.bookingInfo) == null ? void 0 : m.guests);
|
|
173
|
+
const r = ((v = this.bookingInfo) == null ? void 0 : v.additionalFields) || [];
|
|
173
174
|
this.detailsConfirmed.emit({
|
|
174
175
|
primaryParticipant: {
|
|
175
176
|
name: s,
|
|
176
177
|
email: o
|
|
177
178
|
},
|
|
178
|
-
guests:
|
|
179
|
-
additionalFields:
|
|
179
|
+
guests: n,
|
|
180
|
+
additionalFields: { ...r, ...this.additionalFields }
|
|
180
181
|
});
|
|
181
|
-
}, this.updateAdditionalFields = (t,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.configSettings = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.additionalFields = [], this.validationError = { name: "", email: "" };
|
|
182
|
+
}, this.updateAdditionalFields = (t, i) => {
|
|
183
|
+
this.additionalFields && (this.additionalFields[t] = i);
|
|
184
|
+
}, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.configSettings = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.additionalFields = {}, this.validationError = { name: "", email: "" };
|
|
185
185
|
}
|
|
186
186
|
connectedCallback() {
|
|
187
187
|
}
|
|
188
188
|
disconnectedCallback() {
|
|
189
189
|
}
|
|
190
190
|
componentWillLoad() {
|
|
191
|
-
var e, t,
|
|
192
|
-
|
|
191
|
+
var e, t, i;
|
|
192
|
+
d("nylas-booking-form", "componentWillLoad", this.bookingInfo), this.bookingInfo && ((e = this.bookingInfo) != null && e.primaryParticipant) && (this.name = (t = this.bookingInfo.primaryParticipant) == null ? void 0 : t.name, this.email = (i = this.bookingInfo.primaryParticipant) == null ? void 0 : i.email);
|
|
193
193
|
}
|
|
194
194
|
bookingInfoChangedHandler(e) {
|
|
195
195
|
e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
|
|
@@ -220,10 +220,9 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
220
220
|
});
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
|
-
this.updateAdditionalFields(e.detail.label, e.detail.value
|
|
223
|
+
this.updateAdditionalFields(e.detail.label, e.detail.value);
|
|
224
224
|
break;
|
|
225
225
|
}
|
|
226
|
-
e.detail.name === "name" ? this.changeName(e.detail.value) : e.detail.name === "email" && this.changeEmail(e.detail.value);
|
|
227
226
|
}
|
|
228
227
|
selectOptionChangedHandler(e) {
|
|
229
228
|
if (e.detail.error) {
|
|
@@ -233,31 +232,49 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
233
232
|
});
|
|
234
233
|
return;
|
|
235
234
|
}
|
|
236
|
-
this.updateAdditionalFields(e.detail.label, e.detail.value
|
|
235
|
+
this.updateAdditionalFields(e.detail.label, e.detail.value);
|
|
237
236
|
}
|
|
238
237
|
switchToggledHandler(e) {
|
|
239
|
-
this.updateAdditionalFields(e.detail.label, e.detail.checked ? "true" : "false"
|
|
238
|
+
this.updateAdditionalFields(e.detail.label, e.detail.checked ? "true" : "false");
|
|
240
239
|
}
|
|
241
240
|
checkboxToggledHandler(e) {
|
|
242
|
-
this.updateAdditionalFields(e.detail.label, e.detail.checked ? "true" : "false"
|
|
241
|
+
this.updateAdditionalFields(e.detail.label, e.detail.checked ? "true" : "false");
|
|
242
|
+
}
|
|
243
|
+
radioChangedHandler(e) {
|
|
244
|
+
this.updateAdditionalFields(e.detail.label || e.detail.name, e.detail.value);
|
|
243
245
|
}
|
|
244
246
|
render() {
|
|
245
|
-
var e, t,
|
|
246
|
-
return a(
|
|
247
|
-
error: !!this.guestEmailErrors[
|
|
248
|
-
} }, "Guest email"), a("div", { class: "guest-email-input" }, a("input", { type: "email", id: `guest-email-${
|
|
247
|
+
var e, t, i, s, o, n, r, l, p;
|
|
248
|
+
return a(u, { key: "36976cb674781bce8d4ebf7448c6139e16871503" }, a("form", { key: "b680520fd0dd5fc680fb93c2665a0fc3128ef18c", onSubmit: (b) => this.bookButtonClickedHandler(b), noValidate: !0 }, a("div", { key: "d66af23e87ae82517d91802d7e1811888fe0460f", class: "nylas-booking-form" }, a("div", { key: "314fe1fabfbecfa4dc282724b2c50e37ea09ec97", class: "input-wrapper" }, a("input-component", { key: "2f789c887cd3b6f1f5fd325afbc1b507048501d7", label: "Name", name: "name", id: "name", defaultValue: ((t = (e = this.bookingInfo) == null ? void 0 : e.primaryParticipant) == null ? void 0 : t.name) || this.name, placeholder: "Enter your name", type: "text", required: !0, part: "nbf__input-textfield" })), a("div", { key: "49e1cbcdf26466ac6b9634032b4e402850c8dae4", class: "input-wrapper" }, a("input-component", { key: "9248db828f4ccab15b66fd95e4baa4d76a2810df", label: "Email", name: "email", id: "email", pattern: E, defaultValue: ((s = (i = this.bookingInfo) == null ? void 0 : i.primaryParticipant) == null ? void 0 : s.email) || this.email, placeholder: "Enter your email", type: "email", required: !0, part: "nbf__input-textfield" })), ((n = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : n.hide_additional_guests) !== !0 && a("div", { class: "input-wrapper" }, this.guestEmails.map((b, c) => a("div", { class: "input-wrapper button-wrapper" }, a("label", { class: {
|
|
249
|
+
error: !!this.guestEmailErrors[c]
|
|
250
|
+
} }, "Guest email"), a("div", { class: "guest-email-input" }, a("input", { type: "email", id: `guest-email-${c}`, maxLength: 100, class: {
|
|
249
251
|
"guest-email": !0,
|
|
250
|
-
error: !!this.guestEmailErrors[
|
|
251
|
-
}, placeholder: "Enter guest email", value:
|
|
252
|
-
var
|
|
253
|
-
return this.handleGuestBlur(
|
|
254
|
-
}, onInput: (
|
|
255
|
-
var
|
|
256
|
-
return this.handleGuestChange(
|
|
257
|
-
} }), a("button-component", { variant: "basic", onClick: (
|
|
252
|
+
error: !!this.guestEmailErrors[c]
|
|
253
|
+
}, placeholder: "Enter guest email", value: b, "data-index": c, part: "nbf__input-textfield", onBlur: (f) => {
|
|
254
|
+
var m;
|
|
255
|
+
return this.handleGuestBlur(c, (m = f.target) == null ? void 0 : m.value);
|
|
256
|
+
}, onInput: (f) => {
|
|
257
|
+
var m;
|
|
258
|
+
return this.handleGuestChange(c, (m = f.target) == null ? void 0 : m.value);
|
|
259
|
+
} }), a("button-component", { variant: "basic", onClick: (f) => this.removeGuestButtonClickHandler(f, c), class: {
|
|
258
260
|
"remove-guest": !0,
|
|
259
|
-
error: !!this.guestEmailErrors[
|
|
260
|
-
} }, a("close-icon", null))), a("p", { class: "help-text" }, this.guestEmailErrors[
|
|
261
|
+
error: !!this.guestEmailErrors[c]
|
|
262
|
+
} }, a("close-icon", null))), a("p", { class: "help-text" }, this.guestEmailErrors[c]))), a("button-component", { class: "add-guest", variant: "invisible", part: "nbf__button-ghost", onClick: (b) => this.addGuestButtonClickedHandler(b) }, a("div", { class: "button-content" }, a("add-circle-icon", { slot: "icon" }), "Add ", this.guestEmails.length > 0 ? "another " : "", "guest"))), (p = Object.entries(((l = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : l.additional_fields) || {})) == null ? void 0 : p.sort((b, c) => b[1].order - c[1].order).map((b) => {
|
|
263
|
+
var m, v;
|
|
264
|
+
const c = b[1], f = b[0];
|
|
265
|
+
switch (c.type) {
|
|
266
|
+
case "dropdown":
|
|
267
|
+
return a("div", { class: "input-wrapper" }, a("select-dropdown", { label: f, name: f, id: f, withSearch: !1, options: (m = c.options) == null ? void 0 : m.map((y) => ({ value: y, label: y })), required: c.required, part: "nbf__input-textfield" }));
|
|
268
|
+
case "checkbox":
|
|
269
|
+
return a("div", { class: "input-wrapper" }, a("checkbox-component", { label: f, name: f, id: f, required: c.required, part: "nbf__input-textfield" }));
|
|
270
|
+
case "radio_button":
|
|
271
|
+
return a("div", { class: "input-wrapper" }, a("radio-button-group", { label: f, name: f, id: f, options: (v = c.options) == null ? void 0 : v.map((y) => ({ value: y, label: y })), required: c.required, part: "nbf__input-textfield" }));
|
|
272
|
+
case "multi_line_text":
|
|
273
|
+
return a("div", { class: "input-wrapper" }, a("textarea-component", { label: f, name: f, id: f, required: c.required, part: "nbf__input-textfield" }));
|
|
274
|
+
default:
|
|
275
|
+
return a("div", { class: "input-wrapper" }, a("input-component", { label: f, name: f, id: f, type: c.type, required: c.required, part: "nbf__input-textfield" }));
|
|
276
|
+
}
|
|
277
|
+
}), a("slot", { key: "a3ed3aec89ed73ebac18ea67a81a26eafe2cdee1", name: "custom-booking-form" })), a("div", { key: "145d50be8074dacd8ec6e63a80d5ef06c7f01357", class: "cta" }, a("sp-button", { key: "e7cc2a09db2f2365030aa7013aa0a7be3b04915a", treatment: "outline", variant: "secondary", class: "back", part: "nbf__button-outline", onClick: this.handleBackButtonClicked }, a("slot", { key: "7c97f933480ec1fc279531dacebb4cf9458c35ff", name: "booking-form-back-label" }, "Back")), a("sp-button", { key: "368f5f5fc489d6fa06b818f2ad8dee46260fff1c", variant: "primary", class: "book", part: "nbf__button-primary", type: "submit" }, this.isLoading && a("loading-icon", { slot: "icon" }), a("slot", { key: "9dcca97d8629337121b691a649b4a0bd7cd91554", name: "booking-form-book-label" }, "Book now")))));
|
|
261
278
|
}
|
|
262
279
|
get host() {
|
|
263
280
|
return ae(this);
|
|
@@ -269,7 +286,7 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
269
286
|
}
|
|
270
287
|
};
|
|
271
288
|
he([
|
|
272
|
-
|
|
289
|
+
C({
|
|
273
290
|
name: "nylas-booking-form",
|
|
274
291
|
stateToProps: /* @__PURE__ */ new Map([
|
|
275
292
|
["scheduler.isLoading", "isLoading"],
|
|
@@ -294,57 +311,68 @@ he([
|
|
|
294
311
|
L("design:paramtypes", []),
|
|
295
312
|
L("design:returntype", void 0)
|
|
296
313
|
], U.prototype, "render", null);
|
|
297
|
-
U.style =
|
|
298
|
-
const
|
|
299
|
-
var ue = function(e, t,
|
|
300
|
-
var o = arguments.length,
|
|
314
|
+
U.style = be;
|
|
315
|
+
const pe = ':host{display:block;width:400px;--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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:1rem;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600)}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;width:100%;height:48px;padding:8px;line-height:24px;font-family:var(--nylas-font-family)}sp-button.cancel{margin-top:1.25rem;background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.cancel:hover,sp-button.cancel:focus{background-color:var(--nylas-base-600)}sp-button.cancel:active{background-color:var(--nylas-base-800)}sp-button.back{margin-top:0.5rem}sp-button.back:hover,sp-button.back:focus{border-color:var(--nylas-primary)}sp-button.back:active{border-color:var(--nylas-base-600)}sp-field-label{margin-top:1rem;display:flex;color:var(--nylas-base-800);font-size:14px}sp-field-label.error{color:var(--nylas-error)}sp-field-label span.required{color:var(--nylas-error)}sp-textfield{--spectrum-textfield-border-color:var(--nylas-base-300);--spectrum-textfield-icon-color-invalid:var(--nylas-error);position:relative;width:100%;height:48px;margin-bottom:16px;background-color:var(--nylas-base-0);color:var(--nylas-base-500)}sp-textfield.error{--spectrum-textfield-border-color:var(--nylas-error)}sp-help-text{margin:0.25rem 0 1rem 0;color:var(--nylas-error)}', me = pe;
|
|
316
|
+
var ue = function(e, t, i, s) {
|
|
317
|
+
var o = arguments.length, n = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, i) : s, r;
|
|
301
318
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
302
|
-
|
|
319
|
+
n = Reflect.decorate(e, t, i, s);
|
|
303
320
|
else
|
|
304
321
|
for (var l = e.length - 1; l >= 0; l--)
|
|
305
|
-
(r = e[l]) && (
|
|
306
|
-
return o > 3 &&
|
|
322
|
+
(r = e[l]) && (n = (o < 3 ? r(n) : o > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
323
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
307
324
|
}, I = function(e, t) {
|
|
308
325
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
309
326
|
return Reflect.metadata(e, t);
|
|
310
327
|
};
|
|
311
328
|
const Y = class {
|
|
312
329
|
constructor(e) {
|
|
313
|
-
var t,
|
|
314
|
-
|
|
330
|
+
var t, i;
|
|
331
|
+
g(this, e), this.goBackButtonClicked = h(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = h(this, "cancelBookingFormSubmitted", 7), this.cancelBookedEventError = h(this, "cancelBookedEventError", 7), this.cancelBookingFormError = h(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
|
|
315
332
|
this.goBackButtonClicked.emit();
|
|
316
333
|
}, this.handleSubmitCancelBooking = (s) => {
|
|
334
|
+
var r, l, p;
|
|
317
335
|
if (s.preventDefault(), !this.cancellationReason) {
|
|
318
336
|
this.cancellationError = "Please provide a reason for cancellation.", this.cancelBookingFormError.emit({ title: "Cancel booking form error", description: "Please provide a reason for cancellation." });
|
|
319
337
|
return;
|
|
320
338
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
this.cancelBookedEventError.emit(
|
|
339
|
+
const o = (l = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : l.min_cancellation_notice;
|
|
340
|
+
if (this.selectedTimeslot && o && new Date((p = this.selectedTimeslot) == null ? void 0 : p.start_time).getTime() - o * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime()) {
|
|
341
|
+
this.cancelBookedEventError.emit({
|
|
342
|
+
error: {
|
|
343
|
+
title: "Cancellation Error",
|
|
344
|
+
message: `You cannot cancel the booking within ${o} minutes of the event.`
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
d(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
|
|
350
|
+
const n = (b) => {
|
|
351
|
+
this.cancelBookedEventError.emit(b);
|
|
324
352
|
};
|
|
325
|
-
this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, reason: this.cancellationReason, errorHandler:
|
|
353
|
+
this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, reason: this.cancellationReason, errorHandler: n });
|
|
326
354
|
}, this.handleOnChangeCancellationReason = (s) => {
|
|
327
355
|
this.cancellationError = "", this.cancellationReason = s.target.value;
|
|
328
|
-
}, this.cancelBookingId = void 0, this.configSettings = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((
|
|
356
|
+
}, this.cancelBookingId = void 0, this.configSettings = void 0, this.selectedTimeslot = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((i = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : i.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
329
357
|
}
|
|
330
358
|
configSettingsChangedHandler(e) {
|
|
331
359
|
var t;
|
|
332
360
|
this.cancellationPolicy = ((t = e == null ? void 0 : e.scheduler) == null ? void 0 : t.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
333
361
|
}
|
|
334
362
|
connectedCallback() {
|
|
335
|
-
|
|
363
|
+
d("[nylas-cancel-booking-form] Component connected");
|
|
336
364
|
}
|
|
337
365
|
async componentWillLoad() {
|
|
338
|
-
|
|
366
|
+
d("[nylas-cancel-booking-form] Component will load");
|
|
339
367
|
}
|
|
340
368
|
async componentDidLoad() {
|
|
341
|
-
|
|
369
|
+
d("[nylas-cancel-booking-form] Component did load"), this.cancelBookingId || console.warn('[nylas-cancel-booking-form] No booking ID provided, "cancelBookingId" prop is required.');
|
|
342
370
|
}
|
|
343
371
|
disconnectedCallback() {
|
|
344
|
-
|
|
372
|
+
d("[nylas-cancel-booking-form] Component disconnected");
|
|
345
373
|
}
|
|
346
374
|
render() {
|
|
347
|
-
return a(
|
|
375
|
+
return a(u, { key: "b9d70a4033b9e329c30791e348d05aafb22bc5a7", part: "ncec" }, a("sp-theme", { key: "218750e38e273ae65c7b5d9b954abcd087413af3", theme: "spectrum", scale: "medium" }, a("div", { key: "6a7b6cd1d9679c1f4ff9fc2c2968767a17523a47", class: "nylas-cancel-booking-form", part: "ncec__card" }, a("div", { key: "cc9838dea289f92caa24071e719c624047d33b8a", class: "nylas-cancel-booking-form__calendar-icon", part: "ncec__icon" }, a("calendar-cancel-icon", { key: "5d16b7a0a1b8e4e47398fe3b1854bac1364b12dd" })), a("h3", { key: "ab167468e9c518099ff332a57056753a88e88a20", class: "nylas-cancel-booking-form__title", part: "ncec__title" }, "Cancel booking?"), a("div", { key: "76f7aed68228904e5186b43b00ffe07e4f82a704", class: "nylas-cancel-booking-form__description", part: "ncec__description" }, this.cancellationPolicy), a("form", { key: "f544db26c2fd84db363fd7f80615c1c3c22e757e", onSubmit: this.handleSubmitCancelBooking }, a("sp-field-label", { key: "951a80c9f5aa350a093f8934332545a7e21d3949", for: "cancel-reason", class: this.cancellationError ? "error" : "" }, "Reason for cancellation ", a("span", { key: "2bd92cdf3882c1a6a3852f66a8627653f12662d1", class: "required" }, "*")), a("sp-textfield", { key: "223e1c8d2746acc3056c39670a67fe771822aea2", id: "cancel-reason", class: this.cancellationError ? "error" : "", part: "ncec__reason-textarea", multiline: !0, value: this.cancellationReason, onInput: this.handleOnChangeCancellationReason, onFocus: this.handleOnChangeCancellationReason, invalid: !!this.cancellationError }, a("sp-help-text", { key: "4340993d5147663ecaa19a1e7c5bc6c286882760", slot: "negative-help-text" }, this.cancellationError)), a("sp-button", { key: "1dbc5beae35e581d640045458bd305d7ac07968c", variant: "primary", class: "cancel", type: "submit", part: "ncec__button-cta" }, "Cancel booking"), a("sp-button", { key: "2ce80727166893cd38d33975d34fe5809f1d074d", variant: "secondary", class: "back", treatment: "outline", part: "ncec__button-outline", onClick: this.handleGoBackClicked }, "Go back")))));
|
|
348
376
|
}
|
|
349
377
|
static get watchers() {
|
|
350
378
|
return {
|
|
@@ -353,13 +381,16 @@ const Y = class {
|
|
|
353
381
|
}
|
|
354
382
|
};
|
|
355
383
|
ue([
|
|
356
|
-
|
|
384
|
+
C({
|
|
357
385
|
name: "nylas-cancel-booking-form",
|
|
358
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
386
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
387
|
+
["scheduler.configSettings", "configSettings"],
|
|
388
|
+
["scheduler.selectedTimeslot", "selectedTimeslot"]
|
|
389
|
+
]),
|
|
359
390
|
eventToProps: {
|
|
360
391
|
cancelBookingFormSubmitted: async (e, t) => {
|
|
361
|
-
const
|
|
362
|
-
s && (!
|
|
392
|
+
const i = await t.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason), { errorHandler: s } = e.detail;
|
|
393
|
+
s && (!i || "error" in i) && s(i);
|
|
363
394
|
}
|
|
364
395
|
},
|
|
365
396
|
fireRegisterEvent: !0
|
|
@@ -368,55 +399,55 @@ ue([
|
|
|
368
399
|
I("design:paramtypes", []),
|
|
369
400
|
I("design:returntype", void 0)
|
|
370
401
|
], Y.prototype, "render", null);
|
|
371
|
-
Y.style =
|
|
402
|
+
Y.style = me;
|
|
372
403
|
const ye = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancelled-event-card{display:flex;align-items:center;flex-direction:column;width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:1rem;height:48px;padding:8px;line-height:24px;width:100%}sp-button:hover,sp-button:focus{border-color:var(--nylas-primary)}sp-button:active{border-color:var(--nylas-base-600)}', ge = ye;
|
|
373
|
-
var ve = function(e, t,
|
|
374
|
-
var o = arguments.length,
|
|
404
|
+
var ve = function(e, t, i, s) {
|
|
405
|
+
var o = arguments.length, n = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, i) : s, r;
|
|
375
406
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
376
|
-
|
|
407
|
+
n = Reflect.decorate(e, t, i, s);
|
|
377
408
|
else
|
|
378
409
|
for (var l = e.length - 1; l >= 0; l--)
|
|
379
|
-
(r = e[l]) && (
|
|
380
|
-
return o > 3 &&
|
|
410
|
+
(r = e[l]) && (n = (o < 3 ? r(n) : o > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
411
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
381
412
|
}, R = function(e, t) {
|
|
382
413
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
383
414
|
return Reflect.metadata(e, t);
|
|
384
415
|
};
|
|
385
416
|
const X = class {
|
|
386
417
|
constructor(e) {
|
|
387
|
-
|
|
418
|
+
g(this, e), this.closeCancelEventCardClicked = h(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = h(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
|
|
388
419
|
this.isClosing = !0;
|
|
389
|
-
const t = (
|
|
390
|
-
this.cancelledEventCardError.emit(
|
|
420
|
+
const t = (i) => {
|
|
421
|
+
this.cancelledEventCardError.emit(i), this.isClosing = !1;
|
|
391
422
|
};
|
|
392
423
|
this.closeCancelEventCardClicked.emit({ errorHandler: t });
|
|
393
424
|
}, this.cancelledEventInfo = void 0, this.isClosing = !1, this.configSettings = void 0;
|
|
394
425
|
}
|
|
395
426
|
connectedCallback() {
|
|
396
|
-
|
|
427
|
+
d("[nylas-cancelled-event-card] Component connected");
|
|
397
428
|
}
|
|
398
429
|
async componentWillLoad() {
|
|
399
|
-
|
|
430
|
+
d("[nylas-cancelled-event-card] Component will load");
|
|
400
431
|
}
|
|
401
432
|
async componentDidLoad() {
|
|
402
|
-
|
|
433
|
+
d("[nylas-cancelled-event-card] Component did load"), this.cancelledEventInfo || console.warn('[nylas-cancelled-event-card] No cancelled event info provided, "cancelledEventInfo" prop is required.');
|
|
403
434
|
}
|
|
404
435
|
disconnectedCallback() {
|
|
405
|
-
|
|
436
|
+
d("[nylas-cancelled-event-card] Component disconnected");
|
|
406
437
|
}
|
|
407
438
|
render() {
|
|
408
439
|
var e, t;
|
|
409
|
-
return a(
|
|
440
|
+
return a(u, { key: "fe2ed7ce54027987ff6eacc29e4af427d1db3812", part: "ncec" }, a("sp-theme", { key: "9132889a3541fad4294b058769ed891bbc64b3fc", theme: "spectrum", color: "dark", scale: "medium" }, a("div", { key: "2a55f78a1f03dc101b16fd70d235ae507bbf3076", class: "nylas-cancelled-event-card", part: "ncec__card" }, a("div", { key: "6083acf124f5423e3c6f65f07bf6c980244672a6", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, a("calendar-cancel-icon", { key: "0132808a907473f233a58d79ba184997e5ffaf52" })), a("h3", { key: "ba6fcbb8579d5f7fe74910c7252ff555363f3b8e", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, "Your booking has been cancelled successfully!"), a("div", { key: "63863dfcb4f73f5cbcc3b40036bd046dc7bb262a", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, "A cancellation email has been sent to ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), a("div", { key: "d77cc91721cb5b86da50bd31decf015a0d6995a1", class: "nylas-cancelled-event-card__cta" }, a("sp-button", { key: "20685777e9c2674a8b92e7f47581bc6e9812f79d", variant: "secondary", treatment: "outline", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? "Closing..." : "Close")))));
|
|
410
441
|
}
|
|
411
442
|
};
|
|
412
443
|
ve([
|
|
413
|
-
|
|
444
|
+
C({
|
|
414
445
|
name: "nylas-cancelled-event-card",
|
|
415
446
|
stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
|
|
416
447
|
eventToProps: {
|
|
417
448
|
closeCancelEventCardClicked: async (e, t) => {
|
|
418
|
-
const
|
|
419
|
-
s && (!
|
|
449
|
+
const i = await t.scheduler.resetCancel(), { errorHandler: s } = e.detail;
|
|
450
|
+
s && (!i || "error" in i) && s(i);
|
|
420
451
|
}
|
|
421
452
|
},
|
|
422
453
|
fireRegisterEvent: !0
|
|
@@ -427,77 +458,77 @@ ve([
|
|
|
427
458
|
], X.prototype, "render", null);
|
|
428
459
|
X.style = ge;
|
|
429
460
|
const P = /* @__PURE__ */ new Date(), F = /* @__PURE__ */ new Date();
|
|
430
|
-
function
|
|
431
|
-
function o(
|
|
432
|
-
return e(
|
|
433
|
-
}
|
|
434
|
-
return o.floor = (
|
|
435
|
-
const r = o(
|
|
436
|
-
return
|
|
437
|
-
}, o.offset = (
|
|
438
|
-
const
|
|
439
|
-
if (
|
|
440
|
-
return
|
|
441
|
-
let
|
|
461
|
+
function D(e, t, i, s) {
|
|
462
|
+
function o(n) {
|
|
463
|
+
return e(n = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+n)), n;
|
|
464
|
+
}
|
|
465
|
+
return o.floor = (n) => (e(n = /* @__PURE__ */ new Date(+n)), n), o.ceil = (n) => (e(n = new Date(n - 1)), t(n, 1), e(n), n), o.round = (n) => {
|
|
466
|
+
const r = o(n), l = o.ceil(n);
|
|
467
|
+
return n - r < l - n ? r : l;
|
|
468
|
+
}, o.offset = (n, r) => (t(n = /* @__PURE__ */ new Date(+n), r == null ? 1 : Math.floor(r)), n), o.range = (n, r, l) => {
|
|
469
|
+
const p = [];
|
|
470
|
+
if (n = o.ceil(n), l = l == null ? 1 : Math.floor(l), !(n < r) || !(l > 0))
|
|
471
|
+
return p;
|
|
472
|
+
let b;
|
|
442
473
|
do
|
|
443
|
-
|
|
444
|
-
while (
|
|
445
|
-
return
|
|
446
|
-
}, o.filter = (
|
|
474
|
+
p.push(b = /* @__PURE__ */ new Date(+n)), t(n, l), e(n);
|
|
475
|
+
while (b < n && n < r);
|
|
476
|
+
return p;
|
|
477
|
+
}, o.filter = (n) => D((r) => {
|
|
447
478
|
if (r >= r)
|
|
448
|
-
for (; e(r), !
|
|
479
|
+
for (; e(r), !n(r); )
|
|
449
480
|
r.setTime(r - 1);
|
|
450
481
|
}, (r, l) => {
|
|
451
482
|
if (r >= r)
|
|
452
483
|
if (l < 0)
|
|
453
484
|
for (; ++l <= 0; )
|
|
454
|
-
for (; t(r, -1), !
|
|
485
|
+
for (; t(r, -1), !n(r); )
|
|
455
486
|
;
|
|
456
487
|
else
|
|
457
488
|
for (; --l >= 0; )
|
|
458
|
-
for (; t(r, 1), !
|
|
489
|
+
for (; t(r, 1), !n(r); )
|
|
459
490
|
;
|
|
460
|
-
}),
|
|
491
|
+
}), i && (o.count = (n, r) => (P.setTime(+n), F.setTime(+r), e(P), e(F), Math.floor(i(P, F))), o.every = (n) => (n = Math.floor(n), !isFinite(n) || !(n > 0) ? null : n > 1 ? o.filter(s ? (r) => s(r) % n === 0 : (r) => o.count(0, r) % n === 0) : o)), o;
|
|
461
492
|
}
|
|
462
|
-
const ke = 1e3, J = ke * 60, xe = J * 60,
|
|
493
|
+
const ke = 1e3, J = ke * 60, xe = J * 60, T = xe * 24, j = D(
|
|
463
494
|
(e) => e.setHours(0, 0, 0, 0),
|
|
464
495
|
(e, t) => e.setDate(e.getDate() + t),
|
|
465
|
-
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * J) /
|
|
496
|
+
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * J) / T,
|
|
466
497
|
(e) => e.getDate() - 1
|
|
467
498
|
);
|
|
468
|
-
|
|
499
|
+
D((e) => {
|
|
469
500
|
e.setUTCHours(0, 0, 0, 0);
|
|
470
501
|
}, (e, t) => {
|
|
471
502
|
e.setUTCDate(e.getUTCDate() + t);
|
|
472
|
-
}, (e, t) => (t - e) /
|
|
473
|
-
|
|
503
|
+
}, (e, t) => (t - e) / T, (e) => e.getUTCDate() - 1);
|
|
504
|
+
D((e) => {
|
|
474
505
|
e.setUTCHours(0, 0, 0, 0);
|
|
475
506
|
}, (e, t) => {
|
|
476
507
|
e.setUTCDate(e.getUTCDate() + t);
|
|
477
|
-
}, (e, t) => (t - e) /
|
|
508
|
+
}, (e, t) => (t - e) / T, (e) => Math.floor(e / T));
|
|
478
509
|
const Ce = ':host{display:block;min-height:444px;--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{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}.title{margin:0 -1.25rem;display:flex;flex-direction:column;padding:0 1.5rem;gap:0.5rem;border-bottom:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family)}.title h1{margin-bottom:0;font-size:18px;line-height:20px;font-weight:600;display:flex;gap:0.5rem;align-items:center}.title p{margin-top:0;font-size:16px;display:flex;gap:0.5rem;align-items:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:24px}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 412px){.dates .date{width:38px;height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}', we = Ce;
|
|
479
|
-
var _e = function(e, t,
|
|
480
|
-
var o = arguments.length,
|
|
510
|
+
var _e = function(e, t, i, s) {
|
|
511
|
+
var o = arguments.length, n = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, i) : s, r;
|
|
481
512
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
482
|
-
|
|
513
|
+
n = Reflect.decorate(e, t, i, s);
|
|
483
514
|
else
|
|
484
515
|
for (var l = e.length - 1; l >= 0; l--)
|
|
485
|
-
(r = e[l]) && (
|
|
486
|
-
return o > 3 &&
|
|
516
|
+
(r = e[l]) && (n = (o < 3 ? r(n) : o > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
517
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
487
518
|
}, M = function(e, t) {
|
|
488
519
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
489
520
|
return Reflect.metadata(e, t);
|
|
490
521
|
};
|
|
491
522
|
const K = class {
|
|
492
523
|
constructor(e) {
|
|
493
|
-
|
|
524
|
+
g(this, e), this.dateSelected = h(this, "dateSelected", 7), this.monthChanged = h(this, "monthChanged", 7), this.selectableDates = void 0, this.selectedDate = void 0, this.configSettings = void 0, this.isLoading = void 0, this.eventDuration = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.disableNextMonthButton = !1;
|
|
494
525
|
}
|
|
495
526
|
configSettingsChanged(e) {
|
|
496
527
|
var o;
|
|
497
|
-
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1),
|
|
498
|
-
if (
|
|
528
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), i = (o = e == null ? void 0 : e.scheduler) == null ? void 0 : o.available_days_in_future;
|
|
529
|
+
if (i === void 0)
|
|
499
530
|
return;
|
|
500
|
-
|
|
531
|
+
G(/* @__PURE__ */ new Date(), i).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
|
|
501
532
|
}
|
|
502
533
|
connectedCallback() {
|
|
503
534
|
}
|
|
@@ -513,31 +544,31 @@ const K = class {
|
|
|
513
544
|
this.dateSelected.emit(e);
|
|
514
545
|
}
|
|
515
546
|
changeMonth(e) {
|
|
516
|
-
var o,
|
|
547
|
+
var o, n;
|
|
517
548
|
this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
|
|
518
|
-
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1),
|
|
519
|
-
|
|
549
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), i = (n = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : n.available_days_in_future;
|
|
550
|
+
G(/* @__PURE__ */ new Date(), i).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month), this.selectDate();
|
|
520
551
|
}
|
|
521
|
-
isSelected(e, t,
|
|
522
|
-
return e && t &&
|
|
552
|
+
isSelected(e, t, i) {
|
|
553
|
+
return e && t && x(e, t) && i && (i == null ? void 0 : i.length) > 0;
|
|
523
554
|
}
|
|
524
555
|
isDisabled(e, t) {
|
|
525
|
-
return e && (t == null ? void 0 : t.find((
|
|
556
|
+
return e && (t == null ? void 0 : t.find((i) => x(i, e))) === void 0;
|
|
526
557
|
}
|
|
527
558
|
render() {
|
|
528
|
-
var e, t,
|
|
529
|
-
return a(
|
|
530
|
-
var
|
|
531
|
-
const
|
|
559
|
+
var e, t, i, s, o;
|
|
560
|
+
return a(u, { key: "bc2d37f59dc4cc59c9659a15ce640d3f3c738239", part: "ndp" }, a("div", { key: "7b39c6ff3b5c820d6ee4cc3419a80f9803011deb", class: "nylas-date-picker" }, a("div", { key: "e7e08bbe189da82d187241b1025633f9ea690bbe", class: "title", part: "'ndp__title" }, ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) && a("h1", null, a("person-icon", null), ((s = (i = this.configSettings) == null ? void 0 : i.organizer) == null ? void 0 : s.name) || "Organizer"), a("p", { key: "7a952faa33c2421f9b6d25a4d56ec7a510d42ab5" }, a("clock-icon", { key: "35561bc9866d9c75e676b3ef589b1506a6d273c6" }), this.eventDuration ? oe(this.eventDuration) : "- minutes")), a("div", { key: "b3799870aa76c6e54b3ec5a32dda0b684a817e1d", class: "header flex-row" }, a("h2", { key: "bb00822464f175aa9b9c5f66f8fa79e95363b33d", part: "ndp__month-header" }, a("strong", { key: "3cdeb9340334fabb6ee1ef09ffb28a6e75177275" }, this.month.toLocaleDateString(void 0, { month: "long" })), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), a("div", { key: "ad6b090bdff3470d1f7381cce6d5734a698c7af9", class: "pagination" }, a("button", { key: "90621e82962b012b50dedb9ec4c49bc7cdff0936", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: !((o = this.selectableDates) != null && o.length) || this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, a("chevron-icon", { key: "7596ada39a388b9570a3a783ff5cdf7bb3f252c1" })), a("button", { key: "e7bbf331f680b0c6f2538639235a008e213b52ee", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, a("chevron-icon", { key: "898e3a4609bf204bdf4d375cd53c23d5ac52bc50" })))), a("div", { key: "e41bd3d09ef9c8bc48dd8aa5db6554af8b31faa8", class: "dates" }, ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"].map((n) => a("div", { class: "day", part: "ndp__day" }, n)), this.dates.map((n, r) => {
|
|
561
|
+
var p;
|
|
562
|
+
const l = this.isDisabled(n, this.selectableDates);
|
|
532
563
|
return this.isLoading ? a("button", { disabled: !0, class: {
|
|
533
564
|
"date day-skeleton": !0,
|
|
534
|
-
"current-month": S(
|
|
535
|
-
}, style: { animationDelay: `${
|
|
565
|
+
"current-month": S(n, this.month)
|
|
566
|
+
}, style: { animationDelay: `${r * 20}ms` }, part: "ndp__date" }, n.getDate()) : a("button", { class: {
|
|
536
567
|
date: !0,
|
|
537
|
-
selected: !!(this.selectedDate &&
|
|
538
|
-
"current-day":
|
|
539
|
-
"current-month": S(
|
|
540
|
-
}, "aria-lang":
|
|
568
|
+
selected: !!(this.selectedDate && x(n, this.selectedDate) && this.selectableDates && ((p = this.selectableDates) == null ? void 0 : p.length) > 0),
|
|
569
|
+
"current-day": x(n, /* @__PURE__ */ new Date()),
|
|
570
|
+
"current-month": S(n, this.month)
|
|
571
|
+
}, "aria-lang": n.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: l, onClick: () => this.selectDate(n), part: `ndp__date ${this.isSelected(n, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${x(n, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${S(n, this.month) ? "ndp__date--current-month" : ""}` }, n.getDate());
|
|
541
572
|
}))));
|
|
542
573
|
}
|
|
543
574
|
static get watchers() {
|
|
@@ -547,7 +578,7 @@ const K = class {
|
|
|
547
578
|
}
|
|
548
579
|
};
|
|
549
580
|
_e([
|
|
550
|
-
|
|
581
|
+
C({
|
|
551
582
|
name: "nylas-date-picker",
|
|
552
583
|
stateToProps: /* @__PURE__ */ new Map([
|
|
553
584
|
["scheduler.selectableDates", "selectableDates"],
|
|
@@ -568,22 +599,22 @@ _e([
|
|
|
568
599
|
M("design:returntype", void 0)
|
|
569
600
|
], K.prototype, "render", null);
|
|
570
601
|
K.style = we;
|
|
571
|
-
const Ee = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){border:none;padding:10px}select-dropdown::part(sd_dropdown-content){max-width:306px}',
|
|
572
|
-
var
|
|
573
|
-
var o = arguments.length,
|
|
602
|
+
const Ee = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){border:none;padding:10px}select-dropdown::part(sd_dropdown-content){max-width:306px}', Te = Ee;
|
|
603
|
+
var De = function(e, t, i, s) {
|
|
604
|
+
var o = arguments.length, n = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, i) : s, r;
|
|
574
605
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
575
|
-
|
|
606
|
+
n = Reflect.decorate(e, t, i, s);
|
|
576
607
|
else
|
|
577
608
|
for (var l = e.length - 1; l >= 0; l--)
|
|
578
|
-
(r = e[l]) && (
|
|
579
|
-
return o > 3 &&
|
|
609
|
+
(r = e[l]) && (n = (o < 3 ? r(n) : o > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
610
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
580
611
|
}, N = function(e, t) {
|
|
581
612
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
582
613
|
return Reflect.metadata(e, t);
|
|
583
614
|
};
|
|
584
615
|
const Q = class {
|
|
585
616
|
constructor(e) {
|
|
586
|
-
|
|
617
|
+
g(this, e), this.timezoneChanged = h(this, "timezoneChanged", 7), this.languageChanged = h(this, "languageChanged", 7), this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = navigator.language;
|
|
587
618
|
}
|
|
588
619
|
connectedCallback() {
|
|
589
620
|
}
|
|
@@ -598,8 +629,8 @@ const Q = class {
|
|
|
598
629
|
this.selectedLanguage = e, this.languageChanged.emit(e);
|
|
599
630
|
}
|
|
600
631
|
nylasFormDropdownChangedHandler(e) {
|
|
601
|
-
const { name: t, value:
|
|
602
|
-
t === "timezone" ? this.changeTimezone(
|
|
632
|
+
const { name: t, value: i } = e.detail;
|
|
633
|
+
t === "timezone" ? this.changeTimezone(i) : t === "language" && this.changeLanguage(i);
|
|
603
634
|
}
|
|
604
635
|
getTimezoneLabelHTML(e) {
|
|
605
636
|
const t = re(e);
|
|
@@ -615,25 +646,25 @@ const Q = class {
|
|
|
615
646
|
} }, t));
|
|
616
647
|
}
|
|
617
648
|
render() {
|
|
618
|
-
const e = Object.keys(_).map((
|
|
619
|
-
labelHTML: this.getTimezoneLabelHTML(
|
|
620
|
-
label: _[
|
|
621
|
-
value:
|
|
622
|
-
})), t = Object.keys(
|
|
623
|
-
label:
|
|
624
|
-
value:
|
|
649
|
+
const e = Object.keys(_).map((i) => ({
|
|
650
|
+
labelHTML: this.getTimezoneLabelHTML(i),
|
|
651
|
+
label: _[i],
|
|
652
|
+
value: i
|
|
653
|
+
})), t = Object.keys(V).map((i) => ({
|
|
654
|
+
label: V[i],
|
|
655
|
+
value: i
|
|
625
656
|
}));
|
|
626
|
-
return a(
|
|
657
|
+
return a(u, { key: "2d50a22ae8502ec3c6062da3cbbeb0bb6f0fcb8b" }, a("div", { key: "8725370edb7b3fb70264586c8d6bf4cc7c8f6220", class: "nylas-locale-switch" }, a("div", { key: "da5375359f87b3f1fc5c3ec9f094c76886a1a401", class: {
|
|
627
658
|
"select-wrapper": !0,
|
|
628
659
|
timezone: !0
|
|
629
|
-
} }, a("select-dropdown", { key: "
|
|
660
|
+
} }, a("select-dropdown", { key: "3633e969f27a301b59ad64afb9f63a0bf19afcc6", name: "timezone", options: e, defaultSelectedOption: e.find((i) => i.value == this.selectedTimezone) }, a("span", { key: "97db913cf64de05eb986fdea378a17948ead2527", slot: "select-icon" }, a("globe-icon", { key: "ee73e4c113c23614a7084cb1f19e2d6149fd3185", width: "20", height: "20" })))), a("div", { key: "04245f7d6c51994197ff107f064632d5c8050e65", class: {
|
|
630
661
|
"select-wrapper": !0,
|
|
631
662
|
language: !0
|
|
632
|
-
} }, a("select-dropdown", { key: "
|
|
663
|
+
} }, a("select-dropdown", { key: "55ed837e54b69f9db0548c9c4e4c6e5211ef577a", name: "language", options: t, defaultSelectedOption: t.find((i) => i.value == this.selectedLanguage) }, a("span", { key: "43b4d67e865a27842998a796f8d12e0d9b5171eb", slot: "select-icon" }, a("translate-icon", { key: "c393677712c3528f162bc5700368deb4dd6a197c", width: "20", height: "20" }))))));
|
|
633
664
|
}
|
|
634
665
|
};
|
|
635
|
-
|
|
636
|
-
|
|
666
|
+
De([
|
|
667
|
+
C({
|
|
637
668
|
name: "nylas-locale-switch",
|
|
638
669
|
stateToProps: /* @__PURE__ */ new Map([
|
|
639
670
|
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
@@ -650,49 +681,49 @@ Te([
|
|
|
650
681
|
N("design:paramtypes", []),
|
|
651
682
|
N("design:returntype", void 0)
|
|
652
683
|
], Q.prototype, "render", null);
|
|
653
|
-
Q.style =
|
|
684
|
+
Q.style = Te;
|
|
654
685
|
const Se = ".sc-nylas-logo-h{display:flex}", ze = Se, Be = class {
|
|
655
686
|
constructor(e) {
|
|
656
|
-
|
|
687
|
+
g(this, e), this.width = "69", this.height = "24";
|
|
657
688
|
}
|
|
658
689
|
render() {
|
|
659
|
-
return a("svg", { key: "
|
|
690
|
+
return a("svg", { key: "4e7a23dbd3500c29567a0b62738670d7ca7632f7", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("g", { key: "35212097631dc53e2c93992e6952725fe7edee06", "clip-path": "url(#clip0_455_3543)" }, a("path", { key: "ebb39ad3ce1eb1fa4829b4dfd9db45de76f00dcb", d: "M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z", fill: "currentColor" }), a("path", { key: "57f79f9bf217023c96670f32ca94870fbd207881", d: "M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z", fill: "currentColor" }), a("path", { key: "d8f631d5e68d94a0a296125726c1e91a63adfa67", d: "M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z", fill: "currentColor" }), a("path", { key: "bdc5e83bd088371aa905ca5a1f124b400f2676fe", d: "M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z", fill: "currentColor" }), a("path", { key: "8be64d768ae4ef9e1d1d99de000ebf54bab8dd73", d: "M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z", fill: "currentColor" }), a("path", { key: "cceee449f26a95ed82807e5c72b92fbd2c97d90f", d: "M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z", fill: "currentColor" }), a("path", { key: "d032672bdcbade080b8f3fedf82fa732d99a9c70", d: "M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z", fill: "currentColor" }), a("path", { key: "2a477ea45ae3dbf1ca80548231777d9978d8aa4d", d: "M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z", fill: "currentColor" })), a("defs", { key: "9b849e0fd48961476b7a78aaa6c2b09a13d3f915" }, a("clipPath", { key: "57e680efa1be5694782757b7dd8039d744e5c041", id: "clip0_455_3543" }, a("rect", { key: "dfa05f1f6aabb9e79b64e8ebfd5a372f14b0e890", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
|
|
660
691
|
}
|
|
661
692
|
};
|
|
662
693
|
Be.style = ze;
|
|
663
694
|
const Le = ':host{display:block;margin-bottom:-12px;width:100%;z-index: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}.notif{display:flex;padding:17px;align-items:flex-start;justify-content:space-between;gap:16px;border-radius:var(--nylas-border-radius-2x);border:1.5px solid var(--nylas-error);background:var(--nylas-base-0)}@media screen and (max-width: 768px){.notif{width:auto}}.notif .content{display:flex;flex-direction:row;gap:8px}.notif .content .message{font-size:14px;font-weight:400;color:var(--nylas-base-800)}.notif .content .message .title{font-size:16px;font-weight:600;color:var(--nylas-base-950);display:block}.notif .content .message .description{font-size:14px;font-weight:400;color:var(--nylas-base-800);display:block}.notif .content .icon.error{color:var(--nylas-error)}.notif.error{border-color:var(--nylas-error);background:rgb(255, 248, 248)}.notif.warning{border-color:var(--nylas-warning)}.notif.info{border-color:var(--nylas-info)}.notif.success{border-color:var(--nylas-success)}.notif .dismiss-btn{background:none;border:none;color:var(--nylas-base-950);cursor:pointer}', Ie = Le, Re = class {
|
|
664
695
|
constructor(e) {
|
|
665
|
-
|
|
696
|
+
g(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
|
|
666
697
|
}
|
|
667
698
|
onError(e) {
|
|
668
|
-
|
|
699
|
+
d(`[nylas-notification] Error: ${e.detail.title}`), this.handleNotification(e);
|
|
669
700
|
}
|
|
670
701
|
onWarning(e) {
|
|
671
|
-
|
|
702
|
+
d(`[nylas-notification] Warning: ${e.detail.title}`), this.handleNotification(e);
|
|
672
703
|
}
|
|
673
704
|
onInfo(e) {
|
|
674
|
-
|
|
705
|
+
d(`[nylas-notification] Info: ${e.detail.title}`), this.handleNotification(e);
|
|
675
706
|
}
|
|
676
707
|
onSuccess(e) {
|
|
677
|
-
|
|
708
|
+
d(`[nylas-notification] Success: ${e.detail.title}`), this.handleNotification(e);
|
|
678
709
|
}
|
|
679
710
|
handleNotification(e) {
|
|
680
711
|
if (e.defaultPrevented) {
|
|
681
|
-
|
|
712
|
+
d("[nylas-notification] Event default prevented");
|
|
682
713
|
return;
|
|
683
714
|
}
|
|
684
715
|
if (this.ttl === 0) {
|
|
685
|
-
|
|
716
|
+
d("[nylas-notification] TTL is 0");
|
|
686
717
|
return;
|
|
687
718
|
}
|
|
688
719
|
if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.category)) {
|
|
689
|
-
|
|
720
|
+
d("[nylas-notification] Category not allowed");
|
|
690
721
|
return;
|
|
691
722
|
}
|
|
692
723
|
if (this.notifications = [...this.notifications, { ...e.detail }], e.detail.ttl !== "none") {
|
|
693
724
|
const t = e.detail.ttl ? e.detail.ttl : this.ttl;
|
|
694
725
|
window.setTimeout(() => {
|
|
695
|
-
this.notifications = this.notifications.filter((
|
|
726
|
+
this.notifications = this.notifications.filter((i) => i.id !== e.detail.id);
|
|
696
727
|
}, t);
|
|
697
728
|
}
|
|
698
729
|
}
|
|
@@ -700,43 +731,43 @@ const Le = ':host{display:block;margin-bottom:-12px;width:100%;z-index:1;--nylas
|
|
|
700
731
|
this.notifications = this.notifications.filter((t) => t.id !== e);
|
|
701
732
|
}
|
|
702
733
|
render() {
|
|
703
|
-
return a(
|
|
734
|
+
return a(u, { key: "8b65d6792e310fc31d9019fd87ec0bcff83369a1" }, a(se, { key: "03e4f247931a3a363a575c6fd5364d40d9616c52" }, this.notifications.map((e) => a("div", { class: `notif ${e.type}`, key: e.id }, a("div", { class: "content" }, a("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && a("warning-icon", null)), a("span", { class: "message" }, a("span", { class: "title" }, e.title), e.description && a("span", { class: "description" }, e.description))), a("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, a("close-icon", null)))), a("slot", { key: "8af04e4b9c1d6e143496a8bd9c757b059682de9a" })));
|
|
704
735
|
}
|
|
705
736
|
};
|
|
706
737
|
Re.style = Ie;
|
|
707
738
|
const Pe = ":host{display:block}sp-theme{position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:16px;font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}", Fe = Pe;
|
|
708
|
-
var je = function(e, t,
|
|
709
|
-
var o = arguments.length,
|
|
739
|
+
var je = function(e, t, i, s) {
|
|
740
|
+
var o = arguments.length, n = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, i) : s, r;
|
|
710
741
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
711
|
-
|
|
742
|
+
n = Reflect.decorate(e, t, i, s);
|
|
712
743
|
else
|
|
713
744
|
for (var l = e.length - 1; l >= 0; l--)
|
|
714
|
-
(r = e[l]) && (
|
|
715
|
-
return o > 3 &&
|
|
745
|
+
(r = e[l]) && (n = (o < 3 ? r(n) : o > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
746
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
716
747
|
}, O = function(e, t) {
|
|
717
748
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
718
749
|
return Reflect.metadata(e, t);
|
|
719
750
|
};
|
|
720
751
|
const ee = class {
|
|
721
752
|
constructor(e) {
|
|
722
|
-
|
|
753
|
+
g(this, e), this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.startTime = "", this.endTime = "";
|
|
723
754
|
}
|
|
724
755
|
connectedCallback() {
|
|
725
756
|
}
|
|
726
757
|
disconnectedCallback() {
|
|
727
758
|
}
|
|
728
759
|
async componentWillLoad() {
|
|
729
|
-
|
|
760
|
+
d("[nylas-selected-event-card] Component will load");
|
|
730
761
|
}
|
|
731
762
|
async componentDidLoad() {
|
|
732
|
-
|
|
763
|
+
d("[nylas-selected-event-card] Component did load"), this.selectedDate || console.warn('[nylas-selected-event-card] "selectedDate" prop is not provided.'), this.selectedTimeslot || console.warn('[nylas-selected-event-card] "selectedTimeslot" prop is not provided.');
|
|
733
764
|
}
|
|
734
765
|
handleSelectedTimeslotChange(e) {
|
|
735
766
|
this.startTime = new Date(e == null ? void 0 : e.start_time).toLocaleString(void 0, { timeStyle: "short" }), this.endTime = new Date(e == null ? void 0 : e.end_time).toLocaleString(void 0, { timeStyle: "short" });
|
|
736
767
|
}
|
|
737
768
|
render() {
|
|
738
769
|
var e;
|
|
739
|
-
return a(
|
|
770
|
+
return a(u, { key: "ae635bed01604ece8f012b82c00fa7d4b6bc4c3d", part: "nsec" }, a("sp-theme", { key: "edcbe79ce2a87e920bd88714b3a5a747d4a80747", theme: "spectrum", color: "dark", scale: "medium" }, a("div", { key: "8c736e8a7ea756b2ef8ba316e0f2c0f38f3821fd", class: "event-card", part: "nsec__card" }, a("div", { key: "06c33c0fc54e893cbeb8c685503f73a74109ab33", class: "calendar-icon", part: "nsec__icon" }, a("calendar-icon", { key: "69617d50f58122aea2dd92e7ea26d5b2a984c2bf" })), a("div", { key: "e4e53019bba6e23f2c5f0a5b8cde5336973d795d", class: "nylas-selected-event-card__date", part: "nsec__date" }, (e = this.selectedDate) == null ? void 0 : e.toLocaleDateString(void 0, { dateStyle: "full" })), a("div", { key: "c838e6987d4c932471d27dca86c295f549f06a5d", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), a("div", { key: "3e0f9d170e593f39516d49e31fe0da1db49fe828", class: "event-timezone", part: "nsec__timezone" }, a("globe-icon", { key: "12f52fc23ec7d60d046078aceeb6fffba7283078" }), _[this.selectedTimezone])));
|
|
740
771
|
}
|
|
741
772
|
static get watchers() {
|
|
742
773
|
return {
|
|
@@ -745,7 +776,7 @@ const ee = class {
|
|
|
745
776
|
}
|
|
746
777
|
};
|
|
747
778
|
je([
|
|
748
|
-
|
|
779
|
+
C({
|
|
749
780
|
name: "nylas-selected-event-card",
|
|
750
781
|
stateToProps: /* @__PURE__ */ new Map([
|
|
751
782
|
["scheduler.selectedDate", "selectedDate"],
|
|
@@ -760,23 +791,23 @@ je([
|
|
|
760
791
|
O("design:returntype", void 0)
|
|
761
792
|
], ee.prototype, "render", null);
|
|
762
793
|
ee.style = Fe;
|
|
763
|
-
const Me = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.
|
|
764
|
-
var Oe = function(e, t,
|
|
765
|
-
var o = arguments.length,
|
|
794
|
+
const Me = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.timeslots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .timeslot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}.footer sp-button{padding:14px;color:var(--nylas-base-100);border-radius:var(--nylas-border-radius-2x);width:100%;height:48px;font-weight:600;font-size:16px;background-color:var(--nylas-primary);border:none}.footer sp-button:hover,.footer sp-button:focus{background-color:var(--nylas-base-600)}.footer sp-button:active{background-color:var(--nylas-base-800)}", Ne = Me;
|
|
795
|
+
var Oe = function(e, t, i, s) {
|
|
796
|
+
var o = arguments.length, n = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, i) : s, r;
|
|
766
797
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
767
|
-
|
|
798
|
+
n = Reflect.decorate(e, t, i, s);
|
|
768
799
|
else
|
|
769
800
|
for (var l = e.length - 1; l >= 0; l--)
|
|
770
|
-
(r = e[l]) && (
|
|
771
|
-
return o > 3 &&
|
|
801
|
+
(r = e[l]) && (n = (o < 3 ? r(n) : o > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
802
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
772
803
|
}, H = function(e, t) {
|
|
773
804
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
774
805
|
return Reflect.metadata(e, t);
|
|
775
806
|
};
|
|
776
807
|
const te = class {
|
|
777
808
|
constructor(e) {
|
|
778
|
-
|
|
779
|
-
t.preventDefault(),
|
|
809
|
+
g(this, e), this.timeslotSelected = h(this, "timeslotSelected", 7), this.timeslotConfirmed = h(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (t, i) => {
|
|
810
|
+
t.preventDefault(), d("[nylas-timeslot-picker] Confirm timeslot", i), this.timeslotConfirmed.emit(i);
|
|
780
811
|
}, this.handleMouseEnter = (t) => {
|
|
781
812
|
this.hoveredTimeslotIndex = t;
|
|
782
813
|
}, this.handleMouseLeave = () => {
|
|
@@ -789,50 +820,51 @@ const te = class {
|
|
|
789
820
|
}
|
|
790
821
|
async componentWillLoad() {
|
|
791
822
|
var t;
|
|
792
|
-
const e = (t = this.availability) == null ? void 0 : t.filter((
|
|
793
|
-
this.times = e || [],
|
|
823
|
+
const e = (t = this.availability) == null ? void 0 : t.filter((i) => this.selectedDate && x(i.start_time, this.selectedDate)).map((i) => i);
|
|
824
|
+
this.times = e || [], d("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
|
|
794
825
|
}
|
|
795
826
|
async componentDidLoad() {
|
|
796
|
-
|
|
827
|
+
d("[nylas-timeslot-picker] Component did load");
|
|
797
828
|
}
|
|
798
829
|
getTimeslotId(e, t) {
|
|
799
830
|
return `${e.toLocaleDateString()}-${t}`;
|
|
800
831
|
}
|
|
801
832
|
onClickSelectTime(e, t) {
|
|
802
|
-
|
|
833
|
+
d("[nylas-timeslot-picker] Time selected", e, t), this.selectedTimeslotIndex = this.getTimeslotId(e.start_time, t), this.timeslotSelected.emit({
|
|
803
834
|
start_time: e.start_time,
|
|
804
|
-
end_time: e.end_time
|
|
835
|
+
end_time: e.end_time,
|
|
836
|
+
emails: e.emails
|
|
805
837
|
});
|
|
806
838
|
}
|
|
807
839
|
getTimeSlotLabel(e) {
|
|
808
840
|
const t = new Intl.DateTimeFormat("en-US", {
|
|
809
|
-
hour: "
|
|
810
|
-
minute: "
|
|
841
|
+
hour: "2-digit",
|
|
842
|
+
minute: "2-digit",
|
|
811
843
|
timeZone: this.selectedTimezone
|
|
812
844
|
});
|
|
813
845
|
return `${t.format(e.start_time)} - ${t.format(e.end_time)}`;
|
|
814
846
|
}
|
|
815
847
|
selectedDateChanged(e) {
|
|
816
848
|
var t;
|
|
817
|
-
if (
|
|
818
|
-
const
|
|
819
|
-
this.times =
|
|
849
|
+
if (d("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
|
|
850
|
+
const i = (t = this.availability) == null ? void 0 : t.filter((s) => x(s.start_time, e)).map((s) => s);
|
|
851
|
+
this.times = i || [];
|
|
820
852
|
}
|
|
821
853
|
}
|
|
822
854
|
availabilityChanged(e) {
|
|
823
|
-
if (
|
|
824
|
-
const t = e == null ? void 0 : e.filter((
|
|
855
|
+
if (d("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
|
|
856
|
+
const t = e == null ? void 0 : e.filter((i) => this.selectedDate && x(i.start_time, this.selectedDate)).map((i) => i);
|
|
825
857
|
this.times = t || [];
|
|
826
858
|
}
|
|
827
859
|
}
|
|
828
860
|
render() {
|
|
829
|
-
return this.isLoading ? a(
|
|
830
|
-
var
|
|
831
|
-
return a("button", { part: `ntp__timeslot ${((s = (
|
|
861
|
+
return this.isLoading ? a(u, null, a("div", { class: "loading" }, new Array(6).fill(0).map((e, t) => a("div", { class: "timeslot-skeleton", style: { animationDelay: `${t * 20}ms` } })))) : this.availability && this.availability.length === 0 ? a(u, null, a("div", { class: "empty" }, a("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? a(u, null, a("div", { class: "empty" }, a("span", null, "No time slots available for selected date"))) : this.selectedDate ? a(u, { part: "ntp" }, a("div", { class: "time-picker-wrapper" }, a("div", { class: "timeslots" }, this.times.map((e, t) => {
|
|
862
|
+
var i, s, o, n;
|
|
863
|
+
return a("button", { part: `ntp__timeslot ${((s = (i = this.selectedTimeslot) == null ? void 0 : i.start_time) == null ? void 0 : s.getTime()) === e.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, "aria-role": "button", class: {
|
|
832
864
|
time: !0,
|
|
833
|
-
selected: typeof this.selectedTimeslot < "u" && ((
|
|
865
|
+
selected: typeof this.selectedTimeslot < "u" && ((n = (o = this.selectedTimeslot) == null ? void 0 : o.start_time) == null ? void 0 : n.getTime()) === e.start_time.getTime()
|
|
834
866
|
}, onClick: () => this.onClickSelectTime(e, t), onMouseEnter: () => this.handleMouseEnter(t), onMouseLeave: () => this.handleMouseLeave() }, this.hoveredTimeslotIndex == t || this.selectedTimeslotIndex == this.getTimeslotId(e.start_time, t) ? this.getTimeSlotLabel(e) : e.start_time.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone }));
|
|
835
|
-
})), this.selectedTimeslot && a("div", { class: "footer" }, a("sp-button", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, a("slot", { name: "timeslot-picker-cta-label" }, "Next"))))) : a(
|
|
867
|
+
})), this.selectedTimeslot && a("div", { class: "footer" }, a("sp-button", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, a("slot", { name: "timeslot-picker-cta-label" }, "Next"))))) : a(u, null);
|
|
836
868
|
}
|
|
837
869
|
static get watchers() {
|
|
838
870
|
return {
|
|
@@ -842,7 +874,7 @@ const te = class {
|
|
|
842
874
|
}
|
|
843
875
|
};
|
|
844
876
|
Oe([
|
|
845
|
-
|
|
877
|
+
C({
|
|
846
878
|
name: "nylas-timeslot-picker",
|
|
847
879
|
stateToProps: /* @__PURE__ */ new Map([
|
|
848
880
|
["scheduler.selectedDate", "selectedDate"],
|