@nylas/react 1.1.0-canary.11 → 1.1.0-canary.12
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_21.entry-172d31c3.js +6726 -0
- package/dist/add-circle-icon_21.entry-71af48f1.cjs +41 -0
- package/dist/{archive-icon_7.entry-24f31e46.cjs → archive-icon_7.entry-59d9e24f.cjs} +1 -1
- package/dist/{archive-icon_7.entry-3c5e3ccf.js → archive-icon_7.entry-e892a458.js} +1 -1
- package/dist/{arrow-icon.entry-813bffe9.js → arrow-icon.entry-060b9b4f.js} +1 -1
- package/dist/{arrow-icon.entry-562eb541.cjs → arrow-icon.entry-834b8066.cjs} +1 -1
- package/dist/{bold-icon_3.entry-c0e7d524.js → bold-icon_3.entry-0f038db3.js} +1 -1
- package/dist/{bold-icon_3.entry-e8b034fe.cjs → bold-icon_3.entry-eb0fcdaa.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-7d4fdb1b.cjs → calendar-cancel-icon.entry-27a6f628.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-0b0219cb.js → calendar-cancel-icon.entry-96156441.js} +1 -1
- package/dist/{calendar-check-icon_2.entry-88025f63.cjs → calendar-check-icon_2.entry-b6d6d220.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-6ecd2faa.js → calendar-check-icon_2.entry-c7c13e3e.js} +1 -1
- package/dist/{calendar-icon.entry-b753520f.cjs → calendar-icon.entry-e7f6a9a8.cjs} +1 -1
- package/dist/{calendar-icon.entry-34d8ef69.js → calendar-icon.entry-f088fb14.js} +1 -1
- package/dist/{chevron-icon_3.entry-0aeb4cfa.cjs → chevron-icon_3.entry-8c6e6f74.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-ae55fd65.js → chevron-icon_3.entry-90a3e89c.js} +1 -1
- package/dist/{close-icon.entry-c80da833.cjs → close-icon.entry-175b9674.cjs} +1 -1
- package/dist/{close-icon.entry-ae66c827.js → close-icon.entry-e694948f.js} +1 -1
- package/dist/{constants-f34b9c6e-b9f975af.cjs → constants-f34b9c6e-593e21cc.cjs} +1 -1
- package/dist/{constants-f34b9c6e-d0f5cd19.js → constants-f34b9c6e-91f6ad05.js} +1 -1
- package/dist/{document-refresh-icon.entry-36405467.cjs → document-refresh-icon.entry-a54c74b9.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-7d370f85.js → document-refresh-icon.entry-ca98d879.js} +1 -1
- package/dist/{elements-dc5b338e-0dbb4f67.cjs → elements-dc5b338e-60f95088.cjs} +1 -1
- package/dist/{elements-dc5b338e-524cb111.js → elements-dc5b338e-68eab1e5.js} +1 -1
- package/dist/{focus-visible-e8093c16-7e94a4f3.cjs → focus-visible-e8093c16-a0869441.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-17ab1557.js → focus-visible-e8093c16-b5d785fc.js} +1 -1
- package/dist/{forward-icon_6.entry-a479b39e.cjs → forward-icon_6.entry-4b321b9a.cjs} +1 -1
- package/dist/{forward-icon_6.entry-384cc3c5.js → forward-icon_6.entry-84ac76ac.js} +2 -2
- package/dist/global-37eeb0cd-6c5934cf.cjs +1 -0
- package/dist/global-37eeb0cd-b42e0abc.js +4 -0
- package/dist/{globe-icon.entry-58b9f3fc.js → globe-icon.entry-14a60f32.js} +1 -1
- package/dist/{globe-icon.entry-0c848856.cjs → globe-icon.entry-ef04c8bf.cjs} +1 -1
- package/dist/{google-logo-icon_4.entry-3dce1b83.js → google-logo-icon_4.entry-4fa3cb8e.js} +47 -52
- package/dist/google-logo-icon_4.entry-ffeec491.cjs +1 -0
- package/dist/{index-33f74306.cjs → index-3a004ec1.cjs} +10 -10
- package/dist/{index-20ea5b0c.js → index-4c7e8f2f.js} +161 -158
- package/dist/index-92989ac4-69175657.js +902 -0
- package/dist/index-92989ac4-6f32ff2a.cjs +6 -0
- package/dist/{index.es-be19d2df-f732308a.cjs → index.es-9190f785-60475c4c.cjs} +6 -6
- package/dist/{index.es-be19d2df-c2fdca63.js → index.es-9190f785-69269065.js} +12 -13
- package/dist/{info-icon_2.entry-98965833.js → info-icon_2.entry-45f6f01f.js} +1 -1
- package/dist/{info-icon_2.entry-dd0a0633.cjs → info-icon_2.entry-fb099090.cjs} +1 -1
- package/dist/{loading-icon.entry-abd81cea.js → loading-icon.entry-67c8b1fa.js} +1 -1
- package/dist/{loading-icon.entry-46821f18.cjs → loading-icon.entry-eaabff41.cjs} +1 -1
- package/dist/{mailbox-store-76540d24-7bf14e45.cjs → mailbox-store-29139d89-dd9d3d1b.cjs} +1 -1
- package/dist/{mailbox-store-76540d24-dfb53045.js → mailbox-store-29139d89-e3513416.js} +2 -2
- package/dist/{nylas-additional-participants.entry-d35d7af5.cjs → nylas-additional-participants.entry-6413fc87.cjs} +1 -1
- package/dist/{nylas-additional-participants.entry-f6ed34d6.js → nylas-additional-participants.entry-a1fb4ef4.js} +2 -2
- package/dist/{nylas-booked-event-card_10.entry-534e587c.cjs → nylas-booked-event-card_10.entry-ce660783.cjs} +1 -1
- package/dist/{nylas-booked-event-card_10.entry-8efe8335.js → nylas-booked-event-card_10.entry-e435ff63.js} +3 -3
- package/dist/{nylas-custom-booking-flow.entry-12d09496.cjs → nylas-custom-booking-flow.entry-3e690bb7.cjs} +1 -1
- package/dist/{nylas-custom-booking-flow.entry-0e7b605d.js → nylas-custom-booking-flow.entry-56075ecd.js} +2 -2
- package/dist/{nylas-form-card.entry-7dd86dde.js → nylas-form-card.entry-33ff95e1.js} +2 -2
- package/dist/{nylas-form-card.entry-94579d1d.cjs → nylas-form-card.entry-64d7be4d.cjs} +1 -1
- package/dist/{nylas-if-state.entry-32ea90ea.cjs → nylas-if-state.entry-1e4b0a58.cjs} +1 -1
- package/dist/{nylas-if-state.entry-92cbc0b9.js → nylas-if-state.entry-3d22bca7.js} +2 -2
- package/dist/{nylas-list-folders.entry-8595a9b7.cjs → nylas-list-folders.entry-3da37b1c.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-cab222c9.js → nylas-list-folders.entry-e634780d.js} +2 -2
- package/dist/{nylas-list-threads.entry-8e9294a3.js → nylas-list-threads.entry-26dbb8ff.js} +2 -2
- package/dist/{nylas-list-threads.entry-3fef6316.cjs → nylas-list-threads.entry-ef4743af.cjs} +1 -1
- package/dist/{nylas-login.entry-bc885e04.cjs → nylas-login.entry-a76e4aae.cjs} +1 -1
- package/dist/{nylas-login.entry-bd1d5b6f.js → nylas-login.entry-ff7d9db5.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-74d3b376.cjs → nylas-mailbox-pagination.entry-565ee29b.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-58657a09.js → nylas-mailbox-pagination.entry-fcb3cc47.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-8b73b9f4.cjs → nylas-mailbox-toolbar-button.entry-3a94b1e9.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-d7817b46.js → nylas-mailbox-toolbar-button.entry-ae13c538.js} +2 -2
- package/dist/{nylas-mailbox.entry-0bddc2fd.js → nylas-mailbox.entry-6d86abe9.js} +7 -6
- package/dist/nylas-mailbox.entry-8f41c35a.cjs +1 -0
- package/dist/{nylas-provider.entry-2e24192d.js → nylas-provider.entry-01e0944e.js} +6 -5
- package/dist/nylas-provider.entry-65f0f8da.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-7dc20e4d.cjs +2 -0
- package/dist/nylas-scheduler-editor.entry-8f62880a.js +1391 -0
- package/dist/nylas-scheduling.entry-1b6628a3.cjs +1 -0
- package/dist/{nylas-scheduling.entry-3f170361.js → nylas-scheduling.entry-f15b3106.js} +40 -38
- package/dist/{nylas-threads-refresh.entry-3b9f57c3.cjs → nylas-threads-refresh.entry-d62d0574.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-f2967405.js → nylas-threads-refresh.entry-d7727ccb.js} +2 -2
- package/dist/{nylas-threads-search.entry-e70bbf70.js → nylas-threads-search.entry-4803d20b.js} +2 -2
- package/dist/{nylas-threads-search.entry-3e0b4fdc.cjs → nylas-threads-search.entry-eec50b1b.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-4f39f045.js → nylas-view-thread.entry-2b85f8e2.js} +2 -2
- package/dist/{nylas-view-thread.entry-b23080b7.cjs → nylas-view-thread.entry-5da789da.cjs} +1 -1
- package/dist/{people-icon.entry-7f3b95e9.js → people-icon.entry-63f63064.js} +1 -1
- package/dist/{people-icon.entry-15cd7d77.cjs → people-icon.entry-b6426fe6.cjs} +1 -1
- package/dist/{play-icon_2.entry-2172886a.cjs → play-icon_2.entry-2b8094d7.cjs} +1 -1
- package/dist/{play-icon_2.entry-13065065.js → play-icon_2.entry-a3262db3.js} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/{refresh-icon.entry-61067a7f.cjs → refresh-icon.entry-542f680c.cjs} +1 -1
- package/dist/{refresh-icon.entry-fbfa185e.js → refresh-icon.entry-64679ef7.js} +1 -1
- package/dist/{register-component-83e24412-b666e56b.js → register-component-83e24412-51af5293.js} +1 -1
- package/dist/{register-component-83e24412-445c6ad9.cjs → register-component-83e24412-d76a2962.cjs} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-8bde49c6.cjs → scheduler-config-store-ec3b6190-2710b76a.cjs} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-fa81c492.js → scheduler-config-store-ec3b6190-df09ddc0.js} +1 -1
- package/dist/scheduler-store-dabdbc4f-404dc261.cjs +1 -0
- package/dist/{scheduler-store-8ca9003d-8da2c12d.js → scheduler-store-dabdbc4f-6f6096d6.js} +41 -28
- package/dist/{time-period-selector.entry-5e083fd3.js → time-period-selector.entry-8e6954f5.js} +1 -1
- package/dist/{time-period-selector.entry-febf55eb.cjs → time-period-selector.entry-c5faae46.cjs} +1 -1
- package/dist/{translate-icon.entry-8ce0a713.cjs → translate-icon.entry-49a653f0.cjs} +1 -1
- package/dist/{translate-icon.entry-10db7d36.js → translate-icon.entry-57dedacf.js} +1 -1
- package/dist/{warning-icon.entry-470e449d.js → warning-icon.entry-a7977526.js} +1 -1
- package/dist/{warning-icon.entry-b8217553.cjs → warning-icon.entry-bce861bd.cjs} +1 -1
- package/package.json +2 -2
- package/dist/add-circle-icon_21.entry-71e60262.js +0 -1755
- package/dist/add-circle-icon_21.entry-95dda099.cjs +0 -1
- package/dist/google-logo-icon_4.entry-e1e63fd0.cjs +0 -1
- package/dist/nylas-mailbox.entry-762f5062.cjs +0 -1
- package/dist/nylas-provider.entry-f8ba7a6e.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-8189b099.js +0 -2269
- package/dist/nylas-scheduler-editor.entry-a642f833.cjs +0 -7
- package/dist/nylas-scheduling.entry-13087b5f.cjs +0 -1
- package/dist/scheduler-store-8ca9003d-57b3f7a7.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{};exports.global$1=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-3a004ec1.cjs");require("react");require("react-dom");const i=".sc-globe-icon-h{display:flex}",o=i,C=class{constructor(t){e.registerInstance(this,t),this.width="16",this.height="16"}render(){return e.h("svg",{key:"f5143e3cb40a90ae9f1d944bfc452b7074d67582",xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height,viewBox:"0 0 16 16",fill:"none"},e.h("path",{key:"f43a8401af32f5ddaa3e325a32371c858716145b",d:"M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 3C8.37372 3 8.87543 3.35608 9.31258 4.31781C9.4073 4.52619 9.49448 4.75446 9.57265 5H6.42735C6.50552 4.75446 6.5927 4.52619 6.68742 4.31781C7.12457 3.35608 7.62628 3 8 3ZM5.77705 3.90401C5.62614 4.23601 5.49428 4.6038 5.38411 5H3.99963C4.52341 4.30269 5.22525 3.74677 6.03766 3.39978C5.94287 3.56117 5.85596 3.7304 5.77705 3.90401ZM5.16299 6C5.05694 6.6275 5 7.30146 5 8C5 8.69854 5.05694 9.3725 5.16299 10H3.41604C3.14845 9.38754 3 8.7111 3 8C3 7.2889 3.14845 6.61246 3.41604 6H5.16299ZM5.38411 11C5.49428 11.3962 5.62614 11.764 5.77705 12.096C5.85596 12.2696 5.94287 12.4388 6.03766 12.6002C5.22525 12.2532 4.52341 11.6973 3.99963 11H5.38411ZM6.42735 11H9.57265C9.49448 11.2455 9.4073 11.4738 9.31258 11.6822C8.87543 12.6439 8.37372 13 8 13C7.62628 13 7.12457 12.6439 6.68742 11.6822C6.5927 11.4738 6.50552 11.2455 6.42735 11ZM9.82134 10H6.17866C6.06438 9.3892 6 8.71396 6 8C6 7.28604 6.06438 6.6108 6.17866 6H9.82134C9.93562 6.6108 10 7.28604 10 8C10 8.71396 9.93562 9.3892 9.82134 10ZM10.6159 11H12.0004C11.4766 11.6973 10.7747 12.2532 9.96234 12.6002C10.0571 12.4388 10.144 12.2696 10.2229 12.096C10.3739 11.764 10.5057 11.3962 10.6159 11ZM12.584 10H10.837C10.9431 9.3725 11 8.69854 11 8C11 7.30146 10.9431 6.6275 10.837 6H12.584C12.8516 6.61246 13 7.2889 13 8C13 8.7111 12.8516 9.38754 12.584 10ZM9.96234 3.39978C10.7747 3.74677 11.4766 4.30269 12.0004 5H10.6159C10.5057 4.6038 10.3739 4.23601 10.2229 3.90401C10.144 3.7304 10.0571 3.56117 9.96234 3.39978Z",fill:"currentColor"}))}};C.style=o;exports.globe_icon=C;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as L, h as e, c as p, v as
|
|
2
|
-
import { R as
|
|
3
|
-
import { D as K } from "./constants-f34b9c6e-
|
|
1
|
+
import { r as L, h as e, c as p, v as q, d as f, w as Z, H as z, g as W } from "./index-4c7e8f2f.js";
|
|
2
|
+
import { R as G } from "./register-component-83e24412-51af5293.js";
|
|
3
|
+
import { D as K } from "./constants-f34b9c6e-91f6ad05.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
const Q = ".sc-google-logo-icon-h{display:flex}", X = Q, Y = class {
|
|
@@ -43,13 +43,13 @@ function at({ id: n, formState: t, activeTab: a, calendars: r }) {
|
|
|
43
43
|
)
|
|
44
44
|
);
|
|
45
45
|
case "availability":
|
|
46
|
-
const b = t.availability.openHours,
|
|
46
|
+
const b = t.availability.openHours, u = t.availability.timezone ? t.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone, h = (s = t.participants) == null ? void 0 : s.find((c) => c.is_organizer), y = (h == null ? void 0 : h.email) ?? "primary", g = t.calendarIds.length > 0 ? t.calendarIds : [y], m = t.bookingCalendar == "primary" ? y : t.bookingCalendar;
|
|
47
47
|
return e(
|
|
48
48
|
"div",
|
|
49
49
|
{ key: n },
|
|
50
50
|
e("nylas-booking-calendar-picker", { name: "booking-calendar", calendars: r ?? [], defaultBookingCalendar: m, exportparts: "nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content" }),
|
|
51
51
|
e("nylas-calendar-picker", { name: "calendars", calendars: r ?? [], defaultSelectedCalendars: g, exportparts: "ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content" }),
|
|
52
|
-
e("nylas-availability-picker", { name: "availability", openHours: b, defaultTimezone:
|
|
52
|
+
e("nylas-availability-picker", { name: "availability", openHours: b, defaultTimezone: u, 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
53
|
);
|
|
54
54
|
case "bookingOptions":
|
|
55
55
|
return e(
|
|
@@ -82,16 +82,16 @@ var ot = function(n, t, a, r) {
|
|
|
82
82
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
83
83
|
return Reflect.metadata(n, t);
|
|
84
84
|
};
|
|
85
|
-
const
|
|
85
|
+
const J = class {
|
|
86
86
|
constructor(n) {
|
|
87
87
|
L(this, n), this.schedulerConfigChanged = p(this, "schedulerConfigChanged", 7), this.cancelButtonClick = p(this, "cancelButtonClick", 7), this.formSubmitted = p(this, "formSubmitted", 7), this.previewButtonClicked = p(this, "previewButtonClicked", 7), this.setError = (t) => {
|
|
88
88
|
this.error = t.message;
|
|
89
89
|
}, this.formSubmissionHandler = async (t) => {
|
|
90
|
-
var
|
|
90
|
+
var _, w, S, T, B, F, I, E, P, O, R, j, V, M, N, U;
|
|
91
91
|
if (t.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity())
|
|
92
92
|
return;
|
|
93
93
|
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
94
|
-
const r = this.updateFormState(), { title: s, description: i, duration: l, availability: o, calendarIds: d, bookingCalendar: b, location:
|
|
94
|
+
const r = this.updateFormState(), { title: s, description: i, duration: l, availability: o, calendarIds: d, bookingCalendar: b, location: u, bookingType: h, buffer: y, availableDaysInFuture: g, minCancellationNotice: m } = r, c = (w = (_ = this.selectedConfiguration) == null ? void 0 : _.participants) == null ? void 0 : w.find((A) => A.is_organizer), v = {
|
|
95
95
|
...((S = this.selectedConfiguration) == null ? void 0 : S.id) && { id: this.selectedConfiguration.id },
|
|
96
96
|
version: ((T = this.selectedConfiguration) == null ? void 0 : T.version) ?? "1.0.0",
|
|
97
97
|
availability: {
|
|
@@ -100,14 +100,14 @@ const G = class {
|
|
|
100
100
|
availability_rules: {
|
|
101
101
|
availability_method: ((I = (F = (B = this.selectedConfiguration) == null ? void 0 : B.availability) == null ? void 0 : F.availability_rules) == null ? void 0 : I.availability_method) ?? "collective",
|
|
102
102
|
buffer: y || { before: 0, after: 0 },
|
|
103
|
-
default_open_hours: ((
|
|
104
|
-
round_robin_group_id: ((
|
|
103
|
+
default_open_hours: ((O = (P = (E = this.selectedConfiguration) == null ? void 0 : E.availability) == null ? void 0 : P.availability_rules) == null ? void 0 : O.default_open_hours) ?? K,
|
|
104
|
+
round_robin_group_id: ((V = (j = (R = this.selectedConfiguration) == null ? void 0 : R.availability) == null ? void 0 : j.availability_rules) == null ? void 0 : V.round_robin_group_id) ?? ""
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
participants: [
|
|
108
108
|
{
|
|
109
|
-
name: (c == null ? void 0 : c.name) ?? (c == null ? void 0 : c.email) ?? ((
|
|
110
|
-
email: (c == null ? void 0 : c.email) ?? ((
|
|
109
|
+
name: (c == null ? void 0 : c.name) ?? (c == null ? void 0 : c.email) ?? ((M = this.currentUser) == null ? void 0 : M.name) ?? ((N = this.currentUser) == null ? void 0 : N.email) ?? "",
|
|
110
|
+
email: (c == null ? void 0 : c.email) ?? ((U = this.currentUser) == null ? void 0 : U.email) ?? "",
|
|
111
111
|
is_organizer: !0,
|
|
112
112
|
availability: {
|
|
113
113
|
calendar_ids: d != null && d.length ? d : ["primary"],
|
|
@@ -121,48 +121,46 @@ const G = class {
|
|
|
121
121
|
event_booking: {
|
|
122
122
|
title: (s == null ? void 0 : s.toString()) ?? "",
|
|
123
123
|
description: (i == null ? void 0 : i.toString()) ?? "",
|
|
124
|
-
location: (
|
|
125
|
-
booking_type: (
|
|
124
|
+
location: (u == null ? void 0 : u.toString()) ?? "",
|
|
125
|
+
booking_type: (h == null ? void 0 : h.toString()) ?? "booking",
|
|
126
126
|
timezone: (o == null ? void 0 : o.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
127
127
|
},
|
|
128
128
|
scheduler: {
|
|
129
129
|
available_days_in_future: g ?? 30,
|
|
130
130
|
min_cancellation_notice: m ?? 0
|
|
131
131
|
}
|
|
132
|
-
},
|
|
133
|
-
_.requires_session_auth = this.defaultRequiresSessionAuth;
|
|
134
|
-
const k = this.action === "create" ? _ : v, x = (U) => {
|
|
132
|
+
}, C = q(v, this.selectedConfiguration), k = this.action === "create" ? C : v, x = (A) => {
|
|
135
133
|
this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
|
|
136
134
|
this.changesSaved = !1;
|
|
137
135
|
}, 5e3);
|
|
138
136
|
};
|
|
139
137
|
this.schedulerConfigChanged.emit({ config: k, resetLoadingState: x, setError: this.setError, action: this.action });
|
|
140
|
-
}, this.calendars = void 0, this.selectedConfiguration = void 0, this.
|
|
138
|
+
}, 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 = "";
|
|
141
139
|
}
|
|
142
140
|
configChangedHandler(n) {
|
|
143
|
-
|
|
141
|
+
f("[nylas-editor-tabs]", "configChangedHandler", n, this.selectedConfiguration), this.formState = {
|
|
144
142
|
...this.getFormStateFromConfig(n)
|
|
145
143
|
}, n.id ? this.action = "edit" : this.action = "create";
|
|
146
144
|
}
|
|
147
145
|
connectedCallback() {
|
|
148
|
-
|
|
146
|
+
f("[nylas-editor-tabs]", "connectedCallback");
|
|
149
147
|
}
|
|
150
148
|
componentWillLoad() {
|
|
151
|
-
|
|
149
|
+
f("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
152
150
|
}
|
|
153
151
|
componentDidLoad() {
|
|
154
|
-
|
|
152
|
+
f("[nylas-editor-tabs]", "componentDidLoad");
|
|
155
153
|
}
|
|
156
154
|
disconnectedCallback() {
|
|
157
|
-
|
|
155
|
+
f("[nylas-editor-tabs]", "disconnectedCallback");
|
|
158
156
|
}
|
|
159
157
|
handleValueChanged(n) {
|
|
160
|
-
|
|
158
|
+
f("[nylas-editor-tabs]", "handleValueChanged", n);
|
|
161
159
|
const { name: t, value: a } = n.detail;
|
|
162
160
|
this.formState = { ...this.formState, [t]: a }, this.hasUnsavedChanges = !0, this.error = "";
|
|
163
161
|
}
|
|
164
162
|
getFormStateFromConfig(n) {
|
|
165
|
-
var a, r, s, i, l, o, d, b,
|
|
163
|
+
var a, r, s, i, l, o, d, b, u, h, y, g, m, c, v, C, k, x, _, w;
|
|
166
164
|
const t = (a = n == null ? void 0 : n.participants) == null ? void 0 : a.find((S) => S.is_organizer);
|
|
167
165
|
return {
|
|
168
166
|
title: ((r = n == null ? void 0 : n.event_booking) == null ? void 0 : r.title) ?? "",
|
|
@@ -174,12 +172,12 @@ const G = class {
|
|
|
174
172
|
},
|
|
175
173
|
calendarIds: ((b = t == null ? void 0 : t.availability) == null ? void 0 : b.calendar_ids) ?? [],
|
|
176
174
|
participants: (n == null ? void 0 : n.participants) ?? [],
|
|
177
|
-
bookingCalendar: ((
|
|
178
|
-
location: ((y = (
|
|
175
|
+
bookingCalendar: ((u = t == null ? void 0 : t.booking) == null ? void 0 : u.calendar_id) ?? (t == null ? void 0 : t.email) ?? "",
|
|
176
|
+
location: ((y = (h = this.selectedConfiguration) == null ? void 0 : h.event_booking) == null ? void 0 : y.location) ?? "",
|
|
179
177
|
bookingType: ((m = (g = this.selectedConfiguration) == null ? void 0 : g.event_booking) == null ? void 0 : m.booking_type) ?? "booking",
|
|
180
|
-
buffer: ((
|
|
178
|
+
buffer: ((C = (v = (c = this.selectedConfiguration) == null ? void 0 : c.availability) == null ? void 0 : v.availability_rules) == null ? void 0 : C.buffer) ?? { before: 0, after: 0 },
|
|
181
179
|
availableDaysInFuture: ((x = (k = this.selectedConfiguration) == null ? void 0 : k.scheduler) == null ? void 0 : x.available_days_in_future) ?? 30,
|
|
182
|
-
minCancellationNotice: ((
|
|
180
|
+
minCancellationNotice: ((w = (_ = this.selectedConfiguration) == null ? void 0 : _.scheduler) == null ? void 0 : w.min_cancellation_notice) ?? 0
|
|
183
181
|
};
|
|
184
182
|
}
|
|
185
183
|
updateFormState() {
|
|
@@ -229,19 +227,19 @@ const G = class {
|
|
|
229
227
|
}
|
|
230
228
|
render() {
|
|
231
229
|
var n;
|
|
232
|
-
return
|
|
230
|
+
return f("[nylas-editor-tabs]", "render", this.formState), e(z, { key: "d3f12d23dc74dfb3c75db92a9d7c2551ec0ff51a" }, e("form", { key: "daba26d28b0b0247ec002f6159ad5a36fdfe3883", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (t) => this.formRef = t, noValidate: !0 }, this.mode === "app" ? e("div", { class: "form-contents" }, e("div", { class: "tabs" }, e("button", { class: { tab: !0, active: this.activeTab == "eventInfo" }, onClick: (t) => this.setActiveTab(t, "eventInfo") }, e("calendar-info-icon", { width: "16", height: "16" }), "Event Info"), e("button", { class: { tab: !0, active: this.activeTab == "availability" }, onClick: (t) => this.setActiveTab(t, "availability") }, e("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), e("button", { class: { tab: !0, active: this.activeTab == "bookingOptions" }, onClick: (t) => this.setActiveTab(t, "bookingOptions") }, e("flow-icon", { width: "16", height: "16" }), "Booking Options")), e("div", { class: "tab-content" }, e(at, { formState: this.formState, activeTab: this.activeTab, calendars: this.calendars, id: ((n = this.selectedConfiguration) == null ? void 0 : n.id) ?? "new" }))) : e("slot", null), e("div", { key: "faceb1578416778ae58a1f7e8727f7e3cee49d94", class: "footer" }, e("div", { key: "3c993f40369809e92b2d69900564b75e3ef6a3b5", class: "preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && e("button-component", { type: "button", disabled: this.isLoading, clickHandler: (t) => {
|
|
233
231
|
t.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(Z(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
234
|
-
}, variant: "basic" }, "Preview")), e("div", { key: "
|
|
232
|
+
}, variant: "basic" }, "Preview")), e("div", { key: "a99fd708ba9cf7792eada057b4d3509a1287b421", class: "buttons" }, e("p", { key: "fe5bcfaab79cd1800ff68b0c5e18ba24eb3a059f", class: {
|
|
235
233
|
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
236
234
|
"saved-changes": this.changesSaved,
|
|
237
235
|
error: this.error !== "",
|
|
238
236
|
"error-full-width": this.error !== "" && this.action === "create"
|
|
239
|
-
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), e("button-component", { key: "
|
|
237
|
+
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), e("button-component", { key: "2b345968fe00d125457e43ba2d247029d1658c65", type: "button", disabled: this.isLoading, clickHandler: (t) => {
|
|
240
238
|
t.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
241
|
-
}, variant: "basic" }, "Cancel"), e("button-component", { key: "
|
|
239
|
+
}, variant: "basic" }, "Cancel"), e("button-component", { key: "1dc30715388135308db5a3f1ca65a7bcb18fc441", type: "submit", disabled: this.isLoading }, this.isLoading ? e("span", null, "Saving", e("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
|
|
242
240
|
}
|
|
243
241
|
get host() {
|
|
244
|
-
return
|
|
242
|
+
return W(this);
|
|
245
243
|
}
|
|
246
244
|
static get watchers() {
|
|
247
245
|
return {
|
|
@@ -250,7 +248,7 @@ const G = class {
|
|
|
250
248
|
}
|
|
251
249
|
};
|
|
252
250
|
ot([
|
|
253
|
-
|
|
251
|
+
G({
|
|
254
252
|
name: "nylas-editor-tabs",
|
|
255
253
|
stateToProps: /* @__PURE__ */ new Map([
|
|
256
254
|
["schedulerConfig.calendars", "calendars"],
|
|
@@ -275,17 +273,14 @@ ot([
|
|
|
275
273
|
t.schedulerConfigStore.state.action = null;
|
|
276
274
|
}
|
|
277
275
|
},
|
|
278
|
-
localPropsToProp: /* @__PURE__ */ new Map([
|
|
279
|
-
["schedulerPreviewLink", "schedulerPreviewLink"],
|
|
280
|
-
["defaultRequiresSessionAuth", "defaultRequiresSessionAuth"]
|
|
281
|
-
]),
|
|
276
|
+
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
282
277
|
fireRegisterEvent: !0
|
|
283
278
|
}),
|
|
284
279
|
D("design:type", Function),
|
|
285
280
|
D("design:paramtypes", []),
|
|
286
281
|
D("design:returntype", void 0)
|
|
287
|
-
],
|
|
288
|
-
|
|
282
|
+
], J.prototype, "render", null);
|
|
283
|
+
J.style = st;
|
|
289
284
|
const rt = ':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}.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}', lt = rt;
|
|
290
285
|
var ct = function(n, t, a, r) {
|
|
291
286
|
var s = arguments.length, i = s < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, l;
|
|
@@ -299,21 +294,21 @@ var ct = function(n, t, a, r) {
|
|
|
299
294
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
300
295
|
return Reflect.metadata(n, t);
|
|
301
296
|
};
|
|
302
|
-
const
|
|
297
|
+
const $ = class {
|
|
303
298
|
constructor(n) {
|
|
304
299
|
L(this, n), this.initListConfigurations = p(this, "initListConfigurations", 7), this.createButtonClick = p(this, "createButtonClick", 7), this.editButtonClick = p(this, "editButtonClick", 7), this.deleteButtonClick = p(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.state = "loading", this.error = "";
|
|
305
300
|
}
|
|
306
301
|
connectedCallback() {
|
|
307
|
-
|
|
302
|
+
f("[nylas-list-configurations]", "connectedCallback");
|
|
308
303
|
}
|
|
309
304
|
componentWillLoad() {
|
|
310
|
-
|
|
305
|
+
f("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
|
|
311
306
|
}
|
|
312
307
|
componentDidLoad() {
|
|
313
|
-
|
|
308
|
+
f("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit(this.host);
|
|
314
309
|
}
|
|
315
310
|
disconnectedCallback() {
|
|
316
|
-
|
|
311
|
+
f("[nylas-list-configurations]", "disconnectedCallback");
|
|
317
312
|
}
|
|
318
313
|
async getState() {
|
|
319
314
|
return this.state;
|
|
@@ -342,11 +337,11 @@ const J = class {
|
|
|
342
337
|
} }, "Delete"))))))), this.state === "error" && e("div", { class: "error-container" }, e("p", { class: "error" }, this.error)));
|
|
343
338
|
}
|
|
344
339
|
get host() {
|
|
345
|
-
return
|
|
340
|
+
return W(this);
|
|
346
341
|
}
|
|
347
342
|
};
|
|
348
343
|
ct([
|
|
349
|
-
|
|
344
|
+
G({
|
|
350
345
|
name: "nylas-list-configurations",
|
|
351
346
|
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.configurations", "configurations"]]),
|
|
352
347
|
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
@@ -378,11 +373,11 @@ ct([
|
|
|
378
373
|
H("design:type", Function),
|
|
379
374
|
H("design:paramtypes", []),
|
|
380
375
|
H("design:returntype", void 0)
|
|
381
|
-
],
|
|
382
|
-
|
|
376
|
+
], $.prototype, "render", null);
|
|
377
|
+
$.style = lt;
|
|
383
378
|
export {
|
|
384
379
|
Y as google_logo_icon,
|
|
385
380
|
nt as microsoft_logo_icon,
|
|
386
|
-
|
|
387
|
-
|
|
381
|
+
J as nylas_editor_tabs,
|
|
382
|
+
$ as nylas_list_configurations
|
|
388
383
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-3a004ec1.cjs"),A=require("./register-component-83e24412-d76a2962.cjs"),q=require("./constants-f34b9c6e-593e21cc.cjs");require("react");require("react-dom");const W=".sc-google-logo-icon-h{display:flex}",G=W,Z=class{constructor(n){e.registerInstance(this,n),this.width="24",this.height="24"}render(){return e.h("svg",{key:"2445589627197f9af06e10891e1772c17b140c0a",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("g",{key:"b84ea9a0cc741b646d9a63113404d34c5e155fc8","clip-path":"url(#clip0_959_12452)"},e.h("path",{key:"9c774266fb43cf807ea64846b71eb27c6272b17d",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.h("path",{key:"ff0fe8133c31fc75ecf3e9fedecbbaef2e35dd54",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.h("path",{key:"5851b3de9ee71263668f65e2e86f0dfab3039c83",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.h("path",{key:"2a79a335e1b8d03747b5f879a75deb5544e5cf63",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.h("defs",{key:"f3b4d8d363cc9ac066b92de2354b9210d7190b46"},e.h("clipPath",{key:"270b05e06d87d998c7525254f4f2ae3d5a0ab835",id:"clip0_959_12452"},e.h("rect",{key:"de0df984a8f12ccdd0c655968c4f8b2049996968",width:24,height:24,fill:"white"}))))}};Z.style=G;const J=".sc-microsoft-logo-icon-h{display:flex}",$=J,z=class{constructor(n){e.registerInstance(this,n),this.width="22",this.height="22"}render(){return e.h("svg",{key:"de39bfb3167fbd60d21025e74c1bc19cdd7d4dc9",width:this.width,height:this.height,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"0f80864e892ff36e6e76ef03f5f36d62007d99ee",d:"M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z",fill:"#F35325"}),e.h("path",{key:"ab0e85f803a3cf2e32055ebeff1b0705edebe048",d:"M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z",fill:"#81BC06"}),e.h("path",{key:"b6359dcb76ade260f2a9e9bdf1be21ba84b77b79",d:"M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z",fill:"#05A6F0"}),e.h("path",{key:"cf38a555c09aaef94a15fd26b0951e2642eaad6d",d:"M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z",fill:"#FFBA08"}))}};z.style=$;function K({id:n,formState:t,activeTab:a,calendars:r}){var s;switch(a){case"eventInfo":const i=t.title,l=t.description,o=parseInt(t.duration),d=t.location;return e.h("div",{key:n},e.h("nylas-event-info",null,e.h("div",{slot:"inputs"},e.h("nylas-event-title",{name:"title",eventTitle:i,exportparts:"net, net__title, net__dropdown-content"}),e.h("nylas-event-duration",{name:"duration",eventDurationMinutes:o,exportparts:"ned, ned__input, ned__dropdown, ned__dropdown-button, ned__dropdown-content"}),e.h("nylas-location-component",{name:"location",eventLocation:d,exportparts:"nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content"}),e.h("nylas-event-description",{name:"description",eventDescription:l,exportparts:"nedesc, nedesc__textarea"}))));case"availability":const h=t.availability.openHours,f=t.availability.timezone?t.availability.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,b=(s=t.participants)==null?void 0:s.find(c=>c.is_organizer),u=(b==null?void 0:b.email)??"primary",p=t.calendarIds.length>0?t.calendarIds:[u],y=t.bookingCalendar=="primary"?u:t.bookingCalendar;return e.h("div",{key:n},e.h("nylas-booking-calendar-picker",{name:"booking-calendar",calendars:r??[],defaultBookingCalendar:y,exportparts:"nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content"}),e.h("nylas-calendar-picker",{name:"calendars",calendars:r??[],defaultSelectedCalendars:p,exportparts:"ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content"}),e.h("nylas-availability-picker",{name:"availability",openHours:h,defaultTimezone:f,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"}));case"bookingOptions":return e.h("div",{key:n},e.h("nylas-buffer-time",{name:"buffer-time",buffer:t.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"}),e.h("nylas-event-limits",null,e.h("div",{slot:"inputs"},e.h("nylas-limit-future-bookings",{name:"limit-future-bookings",availableDaysInFuture:t.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"}),e.h("nylas-min-cancellation-notice",{name:"min-cancellation-notice",minCancellationNotice:t.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"}))))}}const Q='.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}',X=Q;var Y=function(n,t,a,r){var s=arguments.length,i=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,a):r,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,a,r);else for(var o=n.length-1;o>=0;o--)(l=n[o])&&(i=(s<3?l(i):s>3?l(t,a,i):l(t,a))||i);return s>3&&i&&Object.defineProperty(t,a,i),i},x=function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};const L=class{constructor(n){e.registerInstance(this,n),this.schedulerConfigChanged=e.createEvent(this,"schedulerConfigChanged",7),this.cancelButtonClick=e.createEvent(this,"cancelButtonClick",7),this.formSubmitted=e.createEvent(this,"formSubmitted",7),this.previewButtonClicked=e.createEvent(this,"previewButtonClicked",7),this.setError=t=>{this.error=t.message},this.formSubmissionHandler=async t=>{var m,v,k,E,H,I,T,F,B,P,O,R,j,M,V,N;if(t.preventDefault(),this.formSubmitted.emit(),!this.formRef.checkValidity())return;this.isLoading=!0,this.hasUnsavedChanges=!1;const r=this.updateFormState(),{title:s,description:i,duration:l,availability:o,calendarIds:d,bookingCalendar:h,location:f,bookingType:b,buffer:u,availableDaysInFuture:p,minCancellationNotice:y}=r,c=(v=(m=this.selectedConfiguration)==null?void 0:m.participants)==null?void 0:v.find(U=>U.is_organizer),g={...((k=this.selectedConfiguration)==null?void 0:k.id)&&{id:this.selectedConfiguration.id},version:((E=this.selectedConfiguration)==null?void 0:E.version)??"1.0.0",availability:{duration_minutes:l?parseInt(l):0,interval_minutes:l?parseInt(l):0,availability_rules:{availability_method:((T=(I=(H=this.selectedConfiguration)==null?void 0:H.availability)==null?void 0:I.availability_rules)==null?void 0:T.availability_method)??"collective",buffer:u||{before:0,after:0},default_open_hours:((P=(B=(F=this.selectedConfiguration)==null?void 0:F.availability)==null?void 0:B.availability_rules)==null?void 0:P.default_open_hours)??q.DEFAULT_OPEN_HOURS,round_robin_group_id:((j=(R=(O=this.selectedConfiguration)==null?void 0:O.availability)==null?void 0:R.availability_rules)==null?void 0:j.round_robin_group_id)??""}},participants:[{name:(c==null?void 0:c.name)??(c==null?void 0:c.email)??((M=this.currentUser)==null?void 0:M.name)??((V=this.currentUser)==null?void 0:V.email)??"",email:(c==null?void 0:c.email)??((N=this.currentUser)==null?void 0:N.email)??"",is_organizer:!0,availability:{calendar_ids:d!=null&&d.length?d:["primary"],open_hours:(o==null?void 0:o.openHours)??[]},booking:{calendar_id:h&&h!==""?h:"primary"}}],event_booking:{title:(s==null?void 0:s.toString())??"",description:(i==null?void 0:i.toString())??"",location:(f==null?void 0:f.toString())??"",booking_type:(b==null?void 0:b.toString())??"booking",timezone:(o==null?void 0:o.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone},scheduler:{available_days_in_future:p??30,min_cancellation_notice:y??0}},_=e.mergeDeep(g,this.selectedConfiguration),w=this.action==="create"?_:g,C=U=>{this.isLoading=!1,this.changesSaved=!0,setTimeout(()=>{this.changesSaved=!1},5e3)};this.schedulerConfigChanged.emit({config:w,resetLoadingState:C,setError:this.setError,action:this.action})},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=""}configChangedHandler(n){e.debug("[nylas-editor-tabs]","configChangedHandler",n,this.selectedConfiguration),this.formState={...this.getFormStateFromConfig(n)},n.id?this.action="edit":this.action="create"}connectedCallback(){e.debug("[nylas-editor-tabs]","connectedCallback")}componentWillLoad(){e.debug("[nylas-editor-tabs]","componentWillLoad"),this.formState=this.getFormStateFromConfig(this.selectedConfiguration)}componentDidLoad(){e.debug("[nylas-editor-tabs]","componentDidLoad")}disconnectedCallback(){e.debug("[nylas-editor-tabs]","disconnectedCallback")}handleValueChanged(n){e.debug("[nylas-editor-tabs]","handleValueChanged",n);const{name:t,value:a}=n.detail;this.formState={...this.formState,[t]:a},this.hasUnsavedChanges=!0,this.error=""}getFormStateFromConfig(n){var a,r,s,i,l,o,d,h,f,b,u,p,y,c,g,_,w,C,m,v;const t=(a=n==null?void 0:n.participants)==null?void 0:a.find(k=>k.is_organizer);return{title:((r=n==null?void 0:n.event_booking)==null?void 0:r.title)??"",description:((s=n==null?void 0:n.event_booking)==null?void 0:s.description)??"",duration:((l=(i=n==null?void 0:n.availability)==null?void 0:i.duration_minutes)==null?void 0:l.toString())??"10",availability:{timezone:((o=n==null?void 0:n.event_booking)==null?void 0:o.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone,open_hours:((d=t==null?void 0:t.availability)==null?void 0:d.open_hours)??void 0},calendarIds:((h=t==null?void 0:t.availability)==null?void 0:h.calendar_ids)??[],participants:(n==null?void 0:n.participants)??[],bookingCalendar:((f=t==null?void 0:t.booking)==null?void 0:f.calendar_id)??(t==null?void 0:t.email)??"",location:((u=(b=this.selectedConfiguration)==null?void 0:b.event_booking)==null?void 0:u.location)??"",bookingType:((y=(p=this.selectedConfiguration)==null?void 0:p.event_booking)==null?void 0:y.booking_type)??"booking",buffer:((_=(g=(c=this.selectedConfiguration)==null?void 0:c.availability)==null?void 0:g.availability_rules)==null?void 0:_.buffer)??{before:0,after:0},availableDaysInFuture:((C=(w=this.selectedConfiguration)==null?void 0:w.scheduler)==null?void 0:C.available_days_in_future)??30,minCancellationNotice:((v=(m=this.selectedConfiguration)==null?void 0:m.scheduler)==null?void 0:v.min_cancellation_notice)??0}}updateFormState(){return new FormData(this.formRef).forEach((t,a)=>{switch(a){case"title":this.formState.title=t.toString();break;case"description":this.formState.description=t.toString();break;case"duration":this.formState.duration=t.toString();break;case"availability":this.formState.availability=JSON.parse(t.toString());break;case"participants":this.formState.participants=JSON.parse(t.toString());break;case"calendars":this.formState.calendarIds=t.toString().split(",");break;case"booking-calendar":this.formState.bookingCalendar=t.toString();break;case"location":this.formState.location=t.toString();break;case"booking-type":this.formState.bookingType=t.toString();break;case"buffer-time":this.formState.buffer=JSON.parse(t.toString());break;case"limit-future-bookings":this.formState.availableDaysInFuture=parseInt(t.toString());break;case"min-cancellation-notice":this.formState.minCancellationNotice=parseInt(t.toString());break}}),this.formState={...this.formState},this.formState}setActiveTab(n,t){n.preventDefault(),this.updateFormState(),this.activeTab=t}render(){var n;return e.debug("[nylas-editor-tabs]","render",this.formState),e.h(e.Host,{key:"d3f12d23dc74dfb3c75db92a9d7c2551ec0ff51a"},e.h("form",{key:"daba26d28b0b0247ec002f6159ad5a36fdfe3883",onSubmit:this.formSubmissionHandler,class:"scheduler-editor",ref:t=>this.formRef=t,noValidate:!0},this.mode==="app"?e.h("div",{class:"form-contents"},e.h("div",{class:"tabs"},e.h("button",{class:{tab:!0,active:this.activeTab=="eventInfo"},onClick:t=>this.setActiveTab(t,"eventInfo")},e.h("calendar-info-icon",{width:"16",height:"16"}),"Event Info"),e.h("button",{class:{tab:!0,active:this.activeTab=="availability"},onClick:t=>this.setActiveTab(t,"availability")},e.h("calendar-patterns-icon",{width:"16",height:"16"}),"Availability"),e.h("button",{class:{tab:!0,active:this.activeTab=="bookingOptions"},onClick:t=>this.setActiveTab(t,"bookingOptions")},e.h("flow-icon",{width:"16",height:"16"}),"Booking Options")),e.h("div",{class:"tab-content"},e.h(K,{formState:this.formState,activeTab:this.activeTab,calendars:this.calendars,id:((n=this.selectedConfiguration)==null?void 0:n.id)??"new"}))):e.h("slot",null),e.h("div",{key:"faceb1578416778ae58a1f7e8727f7e3cee49d94",class:"footer"},e.h("div",{key:"3c993f40369809e92b2d69900564b75e3ef6a3b5",class:"preview"},this.schedulerPreviewLink!==""&&this.action==="edit"&&e.h("button-component",{type:"button",disabled:this.isLoading,clickHandler:t=>{t.preventDefault(),this.previewButtonClicked.emit(this.host).defaultPrevented||window.open(e.parsePreviewLink(this.schedulerPreviewLink,this.selectedConfiguration),"_blank")},variant:"basic"},"Preview")),e.h("div",{key:"a99fd708ba9cf7792eada057b4d3509a1287b421",class:"buttons"},e.h("p",{key:"fe5bcfaab79cd1800ff68b0c5e18ba24eb3a059f",class:{"unsaved-changes":this.hasUnsavedChanges&&!this.changesSaved,"saved-changes":this.changesSaved,error:this.error!=="","error-full-width":this.error!==""&&this.action==="create"}},this.error!==""?this.error:"",this.error==""&&this.hasUnsavedChanges&&!this.changesSaved?"Unsaved changes":this.error==""&&this.changesSaved?"Changes saved!":""),e.h("button-component",{key:"2b345968fe00d125457e43ba2d247029d1658c65",type:"button",disabled:this.isLoading,clickHandler:t=>{t.preventDefault(),this.cancelButtonClick.emit(),this.error=""},variant:"basic"},"Cancel"),e.h("button-component",{key:"1dc30715388135308db5a3f1ca65a7bcb18fc441",type:"submit",disabled:this.isLoading},this.isLoading?e.h("span",null,"Saving",e.h("loading-icon",null)," "):this.action=="create"?"Create":"Save changes")))))}get host(){return e.getElement(this)}static get watchers(){return{selectedConfiguration:["configChangedHandler"]}}};Y([A.RegisterComponent({name:"nylas-editor-tabs",stateToProps:new Map([["schedulerConfig.calendars","calendars"],["schedulerConfig.selectedConfiguration","selectedConfiguration"],["schedulerConfig.currentUser","currentUser"]]),eventToProps:{schedulerConfigChanged:async(n,t)=>{const{resetLoadingState:a,setError:r,action:s,config:i}=n.detail,l=o=>{const[d,h]=o;!d&&h&&r&&r(h),a&&a(n)};if(s==="edit"){const o=await t.schedulerConfig.updateConfiguration(i);l(o)}else{const o=await t.schedulerConfig.createConfiguration(i);l(o)}},cancelButtonClick:async(n,t)=>{t.schedulerConfigStore.state.action=null}},localPropsToProp:new Map([["schedulerPreviewLink","schedulerPreviewLink"]]),fireRegisterEvent:!0}),x("design:type",Function),x("design:paramtypes",[]),x("design:returntype",void 0)],L.prototype,"render",null);L.style=X;const ee=':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}.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}',te=ee;var ne=function(n,t,a,r){var s=arguments.length,i=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,a):r,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,a,r);else for(var o=n.length-1;o>=0;o--)(l=n[o])&&(i=(s<3?l(i):s>3?l(t,a,i):l(t,a))||i);return s>3&&i&&Object.defineProperty(t,a,i),i},S=function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};const D=class{constructor(n){e.registerInstance(this,n),this.initListConfigurations=e.createEvent(this,"initListConfigurations",7),this.createButtonClick=e.createEvent(this,"createButtonClick",7),this.editButtonClick=e.createEvent(this,"editButtonClick",7),this.deleteButtonClick=e.createEvent(this,"deleteButtonClick",7),this.configurations=[],this.schedulerPreviewLink="",this.state="loading",this.error=""}connectedCallback(){e.debug("[nylas-list-configurations]","connectedCallback")}componentWillLoad(){e.debug("[nylas-list-configurations]","componentWillLoad"),this.configurations&&this.configurations.length>0&&(this.state="loaded")}componentDidLoad(){e.debug("[nylas-list-configurations]","componentDidLoad"),this.initListConfigurations.emit(this.host)}disconnectedCallback(){e.debug("[nylas-list-configurations]","disconnectedCallback")}async getState(){return this.state}async setState(n){this.state=n}async setError(n){this.error=n}render(){return e.h(e.Host,null,e.h("div",{class:"header"},e.h("div",{class:"description"},e.h("h2",null,"All scheduling pages"),e.h("p",null,"Create, edit and manage all your scheduling pages.")),this.configurations&&this.configurations.length>0&&e.h("div",{class:"actions"},e.h("button-component",{clickHandler:()=>{this.createButtonClick.emit(this.host)}},"Create new"))),e.h("div",{class:"configurations"},e.h("table",{class:{"no-configurations":this.state!=="loading"&&(!this.configurations||this.configurations.length===0)}},e.h("tr",{class:{hide:this.state==="loading"||this.configurations&&this.configurations.length===0}},e.h("th",null,"Scheduling page event title"),e.h("th",null,"Duration"),e.h("th",{class:"actions-header"},"Actions")),this.state==="loading"&&e.h("tr",{class:"no-configurations"},e.h("td",{colSpan:3},e.h("div",null,e.h("h3",null,"Loading..."),e.h("p",null,"Please wait while we fetch the scheduling pages")))),this.state!=="loading"&&(!this.configurations||this.configurations.length===0)&&e.h("tr",{class:"no-configurations"},e.h("td",{colSpan:3},e.h("div",null,e.h("calendar-icon",{width:"48",height:"48"}),e.h("h3",null,"No scheduling pages found"),e.h("p",null,"Get started with creating your first scheduling page"),e.h("button-component",{clickHandler:()=>{this.createButtonClick.emit(this.host)}},"Create new")))),this.state!=="loading"&&this.configurations.map(n=>e.h("tr",{key:n.id},e.h("td",null,e.h("div",{class:"title"},e.h("span",{class:"config-event-title"},n.event_booking.title),e.h("span",{class:"config-event-description"},n.event_booking.description))),e.h("td",null,e.h("div",null,n.availability.duration_minutes," mins")),e.h("td",null,e.h("div",{class:"actions"},e.h("button-component",{variant:"basic",clickHandler:t=>{t.preventDefault(),window.open(e.parsePreviewLink(this.schedulerPreviewLink,n),"_blank")}},"Preview"),e.h("button-component",{variant:"basic",clickHandler:t=>{t.preventDefault(),this.editButtonClick.emit({host:this.host,configuration:n})}},"Edit"),e.h("button-component",{variant:"basic",clickHandler:t=>{t.preventDefault(),this.deleteButtonClick.emit({host:this.host,configuration:n})}},"Delete"))))))),this.state==="error"&&e.h("div",{class:"error-container"},e.h("p",{class:"error"},this.error)))}get host(){return e.getElement(this)}};ne([A.RegisterComponent({name:"nylas-list-configurations",stateToProps:new Map([["schedulerConfig.configurations","configurations"]]),localPropsToProp:new Map([["schedulerPreviewLink","schedulerPreviewLink"]]),eventToProps:{initListConfigurations:async(n,t)=>{const a=n.detail;await a.setState("loading");const[r,s]=await t.schedulerConfig.getConfigurations();if(!r&&s&&s.message){await a.setState("error"),await a.setError(s.message);return}await a.setState("loaded")},createButtonClick:async(n,t)=>{t.schedulerConfigStore.resetSelectedConfiguration(),t.schedulerConfigStore.state.action="create"},deleteButtonClick:async(n,t)=>{const{host:a,configuration:r}=n.detail,[s,i]=await t.schedulerConfig.deleteConfiguration(r.id);!s&&i&&i.message&&(await a.setState("error"),await a.setError(i.message))},editButtonClick:async(n,t)=>{const{configuration:a}=n.detail;t.schedulerConfigStore.state.selectedConfiguration=a,t.schedulerConfigStore.state.action="edit"}},fireRegisterEvent:!0}),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",void 0)],D.prototype,"render",null);D.style=te;exports.google_logo_icon=Z;exports.microsoft_logo_icon=z;exports.nylas_editor_tabs=L;exports.nylas_list_configurations=D;
|