@nylas/react 1.1.0-canary.23 → 1.1.0-canary.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_2.entry-4a6b44be.js +25 -0
- package/dist/add-circle-icon_2.entry-b0e8cb94.cjs +1 -0
- package/dist/{archive-icon_7.entry-3dcc4a66.js → archive-icon_7.entry-0d379e81.js} +14 -14
- package/dist/{archive-icon_7.entry-2ec9b077.cjs → archive-icon_7.entry-464293d2.cjs} +1 -1
- package/dist/{arrow-icon.entry-2cf3e94d.js → arrow-icon.entry-3c2e4e0d.js} +2 -2
- package/dist/{arrow-icon.entry-175e8181.cjs → arrow-icon.entry-4e6fe7be.cjs} +1 -1
- package/dist/{bold-icon_3.entry-9fc74a39.js → bold-icon_3.entry-5f0eedfe.js} +4 -4
- package/dist/{bold-icon_3.entry-a3e61ad8.cjs → bold-icon_3.entry-ba65ceeb.cjs} +1 -1
- package/dist/button-component_2.entry-1290a222.js +26 -0
- package/dist/button-component_2.entry-ae5e68ec.cjs +1 -0
- package/dist/{calendar-agenda-fill-icon_39.entry-493e91f6.js → calendar-agenda-fill-icon_48.entry-4ae8cc76.js} +1966 -1396
- package/dist/calendar-agenda-fill-icon_48.entry-eaa36515.cjs +7 -0
- package/dist/{calendar-cancel-icon.entry-c9c7e3b3.cjs → calendar-cancel-icon.entry-6506440a.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-3ca731f9.js → calendar-cancel-icon.entry-d2f0c9e0.js} +4 -4
- package/dist/{calendar-check-icon_2.entry-5b8f8a75.cjs → calendar-check-icon_2.entry-0f70758f.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-7c409a91.js → calendar-check-icon_2.entry-5212c5b3.js} +9 -9
- package/dist/{calendar-icon.entry-0589697f.js → calendar-icon.entry-b7626be4.js} +7 -7
- package/dist/{calendar-icon.entry-acd00f6f.cjs → calendar-icon.entry-f10bd734.cjs} +1 -1
- package/dist/{checkbox-component_2.entry-538fd8ec.js → checkbox-component_2.entry-7ce6d945.js} +3 -3
- package/dist/{checkbox-component_2.entry-0aa252b9.cjs → checkbox-component_2.entry-879250a5.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-80e03257.js → chevron-icon_3.entry-8c9ca484.js} +14 -14
- package/dist/{chevron-icon_3.entry-7076e105.cjs → chevron-icon_3.entry-a2f9e9ba.cjs} +1 -1
- package/dist/{clock-icon_4.entry-db3fbda1.js → clock-icon_4.entry-3d9d8690.js} +16 -16
- package/dist/{clock-icon_4.entry-d6901afd.cjs → clock-icon_4.entry-7ecb071a.cjs} +1 -1
- package/dist/{constants-12bd3c98-26c75011.js → constants-50c3e067-8cc8e601.js} +618 -605
- package/dist/{constants-12bd3c98-22fd56f2.cjs → constants-50c3e067-da2d4786.cjs} +5 -5
- package/dist/copy-icon.entry-0a80a55e.cjs +1 -0
- package/dist/copy-icon.entry-38cfea6b.js +15 -0
- package/dist/delete-icon_2.entry-9e7cf99e.cjs +1 -0
- package/dist/delete-icon_2.entry-f9a43051.js +25 -0
- package/dist/{document-refresh-icon.entry-a3326831.cjs → document-refresh-icon.entry-5d6c4a99.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-149f2a3b.js → document-refresh-icon.entry-827975fd.js} +5 -5
- package/dist/elements/index.d.ts +9 -1
- package/dist/{elements-dc5b338e-e07600d4.js → elements-dc5b338e-0f8b5d33.js} +1 -1
- package/dist/{elements-dc5b338e-211879a3.cjs → elements-dc5b338e-3a7e1134.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-cb97634f.cjs → focus-visible-e8093c16-088a527d.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-284cefe0.js → focus-visible-e8093c16-40f0c20e.js} +1 -1
- package/dist/{forward-icon_6.entry-751fdd4e.cjs → forward-icon_6.entry-a8f80871.cjs} +3 -3
- package/dist/{forward-icon_6.entry-554b0722.js → forward-icon_6.entry-f984a68b.js} +9 -9
- package/dist/{globe-icon.entry-e3dd58bc.js → globe-icon.entry-a78c8ea8.js} +5 -5
- package/dist/{globe-icon.entry-63eb510d.cjs → globe-icon.entry-c50fc96c.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-14d75c66.cjs +1 -0
- package/dist/google-logo-icon_4.entry-710632b6.js +680 -0
- package/dist/index-53420959-78cc8138.cjs +1 -0
- package/dist/index-53420959-da9158f8.js +5 -0
- package/dist/{index-6d9eeb53-cc42c6f1.js → index-6d9eeb53-407c797a.js} +2 -2
- package/dist/{index-6d9eeb53-81e5b798.cjs → index-6d9eeb53-cac6eaea.cjs} +1 -1
- package/dist/index-a3051853.cjs +42 -0
- package/dist/index-eca7f3e2.js +7859 -0
- package/dist/{index.es-5355a265-f8853ce4.js → index.es-17b386f4-856af8bb.js} +1 -1
- package/dist/{index.es-5355a265-e701a627.cjs → index.es-17b386f4-c6a8cc2a.cjs} +1 -1
- package/dist/{info-icon_2.entry-9559cf3b.cjs → info-icon_2.entry-c08c459c.cjs} +1 -1
- package/dist/{info-icon_2.entry-3b349f01.js → info-icon_2.entry-ffd39ba3.js} +5 -5
- package/dist/input-component.entry-35e6e399.cjs +1 -0
- package/dist/input-component.entry-c09124d3.js +65 -0
- package/dist/{input-dropdown.entry-9bc68630.js → input-dropdown.entry-83f2c378.js} +8 -6
- package/dist/input-dropdown.entry-9ac3e157.cjs +1 -0
- package/dist/{mailbox-store-31d55036-c8618c0b.cjs → mailbox-store-2e401c7f-66a87143.cjs} +1 -1
- package/dist/{mailbox-store-31d55036-1106efe2.js → mailbox-store-2e401c7f-9d607fd1.js} +2 -2
- package/dist/{multi-select-dropdown.entry-36074a81.js → multi-select-dropdown.entry-2c2125e3.js} +2 -2
- package/dist/{multi-select-dropdown.entry-e5ed9285.cjs → multi-select-dropdown.entry-8710acb4.cjs} +1 -1
- package/dist/nylas-booked-event-card_12.entry-009a11e3.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-5821b0c4.js +1134 -0
- package/dist/{nylas-form-card.entry-6e45c873.js → nylas-form-card.entry-0ce9dd7d.js} +18 -18
- package/dist/{nylas-form-card.entry-03a31218.cjs → nylas-form-card.entry-951163a1.cjs} +1 -1
- package/dist/{nylas-if-state.entry-61d7ebc5.cjs → nylas-if-state.entry-16aabbff.cjs} +1 -1
- package/dist/{nylas-if-state.entry-092f4e1a.js → nylas-if-state.entry-474cfdcd.js} +3 -3
- package/dist/{nylas-list-folders.entry-ab9e1c2c.js → nylas-list-folders.entry-a9e53520.js} +7 -7
- package/dist/{nylas-list-folders.entry-1abbb401.cjs → nylas-list-folders.entry-f0a4d566.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-2faaa2bb.js → nylas-list-threads.entry-5af74949.js} +3 -3
- package/dist/{nylas-list-threads.entry-dfc87aca.cjs → nylas-list-threads.entry-7fc8b71d.cjs} +1 -1
- package/dist/{nylas-login.entry-243ae09e.js → nylas-login.entry-acbdf23c.js} +7 -7
- package/dist/{nylas-login.entry-d1cac0a1.cjs → nylas-login.entry-d0fcf7c4.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-b8225a3e.js → nylas-mailbox-pagination.entry-01f32d0c.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-c27af71c.cjs → nylas-mailbox-pagination.entry-a70e4777.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-b66d597d.cjs → nylas-mailbox-toolbar-button.entry-208b2667.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-22347d22.js → nylas-mailbox-toolbar-button.entry-a8166cf0.js} +3 -3
- package/dist/{nylas-mailbox.entry-cb80f58c.cjs → nylas-mailbox.entry-7a3562b6.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-9e6e1b4d.js → nylas-mailbox.entry-bbd33bb0.js} +6 -6
- package/dist/{nylas-provider.entry-196dd5da.js → nylas-provider.entry-7e8aedea.js} +39 -39
- package/dist/{nylas-provider.entry-28c12448.cjs → nylas-provider.entry-9cce7730.cjs} +1 -1
- package/dist/{nylas-reminder-emails.entry-47ef5a9d.cjs → nylas-reminder-emails.entry-287316b6.cjs} +2 -2
- package/dist/{nylas-reminder-emails.entry-b655d888.js → nylas-reminder-emails.entry-a1b49b18.js} +9 -9
- package/dist/{nylas-reminder-time_2.entry-0f3747fb.cjs → nylas-reminder-time_2.entry-0a480ab7.cjs} +1 -1
- package/dist/{nylas-reminder-time_2.entry-9d8f7436.js → nylas-reminder-time_2.entry-6f6067f9.js} +6 -6
- package/dist/{nylas-scheduler-editor.entry-feb7a7db.js → nylas-scheduler-editor.entry-625d597e.js} +63 -45
- package/dist/{nylas-scheduler-editor.entry-504e8ed3.cjs → nylas-scheduler-editor.entry-6be8e9c6.cjs} +2 -2
- package/dist/nylas-scheduling.entry-1678be21.cjs +1 -0
- package/dist/nylas-scheduling.entry-fa471c9e.js +340 -0
- package/dist/{nylas-threads-refresh.entry-e637161b.cjs → nylas-threads-refresh.entry-77015d63.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-91af9af3.js → nylas-threads-refresh.entry-da68039b.js} +11 -11
- package/dist/{nylas-threads-search.entry-5457dcec.js → nylas-threads-search.entry-27472aef.js} +4 -4
- package/dist/{nylas-threads-search.entry-b944f95a.cjs → nylas-threads-search.entry-8f765c67.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-134ef726.cjs → nylas-time-window-picker.entry-a59d7be6.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-a6fd216b.js → nylas-time-window-picker.entry-e8842700.js} +10 -10
- package/dist/{nylas-view-thread.entry-9296a505.cjs → nylas-view-thread.entry-16cc4066.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-6fdd6cb1.js → nylas-view-thread.entry-322a9890.js} +3 -3
- package/dist/{person-icon.entry-4a695727.js → person-icon.entry-b62da62d.js} +4 -4
- package/dist/{person-icon.entry-1cdb4dc2.cjs → person-icon.entry-fd56c344.cjs} +1 -1
- package/dist/{play-icon_2.entry-fb013b17.js → play-icon_2.entry-d0a67f7b.js} +7 -7
- package/dist/play-icon_2.entry-d17c9937.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +108 -100
- package/dist/{refresh-icon.entry-9dbb04ba.cjs → refresh-icon.entry-5427ec8d.cjs} +1 -1
- package/dist/{refresh-icon.entry-46c92605.js → refresh-icon.entry-99d7fbcb.js} +4 -4
- package/dist/{register-component-592986c5-d5d210a8.js → register-component-4487ac6f-4b0c1c53.js} +1 -1
- package/dist/{register-component-592986c5-5edf5835.cjs → register-component-4487ac6f-b29bf135.cjs} +1 -1
- package/dist/scheduler-config-store-2a3b403d-51c51cff.cjs +1 -0
- package/dist/{scheduler-config-store-9ccfba4d-b08031b5.js → scheduler-config-store-2a3b403d-810ef774.js} +5 -4
- package/dist/scheduler-store-55107657-25845a8b.cjs +1 -0
- package/dist/{scheduler-store-fd0d11a5-313e8592.js → scheduler-store-55107657-6c0c5de4.js} +179 -132
- package/dist/{textarea-component.entry-788eb37a.cjs → textarea-component.entry-8bdfbcc9.cjs} +1 -1
- package/dist/{textarea-component.entry-0cd3b57f.js → textarea-component.entry-9803d3c3.js} +4 -4
- package/dist/{time-period-selector.entry-112c0b64.js → time-period-selector.entry-a6c6aefd.js} +41 -41
- package/dist/time-period-selector.entry-d7792301.cjs +1 -0
- package/dist/{translate-icon.entry-c701b391.cjs → translate-icon.entry-4970d886.cjs} +1 -1
- package/dist/{translate-icon.entry-a4df3c16.js → translate-icon.entry-d65cfcea.js} +6 -6
- package/dist/{warning-icon.entry-bda0aafa.cjs → warning-icon.entry-870059cb.cjs} +1 -1
- package/dist/{warning-icon.entry-d1703715.js → warning-icon.entry-eb7da408.js} +5 -5
- package/package.json +3 -3
- package/dist/add-circle-icon_3.entry-37a88ff3.js +0 -79
- package/dist/add-circle-icon_3.entry-4f8f1cbf.cjs +0 -1
- package/dist/button-component.entry-7fdb3bca.cjs +0 -1
- package/dist/button-component.entry-861637f2.js +0 -16
- package/dist/calendar-agenda-fill-icon_39.entry-3c21a3ec.cjs +0 -7
- package/dist/checkmark-icon.entry-0a184b31.cjs +0 -1
- package/dist/checkmark-icon.entry-56302db0.js +0 -15
- package/dist/copy-icon_3.entry-33e89a37.cjs +0 -1
- package/dist/copy-icon_3.entry-9670b9f9.js +0 -35
- package/dist/google-logo-icon_5.entry-bccce7f4.cjs +0 -1
- package/dist/google-logo-icon_5.entry-e462e091.js +0 -748
- package/dist/index-53420959-02fe58ef.js +0 -5
- package/dist/index-53420959-0b9c205e.cjs +0 -1
- package/dist/index-8a536089.cjs +0 -42
- package/dist/index-a15916e5.js +0 -7653
- package/dist/input-dropdown.entry-d454f6bc.cjs +0 -1
- package/dist/loading-icon.entry-1d49e471.js +0 -15
- package/dist/loading-icon.entry-a68da48b.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-38d2fd2e.js +0 -954
- package/dist/nylas-booked-event-card_10.entry-e530a8db.cjs +0 -1
- package/dist/nylas-booking-confirmation-type.entry-2fea82f9.js +0 -106
- package/dist/nylas-booking-confirmation-type.entry-5857a863.cjs +0 -1
- package/dist/nylas-scheduling.entry-8c8f8e35.cjs +0 -1
- package/dist/nylas-scheduling.entry-d35efa9a.js +0 -286
- package/dist/play-icon_2.entry-10fd617e.cjs +0 -1
- package/dist/scheduler-config-store-9ccfba4d-3ec35859.cjs +0 -1
- package/dist/scheduler-store-fd0d11a5-b180b3b7.cjs +0 -1
- package/dist/time-period-selector.entry-1e0b720b.cjs +0 -1
|
@@ -1,954 +0,0 @@
|
|
|
1
|
-
import { r as v, c as u, d, h as a, k as l, n as Y, H as g, g as X, m as W, C as re, D as le, E as C, G as ce, I as de, J as B, F as fe } from "./index-a15916e5.js";
|
|
2
|
-
import { R as w } from "./register-component-592986c5-d5d210a8.js";
|
|
3
|
-
import { T as E, L as J, g as be, a as U } from "./constants-12bd3c98-26c75011.js";
|
|
4
|
-
import { s as S } from "./index-6d9eeb53-cc42c6f1.js";
|
|
5
|
-
import "./index-53420959-02fe58ef.js";
|
|
6
|
-
import "react";
|
|
7
|
-
import "react-dom";
|
|
8
|
-
const he = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 4rem;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:16px;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;padding:8px;font-family:var(--nylas-font-family);font-weight:600;height:48px;line-height:24px}sp-button.cancel{color:var(--nylas-error)}sp-button.cancel:hover,sp-button.cancel:focus{border-color:var(--nylas-error)}sp-button.cancel:active{color:var(--nylas-error-pressed);border-color:var(--nylas-error-pressed)}sp-button.reschedule:hover,sp-button.reschedule:focus{border-color:var(--nylas-primary)}sp-button.reschedule:active{border-color:var(--nylas-base-600)}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}', ue = he;
|
|
9
|
-
var me = function(e, t, i, o) {
|
|
10
|
-
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
11
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
12
|
-
n = Reflect.decorate(e, t, i, o);
|
|
13
|
-
else
|
|
14
|
-
for (var c = e.length - 1; c >= 0; c--)
|
|
15
|
-
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
16
|
-
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
17
|
-
}, z = function(e, t) {
|
|
18
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
19
|
-
return Reflect.metadata(e, t);
|
|
20
|
-
};
|
|
21
|
-
const K = class {
|
|
22
|
-
constructor(e) {
|
|
23
|
-
v(this, e), this.cancelBookingButtonClicked = u(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = u(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = u(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = u(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
|
|
24
|
-
var s, n;
|
|
25
|
-
const t = new Date(this.selectedTimeslot.start_time), i = (n = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : n.min_cancellation_notice;
|
|
26
|
-
t.getTime() - i * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime() ? this.cancelBookedEventValidationError.emit({
|
|
27
|
-
error: {
|
|
28
|
-
title: "Cancellation Error",
|
|
29
|
-
message: `You cannot cancel the booking within ${i} minutes of the event.`
|
|
30
|
-
}
|
|
31
|
-
}) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
|
|
32
|
-
}, this.handleRescheduleButtonClicked = () => {
|
|
33
|
-
const t = (i) => {
|
|
34
|
-
this.rescheduleBookedEventError.emit(i);
|
|
35
|
-
};
|
|
36
|
-
this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: t });
|
|
37
|
-
}, this.getOrganizer = (t) => t == null ? void 0 : t.organizer, this.getPaticipantType = (t) => {
|
|
38
|
-
switch (t) {
|
|
39
|
-
case "host":
|
|
40
|
-
return "Host";
|
|
41
|
-
case "you":
|
|
42
|
-
return "You";
|
|
43
|
-
default:
|
|
44
|
-
return "";
|
|
45
|
-
}
|
|
46
|
-
}, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.configSettings = void 0, this.isLoading = void 0, this.selectedLanguage = navigator.language;
|
|
47
|
-
}
|
|
48
|
-
connectedCallback() {
|
|
49
|
-
}
|
|
50
|
-
disconnectedCallback() {
|
|
51
|
-
}
|
|
52
|
-
async componentWillLoad() {
|
|
53
|
-
d("[nylas-booked-event-card] Component will load");
|
|
54
|
-
}
|
|
55
|
-
async componentDidLoad() {
|
|
56
|
-
d("[nylas-booked-event-card] Component did load"), this.eventInfo || console.warn('[nylas-booked-event-card] "eventInfo" prop missing. Please provide the event info to display the event details in the booked event card component.'), this.bookingInfo || console.warn('[nylas-booked-event-card] "bookingInfo" prop missing. Please provide the booking info to display the guest details in the booked event card component.');
|
|
57
|
-
}
|
|
58
|
-
render() {
|
|
59
|
-
var e, t, i, o, s, n, r, c, m, b, f, p, h, x, k, y, _, q, A, Z, G, V;
|
|
60
|
-
return a(g, { key: "58765b8d8fb8630b0893d6c6e86fd87745885e4b", part: "nbec" }, a("sp-theme", { key: "c7086efdc3ad76d17ab76c21acdd7b8fcf6841d3", theme: "spectrum", color: "dark", scale: "medium" }, a("div", { key: "dbcd53b07cbedc5ec351febea9f6f0d795319e73", class: "booked-event-timezone" }, a("globe-icon", { key: "869433a367eedb9c80f8a4787e16473e96a5286a" }), E[this.selectedTimezone]), a("div", { key: "98daca2ef441eee475178a7e59d193dde4caa189", class: "event-card-wrapper", part: "nbec__card" }, a("div", { key: "6e9758b8fcc0e281dca625c6693e245d420fdcc6", class: "calendar-icon" }, a("calendar-check-icon", { key: "8aa83e62a30306cc86ae234147d8c6eb680ef61c" })), a("div", { key: "8e9f3395b241755c0264611d363f0d639370f6de", class: "booked-event-header" }, a("h2", { key: "0eff7c4489ea882b89575b95e4626e0f2bcf9487", slot: "card-title", part: "nbec__title" }, this.rescheduleBookingId && !this.isLoading ? `${l.t("bookingRescheduled")}` : `${l.t("bookingConfirmed")}`, "!"), a("div", { key: "c839174adae518ef5f036a3e29e82860714113d1", part: "nbec__description" }, ((e = this.getOrganizer(this.eventInfo)) == null ? void 0 : e.name) || ((t = this.getOrganizer(this.eventInfo)) == null ? void 0 : t.email), " & ", ((o = (i = this.bookingInfo) == null ? void 0 : i.primaryParticipant) == null ? void 0 : o.name) || ((n = (s = this.bookingInfo) == null ? void 0 : s.primaryParticipant) == null ? void 0 : n.email))), a("sp-divider", { key: "8257b8c3f930b385f007962d3318d6aa77399489" }), a("div", { key: "9f13c453b1c981108299708db70ebec0be7d58cc", class: "booking-date-time" }, a("checkmark-circle-icon", { key: "9c51212fc00559af74215b88ae4b6c2ad6902ce5" }), a("h3", { key: "a52656d258ee10cf85b61b9fbe9b469482ff9cef" }, l.t("bookingDateAndTimeHeader")), a("p", { key: "3791d36b2d1ef8568e0b87d5b8d64548a40537fe" }, (r = this.selectedTimeslot) != null && r.start_time ? Y(new Date((c = this.selectedTimeslot) == null ? void 0 : c.start_time).toLocaleDateString(J[this.selectedLanguage], { dateStyle: "full" })) : "-", " ", a("br", { key: "15e586a111f8fa6d812a17d04fb9a6ce0ca84f19" }), new Date((m = this.selectedTimeslot) == null ? void 0 : m.start_time).toLocaleTimeString(void 0, { timeStyle: "short" }), " -", " ", new Date((b = this.selectedTimeslot) == null ? void 0 : b.end_time).toLocaleTimeString(void 0, { timeStyle: "short" }))), a("div", { key: "ab4f73ea904bae1978b9f6bcef5048a3f3625e9e", class: "booking-participants" }), a("sp-divider", { key: "d7de8473998bd24742533951e13a5d1893b06758" }), a("div", { key: "ad81fbb94ee37b773dfed28ac91afc2c7b099fe8", class: {
|
|
61
|
-
footer: !0,
|
|
62
|
-
"no-footer": ((p = (f = this.configSettings) == null ? void 0 : f.scheduler) == null ? void 0 : p.hide_cancellation_options) && ((x = (h = this.configSettings) == null ? void 0 : h.scheduler) == null ? void 0 : x.hide_rescheduling_options),
|
|
63
|
-
"no-template-cols": ((y = (k = this.configSettings) == null ? void 0 : k.scheduler) == null ? void 0 : y.hide_cancellation_options) || ((q = (_ = this.configSettings) == null ? void 0 : _.scheduler) == null ? void 0 : q.hide_rescheduling_options)
|
|
64
|
-
} }, !((Z = (A = this.configSettings) == null ? void 0 : A.scheduler) != null && Z.hide_cancellation_options) && a("sp-button", { variant: "secondary", treatment: "outline", class: "cancel", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, `${l.t("cancelBookingButton")}`), !((V = (G = this.configSettings) == null ? void 0 : G.scheduler) != null && V.hide_rescheduling_options) && a("sp-button", { variant: "secondary", treatment: "outline", class: "reschedule", onClick: this.handleRescheduleButtonClicked, part: "nbec__button-outline nbec__reschedule-cta" }, `${l.t("rescheduleBookingButton")}`)))));
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
me([
|
|
68
|
-
w({
|
|
69
|
-
name: "nylas-booked-event-card",
|
|
70
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
71
|
-
["scheduler.bookingInfo", "bookingInfo"],
|
|
72
|
-
["scheduler.rescheduleBookingId", "rescheduleBookingId"],
|
|
73
|
-
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
74
|
-
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
75
|
-
["scheduler.isLoading", "isLoading"],
|
|
76
|
-
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
77
|
-
["scheduler.configSettings", "configSettings"]
|
|
78
|
-
]),
|
|
79
|
-
eventToProps: {
|
|
80
|
-
cancelBookingButtonClicked: async (e, t) => {
|
|
81
|
-
t.scheduler.setCancel(e.detail.bookingId);
|
|
82
|
-
},
|
|
83
|
-
rescheduleButtonClicked: async (e, t) => {
|
|
84
|
-
const i = await t.scheduler.setReschedule(e.detail.bookingId), { errorHandler: o } = e.detail;
|
|
85
|
-
o && (!i || "error" in i) && o(i);
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
fireRegisterEvent: !0
|
|
89
|
-
}),
|
|
90
|
-
z("design:type", Function),
|
|
91
|
-
z("design:paramtypes", []),
|
|
92
|
-
z("design:returntype", void 0)
|
|
93
|
-
], K.prototype, "render", null);
|
|
94
|
-
K.style = ue;
|
|
95
|
-
const pe = ':host{display:block;height:100%;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}sp-textfield{--spectrum-corner-radius-100:var(--nylas-border-radius-2x);--spectrum-textfield-border-color:var(--nylas-base-300);position:relative;width:100%;height:48px;margin-bottom:16px;color:var(--nylas-base-500)}.cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{flex-direction:column-reverse}}sp-button{background-color:transparent;color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);--button-width:50%;font-family:var(--nylas-font-family);font-size:16px;font-weight:600;border:none;height:48px;padding:14px}@media screen and (max-width: 768px){sp-button{--button-width:100%}}sp-button:hover,sp-button:focus{background-color:var(--nylas-base-100);color:var(--nylas-primary);border-radius:var(--nylas-border-radius-2x)}sp-button:active{background-color:var(--nylas-base-200);color:var(--nylas-base-800)}sp-button.back{width:var(--button-width);background-color:transparent;color:var(--nylas-base-700);outline:1px solid var(--nylas-base-300)}sp-button.back:hover,sp-button.back:focus{outline-color:var(--nylas-primary)}sp-button.back:active{outline:2px solid var(--nylas-base-600)}sp-button.book{width:var(--button-width);background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.book:hover,sp-button.book:focus{background-color:var(--nylas-base-600)}sp-button.book:active{background-color:var(--nylas-base-800)}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family);font-size:16px}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}.button-content{display:flex;gap:4px;align-items:center}sp-infield-button{--spectrum-infield-button-background-color:transparent;--spectrum-infield-button-background-color-hover:transparent;--spectrum-infield-button-background-color-active:transparent;--spectrum-infield-button-border-color:transparent;--spectrum-infield-button-border-width:1px;--spectrum-infield-button-border-radius:0;color:var(--nylas-base-600);background:transparent;border:none;outline:1px solid var(--nylas-base-300);border-radius:0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x) 0;height:52px;width:52px;display:flex;position:absolute;right:0;align-items:center;justify-content:center;cursor:pointer}sp-infield-button sp-icon-cross300{color:var(--nylas-base-600)}sp-infield-button.error{border-width:2px;border-color:var(--nylas-error)}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%}input[type=text]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}button-component.remove-guest{position:absolute;height:51px;right:0}button-component.remove-guest.error button{border-color:var(--nylas-error)}button-component.remove-guest button{height:inherit;border-top-left-radius:initial;border-bottom-left-radius:initial;border:none !important;border-left:1px solid var(--nylas-base-300) !important}button-component.remove-guest button:hover,button-component.remove-guest button:focus{outline:1px solid var(--nylas-primary) !important;color:var(--nylas-primary)}.guest-email-input{position:relative;display:flex;width:100%}', ye = pe;
|
|
96
|
-
var ge = function(e, t, i, o) {
|
|
97
|
-
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
98
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
99
|
-
n = Reflect.decorate(e, t, i, o);
|
|
100
|
-
else
|
|
101
|
-
for (var c = e.length - 1; c >= 0; c--)
|
|
102
|
-
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
103
|
-
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
104
|
-
}, I = function(e, t) {
|
|
105
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
106
|
-
return Reflect.metadata(e, t);
|
|
107
|
-
};
|
|
108
|
-
const T = /^[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 {
|
|
109
|
-
constructor(e) {
|
|
110
|
-
v(this, e), this.nameChanged = u(this, "nameChanged", 7), this.emailChanged = u(this, "emailChanged", 7), this.backButtonClicked = u(this, "backButtonClicked", 7), this.detailsConfirmed = u(this, "detailsConfirmed", 7), this.bookingFormError = u(this, "bookingFormError", 7), this.bookingFormSubmitted = u(this, "bookingFormSubmitted", 7), this.handleGuestChange = (t, i) => {
|
|
111
|
-
this.resetGuestEmailError(t);
|
|
112
|
-
const o = [...this.guestEmails];
|
|
113
|
-
o[t] = S(i), this.guestEmails = [...o];
|
|
114
|
-
}, this.handleGuestBlur = (t, i) => {
|
|
115
|
-
if (this.resetGuestEmailError(t), i === "") {
|
|
116
|
-
this.guestEmailErrors[t] = l.t("fieldRequired", { field: l.t("email") });
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
if (!T.test(i)) {
|
|
120
|
-
this.guestEmailErrors[t] = l.t("invalidInputFormat", { field: l.t("email") });
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
this.handleGuestChange(t, i);
|
|
124
|
-
}, this.addGuestButtonClickedHandler = (t) => {
|
|
125
|
-
t.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
|
|
126
|
-
}, this.removeGuestButtonClickHandler = (t, i) => {
|
|
127
|
-
t.preventDefault(), this.resetGuestEmailError(i);
|
|
128
|
-
const o = [...this.guestEmails];
|
|
129
|
-
o.splice(i, 1), this.guestEmails = [...o];
|
|
130
|
-
}, this.handleBackButtonClicked = () => {
|
|
131
|
-
this.backButtonClicked.emit();
|
|
132
|
-
}, this.bookButtonClickedHandler = async (t) => {
|
|
133
|
-
var c, m, b, f, p, h, x;
|
|
134
|
-
if (t.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
|
|
135
|
-
return;
|
|
136
|
-
d("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
|
|
137
|
-
const o = this.name || ((m = (c = this.bookingInfo) == null ? void 0 : c.primaryParticipant) == null ? void 0 : m.name), s = this.email || ((f = (b = this.bookingInfo) == null ? void 0 : b.primaryParticipant) == null ? void 0 : f.email);
|
|
138
|
-
if (!o || o === "") {
|
|
139
|
-
this.isNameValid = !1, this.validationError.name = l.t("fieldRequired", { field: l.t("name") }) || "Name is required", this.bookingFormError.emit({
|
|
140
|
-
title: "Booking form error",
|
|
141
|
-
description: "Name is required"
|
|
142
|
-
});
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
if (!s || s === "") {
|
|
146
|
-
this.isEmailValid = !1, this.validationError.email = l.t("fieldRequired", { field: l.t("email") }) || "Email is required", this.bookingFormError.emit({
|
|
147
|
-
title: "Booking form error",
|
|
148
|
-
description: "Email is required"
|
|
149
|
-
});
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
if (!T.test(s)) {
|
|
153
|
-
this.isEmailValid = !1, this.validationError.email = l.t("invalidInputFormat", { field: l.t("email") }), this.bookingFormError.emit({
|
|
154
|
-
title: "Booking form error",
|
|
155
|
-
description: l.t("invalidInputFormat", { field: l.t("email") }) || "Invalid email"
|
|
156
|
-
});
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
let n = [];
|
|
160
|
-
if (this.guestEmails.length > 0) {
|
|
161
|
-
let k = !1;
|
|
162
|
-
if (this.guestEmails.forEach((y, _) => {
|
|
163
|
-
y === "" ? (k = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [_]: l.t("fieldRequired", { field: l.t("email") }) }) : T.test(y) || (k = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [_]: l.t("invalidInputFormat", { field: l.t("email") }) });
|
|
164
|
-
}), k) {
|
|
165
|
-
this.bookingFormError.emit({
|
|
166
|
-
title: "Booking form error",
|
|
167
|
-
description: l.t("invalidInputFormat", { field: l.t("guestEmail") }) || "Invalid guest email"
|
|
168
|
-
});
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
n = this.guestEmails.map((y) => ({ name: y.trim(), email: y.trim() }));
|
|
172
|
-
} else
|
|
173
|
-
(p = this.bookingInfo) != null && p.guests && (n = (h = this.bookingInfo) == null ? void 0 : h.guests);
|
|
174
|
-
const r = ((x = this.bookingInfo) == null ? void 0 : x.additionalFields) || [];
|
|
175
|
-
this.detailsConfirmed.emit({
|
|
176
|
-
primaryParticipant: {
|
|
177
|
-
name: o,
|
|
178
|
-
email: s
|
|
179
|
-
},
|
|
180
|
-
guests: n,
|
|
181
|
-
additionalFields: { ...r, ...this.additionalFields }
|
|
182
|
-
});
|
|
183
|
-
}, this.updateAdditionalFields = (t, i) => {
|
|
184
|
-
this.additionalFields && (this.additionalFields[t] = i);
|
|
185
|
-
}, 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: "" };
|
|
186
|
-
}
|
|
187
|
-
connectedCallback() {
|
|
188
|
-
}
|
|
189
|
-
disconnectedCallback() {
|
|
190
|
-
}
|
|
191
|
-
componentWillLoad() {
|
|
192
|
-
var e, t, i;
|
|
193
|
-
d("nylas-booking-form", "componentWillLoad", this.bookingInfo), this.bookingInfo && ((e = this.bookingInfo) != null && e.primaryParticipant) && (this.name = (t = this.bookingInfo.primaryParticipant) == null ? void 0 : t.name, this.email = (i = this.bookingInfo.primaryParticipant) == null ? void 0 : i.email);
|
|
194
|
-
}
|
|
195
|
-
bookingInfoChangedHandler(e) {
|
|
196
|
-
e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
|
|
197
|
-
}
|
|
198
|
-
changeName(e) {
|
|
199
|
-
this.isNameValid = !0, this.validationError.name = "", this.name = S(e), this.nameChanged.emit(e);
|
|
200
|
-
}
|
|
201
|
-
changeEmail(e) {
|
|
202
|
-
this.isEmailValid = !0, this.validationError.email = "", this.email = S(e), this.emailChanged.emit(e);
|
|
203
|
-
}
|
|
204
|
-
resetGuestEmailError(e) {
|
|
205
|
-
const t = { ...this.guestEmailErrors };
|
|
206
|
-
delete t[e], this.guestEmailErrors = { ...t };
|
|
207
|
-
}
|
|
208
|
-
nylasFormInputChangedHandler(e) {
|
|
209
|
-
switch (e.detail.name) {
|
|
210
|
-
case "name":
|
|
211
|
-
this.changeName(e.detail.value);
|
|
212
|
-
break;
|
|
213
|
-
case "email":
|
|
214
|
-
this.changeEmail(e.detail.value);
|
|
215
|
-
break;
|
|
216
|
-
default:
|
|
217
|
-
if (e.detail.error) {
|
|
218
|
-
this.bookingFormError.emit({
|
|
219
|
-
title: "Booking form error",
|
|
220
|
-
description: e.detail.error
|
|
221
|
-
});
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
225
|
-
break;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
selectOptionChangedHandler(e) {
|
|
229
|
-
if (e.detail.error) {
|
|
230
|
-
this.bookingFormError.emit({
|
|
231
|
-
title: "Booking form error",
|
|
232
|
-
description: e.detail.error
|
|
233
|
-
});
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
237
|
-
}
|
|
238
|
-
switchToggledHandler(e) {
|
|
239
|
-
this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
|
|
240
|
-
}
|
|
241
|
-
checkboxToggledHandler(e) {
|
|
242
|
-
this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
|
|
243
|
-
}
|
|
244
|
-
radioChangedHandler(e) {
|
|
245
|
-
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
246
|
-
}
|
|
247
|
-
render() {
|
|
248
|
-
var e, t, i, o, s, n, r, c, m;
|
|
249
|
-
return a(g, { key: "b0a70e2fb2f18f7b0efe6bfd108a35853fb67650" }, a("form", { key: "d6d6a14a31cc30fa4a4b3d51d736f9eb553c816f", onSubmit: (b) => this.bookButtonClickedHandler(b), noValidate: !0 }, a("div", { key: "02817a951387617334d00d4abd9170c487ba4a25", class: "nylas-booking-form" }, a("div", { key: "d449e95ce86e9a52f824d2d4281ec7675a21e435", class: "input-wrapper" }, a("input-component", { key: "db0e3c648a573ef41960cbf474d496c21387d22f", label: l.t("name"), name: "name", id: "name", defaultValue: ((t = (e = this.bookingInfo) == null ? void 0 : e.primaryParticipant) == null ? void 0 : t.name) || this.name, placeholder: l.t("namePlaceholder"), type: "text", required: !0, requiredError: l.t("fieldRequired", { field: l.t("name") }), patternError: l.t("invalidInputFormat", { field: l.t("name") }), part: "nbf__input-textfield" })), a("div", { key: "9807c067e59c1e857c4387b450fa657393b6998e", class: "input-wrapper" }, a("input-component", { key: "e09833f14be65cccdfb81614234a37a4a2d8d498", label: l.t("email"), name: "email", id: "email", pattern: T, defaultValue: ((o = (i = this.bookingInfo) == null ? void 0 : i.primaryParticipant) == null ? void 0 : o.email) || this.email, placeholder: l.t("emailPlaceholder"), type: "email", required: !0, requiredError: l.t("fieldRequired", { field: l.t("email") }), patternError: l.t("invalidInputFormat", { field: l.t("email") }), part: "nbf__input-textfield" })), ((n = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : n.hide_additional_guests) !== !0 && a("div", { class: "input-wrapper" }, this.guestEmails.map((b, f) => a("div", { class: "input-wrapper button-wrapper" }, a("label", { class: {
|
|
250
|
-
error: !!this.guestEmailErrors[f]
|
|
251
|
-
} }, l.t("guestEmail")), a("div", { class: "guest-email-input" }, a("input", { type: "email", id: `guest-email-${f}`, maxLength: 100, class: {
|
|
252
|
-
"guest-email": !0,
|
|
253
|
-
error: !!this.guestEmailErrors[f]
|
|
254
|
-
}, placeholder: l.t("guestEmailPlaceholder"), value: b, "data-index": f, part: "nbf__input-textfield", onBlur: (p) => {
|
|
255
|
-
var h;
|
|
256
|
-
return this.handleGuestBlur(f, (h = p.target) == null ? void 0 : h.value);
|
|
257
|
-
}, onInput: (p) => {
|
|
258
|
-
var h;
|
|
259
|
-
return this.handleGuestChange(f, (h = p.target) == null ? void 0 : h.value);
|
|
260
|
-
} }), a("button-component", { variant: "basic", onClick: (p) => this.removeGuestButtonClickHandler(p, f), class: {
|
|
261
|
-
"remove-guest": !0,
|
|
262
|
-
error: !!this.guestEmailErrors[f]
|
|
263
|
-
} }, a("close-icon", null))), a("p", { class: "help-text" }, this.guestEmailErrors[f]))), a("button-component", { class: "add-guest", variant: "invisible", part: "nbf__button-ghost", onClick: (b) => this.addGuestButtonClickedHandler(b) }, a("div", { class: "button-content" }, a("add-circle-icon", { slot: "icon" }), this.guestEmails.length > 0 ? `${l.t("addAnotherGuest")}` : `${l.t("addGuest")}`))), (m = Object.entries(((c = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : c.additional_fields) || {})) == null ? void 0 : m.sort((b, f) => b[1].order - f[1].order).map((b) => {
|
|
264
|
-
var x, k;
|
|
265
|
-
const f = b[1], p = f.label, h = b[0];
|
|
266
|
-
switch (f.type) {
|
|
267
|
-
case "dropdown":
|
|
268
|
-
return a("div", { class: "input-wrapper" }, a("select-dropdown", { label: p, name: h, id: h, withSearch: !1, options: (x = f.options) == null ? void 0 : x.map((y) => ({ value: y, label: y })), required: f.required, part: "nbf__input-textfield" }));
|
|
269
|
-
case "checkbox":
|
|
270
|
-
return a("div", { class: "input-wrapper" }, a("checkbox-component", { label: p, name: h, id: h, required: f.required, part: "nbf__input-textfield" }));
|
|
271
|
-
case "radio_button":
|
|
272
|
-
return a("div", { class: "input-wrapper" }, a("radio-button-group", { label: p, name: h, id: h, options: (k = f.options) == null ? void 0 : k.map((y) => ({ value: y, label: y })), required: f.required, part: "nbf__input-textfield" }));
|
|
273
|
-
case "multi_line_text":
|
|
274
|
-
return a("div", { class: "input-wrapper" }, a("textarea-component", { label: p, name: h, id: h, required: f.required, part: "nbf__input-textfield" }));
|
|
275
|
-
default:
|
|
276
|
-
return a("div", { class: "input-wrapper" }, a("input-component", { label: p, name: h, id: h, type: f.type, requiredError: l.t("fieldRequired", { field: p }), required: f.required, part: "nbf__input-textfield" }));
|
|
277
|
-
}
|
|
278
|
-
})), a("div", { key: "fedca1f1d3dc22fac5e93dd73f44273e3d6a12a2", class: "cta" }, a("sp-button", { key: "6be5ecaa860a446f3bc2dc292b919d29a14ae2c5", treatment: "outline", variant: "secondary", class: "back", part: "nbf__button-outline", onClick: this.handleBackButtonClicked }, a("slot", { key: "b3880450d464da75c0e1ba7193af484b7de18a04", name: "booking-form-back-label" }, `${l.t("backButton")}`)), a("sp-button", { key: "ac722e9ed9e8d1d1fdb284496efdcb8a03b0ca27", variant: "primary", class: "book", part: "nbf__button-primary", type: "submit", disabled: this.isLoading }, this.isLoading && a("loading-icon", { slot: "icon" }), a("slot", { key: "1e4d6c2da02e4d9567c1431d256e2ddf13753630", name: "booking-form-book-label" }, `${l.t("bookNowButton")}`)))));
|
|
279
|
-
}
|
|
280
|
-
get host() {
|
|
281
|
-
return X(this);
|
|
282
|
-
}
|
|
283
|
-
static get watchers() {
|
|
284
|
-
return {
|
|
285
|
-
bookingInfo: ["bookingInfoChangedHandler"]
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
ge([
|
|
290
|
-
w({
|
|
291
|
-
name: "nylas-booking-form",
|
|
292
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
293
|
-
["scheduler.isLoading", "isLoading"],
|
|
294
|
-
["scheduler.bookingInfo", "bookingInfo"],
|
|
295
|
-
["scheduler.eventInfo", "eventInfo"],
|
|
296
|
-
["scheduler.configSettings", "configSettings"]
|
|
297
|
-
]),
|
|
298
|
-
eventToProps: {
|
|
299
|
-
backButtonClicked: async (e, t) => {
|
|
300
|
-
t.scheduler.toggleAdditionalData(!1);
|
|
301
|
-
},
|
|
302
|
-
nameChanged: async (e, t) => {
|
|
303
|
-
t.scheduler.setParticipantName(e.detail);
|
|
304
|
-
},
|
|
305
|
-
emailChanged: async (e, t) => {
|
|
306
|
-
t.scheduler.setParticipantEmail(e.detail);
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
fireRegisterEvent: !0
|
|
310
|
-
}),
|
|
311
|
-
I("design:type", Function),
|
|
312
|
-
I("design:paramtypes", []),
|
|
313
|
-
I("design:returntype", void 0)
|
|
314
|
-
], Q.prototype, "render", null);
|
|
315
|
-
Q.style = ye;
|
|
316
|
-
const ve = ':host{display:block;width:400px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:1rem;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600)}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;width:100%;height:48px;padding:8px;line-height:24px;font-family:var(--nylas-font-family)}sp-button.cancel{margin-top:1.25rem;background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.cancel:hover,sp-button.cancel:focus{background-color:var(--nylas-base-600)}sp-button.cancel:active{background-color:var(--nylas-base-800)}sp-button.back{margin-top:0.5rem}sp-button.back:hover,sp-button.back:focus{border-color:var(--nylas-primary)}sp-button.back:active{border-color:var(--nylas-base-600)}sp-field-label{margin-top:1rem;display:flex;color:var(--nylas-base-800);font-size:14px}sp-field-label.error{color:var(--nylas-error)}sp-field-label span.required{color:var(--nylas-error)}sp-textfield{--spectrum-textfield-border-color:var(--nylas-base-300);--spectrum-textfield-icon-color-invalid:var(--nylas-error);position:relative;width:100%;height:48px;margin-bottom:16px;background-color:var(--nylas-base-0);color:var(--nylas-base-500)}sp-textfield.error{--spectrum-textfield-border-color:var(--nylas-error)}sp-help-text{margin:0.25rem 0 1rem 0;color:var(--nylas-error)}', ke = ve;
|
|
317
|
-
var xe = function(e, t, i, o) {
|
|
318
|
-
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
319
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
320
|
-
n = Reflect.decorate(e, t, i, o);
|
|
321
|
-
else
|
|
322
|
-
for (var c = e.length - 1; c >= 0; c--)
|
|
323
|
-
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
324
|
-
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
325
|
-
}, R = function(e, t) {
|
|
326
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
327
|
-
return Reflect.metadata(e, t);
|
|
328
|
-
};
|
|
329
|
-
const ee = class {
|
|
330
|
-
constructor(e) {
|
|
331
|
-
var t, i;
|
|
332
|
-
v(this, e), this.goBackButtonClicked = u(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = u(this, "cancelBookingFormSubmitted", 7), this.cancelBookedEventError = u(this, "cancelBookedEventError", 7), this.cancelBookingFormError = u(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
|
|
333
|
-
this.goBackButtonClicked.emit();
|
|
334
|
-
}, this.handleSubmitCancelBooking = (o) => {
|
|
335
|
-
var r, c, m;
|
|
336
|
-
if (o.preventDefault(), !this.cancellationReason) {
|
|
337
|
-
this.cancellationError = l.t("cancellationErrorMessage"), this.cancelBookingFormError.emit({ title: l.t("cancelBokingFormError"), description: l.t("cancellationErrorMessage") });
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
const s = (c = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : c.min_cancellation_notice;
|
|
341
|
-
if (this.selectedTimeslot && s && new Date((m = this.selectedTimeslot) == null ? void 0 : m.start_time).getTime() - s * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime()) {
|
|
342
|
-
this.cancelBookedEventError.emit({
|
|
343
|
-
error: {
|
|
344
|
-
title: l.t("cancellationErrorTitle"),
|
|
345
|
-
message: l.t("minimumCancellationNoticeErrorMessage", { minCancellationNotice: s })
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
d(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
|
|
351
|
-
const n = (b) => {
|
|
352
|
-
this.cancelBookedEventError.emit(b);
|
|
353
|
-
};
|
|
354
|
-
this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, reason: this.cancellationReason, errorHandler: n });
|
|
355
|
-
}, this.handleOnChangeCancellationReason = (o) => {
|
|
356
|
-
this.cancellationError = "", this.cancellationReason = o.target.value;
|
|
357
|
-
}, this.cancelBookingId = void 0, this.configSettings = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((i = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : i.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
358
|
-
}
|
|
359
|
-
configSettingsChangedHandler(e) {
|
|
360
|
-
var t;
|
|
361
|
-
this.cancellationPolicy = ((t = e == null ? void 0 : e.scheduler) == null ? void 0 : t.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
362
|
-
}
|
|
363
|
-
connectedCallback() {
|
|
364
|
-
d("[nylas-cancel-booking-form] Component connected");
|
|
365
|
-
}
|
|
366
|
-
async componentWillLoad() {
|
|
367
|
-
d("[nylas-cancel-booking-form] Component will load");
|
|
368
|
-
}
|
|
369
|
-
async componentDidLoad() {
|
|
370
|
-
d("[nylas-cancel-booking-form] Component did load"), this.cancelBookingId || console.warn('[nylas-cancel-booking-form] No booking ID provided, "cancelBookingId" prop is required.');
|
|
371
|
-
}
|
|
372
|
-
disconnectedCallback() {
|
|
373
|
-
d("[nylas-cancel-booking-form] Component disconnected");
|
|
374
|
-
}
|
|
375
|
-
render() {
|
|
376
|
-
var e, t;
|
|
377
|
-
return a(g, { key: "7f2e077d4030a0ee2f4801305b65dac5b54441b0", part: "ncec" }, a("sp-theme", { key: "f80896dfff124295412d3a7b693ed82cf9c3ed91", theme: "spectrum", scale: "medium" }, a("div", { key: "1c487f558c382b9dc2b7f79cf573b237379144ce", class: "nylas-cancel-booking-form", part: "ncec__card" }, a("div", { key: "153d19e9200b4ea3d365067161ecb882dc681efb", class: "nylas-cancel-booking-form__calendar-icon", part: "ncec__icon" }, a("calendar-cancel-icon", { key: "e33e0637944233c62013890e0ada8c31088c8818" })), a("h3", { key: "adc67e221a280a13251383257b32687d6d55307d", class: "nylas-cancel-booking-form__title", part: "ncec__title" }, l.t("cancelBookingTitle")), a("div", { key: "79b6294dbb3456744013ab7f4764c182b335aeef", class: "nylas-cancel-booking-form__description", part: "ncec__description" }, (t = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && t.cancellation_policy ? this.cancellationPolicy : `${l.t("cancelBookingMessage")}`), a("form", { key: "18a7587f130f55bc15debe787f607fda543bb067", onSubmit: this.handleSubmitCancelBooking }, a("sp-field-label", { key: "b692b15310fef3af75d4e7302f2134b3dfc45cdb", for: "cancel-reason", class: this.cancellationError ? "error" : "" }, l.t("reasonForCancellation"), " ", a("span", { key: "6a5e6e7d130b31d34e409c040f14c41bc1d350f4", class: "required" }, "*")), a("sp-textfield", { key: "2e63aae432b4fccfcc55d52a836e71539275bd6f", id: "cancel-reason", class: this.cancellationError ? "error" : "", part: "ncec__reason-textarea", multiline: !0, value: this.cancellationReason, onInput: this.handleOnChangeCancellationReason, onFocus: this.handleOnChangeCancellationReason, invalid: !!this.cancellationError }, a("sp-help-text", { key: "4486e9362d2a1086dc91b4dca0080c0693040fc5", slot: "negative-help-text" }, this.cancellationError)), a("sp-button", { key: "bb750fcd1edd92c99b47f05c8f681ad9e04a3139", variant: "primary", class: "cancel", type: "submit", part: "ncec__button-cta", disabled: this.isLoading }, l.t("cancelBookingButton")), a("sp-button", { key: "e7cf434fb93bf231d44538184ed6ffcc52f0e2d0", variant: "secondary", class: "back", treatment: "outline", part: "ncec__button-outline", onClick: this.handleGoBackClicked }, l.t("goBackButton"))))));
|
|
378
|
-
}
|
|
379
|
-
static get watchers() {
|
|
380
|
-
return {
|
|
381
|
-
configSettings: ["configSettingsChangedHandler"]
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
};
|
|
385
|
-
xe([
|
|
386
|
-
w({
|
|
387
|
-
name: "nylas-cancel-booking-form",
|
|
388
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
389
|
-
["scheduler.configSettings", "configSettings"],
|
|
390
|
-
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
391
|
-
["scheduler.isLoading", "isLoading"]
|
|
392
|
-
]),
|
|
393
|
-
eventToProps: {
|
|
394
|
-
cancelBookingFormSubmitted: async (e, t) => {
|
|
395
|
-
const i = await t.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason), { errorHandler: o } = e.detail;
|
|
396
|
-
o && (!i || "error" in i) && o(i);
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
fireRegisterEvent: !0
|
|
400
|
-
}),
|
|
401
|
-
R("design:type", Function),
|
|
402
|
-
R("design:paramtypes", []),
|
|
403
|
-
R("design:returntype", void 0)
|
|
404
|
-
], ee.prototype, "render", null);
|
|
405
|
-
ee.style = ke;
|
|
406
|
-
const Ce = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancelled-event-card{display:flex;align-items:center;flex-direction:column;width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:1rem;height:48px;padding:8px;line-height:24px;width:100%}sp-button:hover,sp-button:focus{border-color:var(--nylas-primary)}sp-button:active{border-color:var(--nylas-base-600)}', we = Ce;
|
|
407
|
-
var _e = function(e, t, i, o) {
|
|
408
|
-
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
409
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
410
|
-
n = Reflect.decorate(e, t, i, o);
|
|
411
|
-
else
|
|
412
|
-
for (var c = e.length - 1; c >= 0; c--)
|
|
413
|
-
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
414
|
-
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
415
|
-
}, F = function(e, t) {
|
|
416
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
417
|
-
return Reflect.metadata(e, t);
|
|
418
|
-
};
|
|
419
|
-
const te = class {
|
|
420
|
-
constructor(e) {
|
|
421
|
-
v(this, e), this.closeCancelEventCardClicked = u(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = u(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
|
|
422
|
-
this.isClosing = !0;
|
|
423
|
-
const t = (i) => {
|
|
424
|
-
this.cancelledEventCardError.emit(i), this.isClosing = !1;
|
|
425
|
-
};
|
|
426
|
-
this.closeCancelEventCardClicked.emit({ errorHandler: t });
|
|
427
|
-
}, this.cancelledEventInfo = void 0, this.isClosing = !1, this.configSettings = void 0;
|
|
428
|
-
}
|
|
429
|
-
connectedCallback() {
|
|
430
|
-
d("[nylas-cancelled-event-card] Component connected");
|
|
431
|
-
}
|
|
432
|
-
async componentWillLoad() {
|
|
433
|
-
d("[nylas-cancelled-event-card] Component will load");
|
|
434
|
-
}
|
|
435
|
-
async componentDidLoad() {
|
|
436
|
-
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.');
|
|
437
|
-
}
|
|
438
|
-
disconnectedCallback() {
|
|
439
|
-
d("[nylas-cancelled-event-card] Component disconnected");
|
|
440
|
-
}
|
|
441
|
-
render() {
|
|
442
|
-
var e, t;
|
|
443
|
-
return a(g, { key: "9c98c6894ceb733fa180edd1df8175982baf746b", part: "ncec" }, a("sp-theme", { key: "14a7b09fc12551599c93762d7c5398d7326f3507", theme: "spectrum", color: "dark", scale: "medium" }, a("div", { key: "828831866ee86c226f755c0f151baecef91ed995", class: "nylas-cancelled-event-card", part: "ncec__card" }, a("div", { key: "e92df81c9d255aa862382915af84e33d17624150", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, a("calendar-cancel-icon", { key: "bbbbbdf5e90467700c05c1702fcc5cc66968a834" })), a("h3", { key: "17e09dbd68c95dea1f3db1259ef4e801a956724e", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, l.t("bookingCancelledTitle"), "!"), a("div", { key: "12cd951ec167e07a476620c5c0a6bba3f1d7d739", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, l.t("bookingCancelledMessage"), " ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), a("div", { key: "07d80ab4a38a15eecb62c7f2d2205862e42d8e47", class: "nylas-cancelled-event-card__cta" }, a("sp-button", { key: "c5c33eacbce86cb787ef9d0343b05941b9e7189a", variant: "secondary", treatment: "outline", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${l.t("closingButton")}...` : `${l.t("closeButton")}`)))));
|
|
444
|
-
}
|
|
445
|
-
};
|
|
446
|
-
_e([
|
|
447
|
-
w({
|
|
448
|
-
name: "nylas-cancelled-event-card",
|
|
449
|
-
stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
|
|
450
|
-
eventToProps: {
|
|
451
|
-
closeCancelEventCardClicked: async (e, t) => {
|
|
452
|
-
const i = await t.scheduler.resetCancel(), { errorHandler: o } = e.detail;
|
|
453
|
-
o && (!i || "error" in i) && o(i);
|
|
454
|
-
}
|
|
455
|
-
},
|
|
456
|
-
fireRegisterEvent: !0
|
|
457
|
-
}),
|
|
458
|
-
F("design:type", Function),
|
|
459
|
-
F("design:paramtypes", []),
|
|
460
|
-
F("design:returntype", void 0)
|
|
461
|
-
], te.prototype, "render", null);
|
|
462
|
-
te.style = we;
|
|
463
|
-
const P = /* @__PURE__ */ new Date(), M = /* @__PURE__ */ new Date();
|
|
464
|
-
function L(e, t, i, o) {
|
|
465
|
-
function s(n) {
|
|
466
|
-
return e(n = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+n)), n;
|
|
467
|
-
}
|
|
468
|
-
return s.floor = (n) => (e(n = /* @__PURE__ */ new Date(+n)), n), s.ceil = (n) => (e(n = new Date(n - 1)), t(n, 1), e(n), n), s.round = (n) => {
|
|
469
|
-
const r = s(n), c = s.ceil(n);
|
|
470
|
-
return n - r < c - n ? r : c;
|
|
471
|
-
}, s.offset = (n, r) => (t(n = /* @__PURE__ */ new Date(+n), r == null ? 1 : Math.floor(r)), n), s.range = (n, r, c) => {
|
|
472
|
-
const m = [];
|
|
473
|
-
if (n = s.ceil(n), c = c == null ? 1 : Math.floor(c), !(n < r) || !(c > 0))
|
|
474
|
-
return m;
|
|
475
|
-
let b;
|
|
476
|
-
do
|
|
477
|
-
m.push(b = /* @__PURE__ */ new Date(+n)), t(n, c), e(n);
|
|
478
|
-
while (b < n && n < r);
|
|
479
|
-
return m;
|
|
480
|
-
}, s.filter = (n) => L((r) => {
|
|
481
|
-
if (r >= r)
|
|
482
|
-
for (; e(r), !n(r); )
|
|
483
|
-
r.setTime(r - 1);
|
|
484
|
-
}, (r, c) => {
|
|
485
|
-
if (r >= r)
|
|
486
|
-
if (c < 0)
|
|
487
|
-
for (; ++c <= 0; )
|
|
488
|
-
for (; t(r, -1), !n(r); )
|
|
489
|
-
;
|
|
490
|
-
else
|
|
491
|
-
for (; --c >= 0; )
|
|
492
|
-
for (; t(r, 1), !n(r); )
|
|
493
|
-
;
|
|
494
|
-
}), i && (s.count = (n, r) => (P.setTime(+n), M.setTime(+r), e(P), e(M), Math.floor(i(P, M))), s.every = (n) => (n = Math.floor(n), !isFinite(n) || !(n > 0) ? null : n > 1 ? s.filter(o ? (r) => o(r) % n === 0 : (r) => s.count(0, r) % n === 0) : s)), s;
|
|
495
|
-
}
|
|
496
|
-
const Ee = 1e3, ae = Ee * 60, Te = ae * 60, D = Te * 24, j = L(
|
|
497
|
-
(e) => e.setHours(0, 0, 0, 0),
|
|
498
|
-
(e, t) => e.setDate(e.getDate() + t),
|
|
499
|
-
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * ae) / D,
|
|
500
|
-
(e) => e.getDate() - 1
|
|
501
|
-
);
|
|
502
|
-
L((e) => {
|
|
503
|
-
e.setUTCHours(0, 0, 0, 0);
|
|
504
|
-
}, (e, t) => {
|
|
505
|
-
e.setUTCDate(e.getUTCDate() + t);
|
|
506
|
-
}, (e, t) => (t - e) / D, (e) => e.getUTCDate() - 1);
|
|
507
|
-
L((e) => {
|
|
508
|
-
e.setUTCHours(0, 0, 0, 0);
|
|
509
|
-
}, (e, t) => {
|
|
510
|
-
e.setUTCDate(e.getUTCDate() + t);
|
|
511
|
-
}, (e, t) => (t - e) / D, (e) => Math.floor(e / D));
|
|
512
|
-
const De = ':host{display:block;min-height:444px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}.title{margin:0 -1.25rem;display:flex;flex-direction:column;padding:0 1.5rem;gap:0.5rem;border-bottom:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family)}.title h1{margin-bottom:0;font-size:18px;line-height:20px;font-weight:600;display:flex;gap:0.5rem;align-items:center}.title p{margin-top:0;font-size:16px;display:flex;gap:0.5rem;align-items:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:24px}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 412px){.dates .date{width:38px;height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}', Le = De;
|
|
513
|
-
var Be = function(e, t, i, o) {
|
|
514
|
-
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
515
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
516
|
-
n = Reflect.decorate(e, t, i, o);
|
|
517
|
-
else
|
|
518
|
-
for (var c = e.length - 1; c >= 0; c--)
|
|
519
|
-
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
520
|
-
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
521
|
-
}, N = function(e, t) {
|
|
522
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
523
|
-
return Reflect.metadata(e, t);
|
|
524
|
-
};
|
|
525
|
-
const ne = class {
|
|
526
|
-
constructor(e) {
|
|
527
|
-
v(this, e), this.dateSelected = u(this, "dateSelected", 7), this.monthChanged = u(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;
|
|
528
|
-
}
|
|
529
|
-
configSettingsChanged(e) {
|
|
530
|
-
var s;
|
|
531
|
-
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), i = (s = e == null ? void 0 : e.scheduler) == null ? void 0 : s.available_days_in_future;
|
|
532
|
-
if (i === void 0)
|
|
533
|
-
return;
|
|
534
|
-
W(/* @__PURE__ */ new Date(), i).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
|
|
535
|
-
}
|
|
536
|
-
selectedLanguageChanged(e) {
|
|
537
|
-
l.changeLanguage(e);
|
|
538
|
-
}
|
|
539
|
-
connectedCallback() {
|
|
540
|
-
}
|
|
541
|
-
disconnectedCallback() {
|
|
542
|
-
}
|
|
543
|
-
componentWillLoad() {
|
|
544
|
-
}
|
|
545
|
-
getDates() {
|
|
546
|
-
const e = re(this.month), t = le(this.month);
|
|
547
|
-
return j.range(j.offset(t, -t.getDay()), j.offset(e, 7 - e.getDay()));
|
|
548
|
-
}
|
|
549
|
-
selectDate(e) {
|
|
550
|
-
this.dateSelected.emit(e);
|
|
551
|
-
}
|
|
552
|
-
changeMonth(e) {
|
|
553
|
-
var s, n;
|
|
554
|
-
this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
|
|
555
|
-
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), i = (n = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : n.available_days_in_future;
|
|
556
|
-
W(/* @__PURE__ */ new Date(), i).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month);
|
|
557
|
-
}
|
|
558
|
-
isSelected(e, t, i) {
|
|
559
|
-
return e && t && C(e, t) && i && (i == null ? void 0 : i.length) > 0;
|
|
560
|
-
}
|
|
561
|
-
isDisabled(e, t) {
|
|
562
|
-
return e && (t == null ? void 0 : t.find((i) => C(i, e))) === void 0;
|
|
563
|
-
}
|
|
564
|
-
render() {
|
|
565
|
-
var e, t, i, o, s;
|
|
566
|
-
return a(g, { key: "b9352b7200decd122387246dfe84ffa03d8548f7", part: "ndp" }, a("div", { key: "f5e97afdd1f9e56323ec9a6f03c3d03f4f0b9752", class: "nylas-date-picker" }, a("div", { key: "f7b357631c4a8e49b5e2155744cc862c3f5686b2", class: "title", part: "'ndp__title" }, ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) && a("h1", null, a("person-icon", null), ((o = (i = this.configSettings) == null ? void 0 : i.organizer) == null ? void 0 : o.name) || "Organizer"), a("p", { key: "ccaeb9dcb6c26a8debdf1517e7f6c4a38535d7e8" }, a("clock-icon", { key: "00991681f820c8d9cb5aac8d3fffdefd84a7ff8c" }), this.eventDuration ? ce(this.eventDuration) : `- ${l.t("time.minutes")}`)), a("div", { key: "cf9d074f2616969892a4b1993bc812f3a88cc30e", class: "header flex-row" }, a("h2", { key: "e419a9019e07540c61d6348d83ffb1b18dc6ab49", part: "ndp__month-header" }, a("strong", { key: "0b579d2821c676edad234e89a0f76b2625506002" }, de(this.month.toLocaleDateString(void 0, { month: "long" }).toLocaleLowerCase())), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), a("div", { key: "1c54a274075b10933e683b7c94def7b9a9c026bb", class: "pagination" }, a("button", { key: "77625a1039d9397d80d9223b9f70589cccd092e2", 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" }, a("chevron-icon", { key: "52723491a9e3ce61acb280aba55193c1ce11447f" })), a("button", { key: "71a728afda92fee35e1da058c0241f26f46cb837", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, a("chevron-icon", { key: "af862e5450421ae1be319f6a3a9b393cb08b3e5a" })))), a("div", { key: "4edef52ad8c2bd98fc1a249fe28a3029c4a290c9", class: "dates" }, [
|
|
567
|
-
l.t("days.sunday"),
|
|
568
|
-
l.t("days.monday"),
|
|
569
|
-
l.t("days.tuesday"),
|
|
570
|
-
l.t("days.wednesday"),
|
|
571
|
-
l.t("days.thursday"),
|
|
572
|
-
l.t("days.friday"),
|
|
573
|
-
l.t("days.saturday")
|
|
574
|
-
].map((n) => a("div", { class: "day", part: "ndp__day" }, n)), this.dates.map((n, r) => {
|
|
575
|
-
var m;
|
|
576
|
-
const c = this.isDisabled(n, this.selectableDates);
|
|
577
|
-
return this.isLoading ? a("button", { disabled: !0, class: {
|
|
578
|
-
"date day-skeleton": !0,
|
|
579
|
-
"current-month": B(n, this.month)
|
|
580
|
-
}, style: { animationDelay: `${r * 20}ms` }, part: "ndp__date" }, n.getDate()) : a("button", { class: {
|
|
581
|
-
date: !0,
|
|
582
|
-
selected: !!(this.selectedDate && C(n, this.selectedDate) && this.selectableDates && ((m = this.selectableDates) == null ? void 0 : m.length) > 0),
|
|
583
|
-
"current-day": C(n, /* @__PURE__ */ new Date()),
|
|
584
|
-
"current-month": B(n, this.month)
|
|
585
|
-
}, "aria-lang": n.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: c, onClick: () => this.selectDate(n), part: `ndp__date ${this.isSelected(n, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${C(n, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${B(n, this.month) ? "ndp__date--current-month" : ""}` }, n.getDate());
|
|
586
|
-
}))));
|
|
587
|
-
}
|
|
588
|
-
static get watchers() {
|
|
589
|
-
return {
|
|
590
|
-
configSettings: ["configSettingsChanged"],
|
|
591
|
-
selectedLanguage: ["selectedLanguageChanged"]
|
|
592
|
-
};
|
|
593
|
-
}
|
|
594
|
-
};
|
|
595
|
-
Be([
|
|
596
|
-
w({
|
|
597
|
-
name: "nylas-date-picker",
|
|
598
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
599
|
-
["scheduler.selectableDates", "selectableDates"],
|
|
600
|
-
["scheduler.selectedDate", "selectedDate"],
|
|
601
|
-
["scheduler.isLoading", "isLoading"],
|
|
602
|
-
["scheduler.configSettings", "configSettings"],
|
|
603
|
-
["scheduler.eventDuration", "eventDuration"],
|
|
604
|
-
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
605
|
-
]),
|
|
606
|
-
eventToProps: {
|
|
607
|
-
dateSelected: async (e, t) => {
|
|
608
|
-
d("nylas-date-picker", "dateSelected", e.detail), t.scheduler.selectDate(e.detail);
|
|
609
|
-
}
|
|
610
|
-
},
|
|
611
|
-
fireRegisterEvent: !0
|
|
612
|
-
}),
|
|
613
|
-
N("design:type", Function),
|
|
614
|
-
N("design:paramtypes", []),
|
|
615
|
-
N("design:returntype", void 0)
|
|
616
|
-
], ne.prototype, "render", null);
|
|
617
|
-
ne.style = Le;
|
|
618
|
-
const Se = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){border:none;padding:10px}select-dropdown::part(sd_dropdown-content){max-width:306px}', ze = Se;
|
|
619
|
-
var Ie = function(e, t, i, o) {
|
|
620
|
-
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
621
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
622
|
-
n = Reflect.decorate(e, t, i, o);
|
|
623
|
-
else
|
|
624
|
-
for (var c = e.length - 1; c >= 0; c--)
|
|
625
|
-
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
626
|
-
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
627
|
-
}, O = function(e, t) {
|
|
628
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
629
|
-
return Reflect.metadata(e, t);
|
|
630
|
-
};
|
|
631
|
-
const ie = class {
|
|
632
|
-
constructor(e) {
|
|
633
|
-
v(this, e), this.timezoneChanged = u(this, "timezoneChanged", 7), this.languageChanged = u(this, "languageChanged", 7), this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = navigator.language;
|
|
634
|
-
}
|
|
635
|
-
connectedCallback() {
|
|
636
|
-
}
|
|
637
|
-
disconnectedCallback() {
|
|
638
|
-
}
|
|
639
|
-
componentWillLoad() {
|
|
640
|
-
}
|
|
641
|
-
changeTimezone(e) {
|
|
642
|
-
this.selectedTimezone = e, this.timezoneChanged.emit(e);
|
|
643
|
-
}
|
|
644
|
-
changeLanguage(e) {
|
|
645
|
-
this.selectedLanguage = e, this.languageChanged.emit(e);
|
|
646
|
-
}
|
|
647
|
-
nylasFormDropdownChangedHandler(e) {
|
|
648
|
-
const { name: t, value: i } = e.detail;
|
|
649
|
-
t === "timezone" ? this.changeTimezone(i) : t === "language" && this.changeLanguage(i);
|
|
650
|
-
}
|
|
651
|
-
getTimezoneLabelHTML(e) {
|
|
652
|
-
const t = be(e);
|
|
653
|
-
return a("span", { class: "timezone-label", style: {
|
|
654
|
-
display: "flex",
|
|
655
|
-
alignItems: "center",
|
|
656
|
-
justifyContent: "space-between",
|
|
657
|
-
width: "-webkit-fill-available"
|
|
658
|
-
} }, E[e], " ", a("span", { class: "timezone-offset", style: {
|
|
659
|
-
fontSize: "14px",
|
|
660
|
-
fontWeight: "400",
|
|
661
|
-
color: "var(--nylas-base-500)"
|
|
662
|
-
} }, t));
|
|
663
|
-
}
|
|
664
|
-
render() {
|
|
665
|
-
const e = Object.keys(E).map((i) => ({
|
|
666
|
-
labelHTML: this.getTimezoneLabelHTML(i),
|
|
667
|
-
label: E[i],
|
|
668
|
-
value: i
|
|
669
|
-
})), t = Object.keys(U).map((i) => ({
|
|
670
|
-
label: U[i],
|
|
671
|
-
value: i
|
|
672
|
-
}));
|
|
673
|
-
return a(g, { key: "8f8d20420b4bc34e48cd48b2f78f66bc01bae8f8" }, a("div", { key: "bb24d8978ae671cac3b063ace059da9932e638cd", class: "nylas-locale-switch" }, a("div", { key: "4c93f5c209c64e573f1eebdef7c6a9dea1049a08", class: {
|
|
674
|
-
"select-wrapper": !0,
|
|
675
|
-
timezone: !0
|
|
676
|
-
} }, a("select-dropdown", { key: "6dc7c793fbf3d8a3724f957dd0a3512034ec9689", name: "timezone", options: e, defaultSelectedOption: e.find((i) => i.value == this.selectedTimezone) }, a("span", { key: "afbd26c2bd09b94220801c575152773c4ba37c06", slot: "select-icon" }, a("globe-icon", { key: "5ca8b25e1cd2f21445c4431aa5dd3cafda67a5ce", width: "20", height: "20" })))), a("div", { key: "a4171de1a022cfdfd722acf37eff0fb6cf1e876a", class: {
|
|
677
|
-
"select-wrapper": !0,
|
|
678
|
-
language: !0
|
|
679
|
-
} }, a("select-dropdown", { key: "9c3a988489bf572d267a920eb7fbd5cda7401c66", name: "language", options: t, defaultSelectedOption: t.find((i) => i.value == this.selectedLanguage) }, a("span", { key: "45b3b18c932b6a42f927dc769b0eba5327ddc639", slot: "select-icon" }, a("translate-icon", { key: "6081367bbd4d711fdd79418a14921924358f3b2a", width: "20", height: "20" }))))));
|
|
680
|
-
}
|
|
681
|
-
};
|
|
682
|
-
Ie([
|
|
683
|
-
w({
|
|
684
|
-
name: "nylas-locale-switch",
|
|
685
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
686
|
-
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
687
|
-
["scheduler.selectedTimezone", "selectedTimezone"]
|
|
688
|
-
]),
|
|
689
|
-
eventToProps: {
|
|
690
|
-
timezoneChanged: async (e, t) => {
|
|
691
|
-
t.scheduler.selectTimezone(e.detail);
|
|
692
|
-
},
|
|
693
|
-
languageChanged: async (e, t) => {
|
|
694
|
-
t.scheduler.selectLanguage(e.detail);
|
|
695
|
-
}
|
|
696
|
-
},
|
|
697
|
-
fireRegisterEvent: !0
|
|
698
|
-
}),
|
|
699
|
-
O("design:type", Function),
|
|
700
|
-
O("design:paramtypes", []),
|
|
701
|
-
O("design:returntype", void 0)
|
|
702
|
-
], ie.prototype, "render", null);
|
|
703
|
-
ie.style = ze;
|
|
704
|
-
const Re = ".sc-nylas-logo-h{display:flex}", Fe = Re, Pe = class {
|
|
705
|
-
constructor(e) {
|
|
706
|
-
v(this, e), this.width = "69", this.height = "24";
|
|
707
|
-
}
|
|
708
|
-
render() {
|
|
709
|
-
return a("svg", { key: "0fbf980c0b3e79d48eac121208ded45ff37cf755", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("g", { key: "7fada887714f6771756e993a14cc85573cb03381", "clip-path": "url(#clip0_455_3543)" }, a("path", { key: "f91c2de423caf86f05f3f583cf2948dbb2ad57ff", d: "M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z", fill: "currentColor" }), a("path", { key: "cde2692ce02ef84f5fb4dfd0d2586437cec14258", d: "M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z", fill: "currentColor" }), a("path", { key: "f2e8d9f1ad8ab8238f0c412e2ece3e82e0c59cbe", d: "M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z", fill: "currentColor" }), a("path", { key: "8c6634a7b8b1358e5b18ddfd44ac820c2025e92f", d: "M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z", fill: "currentColor" }), a("path", { key: "100297c7cec7475275ddaaa14b77d55391627a23", d: "M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z", fill: "currentColor" }), a("path", { key: "02d4f2d7ff9f1d622352cc6119e146f2369915f0", d: "M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z", fill: "currentColor" }), a("path", { key: "f8c9ab3a5f34b72b550ffeb9869d92b3184f527f", d: "M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z", fill: "currentColor" }), a("path", { key: "bd56ca92b932101416706164329e4eca5ab43437", d: "M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z", fill: "currentColor" })), a("defs", { key: "20ae2f861eb31c0dd81bcd94c652de0ec040c7b3" }, a("clipPath", { key: "34e8be3ddc24fe243728764b8b171b0e8bea15d2", id: "clip0_455_3543" }, a("rect", { key: "da3c1e98ef4a481dd2645b630734905aa0c95a5b", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
|
|
710
|
-
}
|
|
711
|
-
};
|
|
712
|
-
Pe.style = Fe;
|
|
713
|
-
const Me = ':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}', je = Me, Ne = class {
|
|
714
|
-
constructor(e) {
|
|
715
|
-
v(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
|
|
716
|
-
}
|
|
717
|
-
onError(e) {
|
|
718
|
-
d(`[nylas-notification] Error: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
719
|
-
}
|
|
720
|
-
onWarning(e) {
|
|
721
|
-
d(`[nylas-notification] Warning: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
722
|
-
}
|
|
723
|
-
onInfo(e) {
|
|
724
|
-
d(`[nylas-notification] Info: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
725
|
-
}
|
|
726
|
-
onSuccess(e) {
|
|
727
|
-
d(`[nylas-notification] Success: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
728
|
-
}
|
|
729
|
-
isChildOf(e) {
|
|
730
|
-
let t = this.host.parentNode;
|
|
731
|
-
for (; t; ) {
|
|
732
|
-
if (t === e)
|
|
733
|
-
return !0;
|
|
734
|
-
t instanceof ShadowRoot ? t = t.host : t = t.parentNode;
|
|
735
|
-
}
|
|
736
|
-
return !1;
|
|
737
|
-
}
|
|
738
|
-
handleNotification(e) {
|
|
739
|
-
const t = e.detail.host;
|
|
740
|
-
if (e.defaultPrevented) {
|
|
741
|
-
d("[nylas-notification] Event default prevented");
|
|
742
|
-
return;
|
|
743
|
-
}
|
|
744
|
-
if (t && !this.isChildOf(t)) {
|
|
745
|
-
d("[nylas-notification] Host not a parent");
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
if (this.ttl === 0) {
|
|
749
|
-
d("[nylas-notification] TTL is 0");
|
|
750
|
-
return;
|
|
751
|
-
}
|
|
752
|
-
if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.notification.category)) {
|
|
753
|
-
d("[nylas-notification] Category not allowed");
|
|
754
|
-
return;
|
|
755
|
-
}
|
|
756
|
-
if (this.notifications = [...this.notifications, { ...e.detail.notification }], e.detail.notification.ttl !== "none") {
|
|
757
|
-
const i = e.detail.notification.ttl ? e.detail.notification.ttl : this.ttl;
|
|
758
|
-
window.setTimeout(() => {
|
|
759
|
-
this.notifications = this.notifications.filter((o) => o.id !== e.detail.notification.id);
|
|
760
|
-
}, i);
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
dismissNotification(e) {
|
|
764
|
-
this.notifications = this.notifications.filter((t) => t.id !== e);
|
|
765
|
-
}
|
|
766
|
-
render() {
|
|
767
|
-
return a(g, { key: "c507cfeee709a1742cfcfe448edb46148bb7645c" }, a(fe, { key: "bef717616baa583c675852eb3eae03a4303276ee" }, this.notifications.map((e) => a("div", { class: `notif ${e.type}`, key: e.id }, a("div", { class: "content" }, a("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && a("warning-icon", null)), a("span", { class: "message" }, a("span", { class: "title" }, e.title), e.description && a("span", { class: "description" }, e.description))), a("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, a("close-icon", null)))), a("slot", { key: "611326297709c03e357a3bb1597339d540b683b5" })));
|
|
768
|
-
}
|
|
769
|
-
get host() {
|
|
770
|
-
return X(this);
|
|
771
|
-
}
|
|
772
|
-
};
|
|
773
|
-
Ne.style = je;
|
|
774
|
-
const Oe = ":host{display:block}sp-theme{position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:16px;font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}", $e = Oe;
|
|
775
|
-
var He = function(e, t, i, o) {
|
|
776
|
-
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
777
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
778
|
-
n = Reflect.decorate(e, t, i, o);
|
|
779
|
-
else
|
|
780
|
-
for (var c = e.length - 1; c >= 0; c--)
|
|
781
|
-
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
782
|
-
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
783
|
-
}, $ = function(e, t) {
|
|
784
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
785
|
-
return Reflect.metadata(e, t);
|
|
786
|
-
};
|
|
787
|
-
const oe = class {
|
|
788
|
-
constructor(e) {
|
|
789
|
-
v(this, e), this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.startTime = "", this.endTime = "";
|
|
790
|
-
}
|
|
791
|
-
connectedCallback() {
|
|
792
|
-
}
|
|
793
|
-
disconnectedCallback() {
|
|
794
|
-
}
|
|
795
|
-
async componentWillLoad() {
|
|
796
|
-
d("[nylas-selected-event-card] Component will load");
|
|
797
|
-
}
|
|
798
|
-
async componentDidLoad() {
|
|
799
|
-
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.');
|
|
800
|
-
}
|
|
801
|
-
handleSelectedTimeslotChange(e) {
|
|
802
|
-
this.startTime = new Date(e == null ? void 0 : e.start_time).toLocaleString(void 0, { timeStyle: "short" }), this.endTime = new Date(e == null ? void 0 : e.end_time).toLocaleString(void 0, { timeStyle: "short" });
|
|
803
|
-
}
|
|
804
|
-
render() {
|
|
805
|
-
var e;
|
|
806
|
-
return a(g, { key: "f794f4415321af6623c2c9d97925932dbb2047e4", part: "nsec" }, a("sp-theme", { key: "356fedb5c591554eb87d8cdf5cc711fe3524a7c7", theme: "spectrum", color: "dark", scale: "medium" }, a("div", { key: "336de44bd19e2fd086c2826a6c8206608f6ca646", class: "event-card", part: "nsec__card" }, a("div", { key: "940dd832f8fb09e27efa3ff5b0728a5053ff629e", class: "calendar-icon", part: "nsec__icon" }, a("calendar-icon", { key: "523369c88eb905de96b7c8431b9109b4fb8706ec" })), a("div", { key: "385494cc3d1830f124cdca616413caba9fc1ce64", 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" })) : "-"), a("div", { key: "7e92630de5bf9811e3e05ee2ff1fd2f54797f222", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), a("div", { key: "da2b0cd62a7519040ba9b055991684e4db7ff9b9", class: "event-timezone", part: "nsec__timezone" }, a("globe-icon", { key: "045c62d629116f91d3558a236c66374769c3a903" }), E[this.selectedTimezone])));
|
|
807
|
-
}
|
|
808
|
-
static get watchers() {
|
|
809
|
-
return {
|
|
810
|
-
selectedTimeslot: ["handleSelectedTimeslotChange"]
|
|
811
|
-
};
|
|
812
|
-
}
|
|
813
|
-
};
|
|
814
|
-
He([
|
|
815
|
-
w({
|
|
816
|
-
name: "nylas-selected-event-card",
|
|
817
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
818
|
-
["scheduler.selectedDate", "selectedDate"],
|
|
819
|
-
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
820
|
-
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
821
|
-
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
822
|
-
]),
|
|
823
|
-
eventToProps: {},
|
|
824
|
-
fireRegisterEvent: !0
|
|
825
|
-
}),
|
|
826
|
-
$("design:type", Function),
|
|
827
|
-
$("design:paramtypes", []),
|
|
828
|
-
$("design:returntype", void 0)
|
|
829
|
-
], oe.prototype, "render", null);
|
|
830
|
-
oe.style = $e;
|
|
831
|
-
const qe = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.timeslots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .timeslot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}.footer sp-button{padding:14px;color:var(--nylas-base-100);border-radius:var(--nylas-border-radius-2x);width:100%;height:48px;font-weight:600;font-size:16px;background-color:var(--nylas-primary);border:none}.footer sp-button:hover,.footer sp-button:focus{background-color:var(--nylas-base-600)}.footer sp-button:active{background-color:var(--nylas-base-800)}", Ae = qe;
|
|
832
|
-
var Ze = function(e, t, i, o) {
|
|
833
|
-
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
834
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
835
|
-
n = Reflect.decorate(e, t, i, o);
|
|
836
|
-
else
|
|
837
|
-
for (var c = e.length - 1; c >= 0; c--)
|
|
838
|
-
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
839
|
-
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
840
|
-
}, H = function(e, t) {
|
|
841
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
842
|
-
return Reflect.metadata(e, t);
|
|
843
|
-
};
|
|
844
|
-
const se = class {
|
|
845
|
-
constructor(e) {
|
|
846
|
-
v(this, e), this.timeslotSelected = u(this, "timeslotSelected", 7), this.timeslotConfirmed = u(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (t, i) => {
|
|
847
|
-
t.preventDefault(), d("[nylas-timeslot-picker] Confirm timeslot", i), this.timeslotConfirmed.emit(i);
|
|
848
|
-
}, this.handleMouseEnter = (t) => {
|
|
849
|
-
this.hoveredTimeslotIndex = t;
|
|
850
|
-
}, this.handleMouseLeave = () => {
|
|
851
|
-
this.hoveredTimeslotIndex = -1;
|
|
852
|
-
}, 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;
|
|
853
|
-
}
|
|
854
|
-
selectedLanguageChanged(e) {
|
|
855
|
-
l.changeLanguage(e);
|
|
856
|
-
}
|
|
857
|
-
selectedDateChanged(e) {
|
|
858
|
-
var t;
|
|
859
|
-
if (d("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
|
|
860
|
-
const i = (t = this.availability) == null ? void 0 : t.filter((o) => C(o.start_time, e)).map((o) => o);
|
|
861
|
-
this.times = i || [];
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
availabilityChanged(e) {
|
|
865
|
-
if (d("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
|
|
866
|
-
const t = e == null ? void 0 : e.filter((i) => this.selectedDate && C(i.start_time, this.selectedDate)).map((i) => i);
|
|
867
|
-
this.times = t || [];
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
connectedCallback() {
|
|
871
|
-
}
|
|
872
|
-
disconnectedCallback() {
|
|
873
|
-
}
|
|
874
|
-
async componentWillLoad() {
|
|
875
|
-
var t;
|
|
876
|
-
const e = (t = this.availability) == null ? void 0 : t.filter((i) => this.selectedDate && C(i.start_time, this.selectedDate)).map((i) => i);
|
|
877
|
-
this.times = e || [], d("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
|
|
878
|
-
}
|
|
879
|
-
async componentDidLoad() {
|
|
880
|
-
d("[nylas-timeslot-picker] Component did load");
|
|
881
|
-
}
|
|
882
|
-
getTimeslotId(e, t) {
|
|
883
|
-
return `${e.toLocaleDateString()}-${t}`;
|
|
884
|
-
}
|
|
885
|
-
onClickSelectTime(e, t) {
|
|
886
|
-
d("[nylas-timeslot-picker] Time selected", e, t), this.selectedTimeslotIndex = this.getTimeslotId(e.start_time, t), this.timeslotSelected.emit({
|
|
887
|
-
start_time: e.start_time,
|
|
888
|
-
end_time: e.end_time,
|
|
889
|
-
emails: e.emails
|
|
890
|
-
});
|
|
891
|
-
}
|
|
892
|
-
getTimeSlotLabel(e) {
|
|
893
|
-
const t = new Intl.DateTimeFormat("en-US", {
|
|
894
|
-
hour: "2-digit",
|
|
895
|
-
minute: "2-digit",
|
|
896
|
-
timeZone: this.selectedTimezone
|
|
897
|
-
});
|
|
898
|
-
return `${t.format(e.start_time)} - ${t.format(e.end_time)}`;
|
|
899
|
-
}
|
|
900
|
-
render() {
|
|
901
|
-
return this.isLoading ? a(g, null, a("div", { class: "loading" }, new Array(6).fill(0).map((e, t) => a("div", { class: "timeslot-skeleton", style: { animationDelay: `${t * 20}ms` } })))) : this.availability && this.availability.length === 0 ? a(g, null, a("div", { class: "empty" }, a("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? a(g, null, a("div", { class: "empty" }, a("span", null, "No time slots available for selected date"))) : this.selectedDate ? a(g, { part: "ntp" }, a("div", { class: "time-picker-wrapper" }, a("div", { class: "timeslots" }, this.times.map((e, t) => {
|
|
902
|
-
var i, o, s, n;
|
|
903
|
-
return a("button", { part: `ntp__timeslot ${((o = (i = this.selectedTimeslot) == null ? void 0 : i.start_time) == null ? void 0 : o.getTime()) === e.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, "aria-role": "button", class: {
|
|
904
|
-
time: !0,
|
|
905
|
-
selected: typeof this.selectedTimeslot < "u" && ((n = (s = this.selectedTimeslot) == null ? void 0 : s.start_time) == null ? void 0 : n.getTime()) === e.start_time.getTime()
|
|
906
|
-
}, 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 }));
|
|
907
|
-
})), this.selectedTimeslot && a("div", { class: "footer" }, a("sp-button", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, a("slot", { name: "timeslot-picker-cta-label" }, l.t("nextButton")), " ")))) : a(g, null);
|
|
908
|
-
}
|
|
909
|
-
static get watchers() {
|
|
910
|
-
return {
|
|
911
|
-
selectedLanguage: ["selectedLanguageChanged"],
|
|
912
|
-
selectedDate: ["selectedDateChanged"],
|
|
913
|
-
availability: ["availabilityChanged"]
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
|
-
};
|
|
917
|
-
Ze([
|
|
918
|
-
w({
|
|
919
|
-
name: "nylas-timeslot-picker",
|
|
920
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
921
|
-
["scheduler.selectedDate", "selectedDate"],
|
|
922
|
-
["scheduler.availability", "availability"],
|
|
923
|
-
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
924
|
-
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
925
|
-
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
926
|
-
["scheduler.isLoading", "isLoading"]
|
|
927
|
-
]),
|
|
928
|
-
eventToProps: {
|
|
929
|
-
timeslotSelected: async (e, t) => {
|
|
930
|
-
t.scheduler.selectTime(e.detail);
|
|
931
|
-
},
|
|
932
|
-
timeslotConfirmed: async (e, t) => {
|
|
933
|
-
e.detail && t.scheduler.toggleAdditionalData(!0);
|
|
934
|
-
}
|
|
935
|
-
},
|
|
936
|
-
fireRegisterEvent: !0
|
|
937
|
-
}),
|
|
938
|
-
H("design:type", Function),
|
|
939
|
-
H("design:paramtypes", []),
|
|
940
|
-
H("design:returntype", void 0)
|
|
941
|
-
], se.prototype, "render", null);
|
|
942
|
-
se.style = Ae;
|
|
943
|
-
export {
|
|
944
|
-
K as nylas_booked_event_card,
|
|
945
|
-
Q as nylas_booking_form,
|
|
946
|
-
ee as nylas_cancel_booking_form,
|
|
947
|
-
te as nylas_cancelled_event_card,
|
|
948
|
-
ne as nylas_date_picker,
|
|
949
|
-
ie as nylas_locale_switch,
|
|
950
|
-
Pe as nylas_logo,
|
|
951
|
-
Ne as nylas_notification,
|
|
952
|
-
oe as nylas_selected_event_card,
|
|
953
|
-
se as nylas_timeslot_picker
|
|
954
|
-
};
|