@nylas/react 1.3.6 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_2.entry-04909861.cjs +1 -0
- package/dist/add-circle-icon_2.entry-0d9ba871.js +26 -0
- package/dist/archive-icon.entry-3d6d9d3f.js +16 -0
- package/dist/archive-icon.entry-88459432.cjs +1 -0
- package/dist/{arrow-icon.entry-9cfd86a1.js → arrow-icon.entry-789ee889.js} +3 -2
- package/dist/arrow-icon.entry-c35e1933.cjs +1 -0
- package/dist/bold-icon.entry-827e95bf.cjs +1 -0
- package/dist/{bold-icon.entry-eab3420d.js → bold-icon.entry-fbb382d2.js} +7 -6
- package/dist/{button-component_2.entry-7cd5f9c0.js → button-component_2.entry-6c012ee4.js} +10 -9
- package/dist/button-component_2.entry-acd13f45.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_36.entry-1bb3b1a8.js +4689 -0
- package/dist/calendar-agenda-fill-icon_36.entry-fa8121df.cjs +6 -0
- package/dist/calendar-cancel-icon.entry-2e97f7d8.cjs +1 -0
- package/dist/{calendar-cancel-icon.entry-299d6fba.js → calendar-cancel-icon.entry-a4d040db.js} +6 -5
- package/dist/{calendar-check-icon_2.entry-08ef8d2f.js → calendar-check-icon_2.entry-a48a358d.js} +12 -11
- package/dist/calendar-check-icon_2.entry-bca4821d.cjs +1 -0
- package/dist/{calendar-icon.entry-53b54115.js → calendar-icon.entry-57727659.js} +6 -5
- package/dist/calendar-icon.entry-a289313a.cjs +1 -0
- package/dist/checkbox-component.entry-af3e7005.cjs +1 -0
- package/dist/checkbox-component.entry-f4f98226.js +43 -0
- package/dist/checkmark-icon_15.entry-dace1b62.cjs +5 -0
- package/dist/checkmark-icon_15.entry-f43549b3.js +1337 -0
- package/dist/chevron-icon_3.entry-219b42e6.cjs +1 -0
- package/dist/chevron-icon_3.entry-25533d13.js +148 -0
- package/dist/clock-icon_4.entry-3917c667.cjs +1 -0
- package/dist/{clock-icon_4.entry-0e809dcb.js → clock-icon_4.entry-76f29f7e.js} +9 -8
- package/dist/{constants-6da0ede7-49c32ba7.js → constants-3d8016e3-3c080f00.js} +110 -41
- package/dist/constants-3d8016e3-fd6c3848.cjs +1 -0
- package/dist/customParseFormat-6c652dbb-8a42d5b0.js +135 -0
- package/dist/customParseFormat-6c652dbb-ba81ab97.cjs +1 -0
- package/dist/{delete-icon.entry-802084f6.js → delete-icon.entry-3b61864e.js} +8 -7
- package/dist/delete-icon.entry-96420b21.cjs +1 -0
- package/dist/{document-refresh-icon.entry-d1604f53.js → document-refresh-icon.entry-7333b7c9.js} +6 -5
- package/dist/document-refresh-icon.entry-8b5c6b9b.cjs +1 -0
- package/dist/elements/index.d.ts +10 -0
- package/dist/{feedbackSync-c040f483-2b6476c4.js → feedbackSync-352aaf4a-b2b83cfa.js} +1 -1
- package/dist/{feedbackSync-c040f483-d6dd0560.cjs → feedbackSync-352aaf4a-ba1bf452.cjs} +1 -1
- package/dist/{folder-icon.entry-6c0c09ed.js → folder-icon.entry-bb5e2452.js} +5 -4
- package/dist/folder-icon.entry-d2e46d3a.cjs +1 -0
- package/dist/forward-icon.entry-1fcf5a6b.cjs +1 -0
- package/dist/forward-icon.entry-af8d2147.js +16 -0
- package/dist/globe-icon_2.entry-b4b55760.cjs +1 -0
- package/dist/globe-icon_2.entry-cc6d9d67.js +200 -0
- package/dist/google-logo-icon_6.entry-aa7b5b42.js +1484 -0
- package/dist/google-logo-icon_6.entry-eefdec63.cjs +2 -0
- package/dist/google-meet-icon_5.entry-9758e527.js +56 -0
- package/dist/google-meet-icon_5.entry-c545537a.cjs +1 -0
- package/dist/inbox-icon.entry-b9640d5a.cjs +1 -0
- package/dist/inbox-icon.entry-c005ebc5.js +16 -0
- package/dist/index-05630f15.cjs +57 -0
- package/dist/index-78390f2e.js +17607 -0
- package/dist/index.d.ts +1 -3
- package/dist/{index.es-2b014ec7-72557487.js → index.es-4a203e8e-cf485db5.js} +818 -804
- package/dist/{index.es-2b014ec7-0589e68a.cjs → index.es-4a203e8e-f668b8c2.cjs} +6 -6
- package/dist/info-icon_2.entry-b17298b6.js +35 -0
- package/dist/info-icon_2.entry-ecbc6605.cjs +1 -0
- package/dist/input-component.entry-24366ab8.cjs +1 -0
- package/dist/input-component.entry-9da5da6c.js +84 -0
- package/dist/input-dropdown_2.entry-0109b06c.cjs +1 -0
- package/dist/input-dropdown_2.entry-d65f7152.js +231 -0
- package/dist/italic-icon.entry-afa4332a.cjs +1 -0
- package/dist/{italic-icon.entry-d610e66f.js → italic-icon.entry-d0a536f2.js} +3 -2
- package/dist/multi-select-dropdown_2.entry-2c7a1a06.cjs +1 -0
- package/dist/multi-select-dropdown_2.entry-c56b5fd2.js +187 -0
- package/dist/notebook-store-b61693cd-0877e7a2.js +14 -0
- package/dist/notebook-store-b61693cd-a7b8ae37.cjs +5 -0
- package/dist/nylas-booked-event-card_12.entry-827c7fb4.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-960fdfe2.js +1422 -0
- package/dist/nylas-call-summary.entry-1cce1446.js +16 -0
- package/dist/nylas-call-summary.entry-f10f3c54.cjs +1 -0
- package/dist/nylas-event-calendar_3.entry-8bb08ed3.js +9705 -0
- package/dist/nylas-event-calendar_3.entry-b656237b.cjs +6 -0
- package/dist/nylas-form-card.entry-62578338.cjs +1 -0
- package/dist/nylas-form-card.entry-7455b8f1.js +58 -0
- package/dist/nylas-if-state.entry-0897dc70.cjs +1 -0
- package/dist/{nylas-if-state.entry-ee7d92b0.js → nylas-if-state.entry-7fa6d392.js} +4 -3
- package/dist/nylas-key-points.entry-449e1be0.js +29 -0
- package/dist/nylas-key-points.entry-693f33a1.cjs +1 -0
- package/dist/nylas-login.entry-36544dc8.cjs +1 -0
- package/dist/{nylas-login.entry-265f9d0f.js → nylas-login.entry-d7082306.js} +4 -3
- package/dist/{nylas-provider.entry-5605a3e0.js → nylas-provider.entry-a0e7ce4d.js} +6 -5
- package/dist/nylas-provider.entry-b93d2a62.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-332d27e0.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-b3e085b3.js → nylas-scheduler-editor.entry-78fe5abf.js} +524 -266
- package/dist/nylas-scheduling.entry-1d80c349.cjs +1 -0
- package/dist/nylas-scheduling.entry-fa9ff55b.js +439 -0
- package/dist/nylas-transcript.entry-570d3abe.cjs +6 -0
- package/dist/nylas-transcript.entry-b129565c.js +128 -0
- package/dist/nylas-video-player.entry-9c7c9792.cjs +1 -0
- package/dist/nylas-video-player.entry-e208d443.js +39 -0
- package/dist/nylas-video-preview.entry-a3f542ad.js +16 -0
- package/dist/nylas-video-preview.entry-bd9bdda7.cjs +1 -0
- package/dist/{person-icon.entry-85660f98.js → person-icon.entry-82fbc43e.js} +8 -7
- package/dist/person-icon.entry-e4d11400.cjs +1 -0
- package/dist/play-icon.entry-68bc660a.js +16 -0
- package/dist/play-icon.entry-9cab598b.cjs +1 -0
- package/dist/radio-button-group.entry-6a2adf11.cjs +1 -0
- package/dist/radio-button-group.entry-f7679911.js +47 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +134 -125
- package/dist/refresh-icon.entry-0f1e5f20.cjs +1 -0
- package/dist/{refresh-icon.entry-d8644f5d.js → refresh-icon.entry-394b0814.js} +6 -5
- package/dist/{register-component-e9c10e19-80bbc4dd.cjs → register-component-1027b769-62812558.cjs} +1 -1
- package/dist/{register-component-e9c10e19-099fb50f.js → register-component-1027b769-dd21b16d.js} +1 -1
- package/dist/{reply-all-icon.entry-f209daeb.js → reply-all-icon.entry-0fad8f2f.js} +5 -4
- package/dist/reply-all-icon.entry-1680f1e5.cjs +1 -0
- package/dist/{reply-icon.entry-d37a129b.js → reply-icon.entry-5f4b7837.js} +5 -4
- package/dist/reply-icon.entry-77342442.cjs +1 -0
- package/dist/scheduler-config-store-d6729d8d-06a3a314.cjs +1 -0
- package/dist/{scheduler-config-store-ed4a8dfd-35ec90c6.js → scheduler-config-store-d6729d8d-854b5da8.js} +4 -1
- package/dist/scheduler-store-f3e2a26f-7cee436f.cjs +1 -0
- package/dist/scheduler-store-f3e2a26f-85df53f7.js +533 -0
- package/dist/sent-icon.entry-20a8945d.cjs +1 -0
- package/dist/sent-icon.entry-2d122865.js +16 -0
- package/dist/spam-icon.entry-86178cc5.cjs +1 -0
- package/dist/spam-icon.entry-9e374d44.js +16 -0
- package/dist/star-icon.entry-1b94c861.cjs +1 -0
- package/dist/{star-icon.entry-9b22bb32.js → star-icon.entry-bb1b517d.js} +7 -6
- package/dist/stop-icon.entry-7b21833b.cjs +1 -0
- package/dist/{stop-icon.entry-1f7918b2.js → stop-icon.entry-e4d3526d.js} +3 -2
- package/dist/textarea-component.entry-ba3c9311.js +39 -0
- package/dist/textarea-component.entry-fdba933d.cjs +1 -0
- package/dist/toggle-switch.entry-4a980d1d.js +34 -0
- package/dist/toggle-switch.entry-9142a3d3.cjs +1 -0
- package/dist/{translate-icon.entry-8cffa646.js → translate-icon.entry-1657aa04.js} +5 -4
- package/dist/translate-icon.entry-b4908cf3.cjs +1 -0
- package/dist/trash-fill-icon.entry-a6791185.cjs +1 -0
- package/dist/trash-fill-icon.entry-c9e1769e.js +16 -0
- package/dist/{underline-icon.entry-afd9c78b.js → underline-icon.entry-1ba4d923.js} +5 -4
- package/dist/underline-icon.entry-d1f91e63.cjs +1 -0
- package/dist/warning-icon.entry-b1480f57.cjs +1 -0
- package/dist/{warning-icon.entry-53441175.js → warning-icon.entry-fe155c15.js} +5 -4
- package/package.json +12 -4
- package/dist/add-circle-icon.entry-25aecb13.js +0 -15
- package/dist/add-circle-icon.entry-5c49ba96.cjs +0 -1
- package/dist/archive-icon.entry-0a9e8ec3.cjs +0 -1
- package/dist/archive-icon.entry-89e31121.js +0 -15
- package/dist/arrow-icon.entry-19e5237c.cjs +0 -1
- package/dist/bold-icon.entry-d591e701.cjs +0 -1
- package/dist/button-component_2.entry-ce4314bf.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_54.entry-7099138a.js +0 -5865
- package/dist/calendar-agenda-fill-icon_54.entry-9228dbe7.cjs +0 -8
- package/dist/calendar-cancel-icon.entry-6e3d20f1.cjs +0 -1
- package/dist/calendar-check-icon_2.entry-087dd913.cjs +0 -1
- package/dist/calendar-icon.entry-73f9d05b.cjs +0 -1
- package/dist/checkbox-component_3.entry-bc9768dd.cjs +0 -1
- package/dist/checkbox-component_3.entry-d828eb1d.js +0 -149
- package/dist/chevron-icon_3.entry-783588a9.js +0 -147
- package/dist/chevron-icon_3.entry-e956d78c.cjs +0 -1
- package/dist/clock-icon_4.entry-60d41dfd.cjs +0 -1
- package/dist/close-icon.entry-1b5d25c5.cjs +0 -1
- package/dist/close-icon.entry-fef4f624.js +0 -15
- package/dist/constants-6da0ede7-151395ad.cjs +0 -1
- package/dist/copy-icon.entry-25699ab8.js +0 -15
- package/dist/copy-icon.entry-ab6530e0.cjs +0 -1
- package/dist/core-js-38e53e34.cjs +0 -4
- package/dist/core-js-a9d3b6e1.js +0 -3297
- package/dist/delete-icon.entry-e99e1f82.cjs +0 -1
- package/dist/document-refresh-icon.entry-065a59f5.cjs +0 -1
- package/dist/dom-68f08be9.cjs +0 -15
- package/dist/dom-86e17616.js +0 -664
- package/dist/folder-icon.entry-351e61fc.cjs +0 -1
- package/dist/forward-icon.entry-0ccfb600.js +0 -15
- package/dist/forward-icon.entry-6b7af9cd.cjs +0 -1
- package/dist/globe-icon.entry-2b75b66b.cjs +0 -1
- package/dist/globe-icon.entry-5ddcd2cb.js +0 -15
- package/dist/google-logo-icon_4.entry-04174684.js +0 -790
- package/dist/google-logo-icon_4.entry-a685ff91.cjs +0 -1
- package/dist/inbox-icon.entry-0ad18b3f.js +0 -15
- package/dist/inbox-icon.entry-425d1ded.cjs +0 -1
- package/dist/index-7e7c24f1.js +0 -16837
- package/dist/index-81719cc6.cjs +0 -81
- package/dist/info-icon_2.entry-7ec02802.cjs +0 -1
- package/dist/info-icon_2.entry-a6d0e842.js +0 -34
- package/dist/input-color-picker.entry-d98d06ca.js +0 -48
- package/dist/input-color-picker.entry-ed9a1c07.cjs +0 -1
- package/dist/input-component.entry-2e57b00e.cjs +0 -1
- package/dist/input-component.entry-f3aa3419.js +0 -70
- package/dist/input-dropdown_2.entry-0d9c8475.js +0 -228
- package/dist/input-dropdown_2.entry-6fc7df16.cjs +0 -1
- package/dist/italic-icon.entry-7a8712f2.cjs +0 -1
- package/dist/multi-select-dropdown.entry-b31d9f11.js +0 -116
- package/dist/multi-select-dropdown.entry-eaa268b4.cjs +0 -1
- package/dist/nylas-booked-event-card_12.entry-45514813.js +0 -1378
- package/dist/nylas-booked-event-card_12.entry-498de30a.cjs +0 -1
- package/dist/nylas-form-card.entry-67aec298.js +0 -57
- package/dist/nylas-form-card.entry-fdb3c114.cjs +0 -1
- package/dist/nylas-if-state.entry-76b38c9c.cjs +0 -1
- package/dist/nylas-login.entry-589e45d0.cjs +0 -1
- package/dist/nylas-provider.entry-cfb9627c.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-6fdfb9b5.cjs +0 -2
- package/dist/nylas-scheduling.entry-8cc5c353.cjs +0 -1
- package/dist/nylas-scheduling.entry-bc00beba.js +0 -424
- package/dist/nylas-time-window-picker.entry-a77c1d67.cjs +0 -1
- package/dist/nylas-time-window-picker.entry-c421303e.js +0 -316
- package/dist/person-icon.entry-36b21e95.cjs +0 -1
- package/dist/play-icon.entry-953b1bc8.js +0 -15
- package/dist/play-icon.entry-c35ade8a.cjs +0 -1
- package/dist/refresh-icon.entry-038501ca.cjs +0 -1
- package/dist/reply-all-icon.entry-ead9d0ba.cjs +0 -1
- package/dist/reply-icon.entry-b7f35ecd.cjs +0 -1
- package/dist/scheduler-config-store-ed4a8dfd-0d4408cf.cjs +0 -1
- package/dist/scheduler-store-dc3a7958-7c73f5e2.js +0 -487
- package/dist/scheduler-store-dc3a7958-99c6bdf6.cjs +0 -1
- package/dist/sent-icon.entry-b662ef5b.cjs +0 -1
- package/dist/sent-icon.entry-ec433cec.js +0 -15
- package/dist/spam-icon.entry-3a553ae4.js +0 -15
- package/dist/spam-icon.entry-a79819fd.cjs +0 -1
- package/dist/star-icon.entry-47ea44e7.cjs +0 -1
- package/dist/stop-icon.entry-26e2e633.cjs +0 -1
- package/dist/textarea-component.entry-6939d0fc.js +0 -38
- package/dist/textarea-component.entry-da0a861e.cjs +0 -1
- package/dist/toggle-switch.entry-5ae5ba46.js +0 -33
- package/dist/toggle-switch.entry-c5fd3e33.cjs +0 -1
- package/dist/translate-icon.entry-72e0369e.cjs +0 -1
- package/dist/trash-fill-icon.entry-815859c6.js +0 -15
- package/dist/trash-fill-icon.entry-8620c28f.cjs +0 -1
- package/dist/underline-icon.entry-ba1a9e87.cjs +0 -1
- package/dist/warning-icon.entry-7cbede6b.cjs +0 -1
|
@@ -1,1378 +0,0 @@
|
|
|
1
|
-
import { r as _, c as m, d as c, h as a, i as l, k as ue, q as ye, H as k, g as D, s as be, t as Se, j as pe, v as ze, w as Re, x as j, y as je, z as Fe, A as N, C as Pe, F as Oe, D as H } from "./index-7e7c24f1.js";
|
|
2
|
-
import { R as S } from "./register-component-e9c10e19-099fb50f.js";
|
|
3
|
-
import { c as O, T as F, a as ge } from "./constants-6da0ede7-49c32ba7.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
const $e = ':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-booked-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 0;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:16px;font-weight:400;border-bottom:1px solid var(--nylas-base-200);width:inherit;padding:0 0 1.5rem}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booked-event-header .card-description{text-align:center}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:16px;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.button-container{width:inherit}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);border-top:1px solid var(--nylas-base-200);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}', Me = $e;
|
|
7
|
-
var Ne = function(e, t, n, o) {
|
|
8
|
-
var s = arguments.length, i = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, r;
|
|
9
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
10
|
-
i = Reflect.decorate(e, t, n, o);
|
|
11
|
-
else
|
|
12
|
-
for (var d = e.length - 1; d >= 0; d--)
|
|
13
|
-
(r = e[d]) && (i = (s < 3 ? r(i) : s > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
14
|
-
return s > 3 && i && Object.defineProperty(t, n, i), i;
|
|
15
|
-
}, A = function(e, t) {
|
|
16
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
17
|
-
return Reflect.metadata(e, t);
|
|
18
|
-
};
|
|
19
|
-
const ke = class {
|
|
20
|
-
constructor(e) {
|
|
21
|
-
_(this, e), this.cancelBookingButtonClicked = m(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = m(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = m(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = m(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
|
|
22
|
-
var s, i;
|
|
23
|
-
const t = new Date(this.selectedTimeslot.start_time), n = (i = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : i.min_cancellation_notice;
|
|
24
|
-
t.getTime() - n * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime() ? this.cancelBookedEventValidationError.emit({
|
|
25
|
-
error: {
|
|
26
|
-
title: "Cancellation Error",
|
|
27
|
-
message: `You cannot cancel the booking within ${n} minutes of the event.`
|
|
28
|
-
}
|
|
29
|
-
}) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
|
|
30
|
-
}, this.handleRescheduleButtonClicked = () => {
|
|
31
|
-
const t = (n) => {
|
|
32
|
-
this.rescheduleBookedEventError.emit(n);
|
|
33
|
-
};
|
|
34
|
-
this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: t });
|
|
35
|
-
}, this.getPaticipantType = (t) => {
|
|
36
|
-
switch (t) {
|
|
37
|
-
case "host":
|
|
38
|
-
return "Host";
|
|
39
|
-
case "you":
|
|
40
|
-
return "You";
|
|
41
|
-
default:
|
|
42
|
-
return "";
|
|
43
|
-
}
|
|
44
|
-
}, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.configSettings = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.selectedLanguage = navigator.language, this.hour12 = void 0, this.startTime = "", this.endTime = "";
|
|
45
|
-
}
|
|
46
|
-
themeConfigChanged(e) {
|
|
47
|
-
this.applyThemeConfig(e);
|
|
48
|
-
}
|
|
49
|
-
connectedCallback() {
|
|
50
|
-
}
|
|
51
|
-
disconnectedCallback() {
|
|
52
|
-
}
|
|
53
|
-
async componentWillLoad() {
|
|
54
|
-
c("[nylas-booked-event-card] Component will load");
|
|
55
|
-
}
|
|
56
|
-
async componentDidLoad() {
|
|
57
|
-
var n, o;
|
|
58
|
-
c("[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.'), this.applyThemeConfig(this.themeConfig);
|
|
59
|
-
const e = O[this.selectedLanguage || "en"], t = new Intl.DateTimeFormat(e, {
|
|
60
|
-
hour: "2-digit",
|
|
61
|
-
minute: "2-digit",
|
|
62
|
-
timeZone: this.selectedTimezone,
|
|
63
|
-
hour12: this.hour12
|
|
64
|
-
});
|
|
65
|
-
this.startTime = t.format((n = this.selectedTimeslot) == null ? void 0 : n.start_time), this.endTime = t.format((o = this.selectedTimeslot) == null ? void 0 : o.end_time);
|
|
66
|
-
}
|
|
67
|
-
applyThemeConfig(e) {
|
|
68
|
-
if (e)
|
|
69
|
-
for (const [t, n] of Object.entries(e))
|
|
70
|
-
this.host.style.setProperty(`${t}`, n);
|
|
71
|
-
}
|
|
72
|
-
render() {
|
|
73
|
-
var n, o, s, i, r, d, g, p, u, v, x, w, T, E, B, I;
|
|
74
|
-
const e = (n = this.configSettings) == null ? void 0 : n.booking_type, t = e && e !== "booking";
|
|
75
|
-
return a(k, { key: "7db019b852ab70270adb7dc9e958e6e7381a26b3", part: "nbec" }, a("div", { key: "f309b22194e70799fd0333c899e3ef6dc2cadda2", class: "nylas-booked-event-card" }, a("div", { key: "fda9f6f52eb02449553e3a77f02a9bd9ccc1ffb1", class: "booked-event-timezone" }, a("globe-icon", { key: "86e8540c01d68d6b661f1146bbe24849023ce1bd" }), F[this.selectedTimezone]), a("div", { key: "1038dc03151ab6a2b961d5f4ded96ba7445d1a54", class: "event-card-wrapper", part: "nbec__card" }, a("div", { key: "62143a2984318fb91ac9e8211901dddc99481ca2", class: "calendar-icon" }, a("calendar-check-icon", { key: "8c2b99dcc14a65e556648d11fd36fbabda5c6e60" })), a("div", { key: "ceea5100d690b09d4819486a305d639f483522f6", class: "booked-event-header" }, a("h2", { key: "af360b0c2fd115edd22e6fd4977819c77c83aa64", slot: "card-title", part: "nbec__title" }, this.rescheduleBookingId && !this.isLoading ? `${l.t("bookingRescheduled")}` : t && !this.isLoading ? `${l.t("bookingSent")}` : `${l.t("bookingConfirmed")}`, "!"), a("div", { key: "afad927b2a1e56191d73705c93c6b285305810f8", class: "card-description", part: "nbec__description" }, t ? l.t("bookingSentDescription") : a("span", null, l.t("bookingConfirmedDescription")))), a("div", { key: "3a2fcc44ec16291970f5a043fea3c4e0e76cd961", class: "booking-date-time" }, a("checkmark-circle-icon", { key: "9e09cc4a564378d2a57eb26a20d051ff5783959f" }), a("h3", { key: "43751ff57685368a9ff566e042c8ac874a2b972d" }, l.t("bookingDateAndTimeHeader")), a("p", { key: "aa873b56137af390655ff8c2eed3baaab44b287a" }, (o = this.selectedTimeslot) != null && o.start_time ? ue(ye((s = this.selectedTimeslot) == null ? void 0 : s.start_time, this.selectedTimezone)) : "-", " ", a("br", { key: "b310eb7c7482a90874a6488d6cf3d25e5d6bb747" }), this.startTime, " - ", this.endTime)), a("div", { key: "2b3342507a052d72c1e1514753fbb7eb4225cd20", class: "booking-participants" }), !t && a("div", { class: "button-container" }, a("div", { class: {
|
|
76
|
-
footer: !0,
|
|
77
|
-
"no-footer": ((r = (i = this.configSettings) == null ? void 0 : i.scheduler) == null ? void 0 : r.hide_cancellation_options) && ((g = (d = this.configSettings) == null ? void 0 : d.scheduler) == null ? void 0 : g.hide_rescheduling_options) || ((p = this.configSettings) == null ? void 0 : p.booking_type) === "organizer-confirmation",
|
|
78
|
-
"no-template-cols": ((v = (u = this.configSettings) == null ? void 0 : u.scheduler) == null ? void 0 : v.hide_cancellation_options) || ((w = (x = this.configSettings) == null ? void 0 : x.scheduler) == null ? void 0 : w.hide_rescheduling_options)
|
|
79
|
-
} }, !((E = (T = this.configSettings) == null ? void 0 : T.scheduler) != null && E.hide_cancellation_options) && a("button-component", { variant: "destructive", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, `${l.t("cancelBookingButton")}`), !((I = (B = this.configSettings) == null ? void 0 : B.scheduler) != null && I.hide_rescheduling_options) && a("button-component", { variant: "basic", onClick: this.handleRescheduleButtonClicked, disabled: this.isLoading, part: "nbec__button-outline nbec__reschedule-cta" }, `${l.t("rescheduleBookingButton")}`))))));
|
|
80
|
-
}
|
|
81
|
-
get host() {
|
|
82
|
-
return D(this);
|
|
83
|
-
}
|
|
84
|
-
static get watchers() {
|
|
85
|
-
return {
|
|
86
|
-
themeConfig: ["themeConfigChanged"]
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
Ne([
|
|
91
|
-
S({
|
|
92
|
-
name: "nylas-booked-event-card",
|
|
93
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
94
|
-
["scheduler.bookingInfo", "bookingInfo"],
|
|
95
|
-
["scheduler.rescheduleBookingId", "rescheduleBookingId"],
|
|
96
|
-
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
97
|
-
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
98
|
-
["scheduler.isLoading", "isLoading"],
|
|
99
|
-
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
100
|
-
["scheduler.configSettings", "configSettings"],
|
|
101
|
-
["scheduler.themeConfig", "themeConfig"],
|
|
102
|
-
["scheduler.hour12", "hour12"]
|
|
103
|
-
]),
|
|
104
|
-
eventToProps: {
|
|
105
|
-
cancelBookingButtonClicked: async (e, t) => {
|
|
106
|
-
t.scheduler.setCancel(e.detail.bookingId);
|
|
107
|
-
},
|
|
108
|
-
rescheduleButtonClicked: async (e, t) => {
|
|
109
|
-
const n = await t.scheduler.setReschedule(e.detail.bookingId), { errorHandler: o } = e.detail;
|
|
110
|
-
o && (!n || "error" in n) && o(n);
|
|
111
|
-
},
|
|
112
|
-
rescheduleBookedEventError: async (e, t) => {
|
|
113
|
-
c("nylas-booked-event-card", "rescheduleBookedEventError", e.detail);
|
|
114
|
-
},
|
|
115
|
-
cancelBookedEventValidationError: async (e, t) => {
|
|
116
|
-
c("nylas-booked-event-card", "cancelBookedEventValidationError", e.detail);
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
fireRegisterEvent: !0
|
|
120
|
-
}),
|
|
121
|
-
A("design:type", Function),
|
|
122
|
-
A("design:paramtypes", []),
|
|
123
|
-
A("design:returntype", void 0)
|
|
124
|
-
], ke.prototype, "render", null);
|
|
125
|
-
ke.style = Me;
|
|
126
|
-
const He = ':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}.cta{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{grid-template-columns:1fr}}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family);font-size:16px}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}.button-content{display:flex;gap:4px;align-items:center}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%}input[type=text]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}button-component.remove-guest{position:absolute;height:51px;right:0}button-component.remove-guest.error button{border-color:var(--nylas-error)}button-component.remove-guest button{height:inherit;border-top-left-radius:initial;border-bottom-left-radius:initial;border:none !important;border-left:1px solid var(--nylas-base-300) !important}button-component.remove-guest button:hover,button-component.remove-guest button:focus{outline:1px solid var(--nylas-primary) !important;color:var(--nylas-primary)}button-component.back button{--dot-color:var(--nylas-base-800)}.guest-email-input{position:relative;display:flex;width:100%}multi-select-dropdown::part(msd_dropdown-label){margin-bottom:4px}multi-select-dropdown::part(msd_dropdown_error){font-size:16px}multi-select-dropdown::part(msd_dropdown-button){height:52px;border-color:var(--nylas-base-300)}multi-select-dropdown::part(msd_dropdown-button--error){border-width:2px;border-color:var(--nylas-error)}', Ae = He;
|
|
127
|
-
var qe = function(e, t, n, o) {
|
|
128
|
-
var s = arguments.length, i = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, r;
|
|
129
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
130
|
-
i = Reflect.decorate(e, t, n, o);
|
|
131
|
-
else
|
|
132
|
-
for (var d = e.length - 1; d >= 0; d--)
|
|
133
|
-
(r = e[d]) && (i = (s < 3 ? r(i) : s > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
134
|
-
return s > 3 && i && Object.defineProperty(t, n, i), i;
|
|
135
|
-
}, q = function(e, t) {
|
|
136
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
137
|
-
return Reflect.metadata(e, t);
|
|
138
|
-
};
|
|
139
|
-
const P = /^[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])?)*$/, ve = class {
|
|
140
|
-
constructor(e) {
|
|
141
|
-
_(this, e), this.nameChanged = m(this, "nameChanged", 7), this.emailChanged = m(this, "emailChanged", 7), this.backButtonClicked = m(this, "backButtonClicked", 7), this.detailsConfirmed = m(this, "detailsConfirmed", 7), this.bookingFormError = m(this, "bookingFormError", 7), this.bookingFormSubmitted = m(this, "bookingFormSubmitted", 7), this.handleGuestChange = (t, n) => {
|
|
142
|
-
this.resetGuestEmailError(t);
|
|
143
|
-
const o = [...this.guestEmails];
|
|
144
|
-
o[t] = be(n), this.guestEmails = [...o];
|
|
145
|
-
}, this.handleGuestBlur = (t, n) => {
|
|
146
|
-
if (this.resetGuestEmailError(t), n === "") {
|
|
147
|
-
this.guestEmailErrors[t] = l.t("fieldRequired", { field: l.t("email") });
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
if (!P.test(n)) {
|
|
151
|
-
this.guestEmailErrors[t] = l.t("invalidInputFormat", { field: l.t("email") });
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
this.handleGuestChange(t, n);
|
|
155
|
-
}, this.addGuestButtonClickedHandler = (t) => {
|
|
156
|
-
t.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
|
|
157
|
-
}, this.removeGuestButtonClickHandler = (t, n) => {
|
|
158
|
-
t.preventDefault(), this.resetGuestEmailError(n);
|
|
159
|
-
const o = [...this.guestEmails];
|
|
160
|
-
o.splice(n, 1), this.guestEmails = [...o];
|
|
161
|
-
}, this.handleBackButtonClicked = (t) => {
|
|
162
|
-
t.preventDefault(), this.backButtonLoading = !0, this.backButtonClicked.emit();
|
|
163
|
-
}, this.bookButtonClickedHandler = async (t) => {
|
|
164
|
-
var p, u, v, x, w, T, E, B, I, R, y;
|
|
165
|
-
if (t.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
|
|
166
|
-
return;
|
|
167
|
-
c("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
|
|
168
|
-
const o = this.name || ((u = (p = this.bookingInfo) == null ? void 0 : p.primaryParticipant) == null ? void 0 : u.name), s = this.email || ((x = (v = this.bookingInfo) == null ? void 0 : v.primaryParticipant) == null ? void 0 : x.email);
|
|
169
|
-
if (!o || o === "") {
|
|
170
|
-
this.isNameValid = !1, this.validationError.name = l.t("fieldRequired", { field: l.t("name") }) || "Name is required", this.bookingFormError.emit({
|
|
171
|
-
title: "Booking form error",
|
|
172
|
-
description: "Name is required"
|
|
173
|
-
});
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
if (!s || s === "") {
|
|
177
|
-
this.isEmailValid = !1, this.validationError.email = l.t("fieldRequired", { field: l.t("email") }) || "Email is required", this.bookingFormError.emit({
|
|
178
|
-
title: "Booking form error",
|
|
179
|
-
description: "Email is required"
|
|
180
|
-
});
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
if (!P.test(s)) {
|
|
184
|
-
this.isEmailValid = !1, this.validationError.email = l.t("invalidInputFormat", { field: l.t("email") }), this.bookingFormError.emit({
|
|
185
|
-
title: "Booking form error",
|
|
186
|
-
description: l.t("invalidInputFormat", { field: l.t("email") }) || "Invalid email"
|
|
187
|
-
});
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
let i = [];
|
|
191
|
-
if (this.guestEmails.length > 0) {
|
|
192
|
-
let f = !1;
|
|
193
|
-
if (this.guestEmails.forEach((b, h) => {
|
|
194
|
-
b === "" ? (f = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [h]: l.t("fieldRequired", { field: l.t("email") }) }) : P.test(b) || (f = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [h]: l.t("invalidInputFormat", { field: l.t("email") }) });
|
|
195
|
-
}), f) {
|
|
196
|
-
this.bookingFormError.emit({
|
|
197
|
-
title: "Booking form error",
|
|
198
|
-
description: l.t("invalidInputFormat", { field: l.t("guestEmail") }) || "Invalid guest email"
|
|
199
|
-
});
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
i = this.guestEmails.map((b) => ({ name: b.trim(), email: b.trim() }));
|
|
203
|
-
} else
|
|
204
|
-
(w = this.bookingInfo) != null && w.guests && (i = (T = this.bookingInfo) == null ? void 0 : T.guests);
|
|
205
|
-
const r = {}, d = ((B = (E = this.configSettings) == null ? void 0 : E.scheduler) == null ? void 0 : B.additional_fields) || {}, g = ((R = (I = this.configSettings) == null ? void 0 : I.booking) == null ? void 0 : R.additional_fields) || {};
|
|
206
|
-
(y = this.bookingInfo) != null && y.additionalFields && Object.entries(this.bookingInfo.additionalFields).forEach(([f, b]) => {
|
|
207
|
-
f in d && (r[f] = b.value);
|
|
208
|
-
}), Object.entries(d).forEach(([f, b]) => {
|
|
209
|
-
if (!(f in r)) {
|
|
210
|
-
const h = g[f] || b.default || "";
|
|
211
|
-
r[f] = h;
|
|
212
|
-
}
|
|
213
|
-
}), this.detailsConfirmed.emit({
|
|
214
|
-
primaryParticipant: {
|
|
215
|
-
name: o,
|
|
216
|
-
email: s
|
|
217
|
-
},
|
|
218
|
-
guests: i,
|
|
219
|
-
additionalFields: { ...r, ...this.additionalFields }
|
|
220
|
-
});
|
|
221
|
-
}, this.updateAdditionalFields = (t, n) => {
|
|
222
|
-
this.additionalFields && (this.additionalFields[t] = n);
|
|
223
|
-
}, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.additionalFields = {}, this.validationError = { name: "", email: "" }, this.backButtonLoading = !1, this.firstRender = !0;
|
|
224
|
-
}
|
|
225
|
-
connectedCallback() {
|
|
226
|
-
}
|
|
227
|
-
disconnectedCallback() {
|
|
228
|
-
}
|
|
229
|
-
componentWillLoad() {
|
|
230
|
-
c("nylas-booking-form", "componentWillLoad", this.bookingInfo);
|
|
231
|
-
}
|
|
232
|
-
componentDidLoad() {
|
|
233
|
-
var e, t, n, o, s, i, r, d, g, p, u, v, x, w, T, E, B;
|
|
234
|
-
c("nylas-booking-form", "componentDidLoad", this.bookingInfo), this.bookingInfo && ((e = this.bookingInfo) != null && e.primaryParticipant) ? (this.name = (t = this.bookingInfo.primaryParticipant) == null ? void 0 : t.name, this.email = (n = this.bookingInfo.primaryParticipant) == null ? void 0 : n.email) : (s = (o = this.configSettings) == null ? void 0 : o.booking) != null && s.guest && (this.name = (d = (r = (i = this.configSettings) == null ? void 0 : i.booking) == null ? void 0 : r.guest) == null ? void 0 : d.name, this.email = (u = (p = (g = this.configSettings) == null ? void 0 : g.booking) == null ? void 0 : p.guest) == null ? void 0 : u.email), (x = (v = this.configSettings) == null ? void 0 : v.booking) != null && x.additional_guests && ((T = (w = this.configSettings) == null ? void 0 : w.booking) == null ? void 0 : T.additional_guests.length) > 0 && (this.guestEmails = (B = (E = this.configSettings) == null ? void 0 : E.booking) == null ? void 0 : B.additional_guests.map((I) => I.email)), this.applyThemeConfig(this.themeConfig);
|
|
235
|
-
}
|
|
236
|
-
componentDidRender() {
|
|
237
|
-
this.firstRender && this.applyThemeConfig(this.themeConfig);
|
|
238
|
-
}
|
|
239
|
-
bookingInfoChangedHandler(e) {
|
|
240
|
-
e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
|
|
241
|
-
}
|
|
242
|
-
themeConfigChanged(e) {
|
|
243
|
-
this.applyThemeConfig(e);
|
|
244
|
-
}
|
|
245
|
-
iterateFormComponents() {
|
|
246
|
-
const e = this.formRef, t = [
|
|
247
|
-
"input-component",
|
|
248
|
-
"button-component",
|
|
249
|
-
"select-dropdown",
|
|
250
|
-
"checkbox-component",
|
|
251
|
-
"radio-button-group",
|
|
252
|
-
"textarea-component",
|
|
253
|
-
"nylas-date-component",
|
|
254
|
-
"multi-select-dropdown"
|
|
255
|
-
], n = [];
|
|
256
|
-
if (e) {
|
|
257
|
-
const o = (s) => {
|
|
258
|
-
Array.from(s.children).forEach((i) => {
|
|
259
|
-
const r = i.tagName.toLowerCase();
|
|
260
|
-
t.includes(r) && n.push(i), o(i);
|
|
261
|
-
});
|
|
262
|
-
};
|
|
263
|
-
o(e);
|
|
264
|
-
}
|
|
265
|
-
return n;
|
|
266
|
-
}
|
|
267
|
-
applyThemeConfig(e) {
|
|
268
|
-
if (e)
|
|
269
|
-
for (const [t, n] of Object.entries(e))
|
|
270
|
-
this.host.style.setProperty(`${t}`, n), this.iterateFormComponents().forEach((s) => {
|
|
271
|
-
var i;
|
|
272
|
-
s.style.setProperty(`${t}`, n), (i = s.shadowRoot) == null || i.host.style.setProperty(`${t}`, n);
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
changeName(e) {
|
|
276
|
-
this.isNameValid = !0, this.validationError.name = "", this.name = Se(e), this.nameChanged.emit(e);
|
|
277
|
-
}
|
|
278
|
-
changeEmail(e) {
|
|
279
|
-
this.isEmailValid = !0, this.validationError.email = "", this.email = be(e), this.emailChanged.emit(e);
|
|
280
|
-
}
|
|
281
|
-
resetGuestEmailError(e) {
|
|
282
|
-
const t = { ...this.guestEmailErrors };
|
|
283
|
-
delete t[e], this.guestEmailErrors = { ...t };
|
|
284
|
-
}
|
|
285
|
-
nylasFormInputChangedHandler(e) {
|
|
286
|
-
switch (e.detail.name) {
|
|
287
|
-
case "name":
|
|
288
|
-
this.changeName(e.detail.value);
|
|
289
|
-
break;
|
|
290
|
-
case "email":
|
|
291
|
-
this.changeEmail(e.detail.value);
|
|
292
|
-
break;
|
|
293
|
-
default:
|
|
294
|
-
if (e.detail.error) {
|
|
295
|
-
this.bookingFormError.emit({
|
|
296
|
-
title: "Booking form error",
|
|
297
|
-
description: e.detail.error
|
|
298
|
-
});
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
302
|
-
break;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
selectOptionChangedHandler(e) {
|
|
306
|
-
if (e.detail.error) {
|
|
307
|
-
this.bookingFormError.emit({
|
|
308
|
-
title: "Booking form error",
|
|
309
|
-
description: e.detail.error
|
|
310
|
-
});
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
314
|
-
}
|
|
315
|
-
selecedOptionsChangedHandler(e) {
|
|
316
|
-
if (e.detail.error) {
|
|
317
|
-
this.bookingFormError.emit({
|
|
318
|
-
title: "Booking form error",
|
|
319
|
-
description: e.detail.error
|
|
320
|
-
});
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
const t = e.detail.value.toString();
|
|
324
|
-
this.updateAdditionalFields(e.detail.name, t);
|
|
325
|
-
}
|
|
326
|
-
switchToggledHandler(e) {
|
|
327
|
-
this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
|
|
328
|
-
}
|
|
329
|
-
checkboxToggledHandler(e) {
|
|
330
|
-
this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
|
|
331
|
-
}
|
|
332
|
-
radioChangedHandler(e) {
|
|
333
|
-
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
334
|
-
}
|
|
335
|
-
dropdownDefaultSelectedHandler(e) {
|
|
336
|
-
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
337
|
-
}
|
|
338
|
-
render() {
|
|
339
|
-
var e, t, n, o, s, i, r, d, g, p, u, v, x, w, T, E, B, I, R;
|
|
340
|
-
return a(k, { key: "423d11f5129d3c74dc99d4f97852cbd3537b8eaa" }, a("form", { key: "f4ec7f7579b7185bfb571bbb3ab6a1c7b24ee3bb", onSubmit: (y) => this.bookButtonClickedHandler(y), ref: (y) => this.formRef = y, noValidate: !0 }, a("div", { key: "927be2a2a8585fa3e689c3a43febe4c7854be9ec", class: "nylas-booking-form", part: "nbf" }, a("div", { key: "be07ecd47aa91f2d87d4817bbce9aa3bdddbe5bf", class: "input-wrapper", part: "nbf__input-wrapper" }, a("input-component", { key: "a02003025ff7fde52fe02abb29bcb73dbdda6164", label: l.t("name"), name: "name", id: "name", defaultValue: ((t = (e = this.bookingInfo) == null ? void 0 : e.primaryParticipant) == null ? void 0 : t.name) || ((s = (o = (n = this.configSettings) == null ? void 0 : n.booking) == null ? void 0 : o.guest) == null ? void 0 : s.name) || this.name, placeholder: l.t("namePlaceholder"), type: "text", readOnly: ((r = (i = this.bookingInfo) == null ? void 0 : i.primaryParticipant) == null ? void 0 : r.nameReadOnly) || !1, 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: "c424e9b1101d47b564fec49f11830ddb5c92262a", class: "input-wrapper", part: "nbf__input-wrapper" }, a("input-component", { key: "7c93e991bfe06da8aa3dc1220e44ad8c964b2c4e", label: l.t("email"), name: "email", id: "email", pattern: P, defaultValue: ((g = (d = this.bookingInfo) == null ? void 0 : d.primaryParticipant) == null ? void 0 : g.email) || ((v = (u = (p = this.configSettings) == null ? void 0 : p.booking) == null ? void 0 : u.guest) == null ? void 0 : v.email) || this.email, placeholder: l.t("emailPlaceholder"), type: "email", readOnly: ((w = (x = this.bookingInfo) == null ? void 0 : x.primaryParticipant) == null ? void 0 : w.emailReadOnly) || !1, required: !0, requiredError: l.t("fieldRequired", { field: l.t("email") }), patternError: l.t("invalidInputFormat", { field: l.t("email") }), part: "nbf__input-textfield" })), ((E = (T = this.configSettings) == null ? void 0 : T.scheduler) == null ? void 0 : E.hide_additional_guests) !== !0 && a("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, this.guestEmails.map((y, f) => a("div", { class: "input-wrapper button-wrapper" }, a("label", { class: {
|
|
341
|
-
error: !!this.guestEmailErrors[f]
|
|
342
|
-
} }, l.t("guestEmail")), a("div", { class: "guest-email-input" }, a("input", { type: "email", id: `guest-email-${f}`, maxLength: 100, class: {
|
|
343
|
-
"guest-email": !0,
|
|
344
|
-
error: !!this.guestEmailErrors[f]
|
|
345
|
-
}, placeholder: l.t("guestEmailPlaceholder"), value: y, "data-index": f, part: "nbf__input-textfield", onBlur: (b) => {
|
|
346
|
-
var h;
|
|
347
|
-
return this.handleGuestBlur(f, (h = b.target) == null ? void 0 : h.value);
|
|
348
|
-
}, onInput: (b) => {
|
|
349
|
-
var h;
|
|
350
|
-
return this.handleGuestChange(f, (h = b.target) == null ? void 0 : h.value);
|
|
351
|
-
} }), a("button-component", { variant: "basic", tooltip: "Remove guest", onClick: (b) => this.removeGuestButtonClickHandler(b, f), class: {
|
|
352
|
-
"remove-guest": !0,
|
|
353
|
-
error: !!this.guestEmailErrors[f]
|
|
354
|
-
} }, 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: (y) => this.addGuestButtonClickedHandler(y) }, a("div", { class: "button-content" }, a("add-circle-icon", { slot: "icon" }), this.guestEmails.length > 0 ? `${l.t("addAnotherGuest")}` : `${l.t("addGuest")}`))), (R = Object.entries(((I = (B = this.configSettings) == null ? void 0 : B.scheduler) == null ? void 0 : I.additional_fields) || {})) == null ? void 0 : R.sort((y, f) => y[1].order - f[1].order).map((y) => {
|
|
355
|
-
var te, ne, ae, ie, oe, se, re, le, de, ce, fe, he, me;
|
|
356
|
-
const f = y[1], b = f.label, h = y[0], C = ((ae = (ne = (te = this.bookingInfo) == null ? void 0 : te.additionalFields) == null ? void 0 : ne[h]) == null ? void 0 : ae.value) || ((se = (oe = (ie = this.configSettings) == null ? void 0 : ie.booking) == null ? void 0 : oe.additional_fields) == null ? void 0 : se[h]) || f.default || "", z = ((de = (le = (re = this.bookingInfo) == null ? void 0 : re.additionalFields) == null ? void 0 : le[h]) == null ? void 0 : de.readOnly) || !1;
|
|
357
|
-
switch (console.log("key", h, "defaultValue", C, "fieldReadOnly", z), f.type) {
|
|
358
|
-
case "dropdown":
|
|
359
|
-
return a("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, a("select-dropdown", { label: b, name: h, id: h, readOnly: z, withSearch: !1, emptyValue: l.t("nylasBookingCalendarPicker.selectOptionLabel"), defaultSelectedOption: C ? { value: C, label: C } : void 0, options: [
|
|
360
|
-
{ value: "", label: l.t("nylasBookingCalendarPicker.selectOptionLabel") },
|
|
361
|
-
...((ce = f.options) == null ? void 0 : ce.map((L) => ({ value: L, label: L }))) || []
|
|
362
|
-
], required: f.required, exportparts: "sd_dropdown: nbf__dropdown, sd_dropdown-button: nbf__dropdown-button, sd_dropdown-content: nbf__dropdown-content" }));
|
|
363
|
-
case "checkbox":
|
|
364
|
-
return console.log("defaultValue", C, "fieldReadOnly", z), a("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, a("checkbox-component", { readOnly: z, label: b, name: h, id: h, checked: C === "true", required: f.required, part: "nbf__checkbox-component" }));
|
|
365
|
-
case "radio_button":
|
|
366
|
-
return a("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, a("radio-button-group", { label: b, name: h, id: h, readOnly: z, defaultSelectedValue: C || ((fe = f.options) == null ? void 0 : fe[0]) || "", options: (he = f.options) == null ? void 0 : he.map((L) => ({ value: L, label: L })), required: f.required, part: "nbf__radio-button-group" }));
|
|
367
|
-
case "multi_line_text":
|
|
368
|
-
return a("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, a("textarea-component", { readOnly: z, label: b, defaultValue: C, name: h, id: h, required: f.required, part: "nbf__textarea-component" }));
|
|
369
|
-
case "date":
|
|
370
|
-
return a("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, a("nylas-date-component", { readOnly: z, label: b, defaultValue: C, name: h, id: h, required: f.required, part: "nbf__date-component" }));
|
|
371
|
-
case "multi_select":
|
|
372
|
-
const Ie = (C == null ? void 0 : C.split(",").map((L) => L.trim())) || [];
|
|
373
|
-
return a("div", null, a("multi-select-dropdown", { label: b, name: h, id: h, readOnly: z, options: (me = f.options) == null ? void 0 : me.map((L) => ({ value: L, label: L, selected: Ie.includes(L) })), required: f.required, exportparts: "msd_dropdown: nbf__ms_dropdown, msd_dropdown-label: nbf__ms_dropdown-label, msd_dropdown-button: nbf__ms_dropdown-button, msd_dropdown-content: nbf__ms_dropdown-content, msd_dropdown_error: nbf__ms_dropdown_error, msd_dropdown-button--error: nbf__ms_dropdown-button--error" }));
|
|
374
|
-
case "metadata":
|
|
375
|
-
return null;
|
|
376
|
-
default:
|
|
377
|
-
return a("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, a("input-component", { label: b, name: h, id: h, type: f.type, readOnly: z, defaultValue: C || "", requiredError: l.t("fieldRequired", { field: b }), required: f.required, part: "nbf__input-textfield" }));
|
|
378
|
-
}
|
|
379
|
-
})), a("div", { key: "d1ea109c013b9f86a239b55f49b2f1c9acd51a85", class: "cta" }, a("button-component", { key: "0d6c50929110723775ba5235ff1f18ef3b734f00", variant: "basic", class: "back", part: "nbf__button-outline", isLoading: this.backButtonLoading && this.isLoading, onClick: this.handleBackButtonClicked }, a("slot", { key: "8e40f0a823c3cfededb81dc8bdd647403967ac83", name: "booking-form-back-label" }, `${l.t("backButton")}`)), a("button-component", { key: "ac73db7923bf8113d6a86be68a19fb7e055bf4b8", variant: "primary", isLoading: !this.backButtonLoading && this.isLoading, disabled: this.isLoading, part: "nbf__button-primary", type: "submit" }, a("slot", { key: "07c6f16d379e60b1a4ac37e673c00adc72521798", name: "booking-form-book-label" }, `${l.t("bookNowButton")}`)))));
|
|
380
|
-
}
|
|
381
|
-
get host() {
|
|
382
|
-
return D(this);
|
|
383
|
-
}
|
|
384
|
-
static get watchers() {
|
|
385
|
-
return {
|
|
386
|
-
bookingInfo: ["bookingInfoChangedHandler"],
|
|
387
|
-
themeConfig: ["themeConfigChanged"]
|
|
388
|
-
};
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
qe([
|
|
392
|
-
S({
|
|
393
|
-
name: "nylas-booking-form",
|
|
394
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
395
|
-
["scheduler.isLoading", "isLoading"],
|
|
396
|
-
["scheduler.bookingInfo", "bookingInfo"],
|
|
397
|
-
["scheduler.eventInfo", "eventInfo"],
|
|
398
|
-
["scheduler.configSettings", "configSettings"],
|
|
399
|
-
["scheduler.themeConfig", "themeConfig"]
|
|
400
|
-
]),
|
|
401
|
-
eventToProps: {
|
|
402
|
-
backButtonClicked: async (e, t) => {
|
|
403
|
-
t.scheduler.toggleAdditionalData(!1);
|
|
404
|
-
},
|
|
405
|
-
nameChanged: async (e, t) => {
|
|
406
|
-
t.scheduler.setParticipantName(e.detail);
|
|
407
|
-
},
|
|
408
|
-
emailChanged: async (e, t) => {
|
|
409
|
-
t.scheduler.setParticipantEmail(e.detail);
|
|
410
|
-
},
|
|
411
|
-
detailsConfirmed: async (e, t) => {
|
|
412
|
-
c("nylas-booking-form", "detailsConfirmed", e.detail);
|
|
413
|
-
},
|
|
414
|
-
bookingFormSubmitted: async (e, t) => {
|
|
415
|
-
c("nylas-booking-form", "bookingFormSubmitted", e.detail);
|
|
416
|
-
},
|
|
417
|
-
bookingFormError: async (e, t) => {
|
|
418
|
-
c("nylas-booking-form", "bookingFormError", e.detail);
|
|
419
|
-
}
|
|
420
|
-
},
|
|
421
|
-
fireRegisterEvent: !0
|
|
422
|
-
}),
|
|
423
|
-
q("design:type", Function),
|
|
424
|
-
q("design:paramtypes", []),
|
|
425
|
-
q("design:returntype", void 0)
|
|
426
|
-
], ve.prototype, "render", null);
|
|
427
|
-
ve.style = Ae;
|
|
428
|
-
const Ze = ':host{--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;display:block;width:400px;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form form{width:100%}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:16px;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600);padding-bottom:1.25rem}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}.footer{display:grid;grid-template-columns:1fr 1fr;width:100%;padding-top:1.25rem;gap:1rem;border-top:1px solid var(--nylas-base-200);margin-top:1.25rem}', Ge = Ze;
|
|
429
|
-
var Ve = function(e, t, n, o) {
|
|
430
|
-
var s = arguments.length, i = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, r;
|
|
431
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
432
|
-
i = Reflect.decorate(e, t, n, o);
|
|
433
|
-
else
|
|
434
|
-
for (var d = e.length - 1; d >= 0; d--)
|
|
435
|
-
(r = e[d]) && (i = (s < 3 ? r(i) : s > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
436
|
-
return s > 3 && i && Object.defineProperty(t, n, i), i;
|
|
437
|
-
}, Z = function(e, t) {
|
|
438
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
439
|
-
return Reflect.metadata(e, t);
|
|
440
|
-
};
|
|
441
|
-
const Ce = class {
|
|
442
|
-
constructor(e) {
|
|
443
|
-
var t, n;
|
|
444
|
-
_(this, e), this.goBackButtonClicked = m(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = m(this, "cancelBookingFormSubmitted", 7), this.triggerValidation = m(this, "triggerValidation", 7), this.cancelBookedEventError = m(this, "cancelBookedEventError", 7), this.cancelBookingFormError = m(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
|
|
445
|
-
this.goBackButtonClicked.emit();
|
|
446
|
-
}, this.handleSubmitCancelBooking = (o) => {
|
|
447
|
-
var r, d, g;
|
|
448
|
-
if (this.triggerValidation.emit({}), o.preventDefault(), !this.cancellationReason) {
|
|
449
|
-
this.cancellationError = l.t("cancellationErrorMessage"), this.cancelBookingFormError.emit({ title: l.t("cancelBokingFormError"), description: l.t("cancellationErrorMessage") });
|
|
450
|
-
return;
|
|
451
|
-
}
|
|
452
|
-
const s = (d = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : d.min_cancellation_notice;
|
|
453
|
-
if (this.selectedTimeslot && s && new Date((g = this.selectedTimeslot) == null ? void 0 : g.start_time).getTime() - s * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime()) {
|
|
454
|
-
this.cancelBookedEventError.emit({
|
|
455
|
-
error: {
|
|
456
|
-
title: l.t("cancellationErrorTitle"),
|
|
457
|
-
message: l.t("minimumCancellationNoticeErrorMessage", { minCancellationNotice: s })
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
return;
|
|
461
|
-
}
|
|
462
|
-
c(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
|
|
463
|
-
const i = (p) => {
|
|
464
|
-
this.cancelBookedEventError.emit(p);
|
|
465
|
-
};
|
|
466
|
-
this.cancelBookingId ? this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, action: "cancel", reason: this.cancellationReason, errorHandler: i }) : this.rejectBookingId && this.cancelBookingFormSubmitted.emit({ bookingId: this.rejectBookingId, action: "reject", reason: this.cancellationReason, errorHandler: i });
|
|
467
|
-
}, this.cancelBookingId = void 0, this.rejectBookingId = void 0, this.selectedTimeslot = void 0, this.configSettings = void 0, this.eventInfo = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((n = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : n.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
468
|
-
}
|
|
469
|
-
configSettingsChangedHandler(e) {
|
|
470
|
-
var t;
|
|
471
|
-
this.cancellationPolicy = ((t = e == null ? void 0 : e.scheduler) == null ? void 0 : t.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
472
|
-
}
|
|
473
|
-
themeConfigChanged(e) {
|
|
474
|
-
this.applyThemeConfig(e);
|
|
475
|
-
}
|
|
476
|
-
connectedCallback() {
|
|
477
|
-
c("[nylas-cancel-booking-form] Component connected");
|
|
478
|
-
}
|
|
479
|
-
async componentWillLoad() {
|
|
480
|
-
c("[nylas-cancel-booking-form] Component will load");
|
|
481
|
-
}
|
|
482
|
-
async componentDidLoad() {
|
|
483
|
-
c("[nylas-cancel-booking-form] Component did load"), this.cancelBookingId || console.warn('[nylas-cancel-booking-form] No booking ID provided, "cancelBookingId" prop is required.'), this.applyThemeConfig(this.themeConfig);
|
|
484
|
-
}
|
|
485
|
-
disconnectedCallback() {
|
|
486
|
-
c("[nylas-cancel-booking-form] Component disconnected");
|
|
487
|
-
}
|
|
488
|
-
applyThemeConfig(e) {
|
|
489
|
-
var t;
|
|
490
|
-
if (e)
|
|
491
|
-
for (const [n, o] of Object.entries(e))
|
|
492
|
-
this.host.style.setProperty(`${n}`, o), (t = this.textareaRef) == null || t.style.setProperty(`${n}`, o);
|
|
493
|
-
}
|
|
494
|
-
handleNylasFormInputChanged(e) {
|
|
495
|
-
this.triggerValidation.emit({}), e.detail.name === "cancel-reason" && (this.cancellationReason = e.detail.value, this.cancellationError = e.detail.error);
|
|
496
|
-
}
|
|
497
|
-
render() {
|
|
498
|
-
var e, t;
|
|
499
|
-
return a(k, { key: "367d930a41c84cb60109ff80ef6b99974d17552d", part: "ncbf" }, a("div", { key: "9525a7b37aa841574213b457ecc3aaf5d35c9f8f", class: "nylas-cancel-booking-form", part: "ncbf__card" }, a("div", { key: "68274d84b71aa68dce8ac7be3ae30fd0a448afd4", class: "nylas-cancel-booking-form__calendar-icon", part: "ncbf__icon" }, a("calendar-cancel-icon", { key: "2acdf45f5f4772d24f1724cef312513b449f03e2" })), a("h3", { key: "dd5147d144e2ee46232bfb22d1d21dd91ce2a54c", class: "nylas-cancel-booking-form__title", part: "ncbf__title" }, l.t("cancelBookingTitle")), a("div", { key: "f042db3525efb8379dcaf8cc31caad6b5b3ed521", class: "nylas-cancel-booking-form__description", part: "ncbf__description" }, (t = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && t.cancellation_policy ? this.cancellationPolicy : `${l.t("cancelBookingMessage")}`), a("form", { key: "e6f109a4cf6e11f9fb0d2b993b86c49d7dcab484", onSubmit: this.handleSubmitCancelBooking }, a("textarea-component", { key: "46166dfc8b58e8bfc5c251a93f6874ca50fdff2b", id: "cancel-reason", name: "cancel-reason", ref: (n) => this.textareaRef = n, required: !0, label: l.t("reasonForCancellation"), class: this.cancellationError ? "error" : "", part: "ncbf__reason-textarea", defaultValue: this.cancellationReason }), a("div", { key: "b0b3c44298bcd1edbb38a6725bf2e4b6dcb1f614", class: "footer" }, a("button-component", { key: "0640672bb60b6d23d437efa6efb239ace9653a72", variant: "destructive", class: "cancel", type: "submit", part: "ncbf__button-cta", disabled: this.isLoading }, l.t("cancelBookingButton")), !!this.eventInfo && a("button-component", { variant: "basic", class: "back", part: "ncbf__button-outline", onClick: this.handleGoBackClicked }, l.t("goBackButton"))))));
|
|
500
|
-
}
|
|
501
|
-
get host() {
|
|
502
|
-
return D(this);
|
|
503
|
-
}
|
|
504
|
-
static get watchers() {
|
|
505
|
-
return {
|
|
506
|
-
configSettings: ["configSettingsChangedHandler"],
|
|
507
|
-
themeConfig: ["themeConfigChanged"]
|
|
508
|
-
};
|
|
509
|
-
}
|
|
510
|
-
};
|
|
511
|
-
Ve([
|
|
512
|
-
S({
|
|
513
|
-
name: "nylas-cancel-booking-form",
|
|
514
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
515
|
-
["scheduler.configSettings", "configSettings"],
|
|
516
|
-
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
517
|
-
["scheduler.eventInfo", "eventInfo"],
|
|
518
|
-
["scheduler.isLoading", "isLoading"],
|
|
519
|
-
["scheduler.cancelBookingId", "cancelBookingId"],
|
|
520
|
-
["scheduler.rejectBookingId", "rejectBookingId"],
|
|
521
|
-
["scheduler.themeConfig", "themeConfig"]
|
|
522
|
-
]),
|
|
523
|
-
eventToProps: {
|
|
524
|
-
cancelBookingFormSubmitted: async (e, t) => {
|
|
525
|
-
const { action: n, errorHandler: o } = e.detail;
|
|
526
|
-
if (n === "cancel") {
|
|
527
|
-
const s = await t.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason);
|
|
528
|
-
o && (!s || "error" in s) && o(s);
|
|
529
|
-
} else if (n === "reject") {
|
|
530
|
-
const s = await t.scheduler.updateBooking({
|
|
531
|
-
bookingId: e.detail.bookingId,
|
|
532
|
-
status: "cancelled",
|
|
533
|
-
reason: e.detail.reason
|
|
534
|
-
});
|
|
535
|
-
o && (!s || "error" in s) && o(s);
|
|
536
|
-
}
|
|
537
|
-
},
|
|
538
|
-
goBackButtonClicked: async (e, t) => {
|
|
539
|
-
c("nylas-cancel-booking-form", "goBackButtonClicked", e.detail), t.scheduler.goBack();
|
|
540
|
-
},
|
|
541
|
-
cancelBookedEventError: async (e, t) => {
|
|
542
|
-
c("nylas-cancel-booking-form", "cancelBookedEventError", e.detail);
|
|
543
|
-
},
|
|
544
|
-
cancelBookingFormError: async (e, t) => {
|
|
545
|
-
c("nylas-cancel-booking-form", "cancelBookingFormError", e.detail);
|
|
546
|
-
}
|
|
547
|
-
},
|
|
548
|
-
fireRegisterEvent: !0
|
|
549
|
-
}),
|
|
550
|
-
Z("design:type", Function),
|
|
551
|
-
Z("design:paramtypes", []),
|
|
552
|
-
Z("design:returntype", void 0)
|
|
553
|
-
], Ce.prototype, "render", null);
|
|
554
|
-
Ce.style = Ge;
|
|
555
|
-
const We = ':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-cancelled-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{width:100%}', Ue = We;
|
|
556
|
-
var Xe = function(e, t, n, o) {
|
|
557
|
-
var s = arguments.length, i = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, r;
|
|
558
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
559
|
-
i = Reflect.decorate(e, t, n, o);
|
|
560
|
-
else
|
|
561
|
-
for (var d = e.length - 1; d >= 0; d--)
|
|
562
|
-
(r = e[d]) && (i = (s < 3 ? r(i) : s > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
563
|
-
return s > 3 && i && Object.defineProperty(t, n, i), i;
|
|
564
|
-
}, G = function(e, t) {
|
|
565
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
566
|
-
return Reflect.metadata(e, t);
|
|
567
|
-
};
|
|
568
|
-
const _e = class {
|
|
569
|
-
constructor(e) {
|
|
570
|
-
_(this, e), this.closeCancelEventCardClicked = m(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = m(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
|
|
571
|
-
this.isClosing = !0;
|
|
572
|
-
const t = (n) => {
|
|
573
|
-
this.cancelledEventCardError.emit(n), this.isClosing = !1;
|
|
574
|
-
};
|
|
575
|
-
this.closeCancelEventCardClicked.emit({ errorHandler: t });
|
|
576
|
-
}, this.configSettings = void 0, this.themeConfig = void 0, this.cancelledEventInfo = void 0, this.isClosing = !1;
|
|
577
|
-
}
|
|
578
|
-
themeConfigChanged(e) {
|
|
579
|
-
this.applyThemeConfig(e);
|
|
580
|
-
}
|
|
581
|
-
connectedCallback() {
|
|
582
|
-
c("[nylas-cancelled-event-card] Component connected");
|
|
583
|
-
}
|
|
584
|
-
async componentWillLoad() {
|
|
585
|
-
c("[nylas-cancelled-event-card] Component will load");
|
|
586
|
-
}
|
|
587
|
-
async componentDidLoad() {
|
|
588
|
-
c("[nylas-cancelled-event-card] Component did load"), this.cancelledEventInfo || console.warn('[nylas-cancelled-event-card] No cancelled event info provided, "cancelledEventInfo" prop is required.'), this.applyThemeConfig(this.themeConfig);
|
|
589
|
-
}
|
|
590
|
-
disconnectedCallback() {
|
|
591
|
-
c("[nylas-cancelled-event-card] Component disconnected");
|
|
592
|
-
}
|
|
593
|
-
applyThemeConfig(e) {
|
|
594
|
-
if (e)
|
|
595
|
-
for (const [t, n] of Object.entries(e))
|
|
596
|
-
this.host.style.setProperty(`${t}`, n);
|
|
597
|
-
}
|
|
598
|
-
render() {
|
|
599
|
-
var e, t;
|
|
600
|
-
return a(k, { key: "af2dabdb6bbd22ec0d96ae4b25cc0f3521389d93", part: "ncec" }, a("div", { key: "0a4c7d702479470082c461b5db1220d2ea106fbd", class: "nylas-cancelled-event-card", part: "ncec__card" }, a("div", { key: "31c994fe42959c5b77ac8af83e29dce7a2680bbc", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, a("calendar-cancel-icon", { key: "d2bdd176e880eea17505387450cd9649774801a8" })), a("h3", { key: "15c17ff3b26f66a2508b8b172f44962c03c930aa", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, l.t("bookingCancelledTitle"), "!"), a("div", { key: "aaecf0f2c3b7804519bb0d992df7c4d959306b92", 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: "241ffe38d90415919647d5fb64c9a9e5166a30b5", class: "nylas-cancelled-event-card__cta" }, a("button-component", { key: "9cb5d81523c70611f5ec4151436ae960b2e103af", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${l.t("closingButton")}...` : `${l.t("closeButton")}`))));
|
|
601
|
-
}
|
|
602
|
-
get host() {
|
|
603
|
-
return D(this);
|
|
604
|
-
}
|
|
605
|
-
static get watchers() {
|
|
606
|
-
return {
|
|
607
|
-
themeConfig: ["themeConfigChanged"]
|
|
608
|
-
};
|
|
609
|
-
}
|
|
610
|
-
};
|
|
611
|
-
Xe([
|
|
612
|
-
S({
|
|
613
|
-
name: "nylas-cancelled-event-card",
|
|
614
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
615
|
-
["scheduler.configSettings", "configSettings"],
|
|
616
|
-
["scheduler.themeConfig", "themeConfig"],
|
|
617
|
-
["scheduler.themeConfig", "themeConfig"]
|
|
618
|
-
]),
|
|
619
|
-
eventToProps: {
|
|
620
|
-
closeCancelEventCardClicked: async (e, t) => {
|
|
621
|
-
const n = await t.scheduler.resetCancel(), { errorHandler: o } = e.detail;
|
|
622
|
-
o && (!n || "error" in n) && o(n);
|
|
623
|
-
},
|
|
624
|
-
cancelledEventCardError: async (e, t) => {
|
|
625
|
-
c("nylas-cancelled-event-card", "cancelledEventCardError", e.detail);
|
|
626
|
-
}
|
|
627
|
-
},
|
|
628
|
-
fireRegisterEvent: !0
|
|
629
|
-
}),
|
|
630
|
-
G("design:type", Function),
|
|
631
|
-
G("design:paramtypes", []),
|
|
632
|
-
G("design:returntype", void 0)
|
|
633
|
-
], _e.prototype, "render", null);
|
|
634
|
-
_e.style = Ue;
|
|
635
|
-
const Ye = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-confirmed-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-confirmed-event-card{width:inherit}}.nylas-confirmed-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-confirmed-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-confirmed-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-confirmed-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{width:100%}', Je = Ye;
|
|
636
|
-
var Ke = function(e, t, n, o) {
|
|
637
|
-
var s = arguments.length, i = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, r;
|
|
638
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
639
|
-
i = Reflect.decorate(e, t, n, o);
|
|
640
|
-
else
|
|
641
|
-
for (var d = e.length - 1; d >= 0; d--)
|
|
642
|
-
(r = e[d]) && (i = (s < 3 ? r(i) : s > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
643
|
-
return s > 3 && i && Object.defineProperty(t, n, i), i;
|
|
644
|
-
}, V = function(e, t) {
|
|
645
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
646
|
-
return Reflect.metadata(e, t);
|
|
647
|
-
};
|
|
648
|
-
const xe = class {
|
|
649
|
-
constructor(e) {
|
|
650
|
-
_(this, e), this.closeConfirmEventCardClicked = m(this, "closeConfirmEventCardClicked", 7), this.confirmedEventCardError = m(this, "confirmedEventCardError", 7), this.handleCloseClicked = () => {
|
|
651
|
-
this.isClosing = !0;
|
|
652
|
-
const t = (n) => {
|
|
653
|
-
this.confirmedEventCardError.emit(n), this.isClosing = !1;
|
|
654
|
-
};
|
|
655
|
-
this.closeConfirmEventCardClicked.emit({ errorHandler: t });
|
|
656
|
-
}, this.configSettings = void 0, this.themeConfig = void 0, this.confirmedEventInfo = void 0, this.isClosing = !1;
|
|
657
|
-
}
|
|
658
|
-
themeConfigChanged(e) {
|
|
659
|
-
this.applyThemeConfig(e);
|
|
660
|
-
}
|
|
661
|
-
connectedCallback() {
|
|
662
|
-
c("[nylas-confirmed-event-card] Component connected");
|
|
663
|
-
}
|
|
664
|
-
async componentWillLoad() {
|
|
665
|
-
c("[nylas-confirmed-event-card] Component will load");
|
|
666
|
-
}
|
|
667
|
-
async componentDidLoad() {
|
|
668
|
-
c("[nylas-confirmed-event-card] Component did load"), this.confirmedEventInfo || console.warn('[nylas-confirmed-event-card] No confirmed event info provided, "confirmedEventInfo" prop is required.'), this.applyThemeConfig(this.themeConfig);
|
|
669
|
-
}
|
|
670
|
-
disconnectedCallback() {
|
|
671
|
-
c("[nylas-confirmed-event-card] Component disconnected");
|
|
672
|
-
}
|
|
673
|
-
applyThemeConfig(e) {
|
|
674
|
-
if (e)
|
|
675
|
-
for (const [t, n] of Object.entries(e))
|
|
676
|
-
this.host.style.setProperty(`${t}`, n);
|
|
677
|
-
}
|
|
678
|
-
render() {
|
|
679
|
-
var e, t;
|
|
680
|
-
return a(k, { key: "7338eb871e20633474fe2f5d2b7f12f5f8a359ca", part: "ncec" }, a("div", { key: "9356536a89725ef82fa772bfc488f41d78a3ffff", class: "nylas-confirmed-event-card", part: "ncec__card" }, a("div", { key: "23e1d11c96934e827992a9c17ad854c2b1b015ba", class: "nylas-confirmed-event-card__calendar-icon", part: "ncec__icon" }, a("calendar-cancel-icon", { key: "e09a7c24414e6df2df8e9d6c9a05ad598caf8948" })), a("h3", { key: "4d91e7c3a247e4c91f6bdb7ab0187b6e5d241192", class: "nylas-confirmed-event-card__title", part: "ncec__title" }, l.t("confirmedEventCardTitle"), "!"), a("div", { key: "b8dc2d059196989d24ffebedc0beb263699c4525", class: "nylas-confirmed-event-card__description", part: "ncec__description" }, l.t("confirmedEventCardDescription"), " ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), a("div", { key: "0a3f06fc389e248f73d4b8ddd2c3855019be2b9f", class: "nylas-confirmed-event-card__cta" }, a("button-component", { key: "f0a8e8c03ad7931d98b1c5d2a2b50f1383e3bd0a", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${l.t("closingButton")}...` : `${l.t("closeButton")}`))));
|
|
681
|
-
}
|
|
682
|
-
get host() {
|
|
683
|
-
return D(this);
|
|
684
|
-
}
|
|
685
|
-
static get watchers() {
|
|
686
|
-
return {
|
|
687
|
-
themeConfig: ["themeConfigChanged"]
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
};
|
|
691
|
-
Ke([
|
|
692
|
-
S({
|
|
693
|
-
name: "nylas-confirmed-event-card",
|
|
694
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
695
|
-
["scheduler.configSettings", "configSettings"],
|
|
696
|
-
["scheduler.themeConfig", "themeConfig"]
|
|
697
|
-
]),
|
|
698
|
-
eventToProps: {
|
|
699
|
-
closeConfirmEventCardClicked: async (e, t) => {
|
|
700
|
-
const n = await t.scheduler.resetConfirm(), { errorHandler: o } = e.detail;
|
|
701
|
-
o && (!n || "error" in n) && o(n);
|
|
702
|
-
}
|
|
703
|
-
},
|
|
704
|
-
fireRegisterEvent: !0
|
|
705
|
-
}),
|
|
706
|
-
V("design:type", Function),
|
|
707
|
-
V("design:paramtypes", []),
|
|
708
|
-
V("design:returntype", void 0)
|
|
709
|
-
], xe.prototype, "render", null);
|
|
710
|
-
xe.style = Je;
|
|
711
|
-
const W = /* @__PURE__ */ new Date(), U = /* @__PURE__ */ new Date();
|
|
712
|
-
function M(e, t, n, o) {
|
|
713
|
-
function s(i) {
|
|
714
|
-
return e(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i;
|
|
715
|
-
}
|
|
716
|
-
return s.floor = (i) => (e(i = /* @__PURE__ */ new Date(+i)), i), s.ceil = (i) => (e(i = new Date(i - 1)), t(i, 1), e(i), i), s.round = (i) => {
|
|
717
|
-
const r = s(i), d = s.ceil(i);
|
|
718
|
-
return i - r < d - i ? r : d;
|
|
719
|
-
}, s.offset = (i, r) => (t(i = /* @__PURE__ */ new Date(+i), r == null ? 1 : Math.floor(r)), i), s.range = (i, r, d) => {
|
|
720
|
-
const g = [];
|
|
721
|
-
if (i = s.ceil(i), d = d == null ? 1 : Math.floor(d), !(i < r) || !(d > 0))
|
|
722
|
-
return g;
|
|
723
|
-
let p;
|
|
724
|
-
do
|
|
725
|
-
g.push(p = /* @__PURE__ */ new Date(+i)), t(i, d), e(i);
|
|
726
|
-
while (p < i && i < r);
|
|
727
|
-
return g;
|
|
728
|
-
}, s.filter = (i) => M((r) => {
|
|
729
|
-
if (r >= r)
|
|
730
|
-
for (; e(r), !i(r); )
|
|
731
|
-
r.setTime(r - 1);
|
|
732
|
-
}, (r, d) => {
|
|
733
|
-
if (r >= r)
|
|
734
|
-
if (d < 0)
|
|
735
|
-
for (; ++d <= 0; )
|
|
736
|
-
for (; t(r, -1), !i(r); )
|
|
737
|
-
;
|
|
738
|
-
else
|
|
739
|
-
for (; --d >= 0; )
|
|
740
|
-
for (; t(r, 1), !i(r); )
|
|
741
|
-
;
|
|
742
|
-
}), n && (s.count = (i, r) => (W.setTime(+i), U.setTime(+r), e(W), e(U), Math.floor(n(W, U))), s.every = (i) => (i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? s.filter(o ? (r) => o(r) % i === 0 : (r) => s.count(0, r) % i === 0) : s)), s;
|
|
743
|
-
}
|
|
744
|
-
const Qe = 1e3, we = Qe * 60, et = we * 60, $ = et * 24, X = M(
|
|
745
|
-
(e) => e.setHours(0, 0, 0, 0),
|
|
746
|
-
(e, t) => e.setDate(e.getDate() + t),
|
|
747
|
-
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * we) / $,
|
|
748
|
-
(e) => e.getDate() - 1
|
|
749
|
-
);
|
|
750
|
-
M((e) => {
|
|
751
|
-
e.setUTCHours(0, 0, 0, 0);
|
|
752
|
-
}, (e, t) => {
|
|
753
|
-
e.setUTCDate(e.getUTCDate() + t);
|
|
754
|
-
}, (e, t) => (t - e) / $, (e) => e.getUTCDate() - 1);
|
|
755
|
-
M((e) => {
|
|
756
|
-
e.setUTCHours(0, 0, 0, 0);
|
|
757
|
-
}, (e, t) => {
|
|
758
|
-
e.setUTCDate(e.getUTCDate() + t);
|
|
759
|
-
}, (e, t) => (t - e) / $, (e) => Math.floor(e / $));
|
|
760
|
-
const tt = ':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);color:var(--nylas-base-800)}.title h1{max-width:376px;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: 768px){.dates .date{width:-webkit-fill-available;width:-moz-available;width:fill-available}}@media screen and (max-width: 412px){.dates .date{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)}', nt = tt;
|
|
761
|
-
var at = function(e, t, n, o) {
|
|
762
|
-
var s = arguments.length, i = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, r;
|
|
763
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
764
|
-
i = Reflect.decorate(e, t, n, o);
|
|
765
|
-
else
|
|
766
|
-
for (var d = e.length - 1; d >= 0; d--)
|
|
767
|
-
(r = e[d]) && (i = (s < 3 ? r(i) : s > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
768
|
-
return s > 3 && i && Object.defineProperty(t, n, i), i;
|
|
769
|
-
}, Y = function(e, t) {
|
|
770
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
771
|
-
return Reflect.metadata(e, t);
|
|
772
|
-
};
|
|
773
|
-
const Te = class {
|
|
774
|
-
constructor(e) {
|
|
775
|
-
_(this, e), this.dateSelected = m(this, "dateSelected", 7), this.monthChanged = m(this, "monthChanged", 7), this.selectableDates = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.selectedDate = 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;
|
|
776
|
-
}
|
|
777
|
-
configSettingsChanged(e) {
|
|
778
|
-
var s;
|
|
779
|
-
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), n = (s = e == null ? void 0 : e.scheduler) == null ? void 0 : s.available_days_in_future;
|
|
780
|
-
if (n === void 0)
|
|
781
|
-
return;
|
|
782
|
-
pe(/* @__PURE__ */ new Date(), n).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
|
|
783
|
-
}
|
|
784
|
-
selectedLanguageChanged(e) {
|
|
785
|
-
l.changeLanguage(e);
|
|
786
|
-
}
|
|
787
|
-
themeConfigChanged(e) {
|
|
788
|
-
this.applyThemeConfig(e);
|
|
789
|
-
}
|
|
790
|
-
connectedCallback() {
|
|
791
|
-
}
|
|
792
|
-
disconnectedCallback() {
|
|
793
|
-
}
|
|
794
|
-
componentWillLoad() {
|
|
795
|
-
}
|
|
796
|
-
componentDidLoad() {
|
|
797
|
-
c("[nylas-date-picker] Component did load"), this.applyThemeConfig(this.themeConfig);
|
|
798
|
-
}
|
|
799
|
-
applyThemeConfig(e) {
|
|
800
|
-
if (e)
|
|
801
|
-
for (const [t, n] of Object.entries(e))
|
|
802
|
-
this.host.style.setProperty(`${t}`, n);
|
|
803
|
-
}
|
|
804
|
-
getDates() {
|
|
805
|
-
const e = ze(this.month), t = Re(this.month);
|
|
806
|
-
return X.range(X.offset(t, -t.getDay()), X.offset(e, 7 - e.getDay()));
|
|
807
|
-
}
|
|
808
|
-
selectDate(e) {
|
|
809
|
-
this.dateSelected.emit(e);
|
|
810
|
-
}
|
|
811
|
-
changeMonth(e) {
|
|
812
|
-
var s, i;
|
|
813
|
-
this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
|
|
814
|
-
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), n = (i = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : i.available_days_in_future;
|
|
815
|
-
pe(/* @__PURE__ */ new Date(), n).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month);
|
|
816
|
-
}
|
|
817
|
-
isSelected(e, t, n) {
|
|
818
|
-
return e && t && j(e, t) && n && (n == null ? void 0 : n.length) > 0;
|
|
819
|
-
}
|
|
820
|
-
isDisabled(e, t) {
|
|
821
|
-
return e && (t == null ? void 0 : t.find((n) => j(n, e))) === void 0;
|
|
822
|
-
}
|
|
823
|
-
render() {
|
|
824
|
-
var e, t, n, o, s, i;
|
|
825
|
-
return a(k, { key: "4c20e8d37a61de3397cac0625884fdd9c11cc8af", part: "ndp" }, a("div", { key: "44174b6408db8263ab96c9acb57985af0d0780d2", class: "nylas-date-picker" }, a("div", { key: "962fc8b1ab8d8794df5838e16a477b8f705e4e6f", class: "title", part: "ndp__title" }, (e = this.configSettings) != null && e.name ? a("h1", null, (t = this.configSettings) == null ? void 0 : t.name) : ((o = (n = this.configSettings) == null ? void 0 : n.organizer) == null ? void 0 : o.name) && a("h1", null, a("person-icon", null), ((i = (s = this.configSettings) == null ? void 0 : s.organizer) == null ? void 0 : i.name) || "Organizer"), a("p", { key: "422505548dffc0ee5a70811415ff030641faeeff" }, a("clock-icon", { key: "ef51faa1c20ef5caf3f3a8f7ff619c619ba72401" }), this.eventDuration ? je(this.eventDuration) : `- ${l.t("time.minutes")}`)), a("div", { key: "f593d3bbcb954bd863381e445cff053ce0085714", class: "header flex-row" }, a("h2", { key: "bc844a479c3d7e7b4a2065e91aa79baace20b302", part: "ndp__month-header" }, a("strong", { key: "da5035f141b874d58f626426b71ee7e9dd0b6424" }, Fe(this.month.toLocaleDateString(void 0, { month: "long" }).toLocaleLowerCase())), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), a("div", { key: "a2721542d5155de0072aa8a191b111b7d8cd7eea", class: "pagination" }, a("button", { key: "ad051ec43c6eb386ddefcab4db66932b079d75e0", title: "Previous month", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, a("chevron-icon", { key: "29cc3852bddacb1d4dd014aceb061d6baa27bfb4" })), a("button", { key: "92de9256c6c89f2dde6c59717bc9866a122e455c", title: "Next month", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, a("chevron-icon", { key: "98e5e9d80629c9e86767ba151e88b20fb1a188b7" })))), a("div", { key: "a63a1331d33c6f1b79d0e2f99e06c8ad0e4a2e50", class: "dates" }, [
|
|
826
|
-
l.t("days.sunday"),
|
|
827
|
-
l.t("days.monday"),
|
|
828
|
-
l.t("days.tuesday"),
|
|
829
|
-
l.t("days.wednesday"),
|
|
830
|
-
l.t("days.thursday"),
|
|
831
|
-
l.t("days.friday"),
|
|
832
|
-
l.t("days.saturday")
|
|
833
|
-
].map((r) => a("div", { class: "day", part: "ndp__day" }, r)), this.dates.map((r, d) => {
|
|
834
|
-
var p;
|
|
835
|
-
const g = this.isDisabled(r, this.selectableDates);
|
|
836
|
-
return this.isLoading ? a("button", { disabled: !0, class: {
|
|
837
|
-
"date day-skeleton": !0,
|
|
838
|
-
"current-month": N(r, this.month)
|
|
839
|
-
}, style: { animationDelay: `${d * 20}ms` }, part: "ndp__date ndp__date--disabled" }, r.getDate()) : a("button", { class: {
|
|
840
|
-
date: !0,
|
|
841
|
-
selected: !!(this.selectedDate && j(r, this.selectedDate) && this.selectableDates && ((p = this.selectableDates) == null ? void 0 : p.length) > 0),
|
|
842
|
-
"current-day": j(r, /* @__PURE__ */ new Date()),
|
|
843
|
-
"current-month": N(r, this.month)
|
|
844
|
-
}, "aria-label": r.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: g, onClick: () => this.selectDate(r), part: `ndp__date ${this.isSelected(r, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${j(r, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${N(r, this.month) ? "ndp__date--current-month" : ""}` }, r.getDate());
|
|
845
|
-
}))));
|
|
846
|
-
}
|
|
847
|
-
get host() {
|
|
848
|
-
return D(this);
|
|
849
|
-
}
|
|
850
|
-
static get watchers() {
|
|
851
|
-
return {
|
|
852
|
-
configSettings: ["configSettingsChanged"],
|
|
853
|
-
selectedLanguage: ["selectedLanguageChanged"],
|
|
854
|
-
themeConfig: ["themeConfigChanged"]
|
|
855
|
-
};
|
|
856
|
-
}
|
|
857
|
-
};
|
|
858
|
-
at([
|
|
859
|
-
S({
|
|
860
|
-
name: "nylas-date-picker",
|
|
861
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
862
|
-
["scheduler.selectableDates", "selectableDates"],
|
|
863
|
-
["scheduler.selectedDate", "selectedDate"],
|
|
864
|
-
["scheduler.isLoading", "isLoading"],
|
|
865
|
-
["scheduler.configSettings", "configSettings"],
|
|
866
|
-
["scheduler.eventDuration", "eventDuration"],
|
|
867
|
-
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
868
|
-
["scheduler.themeConfig", "themeConfig"]
|
|
869
|
-
]),
|
|
870
|
-
eventToProps: {
|
|
871
|
-
dateSelected: async (e, t) => {
|
|
872
|
-
c("nylas-date-picker", "dateSelected", e.detail), t.scheduler.selectDate(e.detail);
|
|
873
|
-
},
|
|
874
|
-
monthChanged: async (e, t) => {
|
|
875
|
-
c("nylas-date-picker", "monthChanged", e.detail);
|
|
876
|
-
}
|
|
877
|
-
},
|
|
878
|
-
fireRegisterEvent: !0
|
|
879
|
-
}),
|
|
880
|
-
Y("design:type", Function),
|
|
881
|
-
Y("design:paramtypes", []),
|
|
882
|
-
Y("design:returntype", void 0)
|
|
883
|
-
], Te.prototype, "render", null);
|
|
884
|
-
Te.style = nt;
|
|
885
|
-
const it = ':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}@media screen and (max-width: 768px){select-dropdown::part(sd_dropdown-button-selected-label){max-width:80px}select-dropdown::part(sd_dropdown-content){width:100%;max-width:none}}', ot = it;
|
|
886
|
-
var st = function(e, t, n, o) {
|
|
887
|
-
var s = arguments.length, i = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, r;
|
|
888
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
889
|
-
i = Reflect.decorate(e, t, n, o);
|
|
890
|
-
else
|
|
891
|
-
for (var d = e.length - 1; d >= 0; d--)
|
|
892
|
-
(r = e[d]) && (i = (s < 3 ? r(i) : s > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
893
|
-
return s > 3 && i && Object.defineProperty(t, n, i), i;
|
|
894
|
-
}, J = function(e, t) {
|
|
895
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
896
|
-
return Reflect.metadata(e, t);
|
|
897
|
-
};
|
|
898
|
-
const Ee = class {
|
|
899
|
-
constructor(e) {
|
|
900
|
-
var t, n;
|
|
901
|
-
_(this, e), this.timezoneChanged = m(this, "timezoneChanged", 7), this.languageChanged = m(this, "languageChanged", 7), this.themeConfig = void 0, this.bookingInfo = void 0, this.selectedTimezone = ((t = this.bookingInfo) == null ? void 0 : t.timezone) || Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = ((n = this.bookingInfo) == null ? void 0 : n.language) || navigator.language;
|
|
902
|
-
}
|
|
903
|
-
themeConfigChanged(e) {
|
|
904
|
-
this.applyThemeConfig(e);
|
|
905
|
-
}
|
|
906
|
-
bookingInfoChangedHandler(e) {
|
|
907
|
-
e && (e != null && e.timezone) && this.changeTimezone(e.timezone), e && (e != null && e.language) && this.changeLanguage(e.language);
|
|
908
|
-
}
|
|
909
|
-
connectedCallback() {
|
|
910
|
-
}
|
|
911
|
-
disconnectedCallback() {
|
|
912
|
-
}
|
|
913
|
-
componentWillLoad() {
|
|
914
|
-
}
|
|
915
|
-
componentDidLoad() {
|
|
916
|
-
var e, t;
|
|
917
|
-
c("[nylas-locale-switch] Component did load"), this.applyThemeConfig(this.themeConfig), this.bookingInfo && ((e = this.bookingInfo) != null && e.timezone) && this.changeTimezone(this.bookingInfo.timezone), this.bookingInfo && ((t = this.bookingInfo) != null && t.language) && this.changeLanguage(this.bookingInfo.language);
|
|
918
|
-
}
|
|
919
|
-
applyThemeConfig(e) {
|
|
920
|
-
var t, n;
|
|
921
|
-
if (e)
|
|
922
|
-
for (const [o, s] of Object.entries(e))
|
|
923
|
-
this.host.style.setProperty(`${o}`, s), (t = this.timezoneRef) == null || t.style.setProperty(`${o}`, s), (n = this.languageRef) == null || n.style.setProperty(`${o}`, s);
|
|
924
|
-
}
|
|
925
|
-
changeTimezone(e) {
|
|
926
|
-
this.selectedTimezone = e, this.timezoneChanged.emit(e);
|
|
927
|
-
}
|
|
928
|
-
changeLanguage(e) {
|
|
929
|
-
this.selectedLanguage = e, this.languageChanged.emit(e);
|
|
930
|
-
}
|
|
931
|
-
nylasFormDropdownChangedHandler(e) {
|
|
932
|
-
const { name: t, value: n } = e.detail;
|
|
933
|
-
t === "timezone" ? this.changeTimezone(n) : t === "language" && this.changeLanguage(n);
|
|
934
|
-
}
|
|
935
|
-
getTimezoneLabelHTML(e) {
|
|
936
|
-
const t = Pe(e);
|
|
937
|
-
return a("span", { class: "timezone-label", style: {
|
|
938
|
-
display: "flex",
|
|
939
|
-
alignItems: "center",
|
|
940
|
-
justifyContent: "space-between",
|
|
941
|
-
width: "-webkit-fill-available"
|
|
942
|
-
} }, F[e], " ", a("span", { class: "timezone-offset", style: {
|
|
943
|
-
fontSize: "14px",
|
|
944
|
-
fontWeight: "400",
|
|
945
|
-
color: "var(--nylas-base-500)"
|
|
946
|
-
} }, t));
|
|
947
|
-
}
|
|
948
|
-
render() {
|
|
949
|
-
const e = Object.keys(F).map((n) => ({
|
|
950
|
-
labelHTML: this.getTimezoneLabelHTML(n),
|
|
951
|
-
label: F[n],
|
|
952
|
-
value: n
|
|
953
|
-
})), t = Object.keys(ge).map((n) => ({
|
|
954
|
-
label: ge[n],
|
|
955
|
-
value: n
|
|
956
|
-
}));
|
|
957
|
-
return a(k, { key: "1a324cb66322d9dd8cb552a36bd3990a592ee7e9" }, a("div", { key: "18e91795ed822ed59f22c72207ea53ea9766d887", class: "nylas-locale-switch", part: "nls" }, a("div", { key: "7eb5e5ed990f5816e9dd17b1c4d06db3f36191da", class: {
|
|
958
|
-
"select-wrapper": !0,
|
|
959
|
-
timezone: !0
|
|
960
|
-
}, part: "nls__timezone" }, a("select-dropdown", { key: "32323279c21ad428b38d80ad0e4a484f845f135e", name: "timezone", options: e, ref: (n) => this.timezoneRef = n, defaultSelectedOption: e.find((n) => n.value == this.selectedTimezone), exportparts: "sd_dropdown: nls__timezone-dropdown, sd_dropdown-button: nls__timezone-drop-button, sd_dropdown-button-selected-label: nls__timezone-drop-button-selected-label, sd_dropdown-content: nls__timezone-drop-content, sd_dropdown_label: nls__timezone-drop-label" }, a("span", { key: "8c8364acc7d8e52ba170fd1de2a85cae15461e03", slot: "select-icon" }, a("globe-icon", { key: "cd491eef36d00660976120510449e2d2f3e46781", width: "20", height: "20" })))), a("div", { key: "80fcd6d80efd4f69cd8b0cec376ac105f45cb5a1", class: {
|
|
961
|
-
"select-wrapper": !0,
|
|
962
|
-
language: !0
|
|
963
|
-
}, part: "nls__language" }, a("select-dropdown", { key: "578f4a7ddf488cac7eea767c4346167d7bb912ac", name: "language", options: t, ref: (n) => this.languageRef = n, defaultSelectedOption: t.find((n) => n.value == this.selectedLanguage), exportparts: "sd_dropdown: nls__language-dropdown, sd_dropdown-button: nls__language-drop-button, sd_dropdown-content: nls__language-drop-content, sd_dropdown_label: nls__language-drop-label" }, a("span", { key: "e35c2a746e10701f434aaaa3194b4656fc525404", slot: "select-icon" }, a("translate-icon", { key: "7981ceb4834167c19ba6655d558a9a3ae28e5829", width: "20", height: "20" }))))));
|
|
964
|
-
}
|
|
965
|
-
get host() {
|
|
966
|
-
return D(this);
|
|
967
|
-
}
|
|
968
|
-
static get watchers() {
|
|
969
|
-
return {
|
|
970
|
-
themeConfig: ["themeConfigChanged"],
|
|
971
|
-
bookingInfo: ["bookingInfoChangedHandler"]
|
|
972
|
-
};
|
|
973
|
-
}
|
|
974
|
-
};
|
|
975
|
-
st([
|
|
976
|
-
S({
|
|
977
|
-
name: "nylas-locale-switch",
|
|
978
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
979
|
-
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
980
|
-
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
981
|
-
["scheduler.bookingInfo", "bookingInfo"],
|
|
982
|
-
["scheduler.themeConfig", "themeConfig"]
|
|
983
|
-
]),
|
|
984
|
-
eventToProps: {
|
|
985
|
-
timezoneChanged: async (e, t) => {
|
|
986
|
-
c("nylas-locale-switch", "timezoneChanged", e.detail), t.scheduler.selectTimezone(e.detail);
|
|
987
|
-
},
|
|
988
|
-
languageChanged: async (e, t) => {
|
|
989
|
-
c("nylas-locale-switch", "languageChanged", e.detail), t.scheduler.selectLanguage(e.detail);
|
|
990
|
-
}
|
|
991
|
-
},
|
|
992
|
-
fireRegisterEvent: !0
|
|
993
|
-
}),
|
|
994
|
-
J("design:type", Function),
|
|
995
|
-
J("design:paramtypes", []),
|
|
996
|
-
J("design:returntype", void 0)
|
|
997
|
-
], Ee.prototype, "render", null);
|
|
998
|
-
Ee.style = ot;
|
|
999
|
-
const rt = ".sc-nylas-logo-h{display:flex}", lt = rt, dt = class {
|
|
1000
|
-
constructor(e) {
|
|
1001
|
-
_(this, e), this.width = "69", this.height = "24";
|
|
1002
|
-
}
|
|
1003
|
-
render() {
|
|
1004
|
-
return a("svg", { key: "62222dd3800378729b2adde6c2983fe6cee23caa", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("g", { key: "97910c954c2b27d45639c4efee40a9b692928d5c", "clip-path": "url(#clip0_455_3543)" }, a("path", { key: "e0334bf2d85c5bb3d69f9ef9fd16dfcc213fe853", d: "M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z", fill: "currentColor" }), a("path", { key: "0e4dcb860598c50b18aa23b870f995c387df5db1", d: "M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z", fill: "currentColor" }), a("path", { key: "0932b6eef652d9a91bd578c888bdaf3bd14aba4a", d: "M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z", fill: "currentColor" }), a("path", { key: "19c41ab0458b7c96debb14698f9b7c12fb8155d7", d: "M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z", fill: "currentColor" }), a("path", { key: "3f67d09eef5ed6fd2189d8f346cdc87a1fb2d9eb", d: "M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z", fill: "currentColor" }), a("path", { key: "12c89a71827969f361db08eaa92989e77273197c", d: "M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z", fill: "currentColor" }), a("path", { key: "e129a0531742754423169ea6d4f88a8b9a7a3448", d: "M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z", fill: "currentColor" }), a("path", { key: "f1e19b3ef09568e57cac44d71d21a8db19ee1184", d: "M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z", fill: "currentColor" })), a("defs", { key: "c97ba75e4811081b3bd50460af81e60666c44d38" }, a("clipPath", { key: "e585d77949e6cf411e08275bd51b239a8a6b4af8", id: "clip0_455_3543" }, a("rect", { key: "586c6b1e9c085419045cf92a2fd21301ead072ea", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
|
|
1005
|
-
}
|
|
1006
|
-
};
|
|
1007
|
-
dt.style = lt;
|
|
1008
|
-
const ct = ':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}', ft = ct, ht = class {
|
|
1009
|
-
constructor(e) {
|
|
1010
|
-
_(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
|
|
1011
|
-
}
|
|
1012
|
-
onError(e) {
|
|
1013
|
-
c(`[nylas-notification] Error: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
1014
|
-
}
|
|
1015
|
-
onWarning(e) {
|
|
1016
|
-
c(`[nylas-notification] Warning: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
1017
|
-
}
|
|
1018
|
-
onInfo(e) {
|
|
1019
|
-
c(`[nylas-notification] Info: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
1020
|
-
}
|
|
1021
|
-
onSuccess(e) {
|
|
1022
|
-
c(`[nylas-notification] Success: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
1023
|
-
}
|
|
1024
|
-
isChildOf(e) {
|
|
1025
|
-
let t = this.host.parentNode;
|
|
1026
|
-
for (; t; ) {
|
|
1027
|
-
if (t === e)
|
|
1028
|
-
return !0;
|
|
1029
|
-
t instanceof ShadowRoot ? t = t.host : t = t.parentNode;
|
|
1030
|
-
}
|
|
1031
|
-
return !1;
|
|
1032
|
-
}
|
|
1033
|
-
handleNotification(e) {
|
|
1034
|
-
const t = e.detail.host;
|
|
1035
|
-
if (e.defaultPrevented) {
|
|
1036
|
-
c("[nylas-notification] Event default prevented");
|
|
1037
|
-
return;
|
|
1038
|
-
}
|
|
1039
|
-
if (t && !this.isChildOf(t)) {
|
|
1040
|
-
c("[nylas-notification] Host not a parent");
|
|
1041
|
-
return;
|
|
1042
|
-
}
|
|
1043
|
-
if (this.ttl === 0) {
|
|
1044
|
-
c("[nylas-notification] TTL is 0");
|
|
1045
|
-
return;
|
|
1046
|
-
}
|
|
1047
|
-
if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.notification.category)) {
|
|
1048
|
-
c("[nylas-notification] Category not allowed");
|
|
1049
|
-
return;
|
|
1050
|
-
}
|
|
1051
|
-
if (this.notifications = [...this.notifications, { ...e.detail.notification }], e.detail.notification.ttl !== "none") {
|
|
1052
|
-
const n = e.detail.notification.ttl ? e.detail.notification.ttl : this.ttl;
|
|
1053
|
-
window.setTimeout(() => {
|
|
1054
|
-
this.notifications = this.notifications.filter((o) => o.id !== e.detail.notification.id);
|
|
1055
|
-
}, n);
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
dismissNotification(e) {
|
|
1059
|
-
this.notifications = this.notifications.filter((t) => t.id !== e);
|
|
1060
|
-
}
|
|
1061
|
-
render() {
|
|
1062
|
-
return a(k, { key: "b0365498fe23a61f72550be811c6182f11d5ee6e" }, a(Oe, { key: "b498d2e39e010522b1aa77a492afc4e309f223e0" }, 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: "44681e08376a0d325c6ef472bfd24c18234db830" })));
|
|
1063
|
-
}
|
|
1064
|
-
get host() {
|
|
1065
|
-
return D(this);
|
|
1066
|
-
}
|
|
1067
|
-
};
|
|
1068
|
-
ht.style = ft;
|
|
1069
|
-
const mt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.event-card-wrapper{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 4rem;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:16px;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.manage-booking-description{border-top:1px solid var(--nylas-base-200)}.manage-booking-description p{font-size:16px;margin:1rem;padding:0.5rem 1rem;font-weight:400;color:var(--nylas-base-800)}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{--dot-color:var(--nylas-base-700)}', bt = mt;
|
|
1070
|
-
var pt = function(e, t, n, o) {
|
|
1071
|
-
var s = arguments.length, i = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, r;
|
|
1072
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1073
|
-
i = Reflect.decorate(e, t, n, o);
|
|
1074
|
-
else
|
|
1075
|
-
for (var d = e.length - 1; d >= 0; d--)
|
|
1076
|
-
(r = e[d]) && (i = (s < 3 ? r(i) : s > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
1077
|
-
return s > 3 && i && Object.defineProperty(t, n, i), i;
|
|
1078
|
-
}, K = function(e, t) {
|
|
1079
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1080
|
-
return Reflect.metadata(e, t);
|
|
1081
|
-
};
|
|
1082
|
-
const Be = class {
|
|
1083
|
-
constructor(e) {
|
|
1084
|
-
_(this, e), this.rejectBookingButtonClicked = m(this, "rejectBookingButtonClicked", 7), this.confirmBookingButtonClicked = m(this, "confirmBookingButtonClicked", 7), this.confirmBookingError = m(this, "confirmBookingError", 7), this.handleConfirmBookingButtonClicked = () => {
|
|
1085
|
-
this.action = "confirm";
|
|
1086
|
-
const t = (n) => {
|
|
1087
|
-
this.confirmBookingError.emit(n);
|
|
1088
|
-
};
|
|
1089
|
-
this.organizerConfirmationBookingId && !this.isLoading && this.confirmBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host, errorHandler: t });
|
|
1090
|
-
}, this.handleRejectBookingButtonClicked = () => {
|
|
1091
|
-
this.action = "reject", this.organizerConfirmationBookingId && !this.isLoading && this.rejectBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host });
|
|
1092
|
-
}, this.configSettings = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.organizerConfirmationBookingId = void 0, this.selectedLanguage = navigator.language, this.action = null;
|
|
1093
|
-
}
|
|
1094
|
-
themeConfigChanged(e) {
|
|
1095
|
-
this.applyThemeConfig(e);
|
|
1096
|
-
}
|
|
1097
|
-
connectedCallback() {
|
|
1098
|
-
}
|
|
1099
|
-
disconnectedCallback() {
|
|
1100
|
-
}
|
|
1101
|
-
async componentWillLoad() {
|
|
1102
|
-
c("[nylas-organizer-confirmation-card] Component will load");
|
|
1103
|
-
}
|
|
1104
|
-
async componentDidLoad() {
|
|
1105
|
-
c("[nylas-organizer-confirmation-card] Component did load"), this.applyThemeConfig(this.themeConfig);
|
|
1106
|
-
}
|
|
1107
|
-
applyThemeConfig(e) {
|
|
1108
|
-
if (e)
|
|
1109
|
-
for (const [t, n] of Object.entries(e))
|
|
1110
|
-
this.host.style.setProperty(`${t}`, n);
|
|
1111
|
-
}
|
|
1112
|
-
async resetAction() {
|
|
1113
|
-
this.action = null;
|
|
1114
|
-
}
|
|
1115
|
-
render() {
|
|
1116
|
-
var e, t, n, o, s, i, r, d, g, p, u, v;
|
|
1117
|
-
return a(k, { key: "2a98e8192e5090fb92b47164413d2416ed16ac87", part: "nmcc" }, a("div", { key: "46d7f21d715e6765f8a5b6c977fb38372c07d359", class: "event-card-wrapper", part: "nmccc__card" }, a("div", { key: "9146ebba1d74a5347aca4668ccd138d87ec5c841", class: "calendar-icon" }, a("calendar-check-icon", { key: "909c91d527aa74433b456e9559726a2eda596217" })), a("div", { key: "bbf17a11fed1cc526f459c5142df3f68b84e4b20", class: "booked-event-header" }, a("h2", { key: "1f989129600a5354532a4a7cc4d9a371231654cb", slot: "card-title", part: "nmcc__title" }, !!this.organizerConfirmationBookingId && `${l.t("bookingPendingTitle")}!`)), a("div", { key: "e71728b2735214973a6255ec8263f4cce3adfdc1", class: "manage-booking-description" }, a("p", { key: "73dbc21737d6f79b5e61e888c617ee30d7a5192b" }, l.t("bookingPendingnDescription"))), a("div", { key: "da18de4e3d1be59dd94269d94b59649d5ecc7da4", class: {
|
|
1118
|
-
footer: !0,
|
|
1119
|
-
"no-footer": ((t = (e = this.configSettings) == null ? void 0 : e.scheduler) == null ? void 0 : t.hide_cancellation_options) && ((o = (n = this.configSettings) == null ? void 0 : n.scheduler) == null ? void 0 : o.hide_rescheduling_options),
|
|
1120
|
-
"no-template-cols": ((i = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : i.hide_cancellation_options) || ((d = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : d.hide_rescheduling_options)
|
|
1121
|
-
} }, !((p = (g = this.configSettings) == null ? void 0 : g.scheduler) != null && p.hide_cancellation_options) && a("button-component", { variant: "destructive", onClick: this.handleRejectBookingButtonClicked, isLoading: this.isLoading && this.action === "reject", part: "nmcc__button-outline nmcc__cancel-cta" }, `${l.t("rejectBookingButton")}`), !((v = (u = this.configSettings) == null ? void 0 : u.scheduler) != null && v.hide_rescheduling_options) && a("button-component", { variant: "basic", onClick: this.handleConfirmBookingButtonClicked, isLoading: this.isLoading && this.action === "confirm", part: "nmcc__button-outline nmcc__reschedule-cta" }, `${l.t("confirmBookingButton")}`))));
|
|
1122
|
-
}
|
|
1123
|
-
get host() {
|
|
1124
|
-
return D(this);
|
|
1125
|
-
}
|
|
1126
|
-
static get watchers() {
|
|
1127
|
-
return {
|
|
1128
|
-
themeConfig: ["themeConfigChanged"]
|
|
1129
|
-
};
|
|
1130
|
-
}
|
|
1131
|
-
};
|
|
1132
|
-
pt([
|
|
1133
|
-
S({
|
|
1134
|
-
name: "nylas-organizer-confirmation-card",
|
|
1135
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
1136
|
-
["scheduler.organizerConfirmationBookingId", "organizerConfirmationBookingId"],
|
|
1137
|
-
["scheduler.configSettings", "configSettings"],
|
|
1138
|
-
["scheduler.isLoading", "isLoading"],
|
|
1139
|
-
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
1140
|
-
["scheduler.themeConfig", "themeConfig"]
|
|
1141
|
-
]),
|
|
1142
|
-
eventToProps: {
|
|
1143
|
-
rejectBookingButtonClicked: async (e, t) => {
|
|
1144
|
-
t.scheduler.setReject(e.detail.bookingId);
|
|
1145
|
-
},
|
|
1146
|
-
confirmBookingButtonClicked: async (e, t) => {
|
|
1147
|
-
const { host: n } = e.detail, o = await t.scheduler.updateBooking({
|
|
1148
|
-
bookingId: e.detail.bookingId,
|
|
1149
|
-
status: "confirmed"
|
|
1150
|
-
}), { errorHandler: s } = e.detail;
|
|
1151
|
-
s && (!o || "error" in o) && s(o), await n.resetAction();
|
|
1152
|
-
}
|
|
1153
|
-
},
|
|
1154
|
-
fireRegisterEvent: !0
|
|
1155
|
-
}),
|
|
1156
|
-
K("design:type", Function),
|
|
1157
|
-
K("design:paramtypes", []),
|
|
1158
|
-
K("design:returntype", void 0)
|
|
1159
|
-
], Be.prototype, "render", null);
|
|
1160
|
-
Be.style = bt;
|
|
1161
|
-
const gt = ':host{--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;display:block;position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:16px;font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}', ut = gt;
|
|
1162
|
-
var yt = function(e, t, n, o) {
|
|
1163
|
-
var s = arguments.length, i = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, r;
|
|
1164
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1165
|
-
i = Reflect.decorate(e, t, n, o);
|
|
1166
|
-
else
|
|
1167
|
-
for (var d = e.length - 1; d >= 0; d--)
|
|
1168
|
-
(r = e[d]) && (i = (s < 3 ? r(i) : s > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
1169
|
-
return s > 3 && i && Object.defineProperty(t, n, i), i;
|
|
1170
|
-
}, Q = function(e, t) {
|
|
1171
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1172
|
-
return Reflect.metadata(e, t);
|
|
1173
|
-
};
|
|
1174
|
-
const Le = class {
|
|
1175
|
-
constructor(e) {
|
|
1176
|
-
_(this, e), this.themeConfig = void 0, this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.hour12 = void 0, this.startTime = "", this.endTime = "";
|
|
1177
|
-
}
|
|
1178
|
-
themeConfigChanged(e) {
|
|
1179
|
-
this.applyThemeConfig(e);
|
|
1180
|
-
}
|
|
1181
|
-
connectedCallback() {
|
|
1182
|
-
}
|
|
1183
|
-
disconnectedCallback() {
|
|
1184
|
-
}
|
|
1185
|
-
async componentWillLoad() {
|
|
1186
|
-
c("[nylas-selected-event-card] Component will load");
|
|
1187
|
-
}
|
|
1188
|
-
async componentDidLoad() {
|
|
1189
|
-
var n, o;
|
|
1190
|
-
c("[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.'), this.applyThemeConfig(this.themeConfig);
|
|
1191
|
-
const e = O[this.selectedLanguage || "en"], t = new Intl.DateTimeFormat(e, {
|
|
1192
|
-
hour: "2-digit",
|
|
1193
|
-
minute: "2-digit",
|
|
1194
|
-
timeZone: this.selectedTimezone,
|
|
1195
|
-
hour12: this.hour12
|
|
1196
|
-
});
|
|
1197
|
-
this.startTime = t.format(new Date((n = this.selectedTimeslot) == null ? void 0 : n.start_time)), this.endTime = t.format(new Date((o = this.selectedTimeslot) == null ? void 0 : o.end_time));
|
|
1198
|
-
}
|
|
1199
|
-
applyThemeConfig(e) {
|
|
1200
|
-
if (e)
|
|
1201
|
-
for (const [t, n] of Object.entries(e))
|
|
1202
|
-
this.host.style.setProperty(`${t}`, n);
|
|
1203
|
-
}
|
|
1204
|
-
render() {
|
|
1205
|
-
var e;
|
|
1206
|
-
return a(k, { key: "22b7e4f0f55d7a75188ebd3e8cc009497ad5a598", part: "nsec" }, a("div", { key: "0082bd129fe4704e4bf9bcc82ab401f7c50237fe", class: "event-card", part: "nsec__card" }, a("div", { key: "37093be5b192f8a8a533cb677b432df2cec80d14", class: "calendar-icon", part: "nsec__icon" }, a("calendar-icon", { key: "253a63fa567065c7a12f6fc8b82333568b52b777" })), a("div", { key: "a2d5218bd85c6f94652b0f24a11e68f53a8920d3", class: "nylas-selected-event-card__date", part: "nsec__date" }, this.selectedDate ? ue(ye((e = this.selectedTimeslot) == null ? void 0 : e.start_time, this.selectedTimezone)) : "-"), a("div", { key: "ebd987916296b91836d89a99fa1640b42146d4bf", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), a("div", { key: "03543536c6b679782882ba21b8b53f9e37d3256a", class: "event-timezone", part: "nsec__timezone" }, a("globe-icon", { key: "83f0ce5639dbb7b027298ea3da247498e6d62948" }), F[this.selectedTimezone]));
|
|
1207
|
-
}
|
|
1208
|
-
get host() {
|
|
1209
|
-
return D(this);
|
|
1210
|
-
}
|
|
1211
|
-
static get watchers() {
|
|
1212
|
-
return {
|
|
1213
|
-
themeConfig: ["themeConfigChanged"]
|
|
1214
|
-
};
|
|
1215
|
-
}
|
|
1216
|
-
};
|
|
1217
|
-
yt([
|
|
1218
|
-
S({
|
|
1219
|
-
name: "nylas-selected-event-card",
|
|
1220
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
1221
|
-
["scheduler.selectedDate", "selectedDate"],
|
|
1222
|
-
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
1223
|
-
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
1224
|
-
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
1225
|
-
["scheduler.themeConfig", "themeConfig"],
|
|
1226
|
-
["scheduler.hour12", "hour12"]
|
|
1227
|
-
]),
|
|
1228
|
-
eventToProps: {},
|
|
1229
|
-
fireRegisterEvent: !0
|
|
1230
|
-
}),
|
|
1231
|
-
Q("design:type", Function),
|
|
1232
|
-
Q("design:paramtypes", []),
|
|
1233
|
-
Q("design:returntype", void 0)
|
|
1234
|
-
], Le.prototype, "render", null);
|
|
1235
|
-
Le.style = ut;
|
|
1236
|
-
const kt = ':host{display:block;height:calc(100% - 48px);--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}.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)}', vt = kt;
|
|
1237
|
-
var Ct = function(e, t, n, o) {
|
|
1238
|
-
var s = arguments.length, i = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, r;
|
|
1239
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1240
|
-
i = Reflect.decorate(e, t, n, o);
|
|
1241
|
-
else
|
|
1242
|
-
for (var d = e.length - 1; d >= 0; d--)
|
|
1243
|
-
(r = e[d]) && (i = (s < 3 ? r(i) : s > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
1244
|
-
return s > 3 && i && Object.defineProperty(t, n, i), i;
|
|
1245
|
-
}, ee = function(e, t) {
|
|
1246
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1247
|
-
return Reflect.metadata(e, t);
|
|
1248
|
-
};
|
|
1249
|
-
const De = class {
|
|
1250
|
-
constructor(e) {
|
|
1251
|
-
_(this, e), this.timeslotSelected = m(this, "timeslotSelected", 7), this.timeslotConfirmed = m(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (t, n) => {
|
|
1252
|
-
t.preventDefault(), c("[nylas-timeslot-picker] Confirm timeslot", n), this.timeslotConfirmed.emit(n);
|
|
1253
|
-
}, this.handleMouseEnter = (t) => {
|
|
1254
|
-
this.hoveredTimeslotIndex = t;
|
|
1255
|
-
}, this.handleMouseLeave = () => {
|
|
1256
|
-
this.hoveredTimeslotIndex = -1;
|
|
1257
|
-
}, this.availability = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedDate = /* @__PURE__ */ new Date(), this.selectedLanguage = void 0, this.hour12 = void 0, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
|
|
1258
|
-
}
|
|
1259
|
-
selectedLanguageChanged(e) {
|
|
1260
|
-
l.changeLanguage(e);
|
|
1261
|
-
}
|
|
1262
|
-
selectedDateChanged(e) {
|
|
1263
|
-
var t;
|
|
1264
|
-
if (c("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
|
|
1265
|
-
const n = (t = this.availability) == null ? void 0 : t.filter((o) => H(o.start_time, e, this.selectedTimezone)).map((o) => o);
|
|
1266
|
-
this.times = n || [];
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
availabilityChanged(e) {
|
|
1270
|
-
if (c("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
|
|
1271
|
-
const t = e == null ? void 0 : e.filter((n) => this.selectedDate && H(n.start_time, this.selectedDate, this.selectedTimezone)).map((n) => n);
|
|
1272
|
-
this.times = t || [];
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
themeConfigChanged(e) {
|
|
1276
|
-
this.applyThemeConfig(e);
|
|
1277
|
-
}
|
|
1278
|
-
connectedCallback() {
|
|
1279
|
-
}
|
|
1280
|
-
disconnectedCallback() {
|
|
1281
|
-
}
|
|
1282
|
-
async componentWillLoad() {
|
|
1283
|
-
c("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
|
|
1284
|
-
}
|
|
1285
|
-
async componentDidLoad() {
|
|
1286
|
-
var t;
|
|
1287
|
-
c("[nylas-timeslot-picker] Component did load");
|
|
1288
|
-
const e = (t = this.availability) == null ? void 0 : t.filter((n) => this.selectedDate && H(n.start_time, this.selectedDate, this.selectedTimezone)).map((n) => n);
|
|
1289
|
-
this.times = e || [], this.applyThemeConfig(this.themeConfig);
|
|
1290
|
-
}
|
|
1291
|
-
applyThemeConfig(e) {
|
|
1292
|
-
if (e)
|
|
1293
|
-
for (const [t, n] of Object.entries(e))
|
|
1294
|
-
this.host.style.setProperty(`${t}`, n);
|
|
1295
|
-
}
|
|
1296
|
-
getTimeslotId(e, t) {
|
|
1297
|
-
return `${e.toLocaleDateString()}-${t}`;
|
|
1298
|
-
}
|
|
1299
|
-
onClickSelectTime(e, t) {
|
|
1300
|
-
c("[nylas-timeslot-picker] Time selected", e, t), this.selectedTimeslotIndex = this.getTimeslotId(e.start_time, t), this.timeslotSelected.emit({
|
|
1301
|
-
start_time: e.start_time,
|
|
1302
|
-
end_time: e.end_time,
|
|
1303
|
-
emails: e.emails
|
|
1304
|
-
});
|
|
1305
|
-
}
|
|
1306
|
-
getTimeSlotLabel(e) {
|
|
1307
|
-
const t = O[this.selectedLanguage || "en"], n = new Intl.DateTimeFormat(t, {
|
|
1308
|
-
hour: "2-digit",
|
|
1309
|
-
minute: "2-digit",
|
|
1310
|
-
timeZone: this.selectedTimezone,
|
|
1311
|
-
hour12: this.hour12
|
|
1312
|
-
});
|
|
1313
|
-
return `${n.format(e.start_time)} - ${n.format(e.end_time)}`;
|
|
1314
|
-
}
|
|
1315
|
-
render() {
|
|
1316
|
-
const e = O[this.selectedLanguage || "en"];
|
|
1317
|
-
return this.isLoading ? a(k, null, a("div", { class: "loading" }, new Array(6).fill(0).map((t, n) => a("div", { class: "timeslot-skeleton", style: { animationDelay: `${n * 20}ms` } })))) : this.availability && this.availability.length === 0 ? a(k, null, a("div", { class: "empty" }, a("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? a(k, null, a("div", { class: "empty" }, a("span", null, "No time slots available for selected date"))) : this.selectedDate ? a(k, { part: "ntp" }, a("div", { class: "time-picker-wrapper", part: "ntp__time-picker-wrapper" }, a("div", { class: "timeslots", part: "ntp__timeslots" }, this.times.map((t, n) => {
|
|
1318
|
-
var o, s, i, r;
|
|
1319
|
-
return a("button", { part: `ntp__timeslot ${((s = (o = this.selectedTimeslot) == null ? void 0 : o.start_time) == null ? void 0 : s.getTime()) === t.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, class: {
|
|
1320
|
-
time: !0,
|
|
1321
|
-
selected: typeof this.selectedTimeslot < "u" && ((r = (i = this.selectedTimeslot) == null ? void 0 : i.start_time) == null ? void 0 : r.getTime()) === t.start_time.getTime()
|
|
1322
|
-
}, onClick: () => this.onClickSelectTime(t, n), onMouseEnter: () => this.handleMouseEnter(n), onMouseLeave: () => this.handleMouseLeave() }, this.hoveredTimeslotIndex == n || this.selectedTimeslotIndex == this.getTimeslotId(t.start_time, n) ? this.getTimeSlotLabel(t) : t.start_time.toLocaleTimeString(e, { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone, hour12: this.hour12 }));
|
|
1323
|
-
})), this.selectedTimeslot && a("div", { class: "footer" }, a("button-component", { variant: "primary", onClick: (t) => this.handleConfirmedTimeslot(t, this.selectedTimeslot), part: "ntp__button-primary" }, a("slot", { name: "timeslot-picker-cta-label" }, l.t("nextButton")))))) : a(k, null);
|
|
1324
|
-
}
|
|
1325
|
-
get host() {
|
|
1326
|
-
return D(this);
|
|
1327
|
-
}
|
|
1328
|
-
static get watchers() {
|
|
1329
|
-
return {
|
|
1330
|
-
selectedLanguage: ["selectedLanguageChanged"],
|
|
1331
|
-
selectedDate: ["selectedDateChanged"],
|
|
1332
|
-
availability: ["availabilityChanged"],
|
|
1333
|
-
themeConfig: ["themeConfigChanged"]
|
|
1334
|
-
};
|
|
1335
|
-
}
|
|
1336
|
-
};
|
|
1337
|
-
Ct([
|
|
1338
|
-
S({
|
|
1339
|
-
name: "nylas-timeslot-picker",
|
|
1340
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
1341
|
-
["scheduler.selectedDate", "selectedDate"],
|
|
1342
|
-
["scheduler.availability", "availability"],
|
|
1343
|
-
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
1344
|
-
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
1345
|
-
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
1346
|
-
["scheduler.isLoading", "isLoading"],
|
|
1347
|
-
["scheduler.themeConfig", "themeConfig"],
|
|
1348
|
-
["scheduler.hour12", "hour12"]
|
|
1349
|
-
]),
|
|
1350
|
-
eventToProps: {
|
|
1351
|
-
timeslotSelected: async (e, t) => {
|
|
1352
|
-
c("nylas-timeslot-picker", "timeslotSelected", e.detail), t.scheduler.selectTime(e.detail);
|
|
1353
|
-
},
|
|
1354
|
-
timeslotConfirmed: async (e, t) => {
|
|
1355
|
-
c("nylas-timeslot-picker", "timeslotConfirmed", e.detail), e.detail && t.scheduler.toggleAdditionalData(!0);
|
|
1356
|
-
}
|
|
1357
|
-
},
|
|
1358
|
-
fireRegisterEvent: !0
|
|
1359
|
-
}),
|
|
1360
|
-
ee("design:type", Function),
|
|
1361
|
-
ee("design:paramtypes", []),
|
|
1362
|
-
ee("design:returntype", void 0)
|
|
1363
|
-
], De.prototype, "render", null);
|
|
1364
|
-
De.style = vt;
|
|
1365
|
-
export {
|
|
1366
|
-
ke as nylas_booked_event_card,
|
|
1367
|
-
ve as nylas_booking_form,
|
|
1368
|
-
Ce as nylas_cancel_booking_form,
|
|
1369
|
-
_e as nylas_cancelled_event_card,
|
|
1370
|
-
xe as nylas_confirmed_event_card,
|
|
1371
|
-
Te as nylas_date_picker,
|
|
1372
|
-
Ee as nylas_locale_switch,
|
|
1373
|
-
dt as nylas_logo,
|
|
1374
|
-
ht as nylas_notification,
|
|
1375
|
-
Be as nylas_organizer_confirmation_card,
|
|
1376
|
-
Le as nylas_selected_event_card,
|
|
1377
|
-
De as nylas_timeslot_picker
|
|
1378
|
-
};
|