@nylas/react 1.1.0-canary.16 → 1.1.0-canary.18
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-3091976b.cjs +1 -0
- package/dist/add-circle-icon_2.entry-3b13ee64.js +25 -0
- package/dist/{archive-icon_7.entry-54dc5cc2.js → archive-icon_7.entry-8932618a.js} +19 -19
- package/dist/{archive-icon_7.entry-073d9915.cjs → archive-icon_7.entry-c2b6d860.cjs} +1 -1
- package/dist/{arrow-icon.entry-869a1db9.js → arrow-icon.entry-1f54c377.js} +4 -4
- package/dist/{arrow-icon.entry-bada78b8.cjs → arrow-icon.entry-a159bee8.cjs} +1 -1
- package/dist/{bold-icon_3.entry-5695177e.js → bold-icon_3.entry-447d0537.js} +10 -10
- package/dist/{bold-icon_3.entry-cc6150c9.cjs → bold-icon_3.entry-c51e1af3.cjs} +1 -1
- package/dist/{button-component.entry-a0533c8b.js → button-component.entry-52ccb6d9.js} +2 -2
- package/dist/{button-component.entry-3703ecff.cjs → button-component.entry-e79b2d08.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-0f1d98b3.cjs → calendar-cancel-icon.entry-805febcc.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-a9ab0b09.js → calendar-cancel-icon.entry-a78f27bc.js} +2 -2
- package/dist/{calendar-check-icon_2.entry-6b83717e.cjs → calendar-check-icon_2.entry-4a0fd7bd.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-a62b5d2c.js → calendar-check-icon_2.entry-7c8b6c92.js} +3 -3
- package/dist/{calendar-icon.entry-08f83da9.cjs → calendar-icon.entry-1fc018b4.cjs} +1 -1
- package/dist/{calendar-icon.entry-ddc22561.js → calendar-icon.entry-96f9727f.js} +5 -5
- package/dist/calendar-info-icon_28.entry-2054703c.cjs +1 -0
- package/dist/{calendar-info-icon_27.entry-f02f44b7.js → calendar-info-icon_28.entry-e7bebd13.js} +527 -701
- package/dist/{chevron-icon_3.entry-f27202a2.js → chevron-icon_3.entry-25d90239.js} +6 -6
- package/dist/chevron-icon_3.entry-7bd4a4b5.cjs +1 -0
- package/dist/{clock-icon_2.entry-b7b8ef46.cjs → clock-icon_2.entry-2406c3d0.cjs} +1 -1
- package/dist/{clock-icon_2.entry-2277fd45.js → clock-icon_2.entry-c1b22ed4.js} +5 -5
- package/dist/{constants-f34b9c6e-ccdbc4ac.cjs → constants-f34b9c6e-b774916c.cjs} +1 -1
- package/dist/{constants-f34b9c6e-bbca6b6e.js → constants-f34b9c6e-f1c4dd0d.js} +1 -1
- package/dist/document-refresh-icon.entry-570f9c9d.js +15 -0
- package/dist/document-refresh-icon.entry-a0293858.cjs +1 -0
- package/dist/elements/index.d.ts +1 -0
- package/dist/{elements-dc5b338e-d48368b1.cjs → elements-dc5b338e-550a6cb1.cjs} +1 -1
- package/dist/{elements-dc5b338e-c4a07acc.js → elements-dc5b338e-cafa7a55.js} +1 -1
- package/dist/{focus-visible-e8093c16-10c0fa06.js → focus-visible-e8093c16-022799ce.js} +1 -1
- package/dist/{focus-visible-e8093c16-c86f3687.cjs → focus-visible-e8093c16-c14162e8.cjs} +1 -1
- package/dist/{forward-icon_6.entry-07cd4b52.cjs → forward-icon_6.entry-55752b23.cjs} +2 -2
- package/dist/{forward-icon_6.entry-39d788af.js → forward-icon_6.entry-9b832146.js} +9 -9
- package/dist/{globe-icon.entry-60a53e89.js → globe-icon.entry-2b61820e.js} +4 -4
- package/dist/{globe-icon.entry-76c90d97.cjs → globe-icon.entry-dabe7b8b.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-60c0d39a.cjs +1 -0
- package/dist/google-logo-icon_4.entry-a0dc33da.js +467 -0
- package/dist/index-53420959-67beefed.js +5 -0
- package/dist/index-53420959-d3254a34.cjs +1 -0
- package/dist/{index-6d9eeb53-66c114b2.cjs → index-6d9eeb53-3049fc04.cjs} +1 -1
- package/dist/{index-6d9eeb53-38c9f47c.js → index-6d9eeb53-3edef246.js} +2 -2
- package/dist/{index-f383e3c4.js → index-812162da.js} +902 -901
- package/dist/{index-f435e814.cjs → index-e3e9b594.cjs} +3 -3
- package/dist/{index.es-9cc0eb3c-09dc620b.cjs → index.es-9cc0eb3c-0c99c055.cjs} +1 -1
- package/dist/{index.es-9cc0eb3c-510db795.js → index.es-9cc0eb3c-52226859.js} +1 -1
- package/dist/{info-icon_2.entry-a61859ac.js → info-icon_2.entry-2fe6c16c.js} +8 -8
- package/dist/{info-icon_2.entry-7fe8bcd9.cjs → info-icon_2.entry-5f6b9af8.cjs} +1 -1
- package/dist/{input-component.entry-12f60175.js → input-component.entry-1195d579.js} +6 -6
- package/dist/{input-component.entry-04dcc655.cjs → input-component.entry-2b6e44c4.cjs} +1 -1
- package/dist/{input-dropdown_2.entry-0e5925a7.js → input-dropdown_2.entry-dbd0d6f4.js} +35 -28
- package/dist/input-dropdown_2.entry-dbdb5aa3.cjs +1 -0
- package/dist/loading-icon.entry-027a2ad1.js +15 -0
- package/dist/{loading-icon.entry-f82786b4.cjs → loading-icon.entry-e179f122.cjs} +1 -1
- package/dist/{mailbox-store-64b4ef7c-1e6c96cc.cjs → mailbox-store-64b4ef7c-0eac526c.cjs} +1 -1
- package/dist/{mailbox-store-64b4ef7c-017196a6.js → mailbox-store-64b4ef7c-22a6c565.js} +2 -2
- package/dist/nylas-booked-event-card_10.entry-84f64ba5.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-2dff7f16.js → nylas-booked-event-card_10.entry-e0990f5b.js} +170 -170
- package/dist/{nylas-custom-booking-flow.entry-36f7a943.cjs → nylas-custom-booking-flow.entry-898c8cc9.cjs} +1 -1
- package/dist/{nylas-custom-booking-flow.entry-feed589b.js → nylas-custom-booking-flow.entry-bc64af5f.js} +7 -7
- package/dist/{nylas-form-card.entry-e9f09602.cjs → nylas-form-card.entry-0c71f4fc.cjs} +1 -1
- package/dist/{nylas-form-card.entry-49f519dd.js → nylas-form-card.entry-c564b52e.js} +9 -9
- package/dist/{nylas-if-state.entry-127694a9.js → nylas-if-state.entry-e9486e12.js} +3 -3
- package/dist/{nylas-if-state.entry-81916723.cjs → nylas-if-state.entry-ff6a2046.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-e3e9ec1f.js → nylas-list-folders.entry-0258af1e.js} +7 -7
- package/dist/{nylas-list-folders.entry-f4c68fb9.cjs → nylas-list-folders.entry-90716d2b.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-fa4b5318.js → nylas-list-threads.entry-1abcdd30.js} +3 -3
- package/dist/{nylas-list-threads.entry-f0a1b9d1.cjs → nylas-list-threads.entry-21edf012.cjs} +1 -1
- package/dist/{nylas-login.entry-aeac716e.cjs → nylas-login.entry-2e0ce95e.cjs} +1 -1
- package/dist/{nylas-login.entry-6d17e994.js → nylas-login.entry-ba7383ac.js} +3 -3
- package/dist/{nylas-mailbox-pagination.entry-50fba238.cjs → nylas-mailbox-pagination.entry-ba6beb08.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-c440f56a.js → nylas-mailbox-pagination.entry-f6186560.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-d3d0c870.cjs → nylas-mailbox-toolbar-button.entry-0875aadb.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-14e30d36.js → nylas-mailbox-toolbar-button.entry-e18059b0.js} +10 -10
- package/dist/{nylas-mailbox.entry-a59159c7.js → nylas-mailbox.entry-2e3815ed.js} +4 -4
- package/dist/{nylas-mailbox.entry-2fdb3d4c.cjs → nylas-mailbox.entry-bb2905bf.cjs} +1 -1
- package/dist/{nylas-provider.entry-dfa8c7c1.cjs → nylas-provider.entry-51c5cdbf.cjs} +1 -1
- package/dist/{nylas-provider.entry-d7dbb5fc.js → nylas-provider.entry-69ee5061.js} +13 -13
- package/dist/{nylas-scheduler-editor.entry-67e71234.cjs → nylas-scheduler-editor.entry-923b8566.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-3b44b807.js → nylas-scheduler-editor.entry-d4a9afb1.js} +5 -5
- package/dist/{nylas-scheduling.entry-0ce0dab9.cjs → nylas-scheduling.entry-54f1a5e9.cjs} +1 -1
- package/dist/{nylas-scheduling.entry-68f72bf7.js → nylas-scheduling.entry-f82a2822.js} +3 -3
- package/dist/{nylas-threads-refresh.entry-23a83bd4.js → nylas-threads-refresh.entry-72482d2f.js} +10 -10
- package/dist/{nylas-threads-refresh.entry-955e92c7.cjs → nylas-threads-refresh.entry-99001756.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-2fb6db63.cjs → nylas-threads-search.entry-462527fd.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-8f01ee4a.js → nylas-threads-search.entry-c5fe50e5.js} +14 -14
- package/dist/nylas-time-window-picker.entry-0d93e7cc.js +316 -0
- package/dist/nylas-time-window-picker.entry-ccffcf2b.cjs +1 -0
- package/dist/{nylas-view-thread.entry-b957f88b.js → nylas-view-thread.entry-2d34b41c.js} +6 -6
- package/dist/{nylas-view-thread.entry-3cf0c1ac.cjs → nylas-view-thread.entry-58432a52.cjs} +1 -1
- package/dist/play-icon_2.entry-1ea3fd6b.cjs +1 -0
- package/dist/{play-icon_2.entry-ecdf8ea4.js → play-icon_2.entry-d08adf17.js} +7 -7
- package/dist/react.cjs +1 -1
- package/dist/react.js +41 -40
- package/dist/{refresh-icon.entry-76e58ccb.cjs → refresh-icon.entry-1e670732.cjs} +1 -1
- package/dist/{refresh-icon.entry-480d28aa.js → refresh-icon.entry-a041136d.js} +4 -4
- package/dist/{register-component-a5a9ca5d-438c8a96.js → register-component-a5a9ca5d-a5c01c35.js} +1 -1
- package/dist/{register-component-a5a9ca5d-ebf633cf.cjs → register-component-a5a9ca5d-b68b6039.cjs} +1 -1
- package/dist/{scheduler-config-store-4a50a03d-d5a5899e.cjs → scheduler-config-store-4a50a03d-884e6df8.cjs} +1 -1
- package/dist/{scheduler-config-store-4a50a03d-defa6368.js → scheduler-config-store-4a50a03d-ee42ff96.js} +1 -1
- package/dist/{scheduler-store-f02ce045-de4cb1f5.js → scheduler-store-f02ce045-23a14e3f.js} +1 -1
- package/dist/{scheduler-store-f02ce045-00faab09.cjs → scheduler-store-f02ce045-42e3647c.cjs} +1 -1
- package/dist/{textarea-component.entry-1c8d11af.js → textarea-component.entry-1b4c771b.js} +4 -4
- package/dist/{textarea-component.entry-5ff249a8.cjs → textarea-component.entry-24a830c1.cjs} +1 -1
- package/dist/{translate-icon.entry-a55c013b.cjs → translate-icon.entry-0c0add25.cjs} +1 -1
- package/dist/{translate-icon.entry-3741cac0.js → translate-icon.entry-44bde57b.js} +2 -2
- package/dist/{warning-icon.entry-445352b5.js → warning-icon.entry-8956cba2.js} +5 -5
- package/dist/{warning-icon.entry-1a104c52.cjs → warning-icon.entry-9a77ab01.cjs} +1 -1
- package/package.json +2 -2
- package/dist/add-circle-icon_2.entry-035ffd48.cjs +0 -1
- package/dist/add-circle-icon_2.entry-5cadaf97.js +0 -25
- package/dist/calendar-info-icon_27.entry-a8390790.cjs +0 -1
- package/dist/chevron-icon_3.entry-978b52d5.cjs +0 -1
- package/dist/document-refresh-icon.entry-5795e2a9.cjs +0 -1
- package/dist/document-refresh-icon.entry-656a5e02.js +0 -15
- package/dist/google-logo-icon_4.entry-5402eae2.cjs +0 -1
- package/dist/google-logo-icon_4.entry-d327d68f.js +0 -438
- package/dist/index-53420959-791b4e73.js +0 -5
- package/dist/index-53420959-9f979766.cjs +0 -1
- package/dist/input-dropdown_2.entry-d9bff099.cjs +0 -1
- package/dist/loading-icon.entry-51ddd748.js +0 -15
- package/dist/nylas-booked-event-card_10.entry-5a9a4cc6.cjs +0 -1
- package/dist/play-icon_2.entry-c92d5237.cjs +0 -1
- package/dist/toggle-switch.entry-26d3d1c9.cjs +0 -1
- package/dist/toggle-switch.entry-339ab48b.js +0 -25
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import { r as F, h as e, c as _, x as ct, d as u, y as tt, H as et, g as at } from "./index-812162da.js";
|
|
2
|
+
import { R as nt } from "./register-component-a5a9ca5d-a5c01c35.js";
|
|
3
|
+
import { D as Y } from "./constants-f34b9c6e-f1c4dd0d.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
const dt = ".sc-google-logo-icon-h{display:flex}", bt = dt, ut = class {
|
|
7
|
+
constructor(t) {
|
|
8
|
+
F(this, t), this.width = "24", this.height = "24";
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
return e("svg", { key: "0e9d7d49a7c9b6cd2087805b88f0e5a2067dfaed", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("g", { key: "e97ac24bfe96bdba16a9709dde3ebc675e942d56", "clip-path": "url(#clip0_959_12452)" }, e("path", { key: "231167532157853cb95fddc85fa8cffcf1134ef4", d: "M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z", fill: "#4285F4" }), e("path", { key: "4f964a28a6b0894940c9d762a91db0c099f6c2c7", d: "M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z", fill: "#34A853" }), e("path", { key: "9ada4b2f2625f18538ff4455b1160efcfccbd646", d: "M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z", fill: "#FBBC05" }), e("path", { key: "6a260b3024a69fa930820a80a917152dc7ef52a7", d: "M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z", fill: "#EA4335" })), e("defs", { key: "56bc051b67a1bfa29ecaf64bac03ee1017836365" }, e("clipPath", { key: "8057800f9035048497e8198789e1e0b4dba1c64a", id: "clip0_959_12452" }, e("rect", { key: "6c0299822390d3433158d87c607fe9546e878eb0", width: 24, height: 24, fill: "white" }))));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
ut.style = bt;
|
|
15
|
+
const pt = ".sc-microsoft-logo-icon-h{display:flex}", ht = pt, yt = class {
|
|
16
|
+
constructor(t) {
|
|
17
|
+
F(this, t), this.width = "22", this.height = "22";
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return e("svg", { key: "3dd5e1a94ca5889c14f7695c9077f9be0cbc4d00", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("path", { key: "381068331f74d7f1a06c0ca0cd9dfc2b58f72a10", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), e("path", { key: "62c7be7371433602169a19fe2657e0a1635f516e", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), e("path", { key: "72464e489d4cfd78f016282a743a1000fb732368", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), e("path", { key: "d766c4d950ee3122cf4916b53ce5f630b52a30bb", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
yt.style = ht;
|
|
24
|
+
function ft({ id: t, formState: a, activeTab: n, calendars: s }) {
|
|
25
|
+
var o;
|
|
26
|
+
switch (n) {
|
|
27
|
+
case "eventInfo":
|
|
28
|
+
const i = a.title, l = a.description, r = parseInt(a.duration), c = a.location;
|
|
29
|
+
return e(
|
|
30
|
+
"div",
|
|
31
|
+
{ key: t },
|
|
32
|
+
e(
|
|
33
|
+
"nylas-event-info",
|
|
34
|
+
null,
|
|
35
|
+
e(
|
|
36
|
+
"div",
|
|
37
|
+
{ slot: "inputs" },
|
|
38
|
+
e("nylas-event-title", { name: "title", eventTitle: i, exportparts: "net, net__title, net__dropdown-content" }),
|
|
39
|
+
e("nylas-event-duration", { name: "duration", eventDurationMinutes: r, exportparts: "ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
|
|
40
|
+
e("nylas-event-location", { name: "location", eventLocation: c, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
|
|
41
|
+
e("nylas-event-description", { name: "description", eventDescription: l, exportparts: "nedesc, nedesc__textarea" })
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
case "availability":
|
|
46
|
+
const d = a.availability.openHours, m = a.availability.timezone ? a.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone, h = (o = a.participants) == null ? void 0 : o.find((C) => C.is_organizer), v = (h == null ? void 0 : h.email) ?? "primary", w = a.calendarIds.length > 0 ? a.calendarIds : [v], k = a.bookingCalendar == "primary" ? v : a.bookingCalendar;
|
|
47
|
+
return e(
|
|
48
|
+
"div",
|
|
49
|
+
{ key: t },
|
|
50
|
+
e("nylas-booking-calendar-picker", { name: "booking-calendar", calendars: s ?? [], defaultBookingCalendar: k, exportparts: "nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content" }),
|
|
51
|
+
e("nylas-calendar-picker", { name: "calendars", calendars: s ?? [], defaultSelectedCalendars: w, exportparts: "ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content" }),
|
|
52
|
+
e("nylas-availability-picker", { name: "availability", openHours: d, defaultTimezone: m, exportparts: "nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times" })
|
|
53
|
+
);
|
|
54
|
+
case "bookingOptions":
|
|
55
|
+
return e(
|
|
56
|
+
"div",
|
|
57
|
+
{ key: t },
|
|
58
|
+
e("nylas-buffer-time", { name: "buffer-time", buffer: a.buffer, exportparts: "nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview" }),
|
|
59
|
+
e(
|
|
60
|
+
"nylas-event-limits",
|
|
61
|
+
null,
|
|
62
|
+
e(
|
|
63
|
+
"div",
|
|
64
|
+
{ slot: "inputs" },
|
|
65
|
+
e("nylas-min-booking-notice", { name: "min-booking-notice", minBookingNotice: a.minBookingNotice, exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
|
|
66
|
+
e("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: a.availableDaysInFuture, exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
|
|
67
|
+
e("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: a.minCancellationNotice, exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
|
|
68
|
+
e("nylas-cancellation-policy", { name: "cancellation-policy", cancellationPolicy: a.cancellationPolicy, exportparts: "ncpolicy, ncpolicy__textarea" })
|
|
69
|
+
)
|
|
70
|
+
),
|
|
71
|
+
e("nylas-timeslot-interval", { name: "timeslot-interval", eventDurationMinutes: parseInt(a.duration), exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
|
|
72
|
+
e("nylas-customize-booking-settings", { name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
|
|
73
|
+
);
|
|
74
|
+
case "participants":
|
|
75
|
+
return e(
|
|
76
|
+
"div",
|
|
77
|
+
{ key: t },
|
|
78
|
+
e("nylas-additional-participants", { name: "participants", eventParticipants: a.participants, exportparts: "nap__title, nap__subtitle, nap__content, nap__input_group, nap__input_wrapper, nap__input, nap__remove-participant" }),
|
|
79
|
+
e("nylas-participants-custom-availability", { name: "participant-custom-availability", participants: a.participants, exportparts: "npca, npca__header, npca__content, npca__participant-container, npca__participant-title, npca__participant-toggle--container, npca__toggle-label, npca__toggle-input, npca__toggle-slider" })
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const mt = '.sc-nylas-editor-tabs-h{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}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:554px;display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}', gt = mt;
|
|
84
|
+
var _t = function(t, a, n, s) {
|
|
85
|
+
var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, l;
|
|
86
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
87
|
+
i = Reflect.decorate(t, a, n, s);
|
|
88
|
+
else
|
|
89
|
+
for (var r = t.length - 1; r >= 0; r--)
|
|
90
|
+
(l = t[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(a, n, i) : l(a, n)) || i);
|
|
91
|
+
return o > 3 && i && Object.defineProperty(a, n, i), i;
|
|
92
|
+
}, I = function(t, a) {
|
|
93
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
94
|
+
return Reflect.metadata(t, a);
|
|
95
|
+
};
|
|
96
|
+
const it = class {
|
|
97
|
+
constructor(t) {
|
|
98
|
+
F(this, t), this.schedulerConfigChanged = _(this, "schedulerConfigChanged", 7), this.cancelButtonClick = _(this, "cancelButtonClick", 7), this.formSubmitted = _(this, "formSubmitted", 7), this.previewButtonClicked = _(this, "previewButtonClicked", 7), this.setError = (a) => {
|
|
99
|
+
this.error = a.message;
|
|
100
|
+
}, this.formSubmissionHandler = async (a) => {
|
|
101
|
+
var P, E, R, N, j, M, z, V, U, A, $, Z, G, J, W, q;
|
|
102
|
+
if (a.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity())
|
|
103
|
+
return;
|
|
104
|
+
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
105
|
+
const s = this.updateFormState(), { title: o, description: i, duration: l, availability: r, calendarIds: c, bookingCalendar: d, location: m, bookingType: h, buffer: v, availableDaysInFuture: w, minCancellationNotice: k, minBookingNotice: C, cancellationPolicy: L, timeslotInterval: y, additionalGuestsHidden: B, hideCancellationOptions: D, hideReschedulingOptions: T, participants: g, participantOpenHours: f } = s, p = (E = (P = this.selectedConfiguration) == null ? void 0 : P.participants) == null ? void 0 : E.find((b) => b.is_organizer), S = l ? parseInt(l) : 30, x = g && (g == null ? void 0 : g.length) > 0 ? g : [
|
|
106
|
+
{
|
|
107
|
+
name: (p == null ? void 0 : p.name) ?? ((R = this.currentUser) == null ? void 0 : R.name) ?? (p == null ? void 0 : p.email) ?? ((N = this.currentUser) == null ? void 0 : N.email) ?? "",
|
|
108
|
+
email: (p == null ? void 0 : p.email) ?? ((j = this.currentUser) == null ? void 0 : j.email) ?? "",
|
|
109
|
+
is_organizer: !0,
|
|
110
|
+
availability: {
|
|
111
|
+
calendar_ids: c != null && c.length ? c : ["primary"],
|
|
112
|
+
open_hours: []
|
|
113
|
+
},
|
|
114
|
+
booking: {
|
|
115
|
+
calendar_id: d && d !== "" ? d : "primary"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
], H = {
|
|
119
|
+
...((M = this.selectedConfiguration) == null ? void 0 : M.id) && { id: this.selectedConfiguration.id },
|
|
120
|
+
version: ((z = this.selectedConfiguration) == null ? void 0 : z.version) ?? "1.0.0",
|
|
121
|
+
availability: {
|
|
122
|
+
duration_minutes: S,
|
|
123
|
+
interval_minutes: (y == null ? void 0 : y.interval) ?? S,
|
|
124
|
+
round_to: y == null ? void 0 : y.roundTo,
|
|
125
|
+
availability_rules: {
|
|
126
|
+
availability_method: ((A = (U = (V = this.selectedConfiguration) == null ? void 0 : V.availability) == null ? void 0 : U.availability_rules) == null ? void 0 : A.availability_method) ?? "collective",
|
|
127
|
+
buffer: v || { before: 0, after: 0 },
|
|
128
|
+
default_open_hours: (r == null ? void 0 : r.openHours) ?? ((G = (Z = ($ = this.selectedConfiguration) == null ? void 0 : $.availability) == null ? void 0 : Z.availability_rules) == null ? void 0 : G.default_open_hours) ?? Y,
|
|
129
|
+
round_robin_group_id: ((q = (W = (J = this.selectedConfiguration) == null ? void 0 : J.availability) == null ? void 0 : W.availability_rules) == null ? void 0 : q.round_robin_group_id) ?? ""
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
participants: [
|
|
133
|
+
...x == null ? void 0 : x.map((b) => {
|
|
134
|
+
var K, Q, X;
|
|
135
|
+
return b.is_organizer ? {
|
|
136
|
+
name: b.name ?? b.email,
|
|
137
|
+
email: b.email,
|
|
138
|
+
is_organizer: !0,
|
|
139
|
+
availability: {
|
|
140
|
+
calendar_ids: c != null && c.length ? c : ["primary"],
|
|
141
|
+
open_hours: (f == null ? void 0 : f[b.email]) ?? ((K = b.availability) == null ? void 0 : K.open_hours) ?? []
|
|
142
|
+
},
|
|
143
|
+
booking: {
|
|
144
|
+
calendar_id: d && d !== "" ? d : "primary"
|
|
145
|
+
}
|
|
146
|
+
} : {
|
|
147
|
+
...b,
|
|
148
|
+
availability: {
|
|
149
|
+
calendar_ids: ((Q = b.availability) == null ? void 0 : Q.calendar_ids) ?? ["primary"],
|
|
150
|
+
open_hours: (f == null ? void 0 : f[b.email]) ?? ((X = b.availability) == null ? void 0 : X.open_hours) ?? []
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
})
|
|
154
|
+
],
|
|
155
|
+
event_booking: {
|
|
156
|
+
title: (o == null ? void 0 : o.toString()) ?? "",
|
|
157
|
+
description: (i == null ? void 0 : i.toString()) ?? "",
|
|
158
|
+
location: (m == null ? void 0 : m.toString()) ?? "",
|
|
159
|
+
booking_type: (h == null ? void 0 : h.toString()) ?? "booking",
|
|
160
|
+
timezone: (r == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
161
|
+
},
|
|
162
|
+
scheduler: {
|
|
163
|
+
cancellation_policy: L ?? "",
|
|
164
|
+
available_days_in_future: w ?? 30,
|
|
165
|
+
min_cancellation_notice: k ?? 0,
|
|
166
|
+
min_booking_notice: C ?? 60,
|
|
167
|
+
hide_additional_guests: B ?? !1,
|
|
168
|
+
hide_cancellation_options: D ?? !1,
|
|
169
|
+
hide_rescheduling_options: T ?? !1
|
|
170
|
+
}
|
|
171
|
+
}, ot = ct(H, this.selectedConfiguration), rt = this.action === "create" ? ot : H, lt = (b) => {
|
|
172
|
+
this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
|
|
173
|
+
this.changesSaved = !1;
|
|
174
|
+
}, 5e3);
|
|
175
|
+
};
|
|
176
|
+
this.schedulerConfigChanged.emit({ config: rt, resetLoadingState: lt, setError: this.setError, action: this.action });
|
|
177
|
+
}, this.calendars = void 0, this.selectedConfiguration = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.action = "create", this.activeTab = "eventInfo", this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
|
|
178
|
+
}
|
|
179
|
+
configChangedHandler(t) {
|
|
180
|
+
u("[nylas-editor-tabs]", "configChangedHandler", t, this.selectedConfiguration), this.formState = {
|
|
181
|
+
...this.getFormStateFromConfig(t)
|
|
182
|
+
}, t.id ? this.action = "edit" : this.action = "create";
|
|
183
|
+
}
|
|
184
|
+
connectedCallback() {
|
|
185
|
+
u("[nylas-editor-tabs]", "connectedCallback");
|
|
186
|
+
}
|
|
187
|
+
componentWillLoad() {
|
|
188
|
+
u("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
189
|
+
}
|
|
190
|
+
componentDidLoad() {
|
|
191
|
+
u("[nylas-editor-tabs]", "componentDidLoad");
|
|
192
|
+
}
|
|
193
|
+
disconnectedCallback() {
|
|
194
|
+
u("[nylas-editor-tabs]", "disconnectedCallback");
|
|
195
|
+
}
|
|
196
|
+
handleValueChanged(t) {
|
|
197
|
+
u("[nylas-editor-tabs]", "handleValueChanged", t);
|
|
198
|
+
const { name: a, value: n } = t.detail;
|
|
199
|
+
this.setFormState(n, a), this.formState = { ...this.formState }, this.hasUnsavedChanges = !0, this.error = "";
|
|
200
|
+
}
|
|
201
|
+
getFormStateFromConfig(t) {
|
|
202
|
+
var n, s, o, i, l, r, c, d, m, h, v, w, k, C, L, y, B, D, T, g, f, p, S, x;
|
|
203
|
+
const a = (n = t == null ? void 0 : t.participants) == null ? void 0 : n.find((H) => H.is_organizer);
|
|
204
|
+
return {
|
|
205
|
+
title: ((s = t == null ? void 0 : t.event_booking) == null ? void 0 : s.title) ?? "",
|
|
206
|
+
description: ((o = t == null ? void 0 : t.event_booking) == null ? void 0 : o.description) ?? "",
|
|
207
|
+
duration: ((l = (i = t == null ? void 0 : t.availability) == null ? void 0 : i.duration_minutes) == null ? void 0 : l.toString()) ?? "30",
|
|
208
|
+
availability: {
|
|
209
|
+
timezone: ((r = t == null ? void 0 : t.event_booking) == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
210
|
+
openHours: ((d = (c = t == null ? void 0 : t.availability) == null ? void 0 : c.availability_rules) == null ? void 0 : d.default_open_hours) ?? Y
|
|
211
|
+
},
|
|
212
|
+
calendarIds: ((m = a == null ? void 0 : a.availability) == null ? void 0 : m.calendar_ids) ?? [],
|
|
213
|
+
participants: (t == null ? void 0 : t.participants) ?? [],
|
|
214
|
+
bookingCalendar: ((h = a == null ? void 0 : a.booking) == null ? void 0 : h.calendar_id) ?? (a == null ? void 0 : a.email) ?? "",
|
|
215
|
+
location: ((v = t == null ? void 0 : t.event_booking) == null ? void 0 : v.location) ?? "",
|
|
216
|
+
bookingType: ((w = t == null ? void 0 : t.event_booking) == null ? void 0 : w.booking_type) ?? "booking",
|
|
217
|
+
buffer: ((C = (k = t == null ? void 0 : t.availability) == null ? void 0 : k.availability_rules) == null ? void 0 : C.buffer) ?? { before: 0, after: 0 },
|
|
218
|
+
cancellationPolicy: ((L = t == null ? void 0 : t.scheduler) == null ? void 0 : L.cancellation_policy) ?? "",
|
|
219
|
+
availableDaysInFuture: ((y = t == null ? void 0 : t.scheduler) == null ? void 0 : y.available_days_in_future) ?? 30,
|
|
220
|
+
minCancellationNotice: ((B = t == null ? void 0 : t.scheduler) == null ? void 0 : B.min_cancellation_notice) ?? 0,
|
|
221
|
+
minBookingNotice: ((D = t == null ? void 0 : t.scheduler) == null ? void 0 : D.min_booking_notice) ?? 60,
|
|
222
|
+
timeslotInterval: {
|
|
223
|
+
interval: ((T = t == null ? void 0 : t.availability) == null ? void 0 : T.interval_minutes) ?? ((g = t == null ? void 0 : t.availability) == null ? void 0 : g.duration_minutes) ?? 10,
|
|
224
|
+
roundTo: (f = t == null ? void 0 : t.availability) == null ? void 0 : f.round_to
|
|
225
|
+
},
|
|
226
|
+
additionalGuestsHidden: ((p = t == null ? void 0 : t.scheduler) == null ? void 0 : p.hide_additional_guests) ?? !1,
|
|
227
|
+
hideCancellationOptions: ((S = t == null ? void 0 : t.scheduler) == null ? void 0 : S.hide_cancellation_options) ?? !1,
|
|
228
|
+
hideReschedulingOptions: ((x = t == null ? void 0 : t.scheduler) == null ? void 0 : x.hide_rescheduling_options) ?? !1
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
setFormState(t, a) {
|
|
232
|
+
switch (a) {
|
|
233
|
+
case "title":
|
|
234
|
+
this.formState.title = t.toString();
|
|
235
|
+
break;
|
|
236
|
+
case "description":
|
|
237
|
+
this.formState.description = t.toString();
|
|
238
|
+
break;
|
|
239
|
+
case "duration":
|
|
240
|
+
this.formState.duration = t.toString();
|
|
241
|
+
break;
|
|
242
|
+
case "availability":
|
|
243
|
+
this.formState.availability = JSON.parse(t.toString());
|
|
244
|
+
break;
|
|
245
|
+
case "participants":
|
|
246
|
+
this.formState.participants = JSON.parse(t.toString());
|
|
247
|
+
break;
|
|
248
|
+
case "calendars":
|
|
249
|
+
this.formState.calendarIds = t.toString().split(",");
|
|
250
|
+
break;
|
|
251
|
+
case "booking-calendar":
|
|
252
|
+
this.formState.bookingCalendar = t.toString();
|
|
253
|
+
break;
|
|
254
|
+
case "location":
|
|
255
|
+
this.formState.location = t.toString();
|
|
256
|
+
break;
|
|
257
|
+
case "booking-type":
|
|
258
|
+
this.formState.bookingType = t.toString();
|
|
259
|
+
break;
|
|
260
|
+
case "buffer-time":
|
|
261
|
+
this.formState.buffer = JSON.parse(t.toString());
|
|
262
|
+
break;
|
|
263
|
+
case "limit-future-bookings":
|
|
264
|
+
this.formState.availableDaysInFuture = parseInt(t.toString());
|
|
265
|
+
break;
|
|
266
|
+
case "min-cancellation-notice":
|
|
267
|
+
this.formState.minCancellationNotice = parseInt(t.toString());
|
|
268
|
+
break;
|
|
269
|
+
case "min-booking-notice":
|
|
270
|
+
this.formState.minBookingNotice = parseInt(t.toString());
|
|
271
|
+
break;
|
|
272
|
+
case "cancellation-policy":
|
|
273
|
+
this.formState.cancellationPolicy = t.toString();
|
|
274
|
+
break;
|
|
275
|
+
case "timeslot-interval":
|
|
276
|
+
this.formState.timeslotInterval = JSON.parse(t.toString());
|
|
277
|
+
break;
|
|
278
|
+
case "customize-booking-settings":
|
|
279
|
+
const n = JSON.parse(t.toString());
|
|
280
|
+
this.formState.additionalGuestsHidden = n.additionalGuestsHidden, this.formState.hideCancellationOptions = n.hideCancellationOptions, this.formState.hideReschedulingOptions = n.hideReschedulingOptions;
|
|
281
|
+
break;
|
|
282
|
+
case "participant-custom-availability":
|
|
283
|
+
const s = JSON.parse(t.toString());
|
|
284
|
+
this.formState.participantOpenHours = s;
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
updateFormState() {
|
|
289
|
+
return new FormData(this.formRef).forEach((a, n) => {
|
|
290
|
+
this.setFormState(a, n);
|
|
291
|
+
}), this.formState = { ...this.formState }, this.formState;
|
|
292
|
+
}
|
|
293
|
+
setActiveTab(t, a) {
|
|
294
|
+
t.preventDefault(), this.updateFormState(), this.activeTab = a;
|
|
295
|
+
}
|
|
296
|
+
render() {
|
|
297
|
+
var a;
|
|
298
|
+
u("[nylas-editor-tabs]", "render", this.formState);
|
|
299
|
+
const t = localStorage.getItem("nylas") === "Nylas Developer";
|
|
300
|
+
return e(et, { key: "13aad28cba8de3b30e60d7a26849d30ef2578bb5" }, e("form", { key: "31e835f74ca7728d597148a18c840e0791c34c89", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (n) => this.formRef = n, noValidate: !0 }, this.mode === "app" ? e("div", { class: "form-contents" }, e("div", { class: "tabs" }, e("button", { class: { tab: !0, active: this.activeTab == "eventInfo" }, onClick: (n) => this.setActiveTab(n, "eventInfo") }, e("calendar-info-icon", { width: "16", height: "16" }), "Event Info"), e("button", { class: { tab: !0, active: this.activeTab == "availability" }, onClick: (n) => this.setActiveTab(n, "availability") }, e("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), e("button", { class: { tab: !0, active: this.activeTab == "bookingOptions" }, onClick: (n) => this.setActiveTab(n, "bookingOptions") }, e("flow-icon", { width: "16", height: "16" }), "Booking Options"), t && e("button", { class: { tab: !0, active: this.activeTab == "participants" }, onClick: (n) => this.setActiveTab(n, "participants") }, e("people-icon", { width: "16", height: "16" }), "Participants")), e("div", { class: "tab-content" }, e(ft, { formState: this.formState, activeTab: this.activeTab, calendars: this.calendars, id: ((a = this.selectedConfiguration) == null ? void 0 : a.id) ?? "new" }))) : e("slot", null), e("div", { key: "e83274ed2d92f179c90564a21f80ba869d1033a2", class: "footer" }, e("div", { key: "c661b7a0c024f7b8f1c916b55bc5784a10ee9958", class: "preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && e("button-component", { type: "button", disabled: this.isLoading, clickHandler: (n) => {
|
|
301
|
+
n.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(tt(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
302
|
+
}, variant: "basic" }, "Preview")), e("div", { key: "78cb89dbbb6e124aaddf9b486834e81ab10ea70a", class: "buttons" }, e("p", { key: "e07f651a081607471d067aa05a3858446725a6db", class: {
|
|
303
|
+
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
304
|
+
"saved-changes": this.changesSaved,
|
|
305
|
+
error: this.error !== "",
|
|
306
|
+
"error-full-width": this.error !== "" && this.action === "create"
|
|
307
|
+
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), e("button-component", { key: "66500ec7f10c2a5ecb6d98647766e2f31f030fe4", type: "button", disabled: this.isLoading, clickHandler: (n) => {
|
|
308
|
+
n.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
309
|
+
}, variant: "basic" }, "Cancel"), e("button-component", { key: "a816e4c9d7d1f53e09edf635f06c9a177bdcb15a", type: "submit", disabled: this.isLoading }, this.isLoading ? e("span", null, "Saving", e("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
|
|
310
|
+
}
|
|
311
|
+
get host() {
|
|
312
|
+
return at(this);
|
|
313
|
+
}
|
|
314
|
+
static get watchers() {
|
|
315
|
+
return {
|
|
316
|
+
selectedConfiguration: ["configChangedHandler"]
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
_t([
|
|
321
|
+
nt({
|
|
322
|
+
name: "nylas-editor-tabs",
|
|
323
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
324
|
+
["schedulerConfig.calendars", "calendars"],
|
|
325
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
326
|
+
["schedulerConfig.currentUser", "currentUser"]
|
|
327
|
+
]),
|
|
328
|
+
eventToProps: {
|
|
329
|
+
schedulerConfigChanged: async (t, a) => {
|
|
330
|
+
const { resetLoadingState: n, setError: s, action: o, config: i } = t.detail, l = (r) => {
|
|
331
|
+
const [c, d] = r;
|
|
332
|
+
!c && d && s && s(d), n && n(t);
|
|
333
|
+
};
|
|
334
|
+
if (o === "edit") {
|
|
335
|
+
const r = await a.schedulerConfig.updateConfiguration(i);
|
|
336
|
+
l(r);
|
|
337
|
+
} else {
|
|
338
|
+
const r = await a.schedulerConfig.createConfiguration(i);
|
|
339
|
+
l(r);
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
cancelButtonClick: async (t, a) => {
|
|
343
|
+
a.schedulerConfigStore.state.action = null;
|
|
344
|
+
},
|
|
345
|
+
previewButtonClicked: async (t, a) => {
|
|
346
|
+
u("[nylas-editor-tabs]", "previewButtonClicked", a);
|
|
347
|
+
},
|
|
348
|
+
formSubmitted: async (t, a) => {
|
|
349
|
+
u("[nylas-editor-tabs]", "formSubmitted", a);
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
353
|
+
fireRegisterEvent: !0
|
|
354
|
+
}),
|
|
355
|
+
I("design:type", Function),
|
|
356
|
+
I("design:paramtypes", []),
|
|
357
|
+
I("design:returntype", void 0)
|
|
358
|
+
], it.prototype, "render", null);
|
|
359
|
+
it.style = gt;
|
|
360
|
+
const vt = ':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--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}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:1rem;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;overflow-y:auto}.configurations table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations table.no-configurations{height:100%}.configurations table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations table tr:last-of-type{border-bottom:0}.configurations table tr.hide{display:none}.configurations table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations table th.actions-header{text-align:right}.configurations table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations table th,.configurations table td{text-align:left;padding:1rem;font-family:inherit}.configurations table .actions{text-align:right}.configurations table .actions{display:flex;justify-content:flex-end;gap:1rem}@media screen and (max-width: 768px){.configurations table .actions{flex-direction:column;gap:0.5rem}}.configurations table .title{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .config-event-description{font-size:0.75rem}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}button-component#copy button{width:108px}', wt = vt;
|
|
361
|
+
var kt = function(t, a, n, s) {
|
|
362
|
+
var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, l;
|
|
363
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
364
|
+
i = Reflect.decorate(t, a, n, s);
|
|
365
|
+
else
|
|
366
|
+
for (var r = t.length - 1; r >= 0; r--)
|
|
367
|
+
(l = t[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(a, n, i) : l(a, n)) || i);
|
|
368
|
+
return o > 3 && i && Object.defineProperty(a, n, i), i;
|
|
369
|
+
}, O = function(t, a) {
|
|
370
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
371
|
+
return Reflect.metadata(t, a);
|
|
372
|
+
};
|
|
373
|
+
const st = class {
|
|
374
|
+
constructor(t) {
|
|
375
|
+
F(this, t), this.initListConfigurations = _(this, "initListConfigurations", 7), this.createButtonClick = _(this, "createButtonClick", 7), this.editButtonClick = _(this, "editButtonClick", 7), this.deleteButtonClick = _(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.state = "loading", this.error = "", this.copiedButtonIndex = -1;
|
|
376
|
+
}
|
|
377
|
+
connectedCallback() {
|
|
378
|
+
u("[nylas-list-configurations]", "connectedCallback");
|
|
379
|
+
}
|
|
380
|
+
componentWillLoad() {
|
|
381
|
+
u("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
|
|
382
|
+
}
|
|
383
|
+
componentDidLoad() {
|
|
384
|
+
u("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit(this.host);
|
|
385
|
+
}
|
|
386
|
+
disconnectedCallback() {
|
|
387
|
+
u("[nylas-list-configurations]", "disconnectedCallback");
|
|
388
|
+
}
|
|
389
|
+
async getState() {
|
|
390
|
+
return this.state;
|
|
391
|
+
}
|
|
392
|
+
async setState(t) {
|
|
393
|
+
this.state = t;
|
|
394
|
+
}
|
|
395
|
+
async setError(t) {
|
|
396
|
+
this.error = t;
|
|
397
|
+
}
|
|
398
|
+
getDurationString(t) {
|
|
399
|
+
const a = Math.floor(t / 60), n = t % 60;
|
|
400
|
+
return `${a || ""} ${a ? `${a > 1 ? "hours" : "hour"}` : ""} ${n || ""} ${n ? `${n > 1 ? "mins" : "min"}` : ""}`;
|
|
401
|
+
}
|
|
402
|
+
render() {
|
|
403
|
+
return e(et, null, e("div", { class: "header" }, e("div", { class: "description" }, e("h2", null, "All scheduling pages"), e("p", null, "Create, edit and manage all your scheduling pages.")), this.configurations && this.configurations.length > 0 && e("div", { class: "actions" }, e("button-component", { clickHandler: () => {
|
|
404
|
+
this.createButtonClick.emit(this.host);
|
|
405
|
+
} }, "Create new"))), e("div", { class: "configurations" }, e("table", { class: {
|
|
406
|
+
"no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
|
|
407
|
+
} }, e("tr", { class: {
|
|
408
|
+
hide: this.state === "loading" || this.configurations && this.configurations.length === 0
|
|
409
|
+
} }, e("th", null, "Scheduling page title"), e("th", null, "Duration"), e("th", { class: "actions-header" }, "Actions")), this.state === "loading" && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("h3", null, "Loading..."), e("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("calendar-icon", { width: "48", height: "48" }), e("h3", null, "No scheduling pages found"), e("p", null, "Get started with creating your first scheduling page"), e("button-component", { clickHandler: () => {
|
|
410
|
+
this.createButtonClick.emit(this.host);
|
|
411
|
+
} }, "Create new")))), this.state !== "loading" && this.configurations.map((t, a) => e("tr", { key: t.id }, e("td", null, e("div", { class: "title" }, e("span", { class: "config-event-title" }, t.event_booking.title), e("span", { class: "config-event-description" }, t.event_booking.description))), e("td", null, e("div", null, this.getDurationString(t.availability.duration_minutes))), e("td", null, e("div", { class: "actions" }, e("button-component", { variant: "basic", id: "copy", key: `copy-${a}`, clickHandler: async (n) => {
|
|
412
|
+
n.preventDefault();
|
|
413
|
+
const s = tt(this.schedulerPreviewLink, t);
|
|
414
|
+
await navigator.clipboard.writeText(s), this.copiedButtonIndex = a, setTimeout(() => {
|
|
415
|
+
this.copiedButtonIndex = -1;
|
|
416
|
+
}, 3e3);
|
|
417
|
+
} }, this.copiedButtonIndex === a ? "Copied!" : "Copy link"), e("button-component", { variant: "basic", key: `edit-${a}`, clickHandler: (n) => {
|
|
418
|
+
n.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: t });
|
|
419
|
+
} }, "Edit"), e("button-component", { variant: "basic", key: `delete-${a}`, clickHandler: (n) => {
|
|
420
|
+
n.preventDefault(), this.deleteButtonClick.emit({ host: this.host, configuration: t });
|
|
421
|
+
} }, "Delete"))))))), this.state === "error" && e("div", { class: "error-container" }, e("p", { class: "error" }, this.error)));
|
|
422
|
+
}
|
|
423
|
+
get host() {
|
|
424
|
+
return at(this);
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
kt([
|
|
428
|
+
nt({
|
|
429
|
+
name: "nylas-list-configurations",
|
|
430
|
+
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.configurations", "configurations"]]),
|
|
431
|
+
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
432
|
+
eventToProps: {
|
|
433
|
+
initListConfigurations: async (t, a) => {
|
|
434
|
+
const n = t.detail;
|
|
435
|
+
await n.setState("loading");
|
|
436
|
+
const [s, o] = await a.schedulerConfig.getConfigurations();
|
|
437
|
+
if (!s && o && o.message) {
|
|
438
|
+
await n.setState("error"), await n.setError(o.message);
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
await n.setState("loaded");
|
|
442
|
+
},
|
|
443
|
+
createButtonClick: async (t, a) => {
|
|
444
|
+
a.schedulerConfigStore.resetSelectedConfiguration(), a.schedulerConfigStore.state.action = "create";
|
|
445
|
+
},
|
|
446
|
+
deleteButtonClick: async (t, a) => {
|
|
447
|
+
const { host: n, configuration: s } = t.detail, [o, i] = await a.schedulerConfig.deleteConfiguration(s.id);
|
|
448
|
+
!o && i && i.message && (await n.setState("error"), await n.setError(i.message));
|
|
449
|
+
},
|
|
450
|
+
editButtonClick: async (t, a) => {
|
|
451
|
+
const { configuration: n } = t.detail;
|
|
452
|
+
a.schedulerConfigStore.state.selectedConfiguration = n, a.schedulerConfigStore.state.action = "edit";
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
fireRegisterEvent: !0
|
|
456
|
+
}),
|
|
457
|
+
O("design:type", Function),
|
|
458
|
+
O("design:paramtypes", []),
|
|
459
|
+
O("design:returntype", void 0)
|
|
460
|
+
], st.prototype, "render", null);
|
|
461
|
+
st.style = wt;
|
|
462
|
+
export {
|
|
463
|
+
ut as google_logo_icon,
|
|
464
|
+
yt as microsoft_logo_icon,
|
|
465
|
+
it as nylas_editor_tabs,
|
|
466
|
+
st as nylas_list_configurations
|
|
467
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("./index-e3e9b594.cjs");var e=s.commonjsGlobal.process;exports.process=e;
|