@nylas/react 1.1.0-canary.9 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +110 -2
- package/dist/add-circle-icon_2.entry-b14ecb5c.js +25 -0
- package/dist/add-circle-icon_2.entry-c6211866.cjs +1 -0
- package/dist/archive-icon_7.entry-3fe7721a.js +75 -0
- package/dist/archive-icon_7.entry-54fc1f03.cjs +1 -0
- package/dist/arrow-icon.entry-1dfee3bc.cjs +1 -0
- package/dist/arrow-icon.entry-cc936041.js +15 -0
- package/dist/bold-icon_3.entry-4b9de887.cjs +1 -0
- package/dist/bold-icon_3.entry-e2a1d434.js +35 -0
- package/dist/button-component_2.entry-3639ade6.js +26 -0
- package/dist/button-component_2.entry-5666fdfa.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_48.entry-56e364cd.js +5256 -0
- package/dist/calendar-agenda-fill-icon_48.entry-bf278e34.cjs +7 -0
- package/dist/calendar-cancel-icon.entry-ac1cb5dd.cjs +1 -0
- package/dist/calendar-cancel-icon.entry-dcd777cd.js +15 -0
- package/dist/calendar-check-icon_2.entry-6330bd2d.js +25 -0
- package/dist/calendar-check-icon_2.entry-7ad1b2a0.cjs +1 -0
- package/dist/calendar-icon.entry-5849a547.cjs +1 -0
- package/dist/calendar-icon.entry-8559fa0d.js +15 -0
- package/dist/checkbox-component_2.entry-1474c465.js +79 -0
- package/dist/checkbox-component_2.entry-6cf5da6b.cjs +1 -0
- package/dist/chevron-icon_3.entry-41170718.cjs +1 -0
- package/dist/chevron-icon_3.entry-cb757aa3.js +132 -0
- package/dist/clock-icon_4.entry-36a33de5.cjs +1 -0
- package/dist/clock-icon_4.entry-642f4dc6.js +45 -0
- package/dist/constants-50c3e067-4e027da4.cjs +15 -0
- package/dist/constants-50c3e067-83f1d865.js +3883 -0
- package/dist/copy-icon.entry-60740516.js +15 -0
- package/dist/copy-icon.entry-fb63cf53.cjs +1 -0
- package/dist/core-js-38e53e34.cjs +4 -0
- package/dist/core-js-a9d3b6e1.js +3297 -0
- package/dist/delete-icon_2.entry-45851bc5.js +25 -0
- package/dist/delete-icon_2.entry-d1af0606.cjs +1 -0
- package/dist/document-refresh-icon.entry-1731d4d9.cjs +1 -0
- package/dist/document-refresh-icon.entry-5db0830a.js +15 -0
- package/dist/dom-68f08be9.cjs +15 -0
- package/dist/dom-86e17616.js +664 -0
- package/dist/{types/elements → elements}/index.d.ts +48 -1
- package/dist/elements-dc5b338e-3099ee02.js +28031 -0
- package/dist/elements-dc5b338e-ab9afb63.cjs +16516 -0
- package/dist/flow-40ff9cea-6f8c30e2.cjs +9 -0
- package/dist/flow-40ff9cea-ee70fdf5.js +505 -0
- package/dist/focus-visible-e8093c16-067a8f23.js +84 -0
- package/dist/focus-visible-e8093c16-811f50fa.cjs +1 -0
- package/dist/forward-icon_6.entry-4e9c9686.cjs +3 -0
- package/dist/forward-icon_6.entry-e7c5fa46.js +953 -0
- package/dist/globe-icon.entry-74f79652.cjs +1 -0
- package/dist/globe-icon.entry-aa3f3ea3.js +15 -0
- package/dist/google-logo-icon_4.entry-0332a181.cjs +1 -0
- package/dist/google-logo-icon_4.entry-3fe41d69.js +673 -0
- package/dist/index-2a53b6a8.cjs +82 -0
- package/dist/index-a134f625.js +12842 -0
- package/dist/index.es-79f5b771-64a1baf0.cjs +7 -0
- package/dist/index.es-79f5b771-ce07d6fc.js +3135 -0
- package/dist/info-icon_2.entry-a3f40027.cjs +1 -0
- package/dist/info-icon_2.entry-fed731f4.js +34 -0
- package/dist/input-color-picker.entry-37826630.js +48 -0
- package/dist/input-color-picker.entry-cbdce7a1.cjs +1 -0
- package/dist/input-component.entry-b83b7103.js +70 -0
- package/dist/input-component.entry-e71b7062.cjs +1 -0
- package/dist/input-dropdown.entry-150819cd.cjs +1 -0
- package/dist/input-dropdown.entry-db0dae5f.js +134 -0
- package/dist/mailbox-store-9c52a3fa-04f22f60.cjs +1 -0
- package/dist/mailbox-store-9c52a3fa-80fe343c.js +380 -0
- package/dist/multi-select-dropdown.entry-629329d7.cjs +1 -0
- package/dist/multi-select-dropdown.entry-6b429b39.js +95 -0
- package/dist/nylas-booked-event-card_12.entry-660af56a.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-c22c02b4.js +1133 -0
- package/dist/nylas-form-card.entry-2ced5eef.cjs +1 -0
- package/dist/nylas-form-card.entry-f3d6a1e4.js +57 -0
- package/dist/nylas-if-state.entry-55c32c0c.cjs +1 -0
- package/dist/nylas-if-state.entry-862ad978.js +94 -0
- package/dist/nylas-list-folders.entry-544fd38d.js +120 -0
- package/dist/nylas-list-folders.entry-77e936f7.cjs +1 -0
- package/dist/nylas-list-threads.entry-71411da7.js +70 -0
- package/dist/nylas-list-threads.entry-82e04782.cjs +1 -0
- package/dist/nylas-login.entry-3ccc2bef.cjs +1 -0
- package/dist/nylas-login.entry-48179c01.js +73 -0
- package/dist/nylas-mailbox-pagination.entry-77cf03b5.js +101 -0
- package/dist/nylas-mailbox-pagination.entry-d31f9aa4.cjs +1 -0
- package/dist/nylas-mailbox-toolbar-button.entry-33aad610.cjs +1 -0
- package/dist/nylas-mailbox-toolbar-button.entry-40e3c373.js +82 -0
- package/dist/nylas-mailbox.entry-963de1c3.cjs +1 -0
- package/dist/nylas-mailbox.entry-f4066fb2.js +134 -0
- package/dist/nylas-provider.entry-08767da3.cjs +1 -0
- package/dist/nylas-provider.entry-c61428b1.js +145 -0
- package/dist/nylas-reminder-emails.entry-cd8e1d2e.js +129 -0
- package/dist/nylas-reminder-emails.entry-d42a7f1d.cjs +4 -0
- package/dist/nylas-reminder-time_2.entry-d7115393.js +105 -0
- package/dist/nylas-reminder-time_2.entry-e5540fdd.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-65eb4938.js +1447 -0
- package/dist/nylas-scheduler-editor.entry-67904653.cjs +2 -0
- package/dist/nylas-scheduling.entry-50e41d85.cjs +1 -0
- package/dist/nylas-scheduling.entry-7aad4f63.js +345 -0
- package/dist/nylas-threads-refresh.entry-1b8befab.cjs +1 -0
- package/dist/nylas-threads-refresh.entry-d025575a.js +74 -0
- package/dist/nylas-threads-search.entry-78c06183.cjs +1 -0
- package/dist/nylas-threads-search.entry-a254c36e.js +69 -0
- package/dist/nylas-time-window-picker.entry-30baeb50.cjs +1 -0
- package/dist/nylas-time-window-picker.entry-89c15823.js +316 -0
- package/dist/nylas-view-thread.entry-939a4561.cjs +1 -0
- package/dist/nylas-view-thread.entry-c8d56573.js +203 -0
- package/dist/person-icon.entry-5ab75598.cjs +1 -0
- package/dist/person-icon.entry-8aef4041.js +15 -0
- package/dist/play-icon_2.entry-392ad303.cjs +1 -0
- package/dist/play-icon_2.entry-4b068c1b.js +25 -0
- package/dist/react.cjs +1 -0
- package/dist/react.js +145 -0
- package/dist/refresh-icon.entry-9ea254c9.cjs +1 -0
- package/dist/refresh-icon.entry-a754a2b5.js +15 -0
- package/dist/register-component-ea95564d-ab3d630f.cjs +1 -0
- package/dist/register-component-ea95564d-e19ec159.js +109 -0
- package/dist/scheduler-config-store-2a3b403d-4e10b542.cjs +1 -0
- package/dist/scheduler-config-store-2a3b403d-581c70cf.js +27 -0
- package/dist/scheduler-store-9ff4914b-6e28240e.cjs +1 -0
- package/dist/scheduler-store-9ff4914b-b71a0aca.js +474 -0
- package/dist/textarea-component.entry-70bb02bf.cjs +1 -0
- package/dist/textarea-component.entry-a5daab6c.js +37 -0
- package/dist/time-period-selector.entry-25348de7.js +80 -0
- package/dist/time-period-selector.entry-6306e456.cjs +1 -0
- package/dist/translate-icon.entry-785fa109.cjs +1 -0
- package/dist/translate-icon.entry-b6094ecc.js +15 -0
- package/dist/warning-icon.entry-4b400ee2.js +15 -0
- package/dist/warning-icon.entry-94e34c58.cjs +1 -0
- package/package.json +12 -8
- package/dist/elements/index.js +0 -92
- package/dist/elements/index.js.map +0 -1
- package/dist/elements/react-component-lib/createComponent.js +0 -65
- package/dist/elements/react-component-lib/createComponent.js.map +0 -1
- package/dist/elements/react-component-lib/createOverlayComponent.js +0 -98
- package/dist/elements/react-component-lib/createOverlayComponent.js.map +0 -1
- package/dist/elements/react-component-lib/index.js +0 -3
- package/dist/elements/react-component-lib/index.js.map +0 -1
- package/dist/elements/react-component-lib/interfaces.js +0 -2
- package/dist/elements/react-component-lib/interfaces.js.map +0 -1
- package/dist/elements/react-component-lib/utils/attachProps.js +0 -92
- package/dist/elements/react-component-lib/utils/attachProps.js.map +0 -1
- package/dist/elements/react-component-lib/utils/case.js +0 -7
- package/dist/elements/react-component-lib/utils/case.js.map +0 -1
- package/dist/elements/react-component-lib/utils/dev.js +0 -13
- package/dist/elements/react-component-lib/utils/dev.js.map +0 -1
- package/dist/elements/react-component-lib/utils/index.js +0 -31
- package/dist/elements/react-component-lib/utils/index.js.map +0 -1
- package/dist/index.js +0 -29
- package/dist/index.js.map +0 -1
- /package/dist/{types/elements → elements}/react-component-lib/createComponent.d.ts +0 -0
- /package/dist/{types/elements → elements}/react-component-lib/createOverlayComponent.d.ts +0 -0
- /package/dist/{types/elements → elements}/react-component-lib/index.d.ts +0 -0
- /package/dist/{types/elements → elements}/react-component-lib/interfaces.d.ts +0 -0
- /package/dist/{types/elements → elements}/react-component-lib/utils/attachProps.d.ts +0 -0
- /package/dist/{types/elements → elements}/react-component-lib/utils/case.d.ts +0 -0
- /package/dist/{types/elements → elements}/react-component-lib/utils/dev.d.ts +0 -0
- /package/dist/{types/elements → elements}/react-component-lib/utils/index.d.ts +0 -0
- /package/dist/{types/index.d.ts → index.d.ts} +0 -0
|
@@ -0,0 +1,1133 @@
|
|
|
1
|
+
import { r as y, c as h, d, h as n, k as c, n as Y, H as g, D as W, E as ce, g as A, m as U, G as de, I as fe, J as w, K as he, L as me, M as L, F as pe } from "./index-a134f625.js";
|
|
2
|
+
import { R as C } from "./register-component-ea95564d-e19ec159.js";
|
|
3
|
+
import { T as E, a as J, g as be, b as X } from "./constants-50c3e067-83f1d865.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
const ue = ":host{display:block}.nylas-booked-event-card{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 0;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400;border-bottom:1px solid var(--nylas-base-200);width:inherit;padding:0 0 1.5rem}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booked-event-header .card-description{text-align:center}.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}.button-container{width:inherit}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);border-top:1px solid var(--nylas-base-200);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-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}", ge = ue;
|
|
7
|
+
var ye = function(e, t, a, r) {
|
|
8
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
9
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
10
|
+
i = Reflect.decorate(e, t, a, r);
|
|
11
|
+
else
|
|
12
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
13
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
14
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
15
|
+
}, S = function(e, t) {
|
|
16
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
17
|
+
return Reflect.metadata(e, t);
|
|
18
|
+
};
|
|
19
|
+
const K = class {
|
|
20
|
+
constructor(e) {
|
|
21
|
+
y(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 = () => {
|
|
22
|
+
var o, i;
|
|
23
|
+
const t = new Date(this.selectedTimeslot.start_time), a = (i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.min_cancellation_notice;
|
|
24
|
+
t.getTime() - a * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime() ? this.cancelBookedEventValidationError.emit({
|
|
25
|
+
error: {
|
|
26
|
+
title: "Cancellation Error",
|
|
27
|
+
message: `You cannot cancel the booking within ${a} minutes of the event.`
|
|
28
|
+
}
|
|
29
|
+
}) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
|
|
30
|
+
}, this.handleRescheduleButtonClicked = () => {
|
|
31
|
+
const t = (a) => {
|
|
32
|
+
this.rescheduleBookedEventError.emit(a);
|
|
33
|
+
};
|
|
34
|
+
this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: t });
|
|
35
|
+
}, this.getPaticipantType = (t) => {
|
|
36
|
+
switch (t) {
|
|
37
|
+
case "host":
|
|
38
|
+
return "Host";
|
|
39
|
+
case "you":
|
|
40
|
+
return "You";
|
|
41
|
+
default:
|
|
42
|
+
return "";
|
|
43
|
+
}
|
|
44
|
+
}, 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, this.selectedLanguage = navigator.language;
|
|
45
|
+
}
|
|
46
|
+
connectedCallback() {
|
|
47
|
+
}
|
|
48
|
+
disconnectedCallback() {
|
|
49
|
+
}
|
|
50
|
+
async componentWillLoad() {
|
|
51
|
+
d("[nylas-booked-event-card] Component will load");
|
|
52
|
+
}
|
|
53
|
+
async componentDidLoad() {
|
|
54
|
+
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.');
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
var a, r, o, i, s, l, u, m, f, b, p, x, _, v, k, Z, V, G;
|
|
58
|
+
const e = (a = this.configSettings) == null ? void 0 : a.booking_type, t = e && e !== "booking";
|
|
59
|
+
return n(g, { key: "6780a2a0b1c59efc4311278e85e6800f72ab6a98", part: "nbec" }, n("div", { key: "eed7c01aaaca8c92a65beccac1242efe1194f4a3", class: "nylas-booked-event-card" }, n("div", { key: "f20609db6794c30012f299017b01bf63752b6b7f", class: "booked-event-timezone" }, n("globe-icon", { key: "e2f277abf894b2c34e32f4cec4309e81a1b6e19b" }), E[this.selectedTimezone]), n("div", { key: "84c8bcdc7f247eade07d502cd480430cfb2894fd", class: "event-card-wrapper", part: "nbec__card" }, n("div", { key: "58835f4e2b261dff59e212573a2391cac9217cb6", class: "calendar-icon" }, n("calendar-check-icon", { key: "53e406d85941c03c7d0c7c5e86e071f948fe85bd" })), n("div", { key: "0e16b5cabfe5afcea5fd15fefbf88ed2558c5492", class: "booked-event-header" }, n("h2", { key: "8ad08c13c5860cf47b217cc9c6d82dddb0940894", slot: "card-title", part: "nbec__title" }, this.rescheduleBookingId && !this.isLoading ? `${c.t("bookingRescheduled")}` : t && !this.isLoading ? `${c.t("bookingSent")}` : `${c.t("bookingConfirmed")}`, "!"), n("div", { key: "07a056ef47e7d3c173c7ad67acedc5b94748d28f", class: "card-description", part: "nbec__description" }, t ? c.t("bookingSentDescription") : n("span", null, c.t("bookingConfirmedDescription")))), n("div", { key: "4d4f43295cef324b63b3d5fa6f3476dcf3163d25", class: "booking-date-time" }, n("checkmark-circle-icon", { key: "2c717204ed669e40898c8b23dd408e3c62608e8f" }), n("h3", { key: "1a2ec41f82e740d9bdbac8fe1a818454e402db2f" }, c.t("bookingDateAndTimeHeader")), n("p", { key: "1451ecae33ccfbe9f0bc4b682d90a64313f1120c" }, (r = this.selectedTimeslot) != null && r.start_time ? Y(new Date((o = this.selectedTimeslot) == null ? void 0 : o.start_time).toLocaleDateString(J[this.selectedLanguage], { dateStyle: "full" })) : "-", " ", n("br", { key: "df6922d0097f6d3aa7b17dee26a7903e89c9258c" }), new Date((i = this.selectedTimeslot) == null ? void 0 : i.start_time).toLocaleTimeString(void 0, { timeStyle: "short" }), " -", " ", new Date((s = this.selectedTimeslot) == null ? void 0 : s.end_time).toLocaleTimeString(void 0, { timeStyle: "short" }))), n("div", { key: "6e4264737dc50225feeec5374a6bec91de77a0ea", class: "booking-participants" }), !t && n("div", { class: "button-container" }, n("div", { class: {
|
|
60
|
+
footer: !0,
|
|
61
|
+
"no-footer": ((u = (l = this.configSettings) == null ? void 0 : l.scheduler) == null ? void 0 : u.hide_cancellation_options) && ((f = (m = this.configSettings) == null ? void 0 : m.scheduler) == null ? void 0 : f.hide_rescheduling_options) || ((b = this.configSettings) == null ? void 0 : b.booking_type) === "organizer-confirmation",
|
|
62
|
+
"no-template-cols": ((x = (p = this.configSettings) == null ? void 0 : p.scheduler) == null ? void 0 : x.hide_cancellation_options) || ((v = (_ = this.configSettings) == null ? void 0 : _.scheduler) == null ? void 0 : v.hide_rescheduling_options)
|
|
63
|
+
} }, !((Z = (k = this.configSettings) == null ? void 0 : k.scheduler) != null && Z.hide_cancellation_options) && n("button-component", { variant: "destructive", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, `${c.t("cancelBookingButton")}`), !((G = (V = this.configSettings) == null ? void 0 : V.scheduler) != null && G.hide_rescheduling_options) && n("button-component", { variant: "basic", onClick: this.handleRescheduleButtonClicked, part: "nbec__button-outline nbec__reschedule-cta" }, `${c.t("rescheduleBookingButton")}`))))));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
ye([
|
|
67
|
+
C({
|
|
68
|
+
name: "nylas-booked-event-card",
|
|
69
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
70
|
+
["scheduler.bookingInfo", "bookingInfo"],
|
|
71
|
+
["scheduler.rescheduleBookingId", "rescheduleBookingId"],
|
|
72
|
+
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
73
|
+
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
74
|
+
["scheduler.isLoading", "isLoading"],
|
|
75
|
+
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
76
|
+
["scheduler.configSettings", "configSettings"]
|
|
77
|
+
]),
|
|
78
|
+
eventToProps: {
|
|
79
|
+
cancelBookingButtonClicked: async (e, t) => {
|
|
80
|
+
t.scheduler.setCancel(e.detail.bookingId);
|
|
81
|
+
},
|
|
82
|
+
rescheduleButtonClicked: async (e, t) => {
|
|
83
|
+
const a = await t.scheduler.setReschedule(e.detail.bookingId), { errorHandler: r } = e.detail;
|
|
84
|
+
r && (!a || "error" in a) && r(a);
|
|
85
|
+
},
|
|
86
|
+
rescheduleBookedEventError: async (e, t) => {
|
|
87
|
+
d("nylas-booked-event-card", "rescheduleBookedEventError", e.detail);
|
|
88
|
+
},
|
|
89
|
+
cancelBookedEventValidationError: async (e, t) => {
|
|
90
|
+
d("nylas-booked-event-card", "cancelBookedEventValidationError", e.detail);
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
fireRegisterEvent: !0
|
|
94
|
+
}),
|
|
95
|
+
S("design:type", Function),
|
|
96
|
+
S("design:paramtypes", []),
|
|
97
|
+
S("design:returntype", void 0)
|
|
98
|
+
], K.prototype, "render", null);
|
|
99
|
+
K.style = ge;
|
|
100
|
+
const ve = ":host{display:block;height:100%}.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:grid;grid-template-columns:1fr 1fr;gap:0.5rem;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{grid-template-columns:1fr}}.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)}button-component.back button{--dot-color:var(--nylas-base-800)}.guest-email-input{position:relative;display:flex;width:100%}", ke = ve;
|
|
101
|
+
var Ce = function(e, t, a, r) {
|
|
102
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
103
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
104
|
+
i = Reflect.decorate(e, t, a, r);
|
|
105
|
+
else
|
|
106
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
107
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
108
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
109
|
+
}, z = function(e, t) {
|
|
110
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
111
|
+
return Reflect.metadata(e, t);
|
|
112
|
+
};
|
|
113
|
+
const B = /^[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])?)*$/, Q = class {
|
|
114
|
+
constructor(e) {
|
|
115
|
+
y(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, a) => {
|
|
116
|
+
this.resetGuestEmailError(t);
|
|
117
|
+
const r = [...this.guestEmails];
|
|
118
|
+
r[t] = W(a), this.guestEmails = [...r];
|
|
119
|
+
}, this.handleGuestBlur = (t, a) => {
|
|
120
|
+
if (this.resetGuestEmailError(t), a === "") {
|
|
121
|
+
this.guestEmailErrors[t] = c.t("fieldRequired", { field: c.t("email") });
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (!B.test(a)) {
|
|
125
|
+
this.guestEmailErrors[t] = c.t("invalidInputFormat", { field: c.t("email") });
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this.handleGuestChange(t, a);
|
|
129
|
+
}, this.addGuestButtonClickedHandler = (t) => {
|
|
130
|
+
t.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
|
|
131
|
+
}, this.removeGuestButtonClickHandler = (t, a) => {
|
|
132
|
+
t.preventDefault(), this.resetGuestEmailError(a);
|
|
133
|
+
const r = [...this.guestEmails];
|
|
134
|
+
r.splice(a, 1), this.guestEmails = [...r];
|
|
135
|
+
}, this.handleBackButtonClicked = (t) => {
|
|
136
|
+
t.preventDefault(), this.backButtonLoading = !0, this.backButtonClicked.emit();
|
|
137
|
+
}, this.bookButtonClickedHandler = async (t) => {
|
|
138
|
+
var l, u, m, f, b, p, x;
|
|
139
|
+
if (t.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
|
|
140
|
+
return;
|
|
141
|
+
d("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
|
|
142
|
+
const r = this.name || ((u = (l = this.bookingInfo) == null ? void 0 : l.primaryParticipant) == null ? void 0 : u.name), o = this.email || ((f = (m = this.bookingInfo) == null ? void 0 : m.primaryParticipant) == null ? void 0 : f.email);
|
|
143
|
+
if (!r || r === "") {
|
|
144
|
+
this.isNameValid = !1, this.validationError.name = c.t("fieldRequired", { field: c.t("name") }) || "Name is required", this.bookingFormError.emit({
|
|
145
|
+
title: "Booking form error",
|
|
146
|
+
description: "Name is required"
|
|
147
|
+
});
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (!o || o === "") {
|
|
151
|
+
this.isEmailValid = !1, this.validationError.email = c.t("fieldRequired", { field: c.t("email") }) || "Email is required", this.bookingFormError.emit({
|
|
152
|
+
title: "Booking form error",
|
|
153
|
+
description: "Email is required"
|
|
154
|
+
});
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
if (!B.test(o)) {
|
|
158
|
+
this.isEmailValid = !1, this.validationError.email = c.t("invalidInputFormat", { field: c.t("email") }), this.bookingFormError.emit({
|
|
159
|
+
title: "Booking form error",
|
|
160
|
+
description: c.t("invalidInputFormat", { field: c.t("email") }) || "Invalid email"
|
|
161
|
+
});
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
let i = [];
|
|
165
|
+
if (this.guestEmails.length > 0) {
|
|
166
|
+
let _ = !1;
|
|
167
|
+
if (this.guestEmails.forEach((v, k) => {
|
|
168
|
+
v === "" ? (_ = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [k]: c.t("fieldRequired", { field: c.t("email") }) }) : B.test(v) || (_ = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [k]: c.t("invalidInputFormat", { field: c.t("email") }) });
|
|
169
|
+
}), _) {
|
|
170
|
+
this.bookingFormError.emit({
|
|
171
|
+
title: "Booking form error",
|
|
172
|
+
description: c.t("invalidInputFormat", { field: c.t("guestEmail") }) || "Invalid guest email"
|
|
173
|
+
});
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
i = this.guestEmails.map((v) => ({ name: v.trim(), email: v.trim() }));
|
|
177
|
+
} else
|
|
178
|
+
(b = this.bookingInfo) != null && b.guests && (i = (p = this.bookingInfo) == null ? void 0 : p.guests);
|
|
179
|
+
const s = ((x = this.bookingInfo) == null ? void 0 : x.additionalFields) || [];
|
|
180
|
+
this.detailsConfirmed.emit({
|
|
181
|
+
primaryParticipant: {
|
|
182
|
+
name: r,
|
|
183
|
+
email: o
|
|
184
|
+
},
|
|
185
|
+
guests: i,
|
|
186
|
+
additionalFields: { ...s, ...this.additionalFields }
|
|
187
|
+
});
|
|
188
|
+
}, this.updateAdditionalFields = (t, a) => {
|
|
189
|
+
this.additionalFields && (this.additionalFields[t] = a);
|
|
190
|
+
}, 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: "" }, this.backButtonLoading = !1;
|
|
191
|
+
}
|
|
192
|
+
connectedCallback() {
|
|
193
|
+
}
|
|
194
|
+
disconnectedCallback() {
|
|
195
|
+
}
|
|
196
|
+
componentWillLoad() {
|
|
197
|
+
var e, t, a;
|
|
198
|
+
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 = (a = this.bookingInfo.primaryParticipant) == null ? void 0 : a.email);
|
|
199
|
+
}
|
|
200
|
+
bookingInfoChangedHandler(e) {
|
|
201
|
+
e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
|
|
202
|
+
}
|
|
203
|
+
changeName(e) {
|
|
204
|
+
this.isNameValid = !0, this.validationError.name = "", this.name = ce(e), this.nameChanged.emit(e);
|
|
205
|
+
}
|
|
206
|
+
changeEmail(e) {
|
|
207
|
+
this.isEmailValid = !0, this.validationError.email = "", this.email = W(e), this.emailChanged.emit(e);
|
|
208
|
+
}
|
|
209
|
+
resetGuestEmailError(e) {
|
|
210
|
+
const t = { ...this.guestEmailErrors };
|
|
211
|
+
delete t[e], this.guestEmailErrors = { ...t };
|
|
212
|
+
}
|
|
213
|
+
nylasFormInputChangedHandler(e) {
|
|
214
|
+
switch (e.detail.name) {
|
|
215
|
+
case "name":
|
|
216
|
+
this.changeName(e.detail.value);
|
|
217
|
+
break;
|
|
218
|
+
case "email":
|
|
219
|
+
this.changeEmail(e.detail.value);
|
|
220
|
+
break;
|
|
221
|
+
default:
|
|
222
|
+
if (e.detail.error) {
|
|
223
|
+
this.bookingFormError.emit({
|
|
224
|
+
title: "Booking form error",
|
|
225
|
+
description: e.detail.error
|
|
226
|
+
});
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
selectOptionChangedHandler(e) {
|
|
234
|
+
if (e.detail.error) {
|
|
235
|
+
this.bookingFormError.emit({
|
|
236
|
+
title: "Booking form error",
|
|
237
|
+
description: e.detail.error
|
|
238
|
+
});
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
242
|
+
}
|
|
243
|
+
switchToggledHandler(e) {
|
|
244
|
+
this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
|
|
245
|
+
}
|
|
246
|
+
checkboxToggledHandler(e) {
|
|
247
|
+
this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
|
|
248
|
+
}
|
|
249
|
+
radioChangedHandler(e) {
|
|
250
|
+
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
251
|
+
}
|
|
252
|
+
render() {
|
|
253
|
+
var e, t, a, r, o, i, s, l, u;
|
|
254
|
+
return n(g, { key: "17e9e1b042c1570525156b83212bc97a9ccd41a2" }, n("form", { key: "c467069d6a7a52059dfea8067587c6bcace73f7a", onSubmit: (m) => this.bookButtonClickedHandler(m), noValidate: !0 }, n("div", { key: "e83731c91ffb8efbd7073e49df33afa7123ed21c", class: "nylas-booking-form", part: "nbf" }, n("div", { key: "eef32e2f23ab8cb6d42a26af213222caf5c18a70", class: "input-wrapper", part: "nbf__input-wrapper" }, n("input-component", { key: "603ae3c455318e4856e38db224067e8984689aa9", label: c.t("name"), name: "name", id: "name", defaultValue: ((t = (e = this.bookingInfo) == null ? void 0 : e.primaryParticipant) == null ? void 0 : t.name) || this.name, placeholder: c.t("namePlaceholder"), type: "text", required: !0, requiredError: c.t("fieldRequired", { field: c.t("name") }), patternError: c.t("invalidInputFormat", { field: c.t("name") }), part: "nbf__input-textfield" })), n("div", { key: "1c4030a68de1190340b93812196edb18c647f2ee", class: "input-wrapper", part: "nbf__input-wrapper" }, n("input-component", { key: "e1c7d31209b1d9c213ac61669f40e1892b5072c3", label: c.t("email"), name: "email", id: "email", pattern: B, defaultValue: ((r = (a = this.bookingInfo) == null ? void 0 : a.primaryParticipant) == null ? void 0 : r.email) || this.email, placeholder: c.t("emailPlaceholder"), type: "email", required: !0, requiredError: c.t("fieldRequired", { field: c.t("email") }), patternError: c.t("invalidInputFormat", { field: c.t("email") }), part: "nbf__input-textfield" })), ((i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.hide_additional_guests) !== !0 && n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, this.guestEmails.map((m, f) => n("div", { class: "input-wrapper button-wrapper" }, n("label", { class: {
|
|
255
|
+
error: !!this.guestEmailErrors[f]
|
|
256
|
+
} }, c.t("guestEmail")), n("div", { class: "guest-email-input" }, n("input", { type: "email", id: `guest-email-${f}`, maxLength: 100, class: {
|
|
257
|
+
"guest-email": !0,
|
|
258
|
+
error: !!this.guestEmailErrors[f]
|
|
259
|
+
}, placeholder: c.t("guestEmailPlaceholder"), value: m, "data-index": f, part: "nbf__input-textfield", onBlur: (b) => {
|
|
260
|
+
var p;
|
|
261
|
+
return this.handleGuestBlur(f, (p = b.target) == null ? void 0 : p.value);
|
|
262
|
+
}, onInput: (b) => {
|
|
263
|
+
var p;
|
|
264
|
+
return this.handleGuestChange(f, (p = b.target) == null ? void 0 : p.value);
|
|
265
|
+
} }), n("button-component", { variant: "basic", onClick: (b) => this.removeGuestButtonClickHandler(b, f), class: {
|
|
266
|
+
"remove-guest": !0,
|
|
267
|
+
error: !!this.guestEmailErrors[f]
|
|
268
|
+
} }, n("close-icon", null))), n("p", { class: "help-text" }, this.guestEmailErrors[f]))), n("button-component", { class: "add-guest", variant: "invisible", part: "nbf__button-ghost", onClick: (m) => this.addGuestButtonClickedHandler(m) }, n("div", { class: "button-content" }, n("add-circle-icon", { slot: "icon" }), this.guestEmails.length > 0 ? `${c.t("addAnotherGuest")}` : `${c.t("addGuest")}`))), (u = Object.entries(((l = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : l.additional_fields) || {})) == null ? void 0 : u.sort((m, f) => m[1].order - f[1].order).map((m) => {
|
|
269
|
+
var x, _, v;
|
|
270
|
+
const f = m[1], b = f.label, p = m[0];
|
|
271
|
+
switch (f.type) {
|
|
272
|
+
case "dropdown":
|
|
273
|
+
return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("select-dropdown", { label: b, name: p, id: p, withSearch: !1, options: (x = f.options) == null ? void 0 : x.map((k) => ({ value: k, label: k })), required: f.required, exportparts: "sd_dropdown: nbf__dropdown, sd_dropdown-button: nbf__dropdown-button, sd_dropdown-content: nbf__dropdown-content" }));
|
|
274
|
+
case "checkbox":
|
|
275
|
+
return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("checkbox-component", { label: b, name: p, id: p, required: f.required, part: "nbf__checkbox-component" }));
|
|
276
|
+
case "radio_button":
|
|
277
|
+
return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("radio-button-group", { label: b, name: p, id: p, defaultSelectedValue: ((_ = f.options) == null ? void 0 : _[0]) || "", options: (v = f.options) == null ? void 0 : v.map((k) => ({ value: k, label: k })), required: f.required, part: "nbf__radio-button-group" }));
|
|
278
|
+
case "multi_line_text":
|
|
279
|
+
return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("textarea-component", { label: b, name: p, id: p, required: f.required, part: "nbf__textarea-component" }));
|
|
280
|
+
default:
|
|
281
|
+
return n("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, n("input-component", { label: b, name: p, id: p, type: f.type, requiredError: c.t("fieldRequired", { field: b }), required: f.required, part: "nbf__input-textfield" }));
|
|
282
|
+
}
|
|
283
|
+
})), n("div", { key: "9c471dbb1f4418029cf8092244e09dffd5573f9e", class: "cta" }, n("button-component", { key: "86e28e61d762bdc8ff0fb4cb3efb350939783cd8", variant: "basic", class: "back", part: "nbf__button-outline", isLoading: this.backButtonLoading && this.isLoading, onClick: this.handleBackButtonClicked }, n("slot", { key: "82764a66a09a9a596fc110e599d2a7d446a7830f", name: "booking-form-back-label" }, `${c.t("backButton")}`)), n("button-component", { key: "7dcd891f5c5ff216cd5b918bfa778352e745685d", variant: "primary", isLoading: !this.backButtonLoading && this.isLoading, disabled: this.isLoading, part: "nbf__button-primary", type: "submit" }, n("slot", { key: "9914e82ba88650f8c2878d30cebfd75b5af344f2", name: "booking-form-book-label" }, `${c.t("bookNowButton")}`)))));
|
|
284
|
+
}
|
|
285
|
+
get host() {
|
|
286
|
+
return A(this);
|
|
287
|
+
}
|
|
288
|
+
static get watchers() {
|
|
289
|
+
return {
|
|
290
|
+
bookingInfo: ["bookingInfoChangedHandler"]
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
Ce([
|
|
295
|
+
C({
|
|
296
|
+
name: "nylas-booking-form",
|
|
297
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
298
|
+
["scheduler.isLoading", "isLoading"],
|
|
299
|
+
["scheduler.bookingInfo", "bookingInfo"],
|
|
300
|
+
["scheduler.eventInfo", "eventInfo"],
|
|
301
|
+
["scheduler.configSettings", "configSettings"]
|
|
302
|
+
]),
|
|
303
|
+
eventToProps: {
|
|
304
|
+
backButtonClicked: async (e, t) => {
|
|
305
|
+
t.scheduler.toggleAdditionalData(!1);
|
|
306
|
+
},
|
|
307
|
+
nameChanged: async (e, t) => {
|
|
308
|
+
t.scheduler.setParticipantName(e.detail);
|
|
309
|
+
},
|
|
310
|
+
emailChanged: async (e, t) => {
|
|
311
|
+
t.scheduler.setParticipantEmail(e.detail);
|
|
312
|
+
},
|
|
313
|
+
detailsConfirmed: async (e, t) => {
|
|
314
|
+
d("nylas-booking-form", "detailsConfirmed", e.detail);
|
|
315
|
+
},
|
|
316
|
+
bookingFormSubmitted: async (e, t) => {
|
|
317
|
+
d("nylas-booking-form", "bookingFormSubmitted", e.detail);
|
|
318
|
+
},
|
|
319
|
+
bookingFormError: async (e, t) => {
|
|
320
|
+
d("nylas-booking-form", "bookingFormError", e.detail);
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
fireRegisterEvent: !0
|
|
324
|
+
}),
|
|
325
|
+
z("design:type", Function),
|
|
326
|
+
z("design:paramtypes", []),
|
|
327
|
+
z("design:returntype", void 0)
|
|
328
|
+
], Q.prototype, "render", null);
|
|
329
|
+
Q.style = ke;
|
|
330
|
+
const _e = ":host{display:block;width:400px;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 form{width:100%}.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);padding-bottom:1.25rem}.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%}.footer{display:grid;grid-template-columns:1fr 1fr;width:100%;padding-top:1.25rem;gap:1rem;border-top:1px solid var(--nylas-base-200);margin-top:1.25rem}", xe = _e;
|
|
331
|
+
var we = function(e, t, a, r) {
|
|
332
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
333
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
334
|
+
i = Reflect.decorate(e, t, a, r);
|
|
335
|
+
else
|
|
336
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
337
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
338
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
339
|
+
}, I = function(e, t) {
|
|
340
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
341
|
+
return Reflect.metadata(e, t);
|
|
342
|
+
};
|
|
343
|
+
const ee = class {
|
|
344
|
+
constructor(e) {
|
|
345
|
+
var t, a;
|
|
346
|
+
y(this, e), this.goBackButtonClicked = h(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = h(this, "cancelBookingFormSubmitted", 7), this.triggerValidation = h(this, "triggerValidation", 7), this.cancelBookedEventError = h(this, "cancelBookedEventError", 7), this.cancelBookingFormError = h(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
|
|
347
|
+
this.goBackButtonClicked.emit();
|
|
348
|
+
}, this.handleSubmitCancelBooking = (r) => {
|
|
349
|
+
var s, l, u;
|
|
350
|
+
if (this.triggerValidation.emit({}), r.preventDefault(), !this.cancellationReason) {
|
|
351
|
+
this.cancellationError = c.t("cancellationErrorMessage"), this.cancelBookingFormError.emit({ title: c.t("cancelBokingFormError"), description: c.t("cancellationErrorMessage") });
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
const o = (l = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : l.min_cancellation_notice;
|
|
355
|
+
if (this.selectedTimeslot && o && new Date((u = this.selectedTimeslot) == null ? void 0 : u.start_time).getTime() - o * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime()) {
|
|
356
|
+
this.cancelBookedEventError.emit({
|
|
357
|
+
error: {
|
|
358
|
+
title: c.t("cancellationErrorTitle"),
|
|
359
|
+
message: c.t("minimumCancellationNoticeErrorMessage", { minCancellationNotice: o })
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
d(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
|
|
365
|
+
const i = (m) => {
|
|
366
|
+
this.cancelBookedEventError.emit(m);
|
|
367
|
+
};
|
|
368
|
+
this.cancelBookingId ? this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, action: "cancel", reason: this.cancellationReason, errorHandler: i }) : this.rejectBookingId && this.cancelBookingFormSubmitted.emit({ bookingId: this.rejectBookingId, action: "reject", reason: this.cancellationReason, errorHandler: i });
|
|
369
|
+
}, this.cancelBookingId = void 0, this.rejectBookingId = void 0, this.configSettings = void 0, this.eventInfo = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((a = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : a.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
370
|
+
}
|
|
371
|
+
configSettingsChangedHandler(e) {
|
|
372
|
+
var t;
|
|
373
|
+
this.cancellationPolicy = ((t = e == null ? void 0 : e.scheduler) == null ? void 0 : t.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
374
|
+
}
|
|
375
|
+
connectedCallback() {
|
|
376
|
+
d("[nylas-cancel-booking-form] Component connected");
|
|
377
|
+
}
|
|
378
|
+
async componentWillLoad() {
|
|
379
|
+
d("[nylas-cancel-booking-form] Component will load");
|
|
380
|
+
}
|
|
381
|
+
async componentDidLoad() {
|
|
382
|
+
d("[nylas-cancel-booking-form] Component did load"), this.cancelBookingId || console.warn('[nylas-cancel-booking-form] No booking ID provided, "cancelBookingId" prop is required.');
|
|
383
|
+
}
|
|
384
|
+
disconnectedCallback() {
|
|
385
|
+
d("[nylas-cancel-booking-form] Component disconnected");
|
|
386
|
+
}
|
|
387
|
+
handleNylasFormInputChanged(e) {
|
|
388
|
+
this.triggerValidation.emit({}), e.detail.name === "cancel-reason" && (this.cancellationReason = e.detail.value, this.cancellationError = e.detail.error);
|
|
389
|
+
}
|
|
390
|
+
render() {
|
|
391
|
+
var e, t;
|
|
392
|
+
return n(g, { key: "6f680273959b2726cc68cb465aeacce03447ba8e", part: "ncbf" }, n("div", { key: "be243375f24e2029af0ad14c990a254c7f005631", class: "nylas-cancel-booking-form", part: "ncbf__card" }, n("div", { key: "5bef53a115c1108a0ff15ed52b773e03456ed249", class: "nylas-cancel-booking-form__calendar-icon", part: "ncbf__icon" }, n("calendar-cancel-icon", { key: "baa79cd9b1b8fea1019ccacdf0679b702d2f07a2" })), n("h3", { key: "260994a6886a04baccbba07198cb7b55843dcb94", class: "nylas-cancel-booking-form__title", part: "ncbf__title" }, c.t("cancelBookingTitle")), n("div", { key: "5b551fb4c2f91a043b1a06b64dd635cfb2a6465e", class: "nylas-cancel-booking-form__description", part: "ncbf__description" }, (t = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && t.cancellation_policy ? this.cancellationPolicy : `${c.t("cancelBookingMessage")}`), n("form", { key: "535c7fbc0ccd04b614b0b52e39c183bcc0bd4501", onSubmit: this.handleSubmitCancelBooking }, n("textarea-component", { key: "349fa734e6ca521418f315feca30de5c67c5b4ab", id: "cancel-reason", name: "cancel-reason", required: !0, label: c.t("reasonForCancellation"), class: this.cancellationError ? "error" : "", part: "ncbf__reason-textarea", defaultValue: this.cancellationReason }), n("div", { key: "c260628841bb3872a9a1439499c42e494894af9e", class: "footer" }, n("button-component", { key: "1de46efdfe24eaffae44d5a649f9b3ad6a11b3b6", variant: "destructive", class: "cancel", type: "submit", part: "ncbf__button-cta", disabled: this.isLoading }, c.t("cancelBookingButton")), !!this.eventInfo && n("button-component", { variant: "basic", class: "back", part: "ncbf__button-outline", onClick: this.handleGoBackClicked }, c.t("goBackButton"))))));
|
|
393
|
+
}
|
|
394
|
+
static get watchers() {
|
|
395
|
+
return {
|
|
396
|
+
configSettings: ["configSettingsChangedHandler"]
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
we([
|
|
401
|
+
C({
|
|
402
|
+
name: "nylas-cancel-booking-form",
|
|
403
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
404
|
+
["scheduler.configSettings", "configSettings"],
|
|
405
|
+
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
406
|
+
["scheduler.eventInfo", "eventInfo"],
|
|
407
|
+
["scheduler.isLoading", "isLoading"],
|
|
408
|
+
["scheduler.cancelBookingId", "cancelBookingId"],
|
|
409
|
+
["scheduler.rejectBookingId", "rejectBookingId"]
|
|
410
|
+
]),
|
|
411
|
+
eventToProps: {
|
|
412
|
+
cancelBookingFormSubmitted: async (e, t) => {
|
|
413
|
+
const { action: a, errorHandler: r } = e.detail;
|
|
414
|
+
if (a === "cancel") {
|
|
415
|
+
const o = await t.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason);
|
|
416
|
+
r && (!o || "error" in o) && r(o);
|
|
417
|
+
} else if (a === "reject") {
|
|
418
|
+
const o = await t.scheduler.updateBooking({
|
|
419
|
+
bookingId: e.detail.bookingId,
|
|
420
|
+
status: "cancelled",
|
|
421
|
+
reason: e.detail.reason
|
|
422
|
+
});
|
|
423
|
+
r && (!o || "error" in o) && r(o);
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
goBackButtonClicked: async (e, t) => {
|
|
427
|
+
d("nylas-cancel-booking-form", "goBackButtonClicked", e.detail), t.scheduler.goBack();
|
|
428
|
+
},
|
|
429
|
+
cancelBookedEventError: async (e, t) => {
|
|
430
|
+
d("nylas-cancel-booking-form", "cancelBookedEventError", e.detail);
|
|
431
|
+
},
|
|
432
|
+
cancelBookingFormError: async (e, t) => {
|
|
433
|
+
d("nylas-cancel-booking-form", "cancelBookingFormError", e.detail);
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
fireRegisterEvent: !0
|
|
437
|
+
}),
|
|
438
|
+
I("design:type", Function),
|
|
439
|
+
I("design:paramtypes", []),
|
|
440
|
+
I("design:returntype", void 0)
|
|
441
|
+
], ee.prototype, "render", null);
|
|
442
|
+
ee.style = xe;
|
|
443
|
+
const Ee = ":host{display:block}.nylas-cancelled-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);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%}button-component{width:100%}", Be = Ee;
|
|
444
|
+
var Te = function(e, t, a, r) {
|
|
445
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
446
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
447
|
+
i = Reflect.decorate(e, t, a, r);
|
|
448
|
+
else
|
|
449
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
450
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
451
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
452
|
+
}, R = function(e, t) {
|
|
453
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
454
|
+
return Reflect.metadata(e, t);
|
|
455
|
+
};
|
|
456
|
+
const te = class {
|
|
457
|
+
constructor(e) {
|
|
458
|
+
y(this, e), this.closeCancelEventCardClicked = h(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = h(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
|
|
459
|
+
this.isClosing = !0;
|
|
460
|
+
const t = (a) => {
|
|
461
|
+
this.cancelledEventCardError.emit(a), this.isClosing = !1;
|
|
462
|
+
};
|
|
463
|
+
this.closeCancelEventCardClicked.emit({ errorHandler: t });
|
|
464
|
+
}, this.cancelledEventInfo = void 0, this.isClosing = !1, this.configSettings = void 0;
|
|
465
|
+
}
|
|
466
|
+
connectedCallback() {
|
|
467
|
+
d("[nylas-cancelled-event-card] Component connected");
|
|
468
|
+
}
|
|
469
|
+
async componentWillLoad() {
|
|
470
|
+
d("[nylas-cancelled-event-card] Component will load");
|
|
471
|
+
}
|
|
472
|
+
async componentDidLoad() {
|
|
473
|
+
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.');
|
|
474
|
+
}
|
|
475
|
+
disconnectedCallback() {
|
|
476
|
+
d("[nylas-cancelled-event-card] Component disconnected");
|
|
477
|
+
}
|
|
478
|
+
render() {
|
|
479
|
+
var e, t;
|
|
480
|
+
return n(g, { key: "e890d06179d7e35d38abe0f30934645d0dd0866f", part: "ncec" }, n("div", { key: "c2e455774c4d962dbd178c967d6ffcf0dad495e8", class: "nylas-cancelled-event-card", part: "ncec__card" }, n("div", { key: "dae3d09a326b89e8d5c5ac662b663a87332b483f", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, n("calendar-cancel-icon", { key: "908f8f9dce64ef8a02d12b8bea383a9e65662def" })), n("h3", { key: "61a2d624b51686a6a1d9e045a3efa99f204c9e21", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, c.t("bookingCancelledTitle"), "!"), n("div", { key: "0cbf5bce08b5b623729e0741108ecd1a169c0cdb", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, c.t("bookingCancelledMessage"), " ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), n("div", { key: "e43af5b395977d607b3c427bcb7d6062db8d6678", class: "nylas-cancelled-event-card__cta" }, n("button-component", { key: "36bb4ba3bf9fa46a52f5fd7b452bf8e001341d00", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${c.t("closingButton")}...` : `${c.t("closeButton")}`))));
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
Te([
|
|
484
|
+
C({
|
|
485
|
+
name: "nylas-cancelled-event-card",
|
|
486
|
+
stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
|
|
487
|
+
eventToProps: {
|
|
488
|
+
closeCancelEventCardClicked: async (e, t) => {
|
|
489
|
+
const a = await t.scheduler.resetCancel(), { errorHandler: r } = e.detail;
|
|
490
|
+
r && (!a || "error" in a) && r(a);
|
|
491
|
+
},
|
|
492
|
+
cancelledEventCardError: async (e, t) => {
|
|
493
|
+
d("nylas-cancelled-event-card", "cancelledEventCardError", e.detail);
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
fireRegisterEvent: !0
|
|
497
|
+
}),
|
|
498
|
+
R("design:type", Function),
|
|
499
|
+
R("design:paramtypes", []),
|
|
500
|
+
R("design:returntype", void 0)
|
|
501
|
+
], te.prototype, "render", null);
|
|
502
|
+
te.style = Be;
|
|
503
|
+
const De = ':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-confirmed-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);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-confirmed-event-card{width:inherit}}.nylas-confirmed-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-confirmed-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-confirmed-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-confirmed-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%}button-component{width:100%}', Le = De;
|
|
504
|
+
var Se = function(e, t, a, r) {
|
|
505
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
506
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
507
|
+
i = Reflect.decorate(e, t, a, r);
|
|
508
|
+
else
|
|
509
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
510
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
511
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
512
|
+
}, j = function(e, t) {
|
|
513
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
514
|
+
return Reflect.metadata(e, t);
|
|
515
|
+
};
|
|
516
|
+
const ne = class {
|
|
517
|
+
constructor(e) {
|
|
518
|
+
y(this, e), this.closeConfirmEventCardClicked = h(this, "closeConfirmEventCardClicked", 7), this.confirmedEventCardError = h(this, "confirmedEventCardError", 7), this.handleCloseClicked = () => {
|
|
519
|
+
this.isClosing = !0;
|
|
520
|
+
const t = (a) => {
|
|
521
|
+
this.confirmedEventCardError.emit(a), this.isClosing = !1;
|
|
522
|
+
};
|
|
523
|
+
this.closeConfirmEventCardClicked.emit({ errorHandler: t });
|
|
524
|
+
}, this.confirmedEventInfo = void 0, this.isClosing = !1, this.configSettings = void 0;
|
|
525
|
+
}
|
|
526
|
+
connectedCallback() {
|
|
527
|
+
d("[nylas-confirmed-event-card] Component connected");
|
|
528
|
+
}
|
|
529
|
+
async componentWillLoad() {
|
|
530
|
+
d("[nylas-confirmed-event-card] Component will load");
|
|
531
|
+
}
|
|
532
|
+
async componentDidLoad() {
|
|
533
|
+
d("[nylas-confirmed-event-card] Component did load"), this.confirmedEventInfo || console.warn('[nylas-confirmed-event-card] No confirmed event info provided, "confirmedEventInfo" prop is required.');
|
|
534
|
+
}
|
|
535
|
+
disconnectedCallback() {
|
|
536
|
+
d("[nylas-confirmed-event-card] Component disconnected");
|
|
537
|
+
}
|
|
538
|
+
render() {
|
|
539
|
+
var e, t;
|
|
540
|
+
return n(g, { key: "f78755849f1e51daa16349080efbd1154ee5421f", part: "ncec" }, n("div", { key: "3bef7ce7a2365171566b29b096b1625d0724a322", class: "nylas-confirmed-event-card", part: "ncec__card" }, n("div", { key: "1a246865b9400017d1945eb079691ac8f94baf1b", class: "nylas-confirmed-event-card__calendar-icon", part: "ncec__icon" }, n("calendar-cancel-icon", { key: "6af3a586336dc9d89f9e20bd9fbb2d64641c883f" })), n("h3", { key: "ccb933bf503bd9f316c04647dd99652ac4422c78", class: "nylas-confirmed-event-card__title", part: "ncec__title" }, c.t("confirmedEventCardTitle"), "!"), n("div", { key: "21d9fa9069fc947e05b1bfe5f9c5e9a6aa4bb091", class: "nylas-confirmed-event-card__description", part: "ncec__description" }, c.t("confirmedEventCardDescription"), " ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), n("div", { key: "93ee8ddcb48b9ec5f30df4cce75ca1a13a38bfff", class: "nylas-confirmed-event-card__cta" }, n("button-component", { key: "ca0960f860c3701821b492e318a47a7cf58d6c40", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${c.t("closingButton")}...` : `${c.t("closeButton")}`))));
|
|
541
|
+
}
|
|
542
|
+
};
|
|
543
|
+
Se([
|
|
544
|
+
C({
|
|
545
|
+
name: "nylas-confirmed-event-card",
|
|
546
|
+
stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
|
|
547
|
+
eventToProps: {
|
|
548
|
+
closeConfirmEventCardClicked: async (e, t) => {
|
|
549
|
+
const a = await t.scheduler.resetConfirm(), { errorHandler: r } = e.detail;
|
|
550
|
+
r && (!a || "error" in a) && r(a);
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
fireRegisterEvent: !0
|
|
554
|
+
}),
|
|
555
|
+
j("design:type", Function),
|
|
556
|
+
j("design:paramtypes", []),
|
|
557
|
+
j("design:returntype", void 0)
|
|
558
|
+
], ne.prototype, "render", null);
|
|
559
|
+
ne.style = Le;
|
|
560
|
+
const F = /* @__PURE__ */ new Date(), P = /* @__PURE__ */ new Date();
|
|
561
|
+
function D(e, t, a, r) {
|
|
562
|
+
function o(i) {
|
|
563
|
+
return e(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i;
|
|
564
|
+
}
|
|
565
|
+
return o.floor = (i) => (e(i = /* @__PURE__ */ new Date(+i)), i), o.ceil = (i) => (e(i = new Date(i - 1)), t(i, 1), e(i), i), o.round = (i) => {
|
|
566
|
+
const s = o(i), l = o.ceil(i);
|
|
567
|
+
return i - s < l - i ? s : l;
|
|
568
|
+
}, o.offset = (i, s) => (t(i = /* @__PURE__ */ new Date(+i), s == null ? 1 : Math.floor(s)), i), o.range = (i, s, l) => {
|
|
569
|
+
const u = [];
|
|
570
|
+
if (i = o.ceil(i), l = l == null ? 1 : Math.floor(l), !(i < s) || !(l > 0))
|
|
571
|
+
return u;
|
|
572
|
+
let m;
|
|
573
|
+
do
|
|
574
|
+
u.push(m = /* @__PURE__ */ new Date(+i)), t(i, l), e(i);
|
|
575
|
+
while (m < i && i < s);
|
|
576
|
+
return u;
|
|
577
|
+
}, o.filter = (i) => D((s) => {
|
|
578
|
+
if (s >= s)
|
|
579
|
+
for (; e(s), !i(s); )
|
|
580
|
+
s.setTime(s - 1);
|
|
581
|
+
}, (s, l) => {
|
|
582
|
+
if (s >= s)
|
|
583
|
+
if (l < 0)
|
|
584
|
+
for (; ++l <= 0; )
|
|
585
|
+
for (; t(s, -1), !i(s); )
|
|
586
|
+
;
|
|
587
|
+
else
|
|
588
|
+
for (; --l >= 0; )
|
|
589
|
+
for (; t(s, 1), !i(s); )
|
|
590
|
+
;
|
|
591
|
+
}), a && (o.count = (i, s) => (F.setTime(+i), P.setTime(+s), e(F), e(P), Math.floor(a(F, P))), o.every = (i) => (i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? o.filter(r ? (s) => r(s) % i === 0 : (s) => o.count(0, s) % i === 0) : o)), o;
|
|
592
|
+
}
|
|
593
|
+
const ze = 1e3, ae = ze * 60, Ie = ae * 60, T = Ie * 24, M = D(
|
|
594
|
+
(e) => e.setHours(0, 0, 0, 0),
|
|
595
|
+
(e, t) => e.setDate(e.getDate() + t),
|
|
596
|
+
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * ae) / T,
|
|
597
|
+
(e) => e.getDate() - 1
|
|
598
|
+
);
|
|
599
|
+
D((e) => {
|
|
600
|
+
e.setUTCHours(0, 0, 0, 0);
|
|
601
|
+
}, (e, t) => {
|
|
602
|
+
e.setUTCDate(e.getUTCDate() + t);
|
|
603
|
+
}, (e, t) => (t - e) / T, (e) => e.getUTCDate() - 1);
|
|
604
|
+
D((e) => {
|
|
605
|
+
e.setUTCHours(0, 0, 0, 0);
|
|
606
|
+
}, (e, t) => {
|
|
607
|
+
e.setUTCDate(e.getUTCDate() + t);
|
|
608
|
+
}, (e, t) => (t - e) / T, (e) => Math.floor(e / T));
|
|
609
|
+
const Re = ':host{display:block;min-height:444px}@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)}', je = Re;
|
|
610
|
+
var Fe = function(e, t, a, r) {
|
|
611
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
612
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
613
|
+
i = Reflect.decorate(e, t, a, r);
|
|
614
|
+
else
|
|
615
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
616
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
617
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
618
|
+
}, N = function(e, t) {
|
|
619
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
620
|
+
return Reflect.metadata(e, t);
|
|
621
|
+
};
|
|
622
|
+
const ie = class {
|
|
623
|
+
constructor(e) {
|
|
624
|
+
y(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.selectedLanguage = void 0, this.isLoading = void 0, this.eventDuration = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.disableNextMonthButton = !1;
|
|
625
|
+
}
|
|
626
|
+
configSettingsChanged(e) {
|
|
627
|
+
var o;
|
|
628
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), a = (o = e == null ? void 0 : e.scheduler) == null ? void 0 : o.available_days_in_future;
|
|
629
|
+
if (a === void 0)
|
|
630
|
+
return;
|
|
631
|
+
U(/* @__PURE__ */ new Date(), a).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
|
|
632
|
+
}
|
|
633
|
+
selectedLanguageChanged(e) {
|
|
634
|
+
c.changeLanguage(e);
|
|
635
|
+
}
|
|
636
|
+
connectedCallback() {
|
|
637
|
+
}
|
|
638
|
+
disconnectedCallback() {
|
|
639
|
+
}
|
|
640
|
+
componentWillLoad() {
|
|
641
|
+
}
|
|
642
|
+
getDates() {
|
|
643
|
+
const e = de(this.month), t = fe(this.month);
|
|
644
|
+
return M.range(M.offset(t, -t.getDay()), M.offset(e, 7 - e.getDay()));
|
|
645
|
+
}
|
|
646
|
+
selectDate(e) {
|
|
647
|
+
this.dateSelected.emit(e);
|
|
648
|
+
}
|
|
649
|
+
changeMonth(e) {
|
|
650
|
+
var o, i;
|
|
651
|
+
this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
|
|
652
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), a = (i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.available_days_in_future;
|
|
653
|
+
U(/* @__PURE__ */ new Date(), a).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month);
|
|
654
|
+
}
|
|
655
|
+
isSelected(e, t, a) {
|
|
656
|
+
return e && t && w(e, t) && a && (a == null ? void 0 : a.length) > 0;
|
|
657
|
+
}
|
|
658
|
+
isDisabled(e, t) {
|
|
659
|
+
return e && (t == null ? void 0 : t.find((a) => w(a, e))) === void 0;
|
|
660
|
+
}
|
|
661
|
+
render() {
|
|
662
|
+
var e, t, a, r, o, i, s;
|
|
663
|
+
return n(g, { key: "3e6dd28572687991de4841d639c5bdbd5d2d6e0b", part: "ndp" }, n("div", { key: "b8a31231d9e04035c468f9c025bbd3adb4f0dbb2", class: "nylas-date-picker" }, n("div", { key: "c25024241ce71fb94bcc485cc32614c820a69fee", class: "title", part: "ndp__title" }, (e = this.configSettings) != null && e.name ? n("h1", null, (t = this.configSettings) == null ? void 0 : t.name) : ((r = (a = this.configSettings) == null ? void 0 : a.organizer) == null ? void 0 : r.name) && n("h1", null, n("person-icon", null), ((i = (o = this.configSettings) == null ? void 0 : o.organizer) == null ? void 0 : i.name) || "Organizer"), n("p", { key: "f51da2bb7f8b5d6b84ea5a9ea66aef03b9e10e12" }, n("clock-icon", { key: "42a947b00a14afe7c57c716e37ef4d418e55e337" }), this.eventDuration ? he(this.eventDuration) : `- ${c.t("time.minutes")}`)), n("div", { key: "bb264f745cbe51ece10238e3a2f3fae55d2f1bdb", class: "header flex-row" }, n("h2", { key: "16ecbac96e4ede32b8b524a645f96e30d16e2814", part: "ndp__month-header" }, n("strong", { key: "aaf8064ac4ebd41680fb4c147b5a23fc7e5554f2" }, me(this.month.toLocaleDateString(void 0, { month: "long" }).toLocaleLowerCase())), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), n("div", { key: "8d5fdca1f4de5d8b75c89ebf6bc6d964b39b8351", class: "pagination" }, n("button", { key: "9a993814c06483337caea097727932aa75e53243", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: !((s = this.selectableDates) != null && s.length) || this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, n("chevron-icon", { key: "edd3668dee154cb573cf3ed25e72beb2938cb9d2" })), n("button", { key: "9452edc29c45e8ff24f76521b94762f128201ba0", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, n("chevron-icon", { key: "1f27334ee808470e844f8f08c4fd4dfc39376b2d" })))), n("div", { key: "4173feb8a2661c49d0c898864886db0f90f6a181", class: "dates" }, [
|
|
664
|
+
c.t("days.sunday"),
|
|
665
|
+
c.t("days.monday"),
|
|
666
|
+
c.t("days.tuesday"),
|
|
667
|
+
c.t("days.wednesday"),
|
|
668
|
+
c.t("days.thursday"),
|
|
669
|
+
c.t("days.friday"),
|
|
670
|
+
c.t("days.saturday")
|
|
671
|
+
].map((l) => n("div", { class: "day", part: "ndp__day" }, l)), this.dates.map((l, u) => {
|
|
672
|
+
var f;
|
|
673
|
+
const m = this.isDisabled(l, this.selectableDates);
|
|
674
|
+
return this.isLoading ? n("button", { disabled: !0, class: {
|
|
675
|
+
"date day-skeleton": !0,
|
|
676
|
+
"current-month": L(l, this.month)
|
|
677
|
+
}, style: { animationDelay: `${u * 20}ms` }, part: "ndp__date ndp__date--disabled" }, l.getDate()) : n("button", { class: {
|
|
678
|
+
date: !0,
|
|
679
|
+
selected: !!(this.selectedDate && w(l, this.selectedDate) && this.selectableDates && ((f = this.selectableDates) == null ? void 0 : f.length) > 0),
|
|
680
|
+
"current-day": w(l, /* @__PURE__ */ new Date()),
|
|
681
|
+
"current-month": L(l, this.month)
|
|
682
|
+
}, "aria-lang": l.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: m, onClick: () => this.selectDate(l), part: `ndp__date ${this.isSelected(l, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${w(l, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${L(l, this.month) ? "ndp__date--current-month" : ""}` }, l.getDate());
|
|
683
|
+
}))));
|
|
684
|
+
}
|
|
685
|
+
static get watchers() {
|
|
686
|
+
return {
|
|
687
|
+
configSettings: ["configSettingsChanged"],
|
|
688
|
+
selectedLanguage: ["selectedLanguageChanged"]
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
Fe([
|
|
693
|
+
C({
|
|
694
|
+
name: "nylas-date-picker",
|
|
695
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
696
|
+
["scheduler.selectableDates", "selectableDates"],
|
|
697
|
+
["scheduler.selectedDate", "selectedDate"],
|
|
698
|
+
["scheduler.isLoading", "isLoading"],
|
|
699
|
+
["scheduler.configSettings", "configSettings"],
|
|
700
|
+
["scheduler.eventDuration", "eventDuration"],
|
|
701
|
+
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
702
|
+
]),
|
|
703
|
+
eventToProps: {
|
|
704
|
+
dateSelected: async (e, t) => {
|
|
705
|
+
d("nylas-date-picker", "dateSelected", e.detail), t.scheduler.selectDate(e.detail);
|
|
706
|
+
},
|
|
707
|
+
monthChanged: async (e, t) => {
|
|
708
|
+
d("nylas-date-picker", "monthChanged", e.detail);
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
fireRegisterEvent: !0
|
|
712
|
+
}),
|
|
713
|
+
N("design:type", Function),
|
|
714
|
+
N("design:paramtypes", []),
|
|
715
|
+
N("design:returntype", void 0)
|
|
716
|
+
], ie.prototype, "render", null);
|
|
717
|
+
ie.style = je;
|
|
718
|
+
const Pe = ":host{display:block}.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}", Me = Pe;
|
|
719
|
+
var Ne = function(e, t, a, r) {
|
|
720
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
721
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
722
|
+
i = Reflect.decorate(e, t, a, r);
|
|
723
|
+
else
|
|
724
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
725
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
726
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
727
|
+
}, $ = function(e, t) {
|
|
728
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
729
|
+
return Reflect.metadata(e, t);
|
|
730
|
+
};
|
|
731
|
+
const oe = class {
|
|
732
|
+
constructor(e) {
|
|
733
|
+
y(this, e), this.timezoneChanged = h(this, "timezoneChanged", 7), this.languageChanged = h(this, "languageChanged", 7), this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = navigator.language;
|
|
734
|
+
}
|
|
735
|
+
connectedCallback() {
|
|
736
|
+
}
|
|
737
|
+
disconnectedCallback() {
|
|
738
|
+
}
|
|
739
|
+
componentWillLoad() {
|
|
740
|
+
}
|
|
741
|
+
changeTimezone(e) {
|
|
742
|
+
this.selectedTimezone = e, this.timezoneChanged.emit(e);
|
|
743
|
+
}
|
|
744
|
+
changeLanguage(e) {
|
|
745
|
+
this.selectedLanguage = e, this.languageChanged.emit(e);
|
|
746
|
+
}
|
|
747
|
+
nylasFormDropdownChangedHandler(e) {
|
|
748
|
+
const { name: t, value: a } = e.detail;
|
|
749
|
+
t === "timezone" ? this.changeTimezone(a) : t === "language" && this.changeLanguage(a);
|
|
750
|
+
}
|
|
751
|
+
getTimezoneLabelHTML(e) {
|
|
752
|
+
const t = be(e);
|
|
753
|
+
return n("span", { class: "timezone-label", style: {
|
|
754
|
+
display: "flex",
|
|
755
|
+
alignItems: "center",
|
|
756
|
+
justifyContent: "space-between",
|
|
757
|
+
width: "-webkit-fill-available"
|
|
758
|
+
} }, E[e], " ", n("span", { class: "timezone-offset", style: {
|
|
759
|
+
fontSize: "14px",
|
|
760
|
+
fontWeight: "400",
|
|
761
|
+
color: "var(--nylas-base-500)"
|
|
762
|
+
} }, t));
|
|
763
|
+
}
|
|
764
|
+
render() {
|
|
765
|
+
const e = Object.keys(E).map((a) => ({
|
|
766
|
+
labelHTML: this.getTimezoneLabelHTML(a),
|
|
767
|
+
label: E[a],
|
|
768
|
+
value: a
|
|
769
|
+
})), t = Object.keys(X).map((a) => ({
|
|
770
|
+
label: X[a],
|
|
771
|
+
value: a
|
|
772
|
+
}));
|
|
773
|
+
return n(g, { key: "8e8ec3819083fb25cb8620f14aa1f140a995ec89" }, n("div", { key: "45aaebcd9f80d54dc01b5d611094fa05225c8331", class: "nylas-locale-switch", part: "nls" }, n("div", { key: "47d8166b91a3ef742b14e5783338c3701be85eb7", class: {
|
|
774
|
+
"select-wrapper": !0,
|
|
775
|
+
timezone: !0
|
|
776
|
+
}, part: "nls__timezone" }, n("select-dropdown", { key: "71edd2352b6067a18b9ba676495e59c954e6c07d", name: "timezone", options: e, defaultSelectedOption: e.find((a) => a.value == this.selectedTimezone), exportparts: "sd_dropdown: nls__timezone-dropdown, sd_dropdown-button: nls__timezone-drop-button, sd_dropdown-button-selected-label: nls__timezone-drop-button-selected-label, sd_dropdown-content: nls__timezone-drop-content, sd_dropdown_label: nls__timezone-drop-label" }, n("span", { key: "f48e3c11a1981e32b75f5425570db0b584db7f51", slot: "select-icon" }, n("globe-icon", { key: "6b6721c8d88d715dbcb52d2e2750c22015ac252c", width: "20", height: "20" })))), n("div", { key: "fe652536d637774336cad11a65bba7bfd8636972", class: {
|
|
777
|
+
"select-wrapper": !0,
|
|
778
|
+
language: !0
|
|
779
|
+
}, part: "nls__language" }, n("select-dropdown", { key: "f83f8dbf84878fb1670d4a6f59b045c111420ce1", name: "language", options: t, defaultSelectedOption: t.find((a) => a.value == this.selectedLanguage), exportparts: "sd_dropdown: nls__language-dropdown, sd_dropdown-button: nls__language-drop-button, sd_dropdown-content: nls__language-drop-content, sd_dropdown_label: nls__language-drop-label" }, n("span", { key: "3d66833265053e81c9333b5d36ae822ed3a17878", slot: "select-icon" }, n("translate-icon", { key: "30121c5733873930e7e1e3bdaedf11bd2f258139", width: "20", height: "20" }))))));
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
Ne([
|
|
783
|
+
C({
|
|
784
|
+
name: "nylas-locale-switch",
|
|
785
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
786
|
+
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
787
|
+
["scheduler.selectedTimezone", "selectedTimezone"]
|
|
788
|
+
]),
|
|
789
|
+
eventToProps: {
|
|
790
|
+
timezoneChanged: async (e, t) => {
|
|
791
|
+
d("nylas-locale-switch", "timezoneChanged", e.detail), t.scheduler.selectTimezone(e.detail);
|
|
792
|
+
},
|
|
793
|
+
languageChanged: async (e, t) => {
|
|
794
|
+
d("nylas-locale-switch", "languageChanged", e.detail), t.scheduler.selectLanguage(e.detail);
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
fireRegisterEvent: !0
|
|
798
|
+
}),
|
|
799
|
+
$("design:type", Function),
|
|
800
|
+
$("design:paramtypes", []),
|
|
801
|
+
$("design:returntype", void 0)
|
|
802
|
+
], oe.prototype, "render", null);
|
|
803
|
+
oe.style = Me;
|
|
804
|
+
const $e = ".sc-nylas-logo-h{display:flex}", Oe = $e, He = class {
|
|
805
|
+
constructor(e) {
|
|
806
|
+
y(this, e), this.width = "69", this.height = "24";
|
|
807
|
+
}
|
|
808
|
+
render() {
|
|
809
|
+
return n("svg", { key: "62222dd3800378729b2adde6c2983fe6cee23caa", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("g", { key: "97910c954c2b27d45639c4efee40a9b692928d5c", "clip-path": "url(#clip0_455_3543)" }, n("path", { key: "e0334bf2d85c5bb3d69f9ef9fd16dfcc213fe853", 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" }), n("path", { key: "0e4dcb860598c50b18aa23b870f995c387df5db1", 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" }), n("path", { key: "0932b6eef652d9a91bd578c888bdaf3bd14aba4a", 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" }), n("path", { key: "19c41ab0458b7c96debb14698f9b7c12fb8155d7", 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" }), n("path", { key: "3f67d09eef5ed6fd2189d8f346cdc87a1fb2d9eb", 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" }), n("path", { key: "12c89a71827969f361db08eaa92989e77273197c", 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" }), n("path", { key: "e129a0531742754423169ea6d4f88a8b9a7a3448", 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" }), n("path", { key: "f1e19b3ef09568e57cac44d71d21a8db19ee1184", 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" })), n("defs", { key: "c97ba75e4811081b3bd50460af81e60666c44d38" }, n("clipPath", { key: "e585d77949e6cf411e08275bd51b239a8a6b4af8", id: "clip0_455_3543" }, n("rect", { key: "586c6b1e9c085419045cf92a2fd21301ead072ea", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
|
|
810
|
+
}
|
|
811
|
+
};
|
|
812
|
+
He.style = Oe;
|
|
813
|
+
const qe = ':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}', Ae = qe, Ze = class {
|
|
814
|
+
constructor(e) {
|
|
815
|
+
y(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
|
|
816
|
+
}
|
|
817
|
+
onError(e) {
|
|
818
|
+
d(`[nylas-notification] Error: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
819
|
+
}
|
|
820
|
+
onWarning(e) {
|
|
821
|
+
d(`[nylas-notification] Warning: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
822
|
+
}
|
|
823
|
+
onInfo(e) {
|
|
824
|
+
d(`[nylas-notification] Info: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
825
|
+
}
|
|
826
|
+
onSuccess(e) {
|
|
827
|
+
d(`[nylas-notification] Success: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
828
|
+
}
|
|
829
|
+
isChildOf(e) {
|
|
830
|
+
let t = this.host.parentNode;
|
|
831
|
+
for (; t; ) {
|
|
832
|
+
if (t === e)
|
|
833
|
+
return !0;
|
|
834
|
+
t instanceof ShadowRoot ? t = t.host : t = t.parentNode;
|
|
835
|
+
}
|
|
836
|
+
return !1;
|
|
837
|
+
}
|
|
838
|
+
handleNotification(e) {
|
|
839
|
+
const t = e.detail.host;
|
|
840
|
+
if (e.defaultPrevented) {
|
|
841
|
+
d("[nylas-notification] Event default prevented");
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
if (t && !this.isChildOf(t)) {
|
|
845
|
+
d("[nylas-notification] Host not a parent");
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
if (this.ttl === 0) {
|
|
849
|
+
d("[nylas-notification] TTL is 0");
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.notification.category)) {
|
|
853
|
+
d("[nylas-notification] Category not allowed");
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
if (this.notifications = [...this.notifications, { ...e.detail.notification }], e.detail.notification.ttl !== "none") {
|
|
857
|
+
const a = e.detail.notification.ttl ? e.detail.notification.ttl : this.ttl;
|
|
858
|
+
window.setTimeout(() => {
|
|
859
|
+
this.notifications = this.notifications.filter((r) => r.id !== e.detail.notification.id);
|
|
860
|
+
}, a);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
dismissNotification(e) {
|
|
864
|
+
this.notifications = this.notifications.filter((t) => t.id !== e);
|
|
865
|
+
}
|
|
866
|
+
render() {
|
|
867
|
+
return n(g, { key: "9a2b2d32b746b25c06f61494c2cae183712f61e0" }, n(pe, { key: "561d628e0954735a0a0643b076101f4a0e4cfe0a" }, this.notifications.map((e) => n("div", { class: `notif ${e.type}`, key: e.id }, n("div", { class: "content" }, n("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && n("warning-icon", null)), n("span", { class: "message" }, n("span", { class: "title" }, e.title), e.description && n("span", { class: "description" }, e.description))), n("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, n("close-icon", null)))), n("slot", { key: "2f2d91b57282c87026f507f065b0e98615658ff2" })));
|
|
868
|
+
}
|
|
869
|
+
get host() {
|
|
870
|
+
return A(this);
|
|
871
|
+
}
|
|
872
|
+
};
|
|
873
|
+
Ze.style = Ae;
|
|
874
|
+
const Ve = ':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}.event-card-wrapper{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;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}.manage-booking-description{border-top:1px solid var(--nylas-base-200)}.manage-booking-description p{font-size:16px;margin:1rem;padding:0.5rem 1rem;font-weight:400;color:var(--nylas-base-800)}.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-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{--dot-color:var(--nylas-base-700)}', Ge = Ve;
|
|
875
|
+
var We = function(e, t, a, r) {
|
|
876
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
877
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
878
|
+
i = Reflect.decorate(e, t, a, r);
|
|
879
|
+
else
|
|
880
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
881
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
882
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
883
|
+
}, O = function(e, t) {
|
|
884
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
885
|
+
return Reflect.metadata(e, t);
|
|
886
|
+
};
|
|
887
|
+
const re = class {
|
|
888
|
+
constructor(e) {
|
|
889
|
+
y(this, e), this.rejectBookingButtonClicked = h(this, "rejectBookingButtonClicked", 7), this.confirmBookingButtonClicked = h(this, "confirmBookingButtonClicked", 7), this.confirmBookingError = h(this, "confirmBookingError", 7), this.handleConfirmBookingButtonClicked = () => {
|
|
890
|
+
this.action = "confirm";
|
|
891
|
+
const t = (a) => {
|
|
892
|
+
this.confirmBookingError.emit(a);
|
|
893
|
+
};
|
|
894
|
+
this.organizerConfirmationBookingId && !this.isLoading && this.confirmBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host, errorHandler: t });
|
|
895
|
+
}, this.handleRejectBookingButtonClicked = () => {
|
|
896
|
+
this.action = "reject", this.organizerConfirmationBookingId && !this.isLoading && this.rejectBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host });
|
|
897
|
+
}, this.organizerConfirmationBookingId = void 0, this.configSettings = void 0, this.isLoading = void 0, this.selectedLanguage = navigator.language, this.action = null;
|
|
898
|
+
}
|
|
899
|
+
connectedCallback() {
|
|
900
|
+
}
|
|
901
|
+
disconnectedCallback() {
|
|
902
|
+
}
|
|
903
|
+
async componentWillLoad() {
|
|
904
|
+
d("[nylas-organizer-confirmation-card] Component will load");
|
|
905
|
+
}
|
|
906
|
+
async componentDidLoad() {
|
|
907
|
+
d("[nylas-organizer-confirmation-card] Component did load");
|
|
908
|
+
}
|
|
909
|
+
async resetAction() {
|
|
910
|
+
this.action = null;
|
|
911
|
+
}
|
|
912
|
+
render() {
|
|
913
|
+
var e, t, a, r, o, i, s, l, u, m, f, b;
|
|
914
|
+
return n(g, { key: "6d80da6d7d359bad3d317d04db827e51d02f36c9", part: "nmcc" }, n("div", { key: "eeca3a1fe7937e7be2a15ab418e0c46bee8b207f", class: "event-card-wrapper", part: "nmccc__card" }, n("div", { key: "7b5fad347fbe69a1b62945cd4945854e086e4bd2", class: "calendar-icon" }, n("calendar-check-icon", { key: "427696f8e3de3f7d1f8d131626897460beb616f9" })), n("div", { key: "fdb11fa1b76f83cd64e8ed44e637aff89b33e93e", class: "booked-event-header" }, n("h2", { key: "2c18ab70ed2f00251552c972a040721c64979276", slot: "card-title", part: "nmcc__title" }, !!this.organizerConfirmationBookingId && `${c.t("bookingPendingTitle")}!`)), n("div", { key: "70cbb157ae6436799d24092f6bd0ce82df8c4c5d", class: "manage-booking-description" }, n("p", { key: "afaeb94cf6ff0d75fa17c8a24298078b95d5d8f8" }, c.t("bookingPendingnDescription"))), n("div", { key: "fb6b22ad30e9af98b50cd4a35ad545ba8b5a100b", class: {
|
|
915
|
+
footer: !0,
|
|
916
|
+
"no-footer": ((t = (e = this.configSettings) == null ? void 0 : e.scheduler) == null ? void 0 : t.hide_cancellation_options) && ((r = (a = this.configSettings) == null ? void 0 : a.scheduler) == null ? void 0 : r.hide_rescheduling_options),
|
|
917
|
+
"no-template-cols": ((i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.hide_cancellation_options) || ((l = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : l.hide_rescheduling_options)
|
|
918
|
+
} }, !((m = (u = this.configSettings) == null ? void 0 : u.scheduler) != null && m.hide_cancellation_options) && n("button-component", { variant: "destructive", onClick: this.handleRejectBookingButtonClicked, isLoading: this.isLoading && this.action === "reject", part: "nmcc__button-outline nmcc__cancel-cta" }, `${c.t("rejectBookingButton")}`), !((b = (f = this.configSettings) == null ? void 0 : f.scheduler) != null && b.hide_rescheduling_options) && n("button-component", { variant: "basic", onClick: this.handleConfirmBookingButtonClicked, isLoading: this.isLoading && this.action === "confirm", part: "nmcc__button-outline nmcc__reschedule-cta" }, `${c.t("confirmBookingButton")}`))));
|
|
919
|
+
}
|
|
920
|
+
get host() {
|
|
921
|
+
return A(this);
|
|
922
|
+
}
|
|
923
|
+
};
|
|
924
|
+
We([
|
|
925
|
+
C({
|
|
926
|
+
name: "nylas-organizer-confirmation-card",
|
|
927
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
928
|
+
["scheduler.organizerConfirmationBookingId", "organizerConfirmationBookingId"],
|
|
929
|
+
["scheduler.configSettings", "configSettings"],
|
|
930
|
+
["scheduler.isLoading", "isLoading"],
|
|
931
|
+
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
932
|
+
]),
|
|
933
|
+
eventToProps: {
|
|
934
|
+
rejectBookingButtonClicked: async (e, t) => {
|
|
935
|
+
t.scheduler.setReject(e.detail.bookingId);
|
|
936
|
+
},
|
|
937
|
+
confirmBookingButtonClicked: async (e, t) => {
|
|
938
|
+
const { host: a } = e.detail, r = await t.scheduler.updateBooking({
|
|
939
|
+
bookingId: e.detail.bookingId,
|
|
940
|
+
status: "confirmed"
|
|
941
|
+
}), { errorHandler: o } = e.detail;
|
|
942
|
+
o && (!r || "error" in r) && o(r), await a.resetAction();
|
|
943
|
+
}
|
|
944
|
+
},
|
|
945
|
+
fireRegisterEvent: !0
|
|
946
|
+
}),
|
|
947
|
+
O("design:type", Function),
|
|
948
|
+
O("design:paramtypes", []),
|
|
949
|
+
O("design:returntype", void 0)
|
|
950
|
+
], re.prototype, "render", null);
|
|
951
|
+
re.style = Ge;
|
|
952
|
+
const Ue = ":host{display:block;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}}", Xe = Ue;
|
|
953
|
+
var Ye = function(e, t, a, r) {
|
|
954
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
955
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
956
|
+
i = Reflect.decorate(e, t, a, r);
|
|
957
|
+
else
|
|
958
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
959
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
960
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
961
|
+
}, H = function(e, t) {
|
|
962
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
963
|
+
return Reflect.metadata(e, t);
|
|
964
|
+
};
|
|
965
|
+
const se = class {
|
|
966
|
+
constructor(e) {
|
|
967
|
+
y(this, e), this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.startTime = "", this.endTime = "";
|
|
968
|
+
}
|
|
969
|
+
connectedCallback() {
|
|
970
|
+
}
|
|
971
|
+
disconnectedCallback() {
|
|
972
|
+
}
|
|
973
|
+
async componentWillLoad() {
|
|
974
|
+
d("[nylas-selected-event-card] Component will load");
|
|
975
|
+
}
|
|
976
|
+
async componentDidLoad() {
|
|
977
|
+
var t, a;
|
|
978
|
+
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.');
|
|
979
|
+
const e = new Intl.DateTimeFormat("en-US", {
|
|
980
|
+
hour: "2-digit",
|
|
981
|
+
minute: "2-digit",
|
|
982
|
+
timeZone: this.selectedTimezone
|
|
983
|
+
});
|
|
984
|
+
this.startTime = e.format(new Date((t = this.selectedTimeslot) == null ? void 0 : t.start_time)), this.endTime = e.format(new Date((a = this.selectedTimeslot) == null ? void 0 : a.end_time));
|
|
985
|
+
}
|
|
986
|
+
render() {
|
|
987
|
+
var e;
|
|
988
|
+
return n(g, { key: "2b4257d6793fd263e7978504b88e270d77e2e78f", part: "nsec" }, n("div", { key: "8eb84c0c375afd9824d88337003d09b7fe3db171", class: "event-card", part: "nsec__card" }, n("div", { key: "bc7d364f1ec772f06f5eab4549b0433cb947f68d", class: "calendar-icon", part: "nsec__icon" }, n("calendar-icon", { key: "a3f38777fea8b17714ad0dc34cd236a93e4360fd" })), n("div", { key: "1d23698c5a8d627bc10c7969e269a381584b6477", class: "nylas-selected-event-card__date", part: "nsec__date" }, this.selectedDate ? Y((e = this.selectedDate) == null ? void 0 : e.toLocaleDateString(J[this.selectedLanguage || navigator.language], { dateStyle: "full", timeZone: this.selectedTimezone })) : "-"), n("div", { key: "4e02d04cc6918076935614be321619a9df16430d", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), n("div", { key: "ad39ae7e3df5e6652b0dad88b98695cfee00e3db", class: "event-timezone", part: "nsec__timezone" }, n("globe-icon", { key: "23b1e1fd15842a65278a969e1ce3aea0313ea46e" }), E[this.selectedTimezone]));
|
|
989
|
+
}
|
|
990
|
+
};
|
|
991
|
+
Ye([
|
|
992
|
+
C({
|
|
993
|
+
name: "nylas-selected-event-card",
|
|
994
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
995
|
+
["scheduler.selectedDate", "selectedDate"],
|
|
996
|
+
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
997
|
+
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
998
|
+
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
999
|
+
]),
|
|
1000
|
+
eventToProps: {},
|
|
1001
|
+
fireRegisterEvent: !0
|
|
1002
|
+
}),
|
|
1003
|
+
H("design:type", Function),
|
|
1004
|
+
H("design:paramtypes", []),
|
|
1005
|
+
H("design:returntype", void 0)
|
|
1006
|
+
], se.prototype, "render", null);
|
|
1007
|
+
se.style = Xe;
|
|
1008
|
+
const Je = ":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)}", Ke = Je;
|
|
1009
|
+
var Qe = function(e, t, a, r) {
|
|
1010
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, s;
|
|
1011
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1012
|
+
i = Reflect.decorate(e, t, a, r);
|
|
1013
|
+
else
|
|
1014
|
+
for (var l = e.length - 1; l >= 0; l--)
|
|
1015
|
+
(s = e[l]) && (i = (o < 3 ? s(i) : o > 3 ? s(t, a, i) : s(t, a)) || i);
|
|
1016
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
1017
|
+
}, q = function(e, t) {
|
|
1018
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1019
|
+
return Reflect.metadata(e, t);
|
|
1020
|
+
};
|
|
1021
|
+
const le = class {
|
|
1022
|
+
constructor(e) {
|
|
1023
|
+
y(this, e), this.timeslotSelected = h(this, "timeslotSelected", 7), this.timeslotConfirmed = h(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (t, a) => {
|
|
1024
|
+
t.preventDefault(), d("[nylas-timeslot-picker] Confirm timeslot", a), this.timeslotConfirmed.emit(a);
|
|
1025
|
+
}, this.handleMouseEnter = (t) => {
|
|
1026
|
+
this.hoveredTimeslotIndex = t;
|
|
1027
|
+
}, this.handleMouseLeave = () => {
|
|
1028
|
+
this.hoveredTimeslotIndex = -1;
|
|
1029
|
+
}, this.selectedDate = /* @__PURE__ */ new Date(), this.availability = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
|
|
1030
|
+
}
|
|
1031
|
+
selectedLanguageChanged(e) {
|
|
1032
|
+
c.changeLanguage(e);
|
|
1033
|
+
}
|
|
1034
|
+
selectedDateChanged(e) {
|
|
1035
|
+
var t;
|
|
1036
|
+
if (d("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
|
|
1037
|
+
const a = (t = this.availability) == null ? void 0 : t.filter((r) => w(r.start_time, e)).map((r) => r);
|
|
1038
|
+
this.times = a || [];
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
availabilityChanged(e) {
|
|
1042
|
+
if (d("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
|
|
1043
|
+
const t = e == null ? void 0 : e.filter((a) => this.selectedDate && w(a.start_time, this.selectedDate)).map((a) => a);
|
|
1044
|
+
this.times = t || [];
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
connectedCallback() {
|
|
1048
|
+
}
|
|
1049
|
+
disconnectedCallback() {
|
|
1050
|
+
}
|
|
1051
|
+
async componentWillLoad() {
|
|
1052
|
+
var t;
|
|
1053
|
+
const e = (t = this.availability) == null ? void 0 : t.filter((a) => this.selectedDate && w(a.start_time, this.selectedDate)).map((a) => a);
|
|
1054
|
+
this.times = e || [], d("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
|
|
1055
|
+
}
|
|
1056
|
+
async componentDidLoad() {
|
|
1057
|
+
d("[nylas-timeslot-picker] Component did load");
|
|
1058
|
+
}
|
|
1059
|
+
getTimeslotId(e, t) {
|
|
1060
|
+
return `${e.toLocaleDateString()}-${t}`;
|
|
1061
|
+
}
|
|
1062
|
+
onClickSelectTime(e, t) {
|
|
1063
|
+
d("[nylas-timeslot-picker] Time selected", e, t), this.selectedTimeslotIndex = this.getTimeslotId(e.start_time, t), this.timeslotSelected.emit({
|
|
1064
|
+
start_time: e.start_time,
|
|
1065
|
+
end_time: e.end_time,
|
|
1066
|
+
emails: e.emails
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
getTimeSlotLabel(e) {
|
|
1070
|
+
const t = new Intl.DateTimeFormat("en-US", {
|
|
1071
|
+
hour: "2-digit",
|
|
1072
|
+
minute: "2-digit",
|
|
1073
|
+
timeZone: this.selectedTimezone
|
|
1074
|
+
});
|
|
1075
|
+
return `${t.format(e.start_time)} - ${t.format(e.end_time)}`;
|
|
1076
|
+
}
|
|
1077
|
+
render() {
|
|
1078
|
+
return this.isLoading ? n(g, null, n("div", { class: "loading" }, new Array(6).fill(0).map((e, t) => n("div", { class: "timeslot-skeleton", style: { animationDelay: `${t * 20}ms` } })))) : this.availability && this.availability.length === 0 ? n(g, null, n("div", { class: "empty" }, n("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? n(g, null, n("div", { class: "empty" }, n("span", null, "No time slots available for selected date"))) : this.selectedDate ? n(g, { part: "ntp" }, n("div", { class: "time-picker-wrapper" }, n("div", { class: "timeslots" }, this.times.map((e, t) => {
|
|
1079
|
+
var a, r, o, i;
|
|
1080
|
+
return n("button", { part: `ntp__timeslot ${((r = (a = this.selectedTimeslot) == null ? void 0 : a.start_time) == null ? void 0 : r.getTime()) === e.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, "aria-role": "button", class: {
|
|
1081
|
+
time: !0,
|
|
1082
|
+
selected: typeof this.selectedTimeslot < "u" && ((i = (o = this.selectedTimeslot) == null ? void 0 : o.start_time) == null ? void 0 : i.getTime()) === e.start_time.getTime()
|
|
1083
|
+
}, 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 }));
|
|
1084
|
+
})), this.selectedTimeslot && n("div", { class: "footer" }, n("button-component", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, n("slot", { name: "timeslot-picker-cta-label" }, c.t("nextButton")))))) : n(g, null);
|
|
1085
|
+
}
|
|
1086
|
+
static get watchers() {
|
|
1087
|
+
return {
|
|
1088
|
+
selectedLanguage: ["selectedLanguageChanged"],
|
|
1089
|
+
selectedDate: ["selectedDateChanged"],
|
|
1090
|
+
availability: ["availabilityChanged"]
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
Qe([
|
|
1095
|
+
C({
|
|
1096
|
+
name: "nylas-timeslot-picker",
|
|
1097
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
1098
|
+
["scheduler.selectedDate", "selectedDate"],
|
|
1099
|
+
["scheduler.availability", "availability"],
|
|
1100
|
+
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
1101
|
+
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
1102
|
+
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
1103
|
+
["scheduler.isLoading", "isLoading"]
|
|
1104
|
+
]),
|
|
1105
|
+
eventToProps: {
|
|
1106
|
+
timeslotSelected: async (e, t) => {
|
|
1107
|
+
d("nylas-timeslot-picker", "timeslotSelected", e.detail), t.scheduler.selectTime(e.detail);
|
|
1108
|
+
},
|
|
1109
|
+
timeslotConfirmed: async (e, t) => {
|
|
1110
|
+
d("nylas-timeslot-picker", "timeslotConfirmed", e.detail), e.detail && t.scheduler.toggleAdditionalData(!0);
|
|
1111
|
+
}
|
|
1112
|
+
},
|
|
1113
|
+
fireRegisterEvent: !0
|
|
1114
|
+
}),
|
|
1115
|
+
q("design:type", Function),
|
|
1116
|
+
q("design:paramtypes", []),
|
|
1117
|
+
q("design:returntype", void 0)
|
|
1118
|
+
], le.prototype, "render", null);
|
|
1119
|
+
le.style = Ke;
|
|
1120
|
+
export {
|
|
1121
|
+
K as nylas_booked_event_card,
|
|
1122
|
+
Q as nylas_booking_form,
|
|
1123
|
+
ee as nylas_cancel_booking_form,
|
|
1124
|
+
te as nylas_cancelled_event_card,
|
|
1125
|
+
ne as nylas_confirmed_event_card,
|
|
1126
|
+
ie as nylas_date_picker,
|
|
1127
|
+
oe as nylas_locale_switch,
|
|
1128
|
+
He as nylas_logo,
|
|
1129
|
+
Ze as nylas_notification,
|
|
1130
|
+
re as nylas_organizer_confirmation_card,
|
|
1131
|
+
se as nylas_selected_event_card,
|
|
1132
|
+
le as nylas_timeslot_picker
|
|
1133
|
+
};
|