@nylas/react 1.3.6 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_2.entry-04909861.cjs +1 -0
- package/dist/add-circle-icon_2.entry-0d9ba871.js +26 -0
- package/dist/archive-icon.entry-3d6d9d3f.js +16 -0
- package/dist/archive-icon.entry-88459432.cjs +1 -0
- package/dist/{arrow-icon.entry-9cfd86a1.js → arrow-icon.entry-789ee889.js} +3 -2
- package/dist/arrow-icon.entry-c35e1933.cjs +1 -0
- package/dist/bold-icon.entry-827e95bf.cjs +1 -0
- package/dist/{bold-icon.entry-eab3420d.js → bold-icon.entry-fbb382d2.js} +7 -6
- package/dist/{button-component_2.entry-7cd5f9c0.js → button-component_2.entry-6c012ee4.js} +10 -9
- package/dist/button-component_2.entry-acd13f45.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_36.entry-1bb3b1a8.js +4689 -0
- package/dist/calendar-agenda-fill-icon_36.entry-fa8121df.cjs +6 -0
- package/dist/calendar-cancel-icon.entry-2e97f7d8.cjs +1 -0
- package/dist/{calendar-cancel-icon.entry-299d6fba.js → calendar-cancel-icon.entry-a4d040db.js} +6 -5
- package/dist/{calendar-check-icon_2.entry-08ef8d2f.js → calendar-check-icon_2.entry-a48a358d.js} +12 -11
- package/dist/calendar-check-icon_2.entry-bca4821d.cjs +1 -0
- package/dist/{calendar-icon.entry-53b54115.js → calendar-icon.entry-57727659.js} +6 -5
- package/dist/calendar-icon.entry-a289313a.cjs +1 -0
- package/dist/checkbox-component.entry-af3e7005.cjs +1 -0
- package/dist/checkbox-component.entry-f4f98226.js +43 -0
- package/dist/checkmark-icon_15.entry-dace1b62.cjs +5 -0
- package/dist/checkmark-icon_15.entry-f43549b3.js +1337 -0
- package/dist/chevron-icon_3.entry-219b42e6.cjs +1 -0
- package/dist/chevron-icon_3.entry-25533d13.js +148 -0
- package/dist/clock-icon_4.entry-3917c667.cjs +1 -0
- package/dist/{clock-icon_4.entry-0e809dcb.js → clock-icon_4.entry-76f29f7e.js} +9 -8
- package/dist/{constants-6da0ede7-49c32ba7.js → constants-3d8016e3-3c080f00.js} +110 -41
- package/dist/constants-3d8016e3-fd6c3848.cjs +1 -0
- package/dist/customParseFormat-6c652dbb-8a42d5b0.js +135 -0
- package/dist/customParseFormat-6c652dbb-ba81ab97.cjs +1 -0
- package/dist/{delete-icon.entry-802084f6.js → delete-icon.entry-3b61864e.js} +8 -7
- package/dist/delete-icon.entry-96420b21.cjs +1 -0
- package/dist/{document-refresh-icon.entry-d1604f53.js → document-refresh-icon.entry-7333b7c9.js} +6 -5
- package/dist/document-refresh-icon.entry-8b5c6b9b.cjs +1 -0
- package/dist/elements/index.d.ts +10 -0
- package/dist/{feedbackSync-c040f483-2b6476c4.js → feedbackSync-352aaf4a-b2b83cfa.js} +1 -1
- package/dist/{feedbackSync-c040f483-d6dd0560.cjs → feedbackSync-352aaf4a-ba1bf452.cjs} +1 -1
- package/dist/{folder-icon.entry-6c0c09ed.js → folder-icon.entry-bb5e2452.js} +5 -4
- package/dist/folder-icon.entry-d2e46d3a.cjs +1 -0
- package/dist/forward-icon.entry-1fcf5a6b.cjs +1 -0
- package/dist/forward-icon.entry-af8d2147.js +16 -0
- package/dist/globe-icon_2.entry-b4b55760.cjs +1 -0
- package/dist/globe-icon_2.entry-cc6d9d67.js +200 -0
- package/dist/google-logo-icon_6.entry-aa7b5b42.js +1484 -0
- package/dist/google-logo-icon_6.entry-eefdec63.cjs +2 -0
- package/dist/google-meet-icon_5.entry-9758e527.js +56 -0
- package/dist/google-meet-icon_5.entry-c545537a.cjs +1 -0
- package/dist/inbox-icon.entry-b9640d5a.cjs +1 -0
- package/dist/inbox-icon.entry-c005ebc5.js +16 -0
- package/dist/index-05630f15.cjs +57 -0
- package/dist/index-78390f2e.js +17607 -0
- package/dist/index.d.ts +1 -3
- package/dist/{index.es-2b014ec7-72557487.js → index.es-4a203e8e-cf485db5.js} +818 -804
- package/dist/{index.es-2b014ec7-0589e68a.cjs → index.es-4a203e8e-f668b8c2.cjs} +6 -6
- package/dist/info-icon_2.entry-b17298b6.js +35 -0
- package/dist/info-icon_2.entry-ecbc6605.cjs +1 -0
- package/dist/input-component.entry-24366ab8.cjs +1 -0
- package/dist/input-component.entry-9da5da6c.js +84 -0
- package/dist/input-dropdown_2.entry-0109b06c.cjs +1 -0
- package/dist/input-dropdown_2.entry-d65f7152.js +231 -0
- package/dist/italic-icon.entry-afa4332a.cjs +1 -0
- package/dist/{italic-icon.entry-d610e66f.js → italic-icon.entry-d0a536f2.js} +3 -2
- package/dist/multi-select-dropdown_2.entry-2c7a1a06.cjs +1 -0
- package/dist/multi-select-dropdown_2.entry-c56b5fd2.js +187 -0
- package/dist/notebook-store-b61693cd-0877e7a2.js +14 -0
- package/dist/notebook-store-b61693cd-a7b8ae37.cjs +5 -0
- package/dist/nylas-booked-event-card_12.entry-827c7fb4.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-960fdfe2.js +1422 -0
- package/dist/nylas-call-summary.entry-1cce1446.js +16 -0
- package/dist/nylas-call-summary.entry-f10f3c54.cjs +1 -0
- package/dist/nylas-event-calendar_3.entry-8bb08ed3.js +9705 -0
- package/dist/nylas-event-calendar_3.entry-b656237b.cjs +6 -0
- package/dist/nylas-form-card.entry-62578338.cjs +1 -0
- package/dist/nylas-form-card.entry-7455b8f1.js +58 -0
- package/dist/nylas-if-state.entry-0897dc70.cjs +1 -0
- package/dist/{nylas-if-state.entry-ee7d92b0.js → nylas-if-state.entry-7fa6d392.js} +4 -3
- package/dist/nylas-key-points.entry-449e1be0.js +29 -0
- package/dist/nylas-key-points.entry-693f33a1.cjs +1 -0
- package/dist/nylas-login.entry-36544dc8.cjs +1 -0
- package/dist/{nylas-login.entry-265f9d0f.js → nylas-login.entry-d7082306.js} +4 -3
- package/dist/{nylas-provider.entry-5605a3e0.js → nylas-provider.entry-a0e7ce4d.js} +6 -5
- package/dist/nylas-provider.entry-b93d2a62.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-332d27e0.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-b3e085b3.js → nylas-scheduler-editor.entry-78fe5abf.js} +524 -266
- package/dist/nylas-scheduling.entry-1d80c349.cjs +1 -0
- package/dist/nylas-scheduling.entry-fa9ff55b.js +439 -0
- package/dist/nylas-transcript.entry-570d3abe.cjs +6 -0
- package/dist/nylas-transcript.entry-b129565c.js +128 -0
- package/dist/nylas-video-player.entry-9c7c9792.cjs +1 -0
- package/dist/nylas-video-player.entry-e208d443.js +39 -0
- package/dist/nylas-video-preview.entry-a3f542ad.js +16 -0
- package/dist/nylas-video-preview.entry-bd9bdda7.cjs +1 -0
- package/dist/{person-icon.entry-85660f98.js → person-icon.entry-82fbc43e.js} +8 -7
- package/dist/person-icon.entry-e4d11400.cjs +1 -0
- package/dist/play-icon.entry-68bc660a.js +16 -0
- package/dist/play-icon.entry-9cab598b.cjs +1 -0
- package/dist/radio-button-group.entry-6a2adf11.cjs +1 -0
- package/dist/radio-button-group.entry-f7679911.js +47 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +134 -125
- package/dist/refresh-icon.entry-0f1e5f20.cjs +1 -0
- package/dist/{refresh-icon.entry-d8644f5d.js → refresh-icon.entry-394b0814.js} +6 -5
- package/dist/{register-component-e9c10e19-80bbc4dd.cjs → register-component-1027b769-62812558.cjs} +1 -1
- package/dist/{register-component-e9c10e19-099fb50f.js → register-component-1027b769-dd21b16d.js} +1 -1
- package/dist/{reply-all-icon.entry-f209daeb.js → reply-all-icon.entry-0fad8f2f.js} +5 -4
- package/dist/reply-all-icon.entry-1680f1e5.cjs +1 -0
- package/dist/{reply-icon.entry-d37a129b.js → reply-icon.entry-5f4b7837.js} +5 -4
- package/dist/reply-icon.entry-77342442.cjs +1 -0
- package/dist/scheduler-config-store-d6729d8d-06a3a314.cjs +1 -0
- package/dist/{scheduler-config-store-ed4a8dfd-35ec90c6.js → scheduler-config-store-d6729d8d-854b5da8.js} +4 -1
- package/dist/scheduler-store-f3e2a26f-7cee436f.cjs +1 -0
- package/dist/scheduler-store-f3e2a26f-85df53f7.js +533 -0
- package/dist/sent-icon.entry-20a8945d.cjs +1 -0
- package/dist/sent-icon.entry-2d122865.js +16 -0
- package/dist/spam-icon.entry-86178cc5.cjs +1 -0
- package/dist/spam-icon.entry-9e374d44.js +16 -0
- package/dist/star-icon.entry-1b94c861.cjs +1 -0
- package/dist/{star-icon.entry-9b22bb32.js → star-icon.entry-bb1b517d.js} +7 -6
- package/dist/stop-icon.entry-7b21833b.cjs +1 -0
- package/dist/{stop-icon.entry-1f7918b2.js → stop-icon.entry-e4d3526d.js} +3 -2
- package/dist/textarea-component.entry-ba3c9311.js +39 -0
- package/dist/textarea-component.entry-fdba933d.cjs +1 -0
- package/dist/toggle-switch.entry-4a980d1d.js +34 -0
- package/dist/toggle-switch.entry-9142a3d3.cjs +1 -0
- package/dist/{translate-icon.entry-8cffa646.js → translate-icon.entry-1657aa04.js} +5 -4
- package/dist/translate-icon.entry-b4908cf3.cjs +1 -0
- package/dist/trash-fill-icon.entry-a6791185.cjs +1 -0
- package/dist/trash-fill-icon.entry-c9e1769e.js +16 -0
- package/dist/{underline-icon.entry-afd9c78b.js → underline-icon.entry-1ba4d923.js} +5 -4
- package/dist/underline-icon.entry-d1f91e63.cjs +1 -0
- package/dist/warning-icon.entry-b1480f57.cjs +1 -0
- package/dist/{warning-icon.entry-53441175.js → warning-icon.entry-fe155c15.js} +5 -4
- package/package.json +12 -4
- package/dist/add-circle-icon.entry-25aecb13.js +0 -15
- package/dist/add-circle-icon.entry-5c49ba96.cjs +0 -1
- package/dist/archive-icon.entry-0a9e8ec3.cjs +0 -1
- package/dist/archive-icon.entry-89e31121.js +0 -15
- package/dist/arrow-icon.entry-19e5237c.cjs +0 -1
- package/dist/bold-icon.entry-d591e701.cjs +0 -1
- package/dist/button-component_2.entry-ce4314bf.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_54.entry-7099138a.js +0 -5865
- package/dist/calendar-agenda-fill-icon_54.entry-9228dbe7.cjs +0 -8
- package/dist/calendar-cancel-icon.entry-6e3d20f1.cjs +0 -1
- package/dist/calendar-check-icon_2.entry-087dd913.cjs +0 -1
- package/dist/calendar-icon.entry-73f9d05b.cjs +0 -1
- package/dist/checkbox-component_3.entry-bc9768dd.cjs +0 -1
- package/dist/checkbox-component_3.entry-d828eb1d.js +0 -149
- package/dist/chevron-icon_3.entry-783588a9.js +0 -147
- package/dist/chevron-icon_3.entry-e956d78c.cjs +0 -1
- package/dist/clock-icon_4.entry-60d41dfd.cjs +0 -1
- package/dist/close-icon.entry-1b5d25c5.cjs +0 -1
- package/dist/close-icon.entry-fef4f624.js +0 -15
- package/dist/constants-6da0ede7-151395ad.cjs +0 -1
- package/dist/copy-icon.entry-25699ab8.js +0 -15
- package/dist/copy-icon.entry-ab6530e0.cjs +0 -1
- package/dist/core-js-38e53e34.cjs +0 -4
- package/dist/core-js-a9d3b6e1.js +0 -3297
- package/dist/delete-icon.entry-e99e1f82.cjs +0 -1
- package/dist/document-refresh-icon.entry-065a59f5.cjs +0 -1
- package/dist/dom-68f08be9.cjs +0 -15
- package/dist/dom-86e17616.js +0 -664
- package/dist/folder-icon.entry-351e61fc.cjs +0 -1
- package/dist/forward-icon.entry-0ccfb600.js +0 -15
- package/dist/forward-icon.entry-6b7af9cd.cjs +0 -1
- package/dist/globe-icon.entry-2b75b66b.cjs +0 -1
- package/dist/globe-icon.entry-5ddcd2cb.js +0 -15
- package/dist/google-logo-icon_4.entry-04174684.js +0 -790
- package/dist/google-logo-icon_4.entry-a685ff91.cjs +0 -1
- package/dist/inbox-icon.entry-0ad18b3f.js +0 -15
- package/dist/inbox-icon.entry-425d1ded.cjs +0 -1
- package/dist/index-7e7c24f1.js +0 -16837
- package/dist/index-81719cc6.cjs +0 -81
- package/dist/info-icon_2.entry-7ec02802.cjs +0 -1
- package/dist/info-icon_2.entry-a6d0e842.js +0 -34
- package/dist/input-color-picker.entry-d98d06ca.js +0 -48
- package/dist/input-color-picker.entry-ed9a1c07.cjs +0 -1
- package/dist/input-component.entry-2e57b00e.cjs +0 -1
- package/dist/input-component.entry-f3aa3419.js +0 -70
- package/dist/input-dropdown_2.entry-0d9c8475.js +0 -228
- package/dist/input-dropdown_2.entry-6fc7df16.cjs +0 -1
- package/dist/italic-icon.entry-7a8712f2.cjs +0 -1
- package/dist/multi-select-dropdown.entry-b31d9f11.js +0 -116
- package/dist/multi-select-dropdown.entry-eaa268b4.cjs +0 -1
- package/dist/nylas-booked-event-card_12.entry-45514813.js +0 -1378
- package/dist/nylas-booked-event-card_12.entry-498de30a.cjs +0 -1
- package/dist/nylas-form-card.entry-67aec298.js +0 -57
- package/dist/nylas-form-card.entry-fdb3c114.cjs +0 -1
- package/dist/nylas-if-state.entry-76b38c9c.cjs +0 -1
- package/dist/nylas-login.entry-589e45d0.cjs +0 -1
- package/dist/nylas-provider.entry-cfb9627c.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-6fdfb9b5.cjs +0 -2
- package/dist/nylas-scheduling.entry-8cc5c353.cjs +0 -1
- package/dist/nylas-scheduling.entry-bc00beba.js +0 -424
- package/dist/nylas-time-window-picker.entry-a77c1d67.cjs +0 -1
- package/dist/nylas-time-window-picker.entry-c421303e.js +0 -316
- package/dist/person-icon.entry-36b21e95.cjs +0 -1
- package/dist/play-icon.entry-953b1bc8.js +0 -15
- package/dist/play-icon.entry-c35ade8a.cjs +0 -1
- package/dist/refresh-icon.entry-038501ca.cjs +0 -1
- package/dist/reply-all-icon.entry-ead9d0ba.cjs +0 -1
- package/dist/reply-icon.entry-b7f35ecd.cjs +0 -1
- package/dist/scheduler-config-store-ed4a8dfd-0d4408cf.cjs +0 -1
- package/dist/scheduler-store-dc3a7958-7c73f5e2.js +0 -487
- package/dist/scheduler-store-dc3a7958-99c6bdf6.cjs +0 -1
- package/dist/sent-icon.entry-b662ef5b.cjs +0 -1
- package/dist/sent-icon.entry-ec433cec.js +0 -15
- package/dist/spam-icon.entry-3a553ae4.js +0 -15
- package/dist/spam-icon.entry-a79819fd.cjs +0 -1
- package/dist/star-icon.entry-47ea44e7.cjs +0 -1
- package/dist/stop-icon.entry-26e2e633.cjs +0 -1
- package/dist/textarea-component.entry-6939d0fc.js +0 -38
- package/dist/textarea-component.entry-da0a861e.cjs +0 -1
- package/dist/toggle-switch.entry-5ae5ba46.js +0 -33
- package/dist/toggle-switch.entry-c5fd3e33.cjs +0 -1
- package/dist/translate-icon.entry-72e0369e.cjs +0 -1
- package/dist/trash-fill-icon.entry-815859c6.js +0 -15
- package/dist/trash-fill-icon.entry-8620c28f.cjs +0 -1
- package/dist/underline-icon.entry-ba1a9e87.cjs +0 -1
- package/dist/warning-icon.entry-7cbede6b.cjs +0 -1
|
@@ -0,0 +1,1484 @@
|
|
|
1
|
+
import { r as X, h as n, c as _, d as b, i as p, s as fe, v as se, H as re, g as le, F as ie, j as et } from "./index-78390f2e.js";
|
|
2
|
+
import { R as de } from "./register-component-1027b769-dd21b16d.js";
|
|
3
|
+
import { C as O, D as Ge, e as tt, b as nt } from "./constants-3d8016e3-3c080f00.js";
|
|
4
|
+
import { i as Ae, a as je, c as $e, b as Je, f as Ve } from "./feedbackSync-352aaf4a-b2b83cfa.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
const at = ".sc-google-logo-icon-h{display:flex}", ot = at, st = class {
|
|
9
|
+
constructor(e) {
|
|
10
|
+
X(this, e), this.width = "24", this.height = "24";
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return n("svg", { key: "6a2c621ba5bde80fe3adc8427ad0d94df265a2fc", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("g", { key: "87acb19eeb19382c6063360f92c7554039ad2c87", "clip-path": "url(#clip0_959_12452)" }, n("path", { key: "3d6abcc6b7755164cd3037df0529793becefce72", 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" }), n("path", { key: "b7961a5e8c0e93b3d8996cf40b845d7741335229", 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" }), n("path", { key: "32a135d689dc72b3a0fc597dea20f88290c1f6ae", 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" }), n("path", { key: "74518d77b48b593df3085f600d38b99abfe368bb", 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" })), n("defs", { key: "0c69b9fad17f8891565bdb5162822cd3c44f6ca0" }, n("clipPath", { key: "3c645b8c42436ad0664b38ce08b42404f4fa541b", id: "clip0_959_12452" }, n("rect", { key: "f6f7b93e206bce48be1739a1b8ae8bc2e8242357", width: 24, height: 24, fill: "white" }))));
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
st.style = ot;
|
|
17
|
+
const it = ".sc-microsoft-logo-icon-h{display:flex}", rt = it, lt = class {
|
|
18
|
+
constructor(e) {
|
|
19
|
+
X(this, e), this.width = "22", this.height = "22";
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return n("svg", { key: "43e12d49816520a670de91afdb1cfd1136ba6a8e", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("path", { key: "08c5a9b3a6d34bf5900e6149bf0f732e8fb1f51f", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), n("path", { key: "ae3d52d82f9727d53a675d17c76eaf82c3d545ac", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), n("path", { key: "b42837c53c4c0bfc7bbf5676bc82c83e1f3af391", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), n("path", { key: "eec316af4193848e15630e680e357e4c313c6b6c", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
lt.style = rt;
|
|
26
|
+
var u;
|
|
27
|
+
(function(e) {
|
|
28
|
+
e.EventInfo = "eventInfo", e.Availability = "availability", e.BookingOptions = "bookingOptions", e.Communications = "communications", e.Participants = "participants", e.BookingForm = "bookingForm", e.PageStyles = "pageStyles";
|
|
29
|
+
})(u || (u = {}));
|
|
30
|
+
function dt({ id: e, formState: t, activeTab: a }, s) {
|
|
31
|
+
return n(
|
|
32
|
+
ie,
|
|
33
|
+
null,
|
|
34
|
+
n(
|
|
35
|
+
"div",
|
|
36
|
+
{ key: `event-info-${e}`, class: { hide: a !== u.EventInfo } },
|
|
37
|
+
n(
|
|
38
|
+
"nylas-event-info",
|
|
39
|
+
null,
|
|
40
|
+
n(
|
|
41
|
+
"div",
|
|
42
|
+
{ slot: "inputs" },
|
|
43
|
+
n("nylas-event-title", { name: "title", exportparts: "net, net__title, net__dropdown-content" }),
|
|
44
|
+
n("nylas-event-duration", { name: "duration", exportparts: "ned, ned__error, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
|
|
45
|
+
n("nylas-event-location", { name: "location", exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
|
|
46
|
+
n("nylas-event-description", { name: "description", exportparts: "nedesc, nedesc__textarea" })
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
),
|
|
50
|
+
n(
|
|
51
|
+
"div",
|
|
52
|
+
{ key: `availability-${e}`, class: { hide: a !== u.Availability } },
|
|
53
|
+
n("nylas-participant-booking-calendars", { participants: t.participants, name: "participant-booking-calendars", exportparts: "npbc, npbc__header, npbc__content, npbc__participant-container, npbc__participant-title" }),
|
|
54
|
+
n("nylas-connected-calendars", { participants: t.participants, name: "connected-calendars", exportparts: "nccals, nccals__header, nccals__content, nccals__container, nccals__title, nccals__toggle-container, npbc__participant-toggle-container" }),
|
|
55
|
+
n("nylas-availability-picker", { name: "availability", exportparts: "nap, 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" })
|
|
56
|
+
),
|
|
57
|
+
n(
|
|
58
|
+
"div",
|
|
59
|
+
{ key: `booking-options-${e}`, class: { hide: a !== u.BookingOptions } },
|
|
60
|
+
n("nylas-scheduling-method", { name: "availability-method", readOnly: !0, exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
61
|
+
n(
|
|
62
|
+
"nylas-custom-booking-flow",
|
|
63
|
+
{ exportparts: "ncbflow, ncbflow__header, ncbflow__title, ncbflow__content" },
|
|
64
|
+
n(
|
|
65
|
+
"div",
|
|
66
|
+
{ slot: "inputs" },
|
|
67
|
+
n("nylas-booking-confirmation-type", { name: "confirmation-type", exportparts: "nbct, nbct__header, nbct__dropdown, nbct__dropdown-button, nbct__dropdown-content" }),
|
|
68
|
+
n("nylas-booking-confirmation-redirect", { name: "confirmation-redirect", exportparts: "nbcr, nbcr__header, nbcr__dropdown, nbcr__dropdown-button, nbcr__dropdown-content, nbcr__input-textfield" })
|
|
69
|
+
)
|
|
70
|
+
),
|
|
71
|
+
n("nylas-buffer-time", { name: "buffer-time", 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" }),
|
|
72
|
+
n(
|
|
73
|
+
"nylas-event-limits",
|
|
74
|
+
null,
|
|
75
|
+
n(
|
|
76
|
+
"div",
|
|
77
|
+
{ slot: "inputs" },
|
|
78
|
+
n("nylas-min-booking-notice", { name: "min-booking-notice", exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
|
|
79
|
+
n("nylas-limit-future-bookings", { name: "limit-future-bookings", exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
|
|
80
|
+
n("nylas-min-cancellation-notice", { name: "min-cancellation-notice", exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
|
|
81
|
+
n("nylas-cancellation-policy", { name: "cancellation-policy", exportparts: "ncpolicy, ncpolicy__textarea" })
|
|
82
|
+
)
|
|
83
|
+
),
|
|
84
|
+
n("nylas-timeslot-interval", { name: "timeslot-interval", exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
|
|
85
|
+
n("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" })
|
|
86
|
+
),
|
|
87
|
+
n(
|
|
88
|
+
"div",
|
|
89
|
+
{ key: `communications-${e}`, class: { hide: a !== u.Communications } },
|
|
90
|
+
n("nylas-disable-emails", { name: "disable-emails", exportparts: "nde, nde__toggle-label, nde_toggle-input, nde_toggle-slider" }),
|
|
91
|
+
!(t != null && t.disableEmails) && n(
|
|
92
|
+
ie,
|
|
93
|
+
null,
|
|
94
|
+
n("nylas-confirmation-email", { name: "confirmation-email-template", exportparts: "nce, nce__tab-heading, nce__header, nce__body, nce__confirmation-email-toggle--container, nce__summary, nce__reminder-input_dropdown, nce__reminder-input_dropdown-input, nce__reminder-input_dropdown-content" }),
|
|
95
|
+
n("nylas-reminder-emails", { name: "reminder-overrides", exportparts: "nre, nre__tab-heading, nre__header, nre__body, nre__confirmation-email-toggle--container, nre__summary, nrt, nrt__number-dropdown, nrt__number-dropdown-button, nrt__number-dropdown-content, nrt__period-dropdown, nrt__period-dropdown-button, nrt__period-dropdown-content, nrt__time-period-selector" })
|
|
96
|
+
)
|
|
97
|
+
),
|
|
98
|
+
n(
|
|
99
|
+
"div",
|
|
100
|
+
{ key: `participants-${e}`, class: { hide: a !== u.Participants } },
|
|
101
|
+
n("nylas-additional-participants", { name: "participants", exportparts: "nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant" }),
|
|
102
|
+
n("nylas-participants-custom-availability", { participants: t.participants, name: "participant-custom-availability", 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" })
|
|
103
|
+
),
|
|
104
|
+
n(
|
|
105
|
+
"div",
|
|
106
|
+
{ key: `page-styles-${e}`, class: { hide: a !== u.PageStyles } },
|
|
107
|
+
n("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
|
|
108
|
+
n("nylas-page-name", { name: "page-name", exportparts: "npn, npn__body, npn__header, npn__drawer-toggle--container, npn__input-textfield" }),
|
|
109
|
+
n("nylas-page-styling", { name: "page-styling", exportparts: "nps, nps__header, nps__drawer-toggle--container, nps__body, nps__title-input-textfield, nps__company-logo-input-textfield, nps__color-picker, nps__color-picker-button, nps__color-picker-button-label, nps__color-picker-selected-label, nps__submit-button-label-input-textfield, nps__message-textarea" }, s)
|
|
110
|
+
),
|
|
111
|
+
n(
|
|
112
|
+
"div",
|
|
113
|
+
{ key: `booking-form-${e}`, class: { hide: a !== u.BookingForm } },
|
|
114
|
+
n("nylas-booking-form-config", { name: "additional-fields", exportparts: "nbfc, nbfc__header, nbfc__add_field, nbfc__add_field-button, nbfc__add_field-content, nbfc__static_fields, nbfc__additional_fields, nbfc__form-field, nbfc__form-field-header, nbfc__form-field-content" })
|
|
115
|
+
)
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
const ct = '.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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column;height:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:calc(100% - 80px);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)}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{border-right:none}}.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;text-align:left;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.sc-nylas-editor-tabs:last-of-type{margin-bottom: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 .tabs.sc-nylas-editor-tabs .tab.hide.sc-nylas-editor-tabs{display:none}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto;overflow-x:hidden}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .hide.sc-nylas-editor-tabs{display:none}.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}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs{display:flex;flex-direction:column;margin:1rem 1rem 0.5rem;row-gap:4px}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs h3.sc-nylas-editor-tabs{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{margin:0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.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:16px;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}button-component#report-issue.sc-nylas-editor-tabs{width:auto}nylas-feedback-form.sc-nylas-editor-tabs{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}', pt = ct;
|
|
119
|
+
var bt = function(e, t, a, s) {
|
|
120
|
+
var i = arguments.length, o = i < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, l;
|
|
121
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
122
|
+
o = Reflect.decorate(e, t, a, s);
|
|
123
|
+
else
|
|
124
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
125
|
+
(l = e[r]) && (o = (i < 3 ? l(o) : i > 3 ? l(t, a, o) : l(t, a)) || o);
|
|
126
|
+
return i > 3 && o && Object.defineProperty(t, a, o), o;
|
|
127
|
+
}, be = function(e, t) {
|
|
128
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
129
|
+
return Reflect.metadata(e, t);
|
|
130
|
+
};
|
|
131
|
+
const Ze = class {
|
|
132
|
+
constructor(e) {
|
|
133
|
+
X(this, e), this.schedulerConfigChanged = _(this, "schedulerConfigChanged", 7), this.schedulerConfigCreated = _(this, "schedulerConfigCreated", 7), this.cancelButtonClick = _(this, "cancelButtonClick", 7), this.formSubmitted = _(this, "formSubmitted", 7), this.previewButtonClicked = _(this, "previewButtonClicked", 7), this.schedulerEditorFormUpdated = _(this, "schedulerEditorFormUpdated", 7), this.formSubmissionHandler = async (t) => {
|
|
134
|
+
var ge, me, _e, ve, we, ke, Ce, xe, Se, Ee, Te, Fe, Le, Oe, Pe, Be, ze;
|
|
135
|
+
t.preventDefault();
|
|
136
|
+
const a = await this.formSubmitted.emit();
|
|
137
|
+
if (b("[nylas-editor-tabs]", "formSubmissionHandler", a), !this.formRef.checkValidity() || a.defaultPrevented) {
|
|
138
|
+
this.error = this.formRef.validationMessage || p.t("fixFormErrors");
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
142
|
+
const i = this.updateFormState();
|
|
143
|
+
b("[nylas-editor-tabs]", "formState", i);
|
|
144
|
+
const { title: o, description: l, duration: r, availability: d, bookingCalendar: c, location: y, bookingType: g, buffer: C, availableDaysInFuture: E, minCancellationNotice: z, minBookingNotice: P, cancellationPolicy: H, timeslotInterval: S, additionalGuestsHidden: U, hideCancellationOptions: I, hideReschedulingOptions: R, participants: T, participantOpenHours: w, additionalFields: m, participantCalendars: v, conferencing: G, participantBookingCalendars: x, reminders: A, emailTemplate: D, redirectUrl: B, availabilityMethod: j, slug: V, appearance: M, name: Z, disableEmails: Y, organizerLocale: K } = i, k = ((me = (ge = this.selectedConfiguration) == null ? void 0 : ge.participants) == null ? void 0 : me.find((f) => f.is_organizer)) || (T == null ? void 0 : T.find((f) => f.is_organizer)), $ = v && (k != null && k.email) ? v[k == null ? void 0 : k.email] : [], W = ((_e = k == null ? void 0 : k.booking) == null ? void 0 : _e.calendar_id) || c, F = r ? parseInt(r) : 30, L = T && (T == null ? void 0 : T.length) > 0 ? T : [
|
|
145
|
+
{
|
|
146
|
+
name: (k == null ? void 0 : k.name) ?? ((ve = this.currentUser) == null ? void 0 : ve.name) ?? "",
|
|
147
|
+
email: (k == null ? void 0 : k.email) ?? ((we = this.currentUser) == null ? void 0 : we.email) ?? "",
|
|
148
|
+
is_organizer: !0,
|
|
149
|
+
timezone: (d == null ? void 0 : d.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
150
|
+
availability: {
|
|
151
|
+
calendar_ids: c && c !== "" ? [c] : ["primary"],
|
|
152
|
+
open_hours: []
|
|
153
|
+
},
|
|
154
|
+
booking: {
|
|
155
|
+
calendar_id: c && c !== "" ? c : "primary"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
];
|
|
159
|
+
let N = j || (((xe = (Ce = (ke = this.selectedConfiguration) == null ? void 0 : ke.availability) == null ? void 0 : Ce.availability_rules) == null ? void 0 : xe.availability_method) ?? "collective");
|
|
160
|
+
this.selectedEventType && this.selectedEventType !== O.group && (N = this.selectedEventType === O.one_on_one ? O.collective : this.selectedEventType), console.log("availabilityMethodSelected", N);
|
|
161
|
+
const q = {
|
|
162
|
+
...((Se = this.selectedConfiguration) == null ? void 0 : Se.id) && { id: this.selectedConfiguration.id },
|
|
163
|
+
version: ((Ee = this.selectedConfiguration) == null ? void 0 : Ee.version) ?? "1.0.0",
|
|
164
|
+
slug: V,
|
|
165
|
+
name: Z,
|
|
166
|
+
availability: {
|
|
167
|
+
duration_minutes: F,
|
|
168
|
+
interval_minutes: (S == null ? void 0 : S.interval) ?? F,
|
|
169
|
+
round_to: S == null ? void 0 : S.roundTo,
|
|
170
|
+
availability_rules: {
|
|
171
|
+
availability_method: N,
|
|
172
|
+
buffer: C || { before: 0, after: 0 },
|
|
173
|
+
default_open_hours: (d == null ? void 0 : d.openHours) ?? ((Le = (Fe = (Te = this.selectedConfiguration) == null ? void 0 : Te.availability) == null ? void 0 : Fe.availability_rules) == null ? void 0 : Le.default_open_hours) ?? Ge,
|
|
174
|
+
round_robin_group_id: ((Be = (Pe = (Oe = this.selectedConfiguration) == null ? void 0 : Oe.availability) == null ? void 0 : Pe.availability_rules) == null ? void 0 : Be.round_robin_group_id) ?? ""
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
participants: [
|
|
178
|
+
...L ? L.map((f) => {
|
|
179
|
+
var He, Ue, Ie, Ne, Re, De;
|
|
180
|
+
let Q = (d == null ? void 0 : d.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
181
|
+
if ((He = w == null ? void 0 : w[f.email]) != null && He.length && (Q = (Ie = (Ue = w == null ? void 0 : w[f.email]) == null ? void 0 : Ue[0]) == null ? void 0 : Ie.timezone), f.is_organizer) {
|
|
182
|
+
const Me = x != null && x[f.email] ? x == null ? void 0 : x[f.email] : W || "primary", pe = v != null && v[f.email] ? v == null ? void 0 : v[f.email] : $ != null && $.length ? $ : ["primary"], Xe = pe.length === 1 && pe[0] === "primary";
|
|
183
|
+
return {
|
|
184
|
+
name: f.name ?? "",
|
|
185
|
+
email: f.email,
|
|
186
|
+
is_organizer: !0,
|
|
187
|
+
timezone: Q,
|
|
188
|
+
availability: {
|
|
189
|
+
calendar_ids: Xe ? [Me] : pe,
|
|
190
|
+
open_hours: (w == null ? void 0 : w[f.email]) ?? ((Ne = f.availability) == null ? void 0 : Ne.open_hours) ?? []
|
|
191
|
+
},
|
|
192
|
+
booking: {
|
|
193
|
+
calendar_id: Me
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const ee = x != null && x[f.email] ? { calendar_id: x == null ? void 0 : x[f.email] } : (f == null ? void 0 : f.booking) ?? void 0, ce = (v == null ? void 0 : v[f.email]) ?? ((Re = f.availability) == null ? void 0 : Re.calendar_ids) ?? ["primary"], Qe = ce.length === 1 && ce[0] === "primary";
|
|
198
|
+
return {
|
|
199
|
+
...f,
|
|
200
|
+
timezone: Q,
|
|
201
|
+
availability: f.availability ? {
|
|
202
|
+
calendar_ids: Qe && typeof ee < "u" ? [ee == null ? void 0 : ee.calendar_id] : ce,
|
|
203
|
+
open_hours: (w == null ? void 0 : w[f.email]) ?? ((De = f.availability) == null ? void 0 : De.open_hours) ?? []
|
|
204
|
+
} : void 0,
|
|
205
|
+
booking: ee
|
|
206
|
+
};
|
|
207
|
+
}) : []
|
|
208
|
+
],
|
|
209
|
+
event_booking: {
|
|
210
|
+
title: (o == null ? void 0 : o.toString()) ?? "",
|
|
211
|
+
description: (l == null ? void 0 : l.toString()) ?? "",
|
|
212
|
+
location: (y == null ? void 0 : y.toString()) ?? "",
|
|
213
|
+
booking_type: (g == null ? void 0 : g.toString()) ?? "booking",
|
|
214
|
+
timezone: (d == null ? void 0 : d.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
215
|
+
conferencing: G,
|
|
216
|
+
reminders: A,
|
|
217
|
+
disable_emails: typeof Y == "boolean" ? Y : !1
|
|
218
|
+
},
|
|
219
|
+
scheduler: {
|
|
220
|
+
cancellation_policy: H ?? "",
|
|
221
|
+
available_days_in_future: E ?? 30,
|
|
222
|
+
min_cancellation_notice: z ?? 0,
|
|
223
|
+
min_booking_notice: P ?? 60,
|
|
224
|
+
hide_additional_guests: U ?? !1,
|
|
225
|
+
hide_cancellation_options: I ?? !1,
|
|
226
|
+
hide_rescheduling_options: R ?? !1,
|
|
227
|
+
additional_fields: m,
|
|
228
|
+
email_template: D ? {
|
|
229
|
+
...D,
|
|
230
|
+
organizer_locale: K || "en",
|
|
231
|
+
logo: D.logo || ""
|
|
232
|
+
} : void 0,
|
|
233
|
+
confirmation_redirect_url: B
|
|
234
|
+
},
|
|
235
|
+
appearance: M
|
|
236
|
+
}, te = fe(this.selectedConfiguration, q || {}), J = this.action === "create" ? te : q;
|
|
237
|
+
this.isConfigRoundRobin(J) && (J.participants = J.participants.map((f) => ({ ...f, is_organizer: void 0 })));
|
|
238
|
+
const ne = (f) => {
|
|
239
|
+
this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
|
|
240
|
+
this.changesSaved = !1;
|
|
241
|
+
}, 5e3);
|
|
242
|
+
}, ae = this.checkForBookingFormErrors(J), oe = ((ze = this.configurations) == null ? void 0 : ze.find((f) => {
|
|
243
|
+
var Q;
|
|
244
|
+
return f.id === ((Q = this.selectedConfiguration) == null ? void 0 : Q.id);
|
|
245
|
+
})) || {}, Ke = this.checkForOrganizerConfirmationError(fe(J, oe));
|
|
246
|
+
ae || Ke || this.schedulerConfigChanged.emit({ config: J, resetLoadingState: ne, action: this.action, host: this.host });
|
|
247
|
+
}, this.isConfigRoundRobin = (t) => {
|
|
248
|
+
var a, s, i, o;
|
|
249
|
+
return ((s = (a = t == null ? void 0 : t.availability) == null ? void 0 : a.availability_rules) == null ? void 0 : s.availability_method) === "max-availability" || ((o = (i = t.availability) == null ? void 0 : i.availability_rules) == null ? void 0 : o.availability_method) === "max-fairness";
|
|
250
|
+
}, this.checkForOrganizerConfirmationError = (t) => {
|
|
251
|
+
var l, r;
|
|
252
|
+
let a = !1, s = "";
|
|
253
|
+
const i = ((l = t.event_booking) == null ? void 0 : l.booking_type) === "organizer-confirmation", o = (r = t.scheduler) == null ? void 0 : r.organizer_confirmation_url;
|
|
254
|
+
return i && !o && (s += "Organizer confirmation URL is required when using organizer confirmation booking type.", a = !0), a && (this.isLoading = !1, this.host.setError(new Error(s))), a;
|
|
255
|
+
}, this.checkForBookingFormErrors = (t) => {
|
|
256
|
+
var o;
|
|
257
|
+
let a = !1, s = "";
|
|
258
|
+
const i = (o = t.scheduler) == null ? void 0 : o.additional_fields;
|
|
259
|
+
return i && (s = p.t("nylasEditorTabs.bookingFormError"), Object.entries(i).forEach((l) => {
|
|
260
|
+
const r = l[1];
|
|
261
|
+
if (r.label === "") {
|
|
262
|
+
s += p.t("nylasEditorTabs.bookingFormError_label", { type: r.type }), a = !0;
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
if (r.options) {
|
|
266
|
+
for (const d of r.options)
|
|
267
|
+
if (d.trim() === "") {
|
|
268
|
+
s += p.t("nylasEditorTabs.bookingFormError_option", { label: r.label, type: r.type }), a = !0;
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
})), a && (this.isLoading = !1, this.host.setError(new Error(s))), a;
|
|
273
|
+
}, this.calendars = void 0, this.selectedConfiguration = void 0, this.configurations = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.hideEditorTabs = [], this.enableUserFeedback = !0, this.selectedLanguage = void 0, this.selectedEventType = void 0, this.action = "create", this.showFeedbackModal = !1, this.activeTab = u.EventInfo, this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
|
|
274
|
+
}
|
|
275
|
+
configChangedHandler(e) {
|
|
276
|
+
b("[nylas-editor-tabs]", "configChangedHandler", e, this.selectedConfiguration), this.formState = {
|
|
277
|
+
...this.getFormStateFromConfig(e)
|
|
278
|
+
}, e != null && e.id ? this.action = "edit" : this.action = "create";
|
|
279
|
+
}
|
|
280
|
+
userChangedHandler(e) {
|
|
281
|
+
b("[nylas-editor-tabs]", "userChangedHandler", e), e && (this.formState = {
|
|
282
|
+
...this.getFormStateFromConfig(this.selectedConfiguration)
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
selectedLanguageChangedHandler(e, t) {
|
|
286
|
+
e !== t && (p.changeLanguage(e), this.error && (this.error = p.t("fixFormErrors")));
|
|
287
|
+
}
|
|
288
|
+
async schedulerConfigCreatedEventHandler(e) {
|
|
289
|
+
return this.schedulerConfigCreated.emit(e);
|
|
290
|
+
}
|
|
291
|
+
async setError(e) {
|
|
292
|
+
this.error = e.message;
|
|
293
|
+
}
|
|
294
|
+
connectedCallback() {
|
|
295
|
+
b("[nylas-editor-tabs]", "connectedCallback");
|
|
296
|
+
}
|
|
297
|
+
componentWillLoad() {
|
|
298
|
+
b("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
299
|
+
}
|
|
300
|
+
componentDidLoad() {
|
|
301
|
+
var t, a;
|
|
302
|
+
b("[nylas-editor-tabs]", "componentDidLoad"), this.enableUserFeedback && !Ae() && je({
|
|
303
|
+
dsn: "https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",
|
|
304
|
+
release: "1.4.1",
|
|
305
|
+
integrations: (s) => [
|
|
306
|
+
...s.filter((i) => !1),
|
|
307
|
+
Ve({
|
|
308
|
+
colorScheme: "system",
|
|
309
|
+
autoInject: !1
|
|
310
|
+
})
|
|
311
|
+
],
|
|
312
|
+
autoSessionTracking: !1,
|
|
313
|
+
beforeSend: () => null
|
|
314
|
+
}), (t = this.selectedConfiguration) != null && t.id && this.configChangedHandler(this.selectedConfiguration);
|
|
315
|
+
const e = (a = this.host.querySelector("button.tab:not(.hide)")) == null ? void 0 : a.name;
|
|
316
|
+
e && (this.activeTab = e);
|
|
317
|
+
}
|
|
318
|
+
disconnectedCallback() {
|
|
319
|
+
b("[nylas-editor-tabs]", "disconnectedCallback");
|
|
320
|
+
}
|
|
321
|
+
handleValueChanged(e) {
|
|
322
|
+
b("[nylas-editor-tabs]", "handleValueChanged", e);
|
|
323
|
+
const { name: t, value: a } = e.detail;
|
|
324
|
+
console.log("name", t, "value", a), this.setFormState(a, t), this.formState = { ...this.formState }, this.error = "", tt.includes(t) && (this.hasUnsavedChanges = !0), this.schedulerEditorFormUpdated.emit({
|
|
325
|
+
value: e.detail.value,
|
|
326
|
+
name: e.detail.name
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
feedbackModalClosedHandler() {
|
|
330
|
+
this.showFeedbackModal = !1;
|
|
331
|
+
}
|
|
332
|
+
feedbackSubmittedHandler(e) {
|
|
333
|
+
var s, i, o, l, r, d;
|
|
334
|
+
const a = {
|
|
335
|
+
eventId: $e("Scheduler Editor User Feedback", {
|
|
336
|
+
extra: {
|
|
337
|
+
configId: (s = this.selectedConfiguration) == null ? void 0 : s.id,
|
|
338
|
+
slug: (i = this.selectedConfiguration) == null ? void 0 : i.slug
|
|
339
|
+
}
|
|
340
|
+
}),
|
|
341
|
+
message: e.detail.feedback
|
|
342
|
+
};
|
|
343
|
+
Je(a, {
|
|
344
|
+
includeReplay: !0,
|
|
345
|
+
captureContext: {
|
|
346
|
+
tags: {
|
|
347
|
+
"nylas-web-element": "nylas-scheduler-editor",
|
|
348
|
+
"nylas-web-element-version": "1.4.1",
|
|
349
|
+
"nylas-config-id": (o = this.selectedConfiguration) == null ? void 0 : o.id,
|
|
350
|
+
"nylas-slug": (l = this.selectedConfiguration) == null ? void 0 : l.slug,
|
|
351
|
+
"host-url": window.location.href
|
|
352
|
+
},
|
|
353
|
+
extra: {
|
|
354
|
+
configId: (r = this.selectedConfiguration) == null ? void 0 : r.id,
|
|
355
|
+
slug: (d = this.selectedConfiguration) == null ? void 0 : d.slug
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}), this.showFeedbackModal = !1;
|
|
359
|
+
}
|
|
360
|
+
getFormStateFromConfig(e) {
|
|
361
|
+
var a, s, i, o, l, r, d, c, y, g, C, E, z, P, H, S, U, I, R, T, w, m, v, G, x, A, D, B, j, V, M, Z, Y, K, k, $, W;
|
|
362
|
+
let t = (a = e == null ? void 0 : e.participants) == null ? void 0 : a.find((F) => F.is_organizer);
|
|
363
|
+
return !t && ((i = (s = e == null ? void 0 : e.availability) == null ? void 0 : s.availability_rules) == null ? void 0 : i.availability_method) !== "collective" && (t = (o = e == null ? void 0 : e.participants) == null ? void 0 : o.find((F) => {
|
|
364
|
+
var L;
|
|
365
|
+
return F.email === ((L = this.currentUser) == null ? void 0 : L.email);
|
|
366
|
+
}), t && (t.is_organizer = !0)), e != null && e.appearance && console.info("Appearance settings have been returned from the given configuration; please remember to grab them from the configSettingsLoaded event and apply them as desired."), {
|
|
367
|
+
title: ((l = e == null ? void 0 : e.event_booking) == null ? void 0 : l.title) ?? "",
|
|
368
|
+
description: ((r = e == null ? void 0 : e.event_booking) == null ? void 0 : r.description) ?? "",
|
|
369
|
+
duration: ((c = (d = e == null ? void 0 : e.availability) == null ? void 0 : d.duration_minutes) == null ? void 0 : c.toString()) ?? "30",
|
|
370
|
+
availability: {
|
|
371
|
+
timezone: ((y = e == null ? void 0 : e.event_booking) == null ? void 0 : y.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
372
|
+
openHours: ((C = (g = e == null ? void 0 : e.availability) == null ? void 0 : g.availability_rules) == null ? void 0 : C.default_open_hours) ?? Ge
|
|
373
|
+
},
|
|
374
|
+
additionalFields: ((E = e == null ? void 0 : e.scheduler) == null ? void 0 : E.additional_fields) ?? {},
|
|
375
|
+
conferencing: ((z = e == null ? void 0 : e.event_booking) == null ? void 0 : z.conferencing) ?? {},
|
|
376
|
+
calendarIds: ((P = t == null ? void 0 : t.availability) == null ? void 0 : P.calendar_ids) ?? [],
|
|
377
|
+
participants: (e == null ? void 0 : e.participants) ?? [],
|
|
378
|
+
bookingCalendar: ((H = t == null ? void 0 : t.booking) == null ? void 0 : H.calendar_id) ?? (t == null ? void 0 : t.email) ?? "",
|
|
379
|
+
location: ((S = e == null ? void 0 : e.event_booking) == null ? void 0 : S.location) ?? "",
|
|
380
|
+
bookingType: ((U = e == null ? void 0 : e.event_booking) == null ? void 0 : U.booking_type) ?? "booking",
|
|
381
|
+
buffer: ((R = (I = e == null ? void 0 : e.availability) == null ? void 0 : I.availability_rules) == null ? void 0 : R.buffer) ?? { before: 0, after: 0 },
|
|
382
|
+
cancellationPolicy: ((T = e == null ? void 0 : e.scheduler) == null ? void 0 : T.cancellation_policy) ?? "",
|
|
383
|
+
availableDaysInFuture: ((w = e == null ? void 0 : e.scheduler) == null ? void 0 : w.available_days_in_future) ?? 30,
|
|
384
|
+
minCancellationNotice: ((m = e == null ? void 0 : e.scheduler) == null ? void 0 : m.min_cancellation_notice) ?? 0,
|
|
385
|
+
minBookingNotice: ((v = e == null ? void 0 : e.scheduler) == null ? void 0 : v.min_booking_notice) ?? 60,
|
|
386
|
+
timeslotInterval: {
|
|
387
|
+
interval: ((G = e == null ? void 0 : e.availability) == null ? void 0 : G.interval_minutes) ?? ((x = e == null ? void 0 : e.availability) == null ? void 0 : x.duration_minutes),
|
|
388
|
+
roundTo: (A = e == null ? void 0 : e.availability) == null ? void 0 : A.round_to
|
|
389
|
+
},
|
|
390
|
+
additionalGuestsHidden: ((D = e == null ? void 0 : e.scheduler) == null ? void 0 : D.hide_additional_guests) ?? !1,
|
|
391
|
+
hideCancellationOptions: ((B = e == null ? void 0 : e.scheduler) == null ? void 0 : B.hide_cancellation_options) ?? !1,
|
|
392
|
+
hideReschedulingOptions: ((j = e == null ? void 0 : e.scheduler) == null ? void 0 : j.hide_rescheduling_options) ?? !1,
|
|
393
|
+
participantBookingCalendars: ((V = e == null ? void 0 : e.participants) == null ? void 0 : V.reduce((F, L) => {
|
|
394
|
+
var N, q;
|
|
395
|
+
return (N = L.booking) != null && N.calendar_id && (F[L.email] = (q = L.booking) == null ? void 0 : q.calendar_id), F;
|
|
396
|
+
})) ?? {},
|
|
397
|
+
participantCalendars: ((M = e == null ? void 0 : e.participants) == null ? void 0 : M.reduce((F, L) => {
|
|
398
|
+
var N;
|
|
399
|
+
return F[L.email] = (N = L.availability) == null ? void 0 : N.calendar_ids, F;
|
|
400
|
+
}, {})) ?? {},
|
|
401
|
+
reminders: (Z = e == null ? void 0 : e.event_booking) == null ? void 0 : Z.reminders,
|
|
402
|
+
emailTemplate: (Y = e == null ? void 0 : e.scheduler) == null ? void 0 : Y.email_template,
|
|
403
|
+
redirectUrl: (K = e == null ? void 0 : e.scheduler) == null ? void 0 : K.confirmation_redirect_url,
|
|
404
|
+
slug: e == null ? void 0 : e.slug,
|
|
405
|
+
appearance: e == null ? void 0 : e.appearance,
|
|
406
|
+
name: e == null ? void 0 : e.name,
|
|
407
|
+
disableEmails: (k = e == null ? void 0 : e.event_booking) == null ? void 0 : k.disable_emails,
|
|
408
|
+
organizerLocale: (W = ($ = e == null ? void 0 : e.scheduler) == null ? void 0 : $.email_template) == null ? void 0 : W.organizer_locale
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
setFormState(e, t) {
|
|
412
|
+
switch (t) {
|
|
413
|
+
case "title":
|
|
414
|
+
this.formState.title = e.toString();
|
|
415
|
+
break;
|
|
416
|
+
case "description":
|
|
417
|
+
this.formState.description = e.toString();
|
|
418
|
+
break;
|
|
419
|
+
case "duration":
|
|
420
|
+
this.formState.duration = e.toString();
|
|
421
|
+
break;
|
|
422
|
+
case "availability":
|
|
423
|
+
this.formState.availability = JSON.parse(e.toString());
|
|
424
|
+
break;
|
|
425
|
+
case "participants":
|
|
426
|
+
this.formState.participants = JSON.parse(e.toString());
|
|
427
|
+
break;
|
|
428
|
+
case "booking-calendar":
|
|
429
|
+
this.formState.bookingCalendar = e.toString();
|
|
430
|
+
break;
|
|
431
|
+
case "participant-booking-calendars":
|
|
432
|
+
this.formState.participantBookingCalendars = JSON.parse(e.toString());
|
|
433
|
+
break;
|
|
434
|
+
case "location":
|
|
435
|
+
this.formState.location = e.toString();
|
|
436
|
+
break;
|
|
437
|
+
case "conference":
|
|
438
|
+
this.formState.conferencing = JSON.parse(e.toString());
|
|
439
|
+
break;
|
|
440
|
+
case "confirmation-type":
|
|
441
|
+
this.formState.bookingType = e.toString();
|
|
442
|
+
break;
|
|
443
|
+
case "buffer-time":
|
|
444
|
+
this.formState.buffer = JSON.parse(e.toString());
|
|
445
|
+
break;
|
|
446
|
+
case "limit-future-bookings":
|
|
447
|
+
this.formState.availableDaysInFuture = parseInt(e.toString());
|
|
448
|
+
break;
|
|
449
|
+
case "min-cancellation-notice":
|
|
450
|
+
this.formState.minCancellationNotice = parseInt(e.toString());
|
|
451
|
+
break;
|
|
452
|
+
case "min-booking-notice":
|
|
453
|
+
this.formState.minBookingNotice = parseInt(e.toString());
|
|
454
|
+
break;
|
|
455
|
+
case "cancellation-policy":
|
|
456
|
+
this.formState.cancellationPolicy = e.toString();
|
|
457
|
+
break;
|
|
458
|
+
case "timeslot-interval":
|
|
459
|
+
this.formState.timeslotInterval = JSON.parse(e.toString());
|
|
460
|
+
break;
|
|
461
|
+
case "customize-booking-settings": {
|
|
462
|
+
const a = JSON.parse(e.toString());
|
|
463
|
+
this.formState.additionalGuestsHidden = a.additionalGuestsHidden, this.formState.hideCancellationOptions = a.hideCancellationOptions, this.formState.hideReschedulingOptions = a.hideReschedulingOptions;
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
case "participant-custom-availability": {
|
|
467
|
+
const a = JSON.parse(e.toString());
|
|
468
|
+
this.formState.participantOpenHours = a;
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
case "additional-fields":
|
|
472
|
+
this.formState.additionalFields = JSON.parse(e.toString());
|
|
473
|
+
break;
|
|
474
|
+
case "connected-calendars":
|
|
475
|
+
this.formState.participantCalendars = JSON.parse(e.toString());
|
|
476
|
+
break;
|
|
477
|
+
case "confirmation-email-template":
|
|
478
|
+
this.formState.emailTemplate = JSON.parse(e.toString());
|
|
479
|
+
break;
|
|
480
|
+
case "disable-emails": {
|
|
481
|
+
const { disableEmails: a, organizerLocale: s } = JSON.parse(e.toString());
|
|
482
|
+
this.formState.disableEmails = a, this.formState.organizerLocale = s;
|
|
483
|
+
break;
|
|
484
|
+
}
|
|
485
|
+
case "reminder-overrides":
|
|
486
|
+
this.formState.reminders = JSON.parse(e.toString());
|
|
487
|
+
break;
|
|
488
|
+
case "confirmation-redirect":
|
|
489
|
+
this.formState.redirectUrl = e.toString();
|
|
490
|
+
break;
|
|
491
|
+
case "availability-method":
|
|
492
|
+
this.formState.availabilityMethod = e.toString();
|
|
493
|
+
break;
|
|
494
|
+
case "custom-event-slug":
|
|
495
|
+
console.debug("custom-event-slug", e), this.formState.slug = JSON.parse(e.toString());
|
|
496
|
+
break;
|
|
497
|
+
case "page-styling":
|
|
498
|
+
this.formState.appearance = JSON.parse(e.toString());
|
|
499
|
+
break;
|
|
500
|
+
case "page-name":
|
|
501
|
+
this.formState.name = JSON.parse(e.toString());
|
|
502
|
+
break;
|
|
503
|
+
}
|
|
504
|
+
this.schedulerEditorFormUpdated.emit({
|
|
505
|
+
value: e,
|
|
506
|
+
name: t
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
updateFormState() {
|
|
510
|
+
return new FormData(this.formRef).forEach((t, a) => {
|
|
511
|
+
this.setFormState(t, a);
|
|
512
|
+
}), this.formState = { ...this.formState }, this.formState;
|
|
513
|
+
}
|
|
514
|
+
setActiveTab(e, t) {
|
|
515
|
+
e.preventDefault(), this.updateFormState(), this.activeTab = t;
|
|
516
|
+
}
|
|
517
|
+
hideTab(e) {
|
|
518
|
+
var t;
|
|
519
|
+
return ((t = this.hideEditorTabs) == null ? void 0 : t.includes(e)) || !1;
|
|
520
|
+
}
|
|
521
|
+
onFeedbackClick(e) {
|
|
522
|
+
e.preventDefault(), this.showFeedbackModal = !0;
|
|
523
|
+
}
|
|
524
|
+
render() {
|
|
525
|
+
var e, t;
|
|
526
|
+
return b("[nylas-editor-tabs]", "render", this.formState), n(re, { key: "19f6d1ad319b8c695078eac212c0316e8c4f96a6" }, n("form", { key: "c32b5443ea3f4797005b38b69184212994b9991e", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (a) => this.formRef = a, noValidate: !0 }, this.mode === "app" ? n("div", { class: "form-contents", part: "editor__form-contents net__form-contents" }, n("div", { class: "tabs", part: "editor__tabs net__tabs" }, n("button", { name: u.EventInfo, class: { tab: !0, active: this.activeTab == u.EventInfo, hide: this.hideTab(u.EventInfo) }, part: "editortab__event-info net__tab-event-info", onClick: (a) => this.setActiveTab(a, u.EventInfo) }, n("calendar-info-icon", { width: "16", height: "16" }), p.t("eventInfoTab")), n("button", { name: u.Availability, class: { tab: !0, active: this.activeTab == u.Availability, hide: this.hideTab(u.Availability) }, part: "editortab__availability net__tab-availability", onClick: (a) => this.setActiveTab(a, u.Availability) }, n("calendar-patterns-icon", { width: "16", height: "16" }), p.t("availabilityTab")), n("button", { name: u.Participants, class: { tab: !0, active: this.activeTab == u.Participants, hide: this.hideTab(u.Participants) }, part: "editortab__participants net__tab-participants", onClick: (a) => this.setActiveTab(a, u.Participants) }, n("people-icon", { width: "16", height: "16" }), p.t("participantsTab")), n("button", { name: u.BookingOptions, class: { tab: !0, active: this.activeTab == u.BookingOptions, hide: this.hideTab(u.BookingOptions) }, part: "editortab__booking-options net__tab-booking-options", onClick: (a) => this.setActiveTab(a, u.BookingOptions) }, n("flow-icon", { width: "16", height: "16" }), p.t("bookingOptionsTab")), n("button", { name: u.BookingForm, class: { tab: !0, active: this.activeTab == "bookingForm", hide: this.hideTab(u.BookingForm) }, part: "editortab__booking-form net__tab-booking-form", onClick: (a) => this.setActiveTab(a, u.BookingForm) }, this.activeTab == u.BookingForm ? n("calendar-agenda-fill-icon", { width: "16", height: "16" }) : n("calendar-agenda-icon", { width: "16", height: "16" }), p.t("bookingFormTab")), n("button", { name: u.Communications, class: { tab: !0, active: this.activeTab == "communications", hide: this.hideTab(u.Communications) }, onClick: (a) => this.setActiveTab(a, u.Communications), part: "editortab__communications net__tab-communications" }, this.activeTab == u.Communications ? n("envelope-fill-icon", { width: "16", height: "16" }) : n("envelope-icon", { width: "16", height: "16" }), p.t("communicationsTab")), n("button", { name: u.PageStyles, class: { tab: !0, active: this.activeTab == "pageStyles", hide: this.hideTab(u.PageStyles) }, onClick: (a) => this.setActiveTab(a, u.PageStyles), part: "editortab__page-styles net__tab-page-styles" }, this.activeTab == u.PageStyles ? n("paintbrush-fill-icon", { width: "16", height: "16" }) : n("paintbrush-icon", { width: "16", height: "16" }), p.t("pageStylesTab"))), n("div", { class: "tab-content", part: "editor__tab-content net__tab-content" }, n(dt, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((e = this.selectedConfiguration) == null ? void 0 : e.id) ?? "new", i18next: p }))) : n("div", { class: "composable", key: (t = this.selectedConfiguration) == null ? void 0 : t.id }, n("slot", null)), n("div", { key: "6f9c0945829766cbfba0c7425a78a7af49ad6364", class: "footer", part: "editor__footer net__footer" }, n("div", { key: "679739b48dcba5bb65037dc495a7c5bcdf48b3c9", class: "preview", part: "editor__footer-preview net__footer-preview" }, this.enableUserFeedback && n("button-component", { title: "Share your feedback", id: "report-issue", variant: "basic", onClick: (a) => this.onFeedbackClick(a) }, n("feedback-icon", null))), n("div", { key: "bc6758b9768fe3de1cd0acf5bf5cd1e76c36a4a5", class: "buttons", part: "editor__footer-buttons net__footer-buttons" }, n("p", { key: "513690770ca68d84ac1045a0287eb5278bf4f1e9", class: {
|
|
527
|
+
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
528
|
+
"saved-changes": this.changesSaved,
|
|
529
|
+
error: this.error !== "",
|
|
530
|
+
"error-full-width": this.error !== "" && this.action === "create"
|
|
531
|
+
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? p.t("unsavedChangesLabel") : this.error == "" && this.changesSaved ? `${p.t("changesSavedLabel")}!` : ""), this.schedulerPreviewLink !== "" && this.action === "edit" && n("button-component", { title: "Preview", type: "button", disabled: this.isLoading, clickHandler: (a) => {
|
|
532
|
+
a.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(se(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
533
|
+
}, variant: "basic" }, n("eye-icon", null)), n("button-component", { key: "4c142bdcf49ad45d73b4eb69732b87f1c0ee5d53", type: "button", disabled: this.isLoading, clickHandler: (a) => {
|
|
534
|
+
a.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
535
|
+
}, variant: "basic", part: "editor__footer-cancel net__footer-cancel" }, p.t("backButton")), n("button-component", { key: "7609fa4f1c76454e0d65253e76eeadc3169bd93d", type: "submit", disabled: this.isLoading, part: "editor__footer-cta, net__footer-cta" }, this.isLoading ? n("span", null, p.t("savingButtonText"), n("loading-icon", null), " ") : this.action === "create" ? `${p.t("createButtonText")}` : `${p.t("saveChangesButtonText")}`)))), this.showFeedbackModal && n("nylas-feedback-form", null));
|
|
536
|
+
}
|
|
537
|
+
get host() {
|
|
538
|
+
return le(this);
|
|
539
|
+
}
|
|
540
|
+
static get watchers() {
|
|
541
|
+
return {
|
|
542
|
+
selectedConfiguration: ["configChangedHandler"],
|
|
543
|
+
currentUser: ["userChangedHandler"],
|
|
544
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
bt([
|
|
549
|
+
de({
|
|
550
|
+
name: "nylas-editor-tabs",
|
|
551
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
552
|
+
["schedulerConfig.calendars", "calendars"],
|
|
553
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
554
|
+
["schedulerConfig.currentUser", "currentUser"],
|
|
555
|
+
["schedulerConfig.configurations", "configurations"],
|
|
556
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"],
|
|
557
|
+
["schedulerConfig.selectedEventType", "selectedEventType"]
|
|
558
|
+
]),
|
|
559
|
+
eventToProps: {
|
|
560
|
+
schedulerConfigChanged: async (e, t) => {
|
|
561
|
+
const { resetLoadingState: a, host: s, action: i, config: o } = e.detail, l = (r) => {
|
|
562
|
+
const [d, c] = r;
|
|
563
|
+
!d && c ? s.setError(c) : d && !c && i === "create" && (s.schedulerConfigCreatedEventHandler({ config: d, action: i, host: s }), t.schedulerConfigStore.set("selectedEventType", void 0)), a && a(e);
|
|
564
|
+
};
|
|
565
|
+
if (i === "edit") {
|
|
566
|
+
const r = await t.schedulerConfig.updateConfiguration(o);
|
|
567
|
+
l(r);
|
|
568
|
+
} else {
|
|
569
|
+
const r = await t.schedulerConfig.createConfiguration(o);
|
|
570
|
+
l(r);
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
cancelButtonClick: async (e, t) => {
|
|
574
|
+
t.schedulerConfigStore.state.action = null, t.schedulerConfigStore.set("selectedEventType", void 0);
|
|
575
|
+
},
|
|
576
|
+
previewButtonClicked: async (e, t) => {
|
|
577
|
+
b("[nylas-editor-tabs]", "previewButtonClicked", t);
|
|
578
|
+
},
|
|
579
|
+
formSubmitted: async (e, t) => {
|
|
580
|
+
b("[nylas-editor-tabs]", "formSubmitted", t);
|
|
581
|
+
},
|
|
582
|
+
schedulerEditorFormUpdated: async (e, t) => {
|
|
583
|
+
b("[nylas-editor-tabs]", "schedulerEditorFormUpdated", e);
|
|
584
|
+
},
|
|
585
|
+
schedulerConfigCreated: async (e, t) => {
|
|
586
|
+
b("[nylas-editor-tabs]", "schedulerConfigCreated", e);
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
localPropsToProp: /* @__PURE__ */ new Map([
|
|
590
|
+
["schedulerPreviewLink", "schedulerPreviewLink"],
|
|
591
|
+
["enableUserFeedback", "enableUserFeedback"],
|
|
592
|
+
["hideEditorTabs", "hideEditorTabs"]
|
|
593
|
+
]),
|
|
594
|
+
fireRegisterEvent: !0
|
|
595
|
+
}),
|
|
596
|
+
be("design:type", Function),
|
|
597
|
+
be("design:paramtypes", []),
|
|
598
|
+
be("design:returntype", void 0)
|
|
599
|
+
], Ze.prototype, "render", null);
|
|
600
|
+
Ze.style = pt;
|
|
601
|
+
var h;
|
|
602
|
+
(function(e) {
|
|
603
|
+
e.BookingOptions = "bookingOptions", e.Communications = "communications", e.BookingForm = "bookingForm", e.PageStyles = "pageStyles", e.CalendarView = "calendarView";
|
|
604
|
+
})(h || (h = {}));
|
|
605
|
+
function ut({ id: e, formState: t, activeTab: a }, s) {
|
|
606
|
+
return n(
|
|
607
|
+
ie,
|
|
608
|
+
null,
|
|
609
|
+
a === h.CalendarView && n(
|
|
610
|
+
"div",
|
|
611
|
+
{ key: `calendar-view-${e}`, class: { hide: a !== h.CalendarView, "calendar-view": !0 } },
|
|
612
|
+
n("nylas-event-calendar", null)
|
|
613
|
+
),
|
|
614
|
+
n(
|
|
615
|
+
"div",
|
|
616
|
+
{ key: `booking-options-${e}`, class: { hide: a !== h.BookingOptions } },
|
|
617
|
+
n("nylas-scheduling-method", { name: "availability-method", readOnly: !0, exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
618
|
+
n(
|
|
619
|
+
"nylas-custom-booking-flow",
|
|
620
|
+
{ exportparts: "ncbflow, ncbflow__header, ncbflow__title, ncbflow__content" },
|
|
621
|
+
n(
|
|
622
|
+
"div",
|
|
623
|
+
{ slot: "inputs" },
|
|
624
|
+
n("nylas-booking-confirmation-type", { name: "confirmation-type", exportparts: "nbct, nbct__header, nbct__dropdown, nbct__dropdown-button, nbct__dropdown-content" }),
|
|
625
|
+
n("nylas-booking-confirmation-redirect", { name: "confirmation-redirect", exportparts: "nbcr, nbcr__header, nbcr__dropdown, nbcr__dropdown-button, nbcr__dropdown-content, nbcr__input-textfield" })
|
|
626
|
+
)
|
|
627
|
+
),
|
|
628
|
+
n(
|
|
629
|
+
"nylas-event-limits",
|
|
630
|
+
null,
|
|
631
|
+
n(
|
|
632
|
+
"div",
|
|
633
|
+
{ slot: "inputs" },
|
|
634
|
+
n("nylas-min-cancellation-notice", { name: "min-cancellation-notice", exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
|
|
635
|
+
n("nylas-cancellation-policy", { name: "cancellation-policy", exportparts: "ncpolicy, ncpolicy__textarea" })
|
|
636
|
+
)
|
|
637
|
+
),
|
|
638
|
+
n("nylas-customize-booking-settings", { showSettings: ["hideCancellationOptions", "hideReschedulingOptions"], name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
|
|
639
|
+
),
|
|
640
|
+
n(
|
|
641
|
+
"div",
|
|
642
|
+
{ key: `communications-${e}`, class: { hide: a !== h.Communications } },
|
|
643
|
+
n("nylas-disable-emails", { name: "disable-emails", exportparts: "nde, nde__toggle-label, nde_toggle-input, nde_toggle-slider" }),
|
|
644
|
+
!(t != null && t.disableEmails) && n(
|
|
645
|
+
ie,
|
|
646
|
+
null,
|
|
647
|
+
n("nylas-confirmation-email", { name: "confirmation-email-template", exportparts: "nce, nce__tab-heading, nce__header, nce__body, nce__confirmation-email-toggle--container, nce__summary, nce__reminder-input_dropdown, nce__reminder-input_dropdown-input, nce__reminder-input_dropdown-content" }),
|
|
648
|
+
n("nylas-reminder-emails", { name: "reminder-overrides", exportparts: "nre, nre__tab-heading, nre__header, nre__body, nre__confirmation-email-toggle--container, nre__summary, nrt, nrt__number-dropdown, nrt__number-dropdown-button, nrt__number-dropdown-content, nrt__period-dropdown, nrt__period-dropdown-button, nrt__period-dropdown-content, nrt__time-period-selector" })
|
|
649
|
+
)
|
|
650
|
+
),
|
|
651
|
+
n(
|
|
652
|
+
"div",
|
|
653
|
+
{ key: `page-styles-${e}`, class: { hide: a !== h.PageStyles } },
|
|
654
|
+
n("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
|
|
655
|
+
n("nylas-page-name", { name: "page-name", requirePageName: !0, exportparts: "npn, npn__body, npn__header, npn__drawer-toggle--container, npn__input-textfield" }),
|
|
656
|
+
n("nylas-page-styling", { name: "page-styling", exportparts: "nps, nps__header, nps__drawer-toggle--container, nps__body, nps__title-input-textfield, nps__company-logo-input-textfield, nps__color-picker, nps__color-picker-button, nps__color-picker-button-label, nps__color-picker-selected-label, nps__submit-button-label-input-textfield, nps__message-textarea" }, s)
|
|
657
|
+
),
|
|
658
|
+
n(
|
|
659
|
+
"div",
|
|
660
|
+
{ key: `booking-form-${e}`, class: { hide: a !== h.BookingForm } },
|
|
661
|
+
n("nylas-booking-form-config", { name: "additional-fields", exportparts: "nbfc, nbfc__header, nbfc__add_field, nbfc__add_field-button, nbfc__add_field-content, nbfc__static_fields, nbfc__additional_fields, nbfc__form-field, nbfc__form-field-header, nbfc__form-field-content" })
|
|
662
|
+
)
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
const ht = '.sc-nylas-editor-tabs-group-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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.scheduler-editor.sc-nylas-editor-tabs-group{display:flex;flex-direction:column;height:inherit;position:relative}.scheduler-editor.sc-nylas-editor-tabs-group div.return-to-calendar-view.sc-nylas-editor-tabs-group{display:flex;border-bottom:1px solid var(--nylas-base-200)}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group{display:grid;grid-template-columns:minmax(224px, 25%) 1fr;height:auto;overflow-y:auto;min-height:calc(100% - 80px - 48px)}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group{display:table-column-group;height:auto;min-height:calc(100% - 80px - 196px - 48px)}}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group{border-right:none}}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.sc-nylas-editor-tabs-group{display:flex;align-items:center;text-align:left;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-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.sc-nylas-editor-tabs-group:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.sc-nylas-editor-tabs-group:last-of-type{margin-bottom:0.25rem}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.active.sc-nylas-editor-tabs-group{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-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.hide.sc-nylas-editor-tabs-group{display:none}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group{max-width:692px;overflow-y:auto;overflow-x:hidden}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .hide.sc-nylas-editor-tabs-group{display:none}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .calendar-view.sc-nylas-editor-tabs-group{position:absolute;top:0;left:0;height:calc(100% - 80px);width:-webkit-fill-available;background:var(--nylas-base-0)}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-info.sc-nylas-editor-tabs-group,.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-limits.sc-nylas-editor-tabs-group{width:inherit}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-info.sc-nylas-editor-tabs-group div[slot=inputs].sc-nylas-editor-tabs-group,.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-limits.sc-nylas-editor-tabs-group div[slot=inputs].sc-nylas-editor-tabs-group{display:flex;flex-direction:column;gap:1rem}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .tab-header.sc-nylas-editor-tabs-group{display:flex;flex-direction:column;margin:1rem 1rem 0.5rem;row-gap:4px}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .tab-header.sc-nylas-editor-tabs-group h3.sc-nylas-editor-tabs-group{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .tab-header.sc-nylas-editor-tabs-group p.sc-nylas-editor-tabs-group{margin:0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.footer.sc-nylas-editor-tabs-group{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-group{flex-direction:column;height:auto;z-index:2}}.footer.sc-nylas-editor-tabs-group .preview.sc-nylas-editor-tabs-group{display:flex;gap:16px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .preview.sc-nylas-editor-tabs-group{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group{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-group .buttons.sc-nylas-editor-tabs-group{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group .footer-buttons__row.sc-nylas-editor-tabs-group{display:flex;gap:16px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group .footer-buttons__row.sc-nylas-editor-tabs-group{width:100%}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group .footer-buttons__row.sc-nylas-editor-tabs-group button-component[title=Preview].sc-nylas-editor-tabs-group{width:48px}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.sc-nylas-editor-tabs-group{max-width:524px}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.unsaved-changes.sc-nylas-editor-tabs-group{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.saved-changes.sc-nylas-editor-tabs-group{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.error.sc-nylas-editor-tabs-group{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.error-full-width.sc-nylas-editor-tabs-group{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button-component.sc-nylas-editor-tabs-group{width:100%}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group span.sc-nylas-editor-tabs-group{display:flex;align-items:center;justify-content:center;gap:0.5rem}button-component#report-issue.sc-nylas-editor-tabs-group{width:auto}nylas-feedback-form.sc-nylas-editor-tabs-group{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}', yt = ht;
|
|
666
|
+
var ft = function(e, t, a, s) {
|
|
667
|
+
var i = arguments.length, o = i < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, l;
|
|
668
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
669
|
+
o = Reflect.decorate(e, t, a, s);
|
|
670
|
+
else
|
|
671
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
672
|
+
(l = e[r]) && (o = (i < 3 ? l(o) : i > 3 ? l(t, a, o) : l(t, a)) || o);
|
|
673
|
+
return i > 3 && o && Object.defineProperty(t, a, o), o;
|
|
674
|
+
}, ue = function(e, t) {
|
|
675
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
676
|
+
return Reflect.metadata(e, t);
|
|
677
|
+
};
|
|
678
|
+
const We = class {
|
|
679
|
+
constructor(e) {
|
|
680
|
+
X(this, e), this.schedulerConfigChanged = _(this, "schedulerConfigChanged", 7), this.schedulerConfigCreated = _(this, "schedulerConfigCreated", 7), this.cancelButtonClick = _(this, "cancelButtonClick", 7), this.formSubmitted = _(this, "formSubmitted", 7), this.previewButtonClicked = _(this, "previewButtonClicked", 7), this.schedulerEditorFormUpdated = _(this, "schedulerEditorFormUpdated", 7), this.groupEventCreateTriggered = _(this, "groupEventCreateTriggered", 7), this.groupEventUpdateTriggered = _(this, "groupEventUpdateTriggered", 7), this.groupEventDeleteTriggered = _(this, "groupEventDeleteTriggered", 7), this.groupEventImportTriggered = _(this, "groupEventImportTriggered", 7), this.saveGroupEventChangesError = _(this, "saveGroupEventChangesError", 7), this.formSubmissionHandler = async (t) => {
|
|
681
|
+
var k, $, W, F, L, N, q, te, J, ne, ae;
|
|
682
|
+
t.preventDefault();
|
|
683
|
+
const a = await this.formSubmitted.emit();
|
|
684
|
+
if (b("[nylas-editor-tabs-group]", "formSubmissionHandler", a), !this.formRef.checkValidity() || a.defaultPrevented) {
|
|
685
|
+
this.error = this.formRef.validationMessage || "Please fix the form errors.";
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
689
|
+
const i = this.updateFormState();
|
|
690
|
+
b("[nylas-editor-tabs-group]", "formState", i);
|
|
691
|
+
const { title: o, description: l, bookingCalendar: r, location: d, bookingType: c, minCancellationNotice: y, cancellationPolicy: g, hideCancellationOptions: C, hideReschedulingOptions: E, additionalFields: z, conferencing: P, reminders: H, emailTemplate: S, redirectUrl: U, slug: I, appearance: R, name: T, eventCapacity: w, eventTimeslot: m, participants: v, disableEmails: G, organizerLocale: x } = i, A = {
|
|
692
|
+
...((k = this.selectedConfiguration) == null ? void 0 : k.id) && { id: this.selectedConfiguration.id },
|
|
693
|
+
slug: I,
|
|
694
|
+
name: T,
|
|
695
|
+
type: this.selectedEventType === O.group ? O.group : void 0,
|
|
696
|
+
scheduler: {
|
|
697
|
+
cancellation_policy: g ?? "",
|
|
698
|
+
min_cancellation_notice: y ?? 0,
|
|
699
|
+
hide_cancellation_options: C ?? !1,
|
|
700
|
+
hide_rescheduling_options: E ?? !1,
|
|
701
|
+
additional_fields: z,
|
|
702
|
+
email_template: S ? {
|
|
703
|
+
...S,
|
|
704
|
+
organizer_locale: x || "en",
|
|
705
|
+
logo: S.logo || ""
|
|
706
|
+
} : void 0,
|
|
707
|
+
confirmation_redirect_url: U
|
|
708
|
+
},
|
|
709
|
+
appearance: R,
|
|
710
|
+
group_booking: {
|
|
711
|
+
booking_type: c || "booking",
|
|
712
|
+
disable_emails: typeof G == "boolean" ? G : !1,
|
|
713
|
+
reminders: H,
|
|
714
|
+
conferencing: P,
|
|
715
|
+
calendar_id: r || "primary",
|
|
716
|
+
default_capacity: w || 10
|
|
717
|
+
}
|
|
718
|
+
}, D = fe(this.selectedConfiguration, A || {}), B = this.action === "create" ? D : A;
|
|
719
|
+
delete B.availability, delete B.participants, delete B.event_booking;
|
|
720
|
+
const j = (oe) => {
|
|
721
|
+
this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
|
|
722
|
+
this.changesSaved = !1;
|
|
723
|
+
}, 3e3);
|
|
724
|
+
};
|
|
725
|
+
if (this.checkForBookingFormErrors(B))
|
|
726
|
+
return;
|
|
727
|
+
const M = {
|
|
728
|
+
name: (($ = this.currentUser) == null ? void 0 : $.name) ?? ((W = this.currentUser) == null ? void 0 : W.email) ?? "",
|
|
729
|
+
email: ((F = this.currentUser) == null ? void 0 : F.email) ?? ""
|
|
730
|
+
}, Z = ((L = this.calendars) == null ? void 0 : L.find((oe) => oe.is_primary)) ?? ((N = this.calendars) == null ? void 0 : N[0]), Y = [{ ...M, is_organizer: !0 }], K = (q = this.selectedConfiguration) != null && q.id ? void 0 : {
|
|
731
|
+
title: o,
|
|
732
|
+
description: l,
|
|
733
|
+
location: P ? void 0 : d,
|
|
734
|
+
conferencing: d ? void 0 : P,
|
|
735
|
+
when: {
|
|
736
|
+
start_time: ((te = m == null ? void 0 : m.when) == null ? void 0 : te.start_time) ?? 0,
|
|
737
|
+
end_time: ((J = m == null ? void 0 : m.when) == null ? void 0 : J.end_time) ?? 0,
|
|
738
|
+
start_timezone: ((ne = m == null ? void 0 : m.when) == null ? void 0 : ne.start_timezone) ?? "",
|
|
739
|
+
end_timezone: ((ae = m == null ? void 0 : m.when) == null ? void 0 : ae.end_timezone) ?? ""
|
|
740
|
+
},
|
|
741
|
+
recurrence: (m == null ? void 0 : m.recurrence) ?? [],
|
|
742
|
+
calendar_id: r || (Z == null ? void 0 : Z.id) || "primary",
|
|
743
|
+
participants: v != null && v.length ? v : Y,
|
|
744
|
+
organizer: M,
|
|
745
|
+
capacity: w || 10
|
|
746
|
+
};
|
|
747
|
+
this.schedulerConfigChanged.emit({ groupEvent: K || void 0, config: B, resetLoadingState: j, action: this.action, host: this.host });
|
|
748
|
+
}, this.checkForBookingFormErrors = (t) => {
|
|
749
|
+
var o;
|
|
750
|
+
let a = !1, s = "";
|
|
751
|
+
const i = (o = t.scheduler) == null ? void 0 : o.additional_fields;
|
|
752
|
+
return i && (s = "Booking form error: ", Object.entries(i).forEach((l) => {
|
|
753
|
+
const r = l[1];
|
|
754
|
+
if (r.label === "") {
|
|
755
|
+
s += `Label is required for field of type ${r.type}.`, a = !0;
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
if (r.options) {
|
|
759
|
+
for (const d of r.options)
|
|
760
|
+
if (d.trim() === "") {
|
|
761
|
+
s += `Empty option detected inside ${r.label} of type ${r.type}.`, a = !0;
|
|
762
|
+
break;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
})), a && (this.isLoading = !1, this.host.setError(new Error(s))), a;
|
|
766
|
+
}, this.calendars = void 0, this.selectedConfiguration = void 0, this.configurations = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.hideEditorTabs = [], this.enableUserFeedback = !0, this.selectedLanguage = void 0, this.selectedEventType = void 0, this.selectedGroupEvent = void 0, this.action = "create", this.showFeedbackModal = !1, this.activeTab = h.CalendarView, this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
|
|
767
|
+
}
|
|
768
|
+
configChangedHandler(e) {
|
|
769
|
+
b("[nylas-editor-tabs-group]", "configChangedHandler", e, this.selectedConfiguration), this.formState = {
|
|
770
|
+
...this.getFormStateFromConfig(e)
|
|
771
|
+
}, e != null && e.id ? this.action = "edit" : this.action = "create";
|
|
772
|
+
}
|
|
773
|
+
selectedGroupEventChangedHandler(e) {
|
|
774
|
+
var t, a, s, i, o, l, r, d, c, y, g, C, E, z, P, H, S, U, I, R, T, w, m, v, G, x, A, D, B, j, V;
|
|
775
|
+
b("[nylas-editor-tabs-group]", "selectedGroupEventChangedHandler", e, this.selectedConfiguration), this.formState = {
|
|
776
|
+
...this.formState,
|
|
777
|
+
title: (a = (t = this.selectedGroupEvent) == null ? void 0 : t.event) == null ? void 0 : a.title,
|
|
778
|
+
description: (i = (s = this.selectedGroupEvent) == null ? void 0 : s.event) == null ? void 0 : i.description,
|
|
779
|
+
location: (l = (o = this.selectedGroupEvent) == null ? void 0 : o.event) == null ? void 0 : l.location,
|
|
780
|
+
conferencing: (d = (r = this.selectedGroupEvent) == null ? void 0 : r.event) == null ? void 0 : d.conferencing,
|
|
781
|
+
eventCapacity: (y = (c = this.selectedGroupEvent) == null ? void 0 : c.group_event_info) == null ? void 0 : y.capacity,
|
|
782
|
+
participants: (E = (C = (g = this.selectedGroupEvent) == null ? void 0 : g.group_event_info) == null ? void 0 : C.participants) == null ? void 0 : E.map((M) => ({
|
|
783
|
+
name: M.name,
|
|
784
|
+
email: M.email,
|
|
785
|
+
is_organizer: !!M.is_organizer,
|
|
786
|
+
timezone: ""
|
|
787
|
+
})),
|
|
788
|
+
eventTimeslot: (P = (z = this.selectedGroupEvent) == null ? void 0 : z.event) != null && P.when ? {
|
|
789
|
+
when: {
|
|
790
|
+
start_time: (U = (S = (H = this.selectedGroupEvent) == null ? void 0 : H.event) == null ? void 0 : S.when) == null ? void 0 : U.start_time,
|
|
791
|
+
end_time: (T = (R = (I = this.selectedGroupEvent) == null ? void 0 : I.event) == null ? void 0 : R.when) == null ? void 0 : T.end_time,
|
|
792
|
+
start_timezone: (v = (m = (w = this.selectedGroupEvent) == null ? void 0 : w.event) == null ? void 0 : m.when) == null ? void 0 : v.start_timezone,
|
|
793
|
+
end_timezone: (A = (x = (G = this.selectedGroupEvent) == null ? void 0 : G.event) == null ? void 0 : x.when) == null ? void 0 : A.end_timezone
|
|
794
|
+
},
|
|
795
|
+
recurrence: (B = (D = this.selectedGroupEvent) == null ? void 0 : D.group_event_info) != null && B.rrule ? (V = (j = this.selectedGroupEvent) == null ? void 0 : j.group_event_info) == null ? void 0 : V.rrule : []
|
|
796
|
+
} : void 0
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
userChangedHandler(e) {
|
|
800
|
+
b("[nylas-editor-tabs-group]", "userChangedHandler", e), e && (this.formState = {
|
|
801
|
+
...this.getFormStateFromConfig(this.selectedConfiguration)
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
selectedLanguageChangedHandler(e, t) {
|
|
805
|
+
e !== t && p.changeLanguage(e);
|
|
806
|
+
}
|
|
807
|
+
async schedulerConfigCreatedEventHandler(e) {
|
|
808
|
+
return this.schedulerConfigCreated.emit(e);
|
|
809
|
+
}
|
|
810
|
+
async setError(e) {
|
|
811
|
+
this.error = e.message;
|
|
812
|
+
}
|
|
813
|
+
async resetError() {
|
|
814
|
+
this.error = "";
|
|
815
|
+
}
|
|
816
|
+
connectedCallback() {
|
|
817
|
+
b("[nylas-editor-tabs-group]", "connectedCallback");
|
|
818
|
+
}
|
|
819
|
+
componentWillLoad() {
|
|
820
|
+
b("[nylas-editor-tabs-group]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
821
|
+
}
|
|
822
|
+
componentDidLoad() {
|
|
823
|
+
var t, a, s;
|
|
824
|
+
b("[nylas-editor-tabs-group]", "componentDidLoad"), this.enableUserFeedback && !Ae() && je({
|
|
825
|
+
dsn: "https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",
|
|
826
|
+
release: "1.4.1",
|
|
827
|
+
integrations: (i) => [
|
|
828
|
+
...i.filter((o) => !1),
|
|
829
|
+
Ve({
|
|
830
|
+
colorScheme: "system",
|
|
831
|
+
autoInject: !1
|
|
832
|
+
})
|
|
833
|
+
],
|
|
834
|
+
autoSessionTracking: !1,
|
|
835
|
+
beforeSend: () => null
|
|
836
|
+
}), (t = this.selectedConfiguration) != null && t.id && this.configChangedHandler(this.selectedConfiguration);
|
|
837
|
+
const e = (a = this.host.querySelector("button.tab:not(.hide)")) == null ? void 0 : a.name;
|
|
838
|
+
e && ((s = this.hideEditorTabs) != null && s.includes(this.activeTab)) && (this.activeTab = e), this.updateFormState();
|
|
839
|
+
}
|
|
840
|
+
disconnectedCallback() {
|
|
841
|
+
b("[nylas-editor-tabs-group]", "disconnectedCallback");
|
|
842
|
+
}
|
|
843
|
+
handleValueChanged(e) {
|
|
844
|
+
b("[nylas-editor-tabs-group]", "handleValueChanged", e);
|
|
845
|
+
const { name: t, value: a } = e.detail;
|
|
846
|
+
console.log("name", t, "value", a), this.setFormState(a, t), this.formState = { ...this.formState }, nt.includes(t) && (this.hasUnsavedChanges = !0), this.error = "", this.schedulerEditorFormUpdated.emit({
|
|
847
|
+
value: e.detail.value,
|
|
848
|
+
name: e.detail.name
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
feedbackModalClosedHandler() {
|
|
852
|
+
this.showFeedbackModal = !1;
|
|
853
|
+
}
|
|
854
|
+
feedbackSubmittedHandler(e) {
|
|
855
|
+
var s, i;
|
|
856
|
+
const a = {
|
|
857
|
+
eventId: $e("Scheduler Editor User Feedback"),
|
|
858
|
+
message: e.detail.feedback
|
|
859
|
+
};
|
|
860
|
+
Je(a, {
|
|
861
|
+
includeReplay: !0,
|
|
862
|
+
captureContext: {
|
|
863
|
+
tags: {
|
|
864
|
+
"nylas-web-element": "nylas-scheduler-editor",
|
|
865
|
+
"nylas-web-element-version": "1.4.1"
|
|
866
|
+
},
|
|
867
|
+
extra: {
|
|
868
|
+
configId: (s = this.selectedConfiguration) == null ? void 0 : s.id,
|
|
869
|
+
slug: (i = this.selectedConfiguration) == null ? void 0 : i.slug
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}), this.showFeedbackModal = !1;
|
|
873
|
+
}
|
|
874
|
+
importGroupEventHandler(e) {
|
|
875
|
+
var t;
|
|
876
|
+
this.groupEventImportTriggered.emit({ groupEvent: e.detail, configId: ((t = this.selectedConfiguration) == null ? void 0 : t.id) ?? "", host: this.host });
|
|
877
|
+
}
|
|
878
|
+
saveGroupEventChangesHandler(e) {
|
|
879
|
+
var s, i, o, l, r, d, c;
|
|
880
|
+
b("saveGroupEventChangesHandler", e.detail, this.selectedGroupEvent);
|
|
881
|
+
const t = this.formRef.checkValidity(), a = this.getGroupEventDetailsFromFormState();
|
|
882
|
+
if (this.resetError(), a.title || this.setError(new Error("Event title is required.")), (!((s = a.when) != null && s.start_time) || !((i = a.when) != null && i.end_time)) && this.setError(new Error("Event time is required.")), (o = a.participants) != null && o.length || this.setError(new Error("Participants are required.")), (l = a.participants) != null && l.length && ((r = a.participants) != null && r.some((y) => !y.email)) && this.setError(new Error("Participant email is required.")), this.error !== "" || !t) {
|
|
883
|
+
this.saveGroupEventChangesError.emit({
|
|
884
|
+
error: this.error ?? "An error occurred while saving changes.",
|
|
885
|
+
configId: ((d = this.selectedConfiguration) == null ? void 0 : d.id) ?? "",
|
|
886
|
+
host: this.host
|
|
887
|
+
});
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
this.groupEventUpdateTriggered.emit({
|
|
891
|
+
groupEvent: a,
|
|
892
|
+
chosenOption: e.detail.action,
|
|
893
|
+
configId: ((c = this.selectedConfiguration) == null ? void 0 : c.id) ?? "",
|
|
894
|
+
host: this.host
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
deleteGroupEventHandler(e) {
|
|
898
|
+
var a;
|
|
899
|
+
b("deleteGroupEventHandler", e.detail);
|
|
900
|
+
const t = this.getGroupEventDetailsFromFormState();
|
|
901
|
+
this.groupEventDeleteTriggered.emit({
|
|
902
|
+
groupEvent: t,
|
|
903
|
+
chosenOption: e.detail.action,
|
|
904
|
+
configId: ((a = this.selectedConfiguration) == null ? void 0 : a.id) ?? "",
|
|
905
|
+
host: this.host
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
createGroupEventHandler(e) {
|
|
909
|
+
var l, r, d, c, y, g, C;
|
|
910
|
+
const t = e.detail, a = {
|
|
911
|
+
name: ((l = this.currentUser) == null ? void 0 : l.name) ?? ((r = this.currentUser) == null ? void 0 : r.email) ?? "",
|
|
912
|
+
email: ((d = this.currentUser) == null ? void 0 : d.email) ?? ""
|
|
913
|
+
}, s = ((c = this.calendars) == null ? void 0 : c.find((E) => E.is_primary)) ?? ((y = this.calendars) == null ? void 0 : y[0]), i = ((g = this.formState) == null ? void 0 : g.conferencing) || t.conferencing, o = {
|
|
914
|
+
title: t.title,
|
|
915
|
+
description: t.description,
|
|
916
|
+
location: i ? void 0 : t.location,
|
|
917
|
+
participants: t.participants,
|
|
918
|
+
organizer: a,
|
|
919
|
+
conferencing: t.location ? void 0 : i,
|
|
920
|
+
when: t.eventTimeslot.when,
|
|
921
|
+
recurrence: t.eventTimeslot.recurrence,
|
|
922
|
+
calendar_id: (s == null ? void 0 : s.id) || "primary",
|
|
923
|
+
capacity: t.eventCapacity
|
|
924
|
+
};
|
|
925
|
+
this.groupEventCreateTriggered.emit({ groupEvent: o, configId: ((C = this.selectedConfiguration) == null ? void 0 : C.id) ?? "", host: this.host });
|
|
926
|
+
}
|
|
927
|
+
getGroupEventDetailsFromFormState() {
|
|
928
|
+
var g, C, E, z, P, H, S, U, I;
|
|
929
|
+
const e = ((g = this.calendars) == null ? void 0 : g.find((R) => R.is_primary)) ?? ((C = this.calendars) == null ? void 0 : C[0]), t = {
|
|
930
|
+
name: ((E = this.currentUser) == null ? void 0 : E.name) ?? ((z = this.currentUser) == null ? void 0 : z.email) ?? "",
|
|
931
|
+
email: ((P = this.currentUser) == null ? void 0 : P.email) ?? ""
|
|
932
|
+
}, a = [{ ...t, is_organizer: !0 }], { title: s, description: i, bookingCalendar: o, location: l, conferencing: r, eventCapacity: d, eventTimeslot: c, participants: y } = this.formState;
|
|
933
|
+
return {
|
|
934
|
+
title: s,
|
|
935
|
+
description: i,
|
|
936
|
+
location: r ? void 0 : l,
|
|
937
|
+
conferencing: l ? void 0 : r,
|
|
938
|
+
when: {
|
|
939
|
+
start_time: ((H = c == null ? void 0 : c.when) == null ? void 0 : H.start_time) ?? 0,
|
|
940
|
+
end_time: ((S = c == null ? void 0 : c.when) == null ? void 0 : S.end_time) ?? 0,
|
|
941
|
+
start_timezone: ((U = c == null ? void 0 : c.when) == null ? void 0 : U.start_timezone) ?? "",
|
|
942
|
+
end_timezone: ((I = c == null ? void 0 : c.when) == null ? void 0 : I.end_timezone) ?? ""
|
|
943
|
+
},
|
|
944
|
+
recurrence: (c == null ? void 0 : c.recurrence) ?? [],
|
|
945
|
+
calendar_id: o || (e == null ? void 0 : e.id) || "primary",
|
|
946
|
+
participants: y != null && y.length ? y : a,
|
|
947
|
+
organizer: t,
|
|
948
|
+
capacity: d || 10
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
getFormStateFromConfig(e) {
|
|
952
|
+
var t, a, s, i, o, l, r, d, c, y, g, C, E;
|
|
953
|
+
return e != null && e.appearance && console.info("Appearance settings have been returned from the given configuration; please remember to grab them from the configSettingsLoaded event and apply them as desired."), {
|
|
954
|
+
additionalFields: ((t = e == null ? void 0 : e.scheduler) == null ? void 0 : t.additional_fields) ?? {},
|
|
955
|
+
bookingType: ((a = e == null ? void 0 : e.group_booking) == null ? void 0 : a.booking_type) ?? "booking",
|
|
956
|
+
cancellationPolicy: ((s = e == null ? void 0 : e.scheduler) == null ? void 0 : s.cancellation_policy) ?? "",
|
|
957
|
+
minCancellationNotice: ((i = e == null ? void 0 : e.scheduler) == null ? void 0 : i.min_cancellation_notice) ?? 0,
|
|
958
|
+
hideCancellationOptions: ((o = e == null ? void 0 : e.scheduler) == null ? void 0 : o.hide_cancellation_options) ?? !1,
|
|
959
|
+
hideReschedulingOptions: ((l = e == null ? void 0 : e.scheduler) == null ? void 0 : l.hide_rescheduling_options) ?? !1,
|
|
960
|
+
reminders: (r = e == null ? void 0 : e.group_booking) == null ? void 0 : r.reminders,
|
|
961
|
+
emailTemplate: (d = e == null ? void 0 : e.scheduler) == null ? void 0 : d.email_template,
|
|
962
|
+
redirectUrl: (c = e == null ? void 0 : e.scheduler) == null ? void 0 : c.confirmation_redirect_url,
|
|
963
|
+
slug: e == null ? void 0 : e.slug,
|
|
964
|
+
appearance: e == null ? void 0 : e.appearance,
|
|
965
|
+
name: e == null ? void 0 : e.name,
|
|
966
|
+
bookingCalendar: (y = e == null ? void 0 : e.group_booking) == null ? void 0 : y.calendar_id,
|
|
967
|
+
disableEmails: (g = e == null ? void 0 : e.group_booking) == null ? void 0 : g.disable_emails,
|
|
968
|
+
organizerLocale: (E = (C = e == null ? void 0 : e.scheduler) == null ? void 0 : C.email_template) == null ? void 0 : E.organizer_locale
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
setFormState(e, t) {
|
|
972
|
+
switch (t) {
|
|
973
|
+
case "title":
|
|
974
|
+
this.formState.title = e.toString();
|
|
975
|
+
break;
|
|
976
|
+
case "description":
|
|
977
|
+
this.formState.description = e.toString();
|
|
978
|
+
break;
|
|
979
|
+
case "location":
|
|
980
|
+
this.formState.location = e.toString();
|
|
981
|
+
break;
|
|
982
|
+
case "conference":
|
|
983
|
+
this.formState.conferencing = JSON.parse(e.toString());
|
|
984
|
+
break;
|
|
985
|
+
case "confirmation-type":
|
|
986
|
+
this.formState.bookingType = e.toString();
|
|
987
|
+
break;
|
|
988
|
+
case "min-cancellation-notice":
|
|
989
|
+
this.formState.minCancellationNotice = parseInt(e.toString());
|
|
990
|
+
break;
|
|
991
|
+
case "cancellation-policy":
|
|
992
|
+
this.formState.cancellationPolicy = e.toString();
|
|
993
|
+
break;
|
|
994
|
+
case "customize-booking-settings": {
|
|
995
|
+
const a = JSON.parse(e.toString());
|
|
996
|
+
this.formState.hideCancellationOptions = a.hideCancellationOptions, this.formState.hideReschedulingOptions = a.hideReschedulingOptions;
|
|
997
|
+
break;
|
|
998
|
+
}
|
|
999
|
+
case "booking-calendar":
|
|
1000
|
+
this.formState.bookingCalendar = e.toString();
|
|
1001
|
+
break;
|
|
1002
|
+
case "event-capacity":
|
|
1003
|
+
this.formState.eventCapacity = parseInt(String(e));
|
|
1004
|
+
break;
|
|
1005
|
+
case "additional-fields":
|
|
1006
|
+
this.formState.additionalFields = JSON.parse(e.toString());
|
|
1007
|
+
break;
|
|
1008
|
+
case "confirmation-email-template":
|
|
1009
|
+
this.formState.emailTemplate = JSON.parse(e.toString());
|
|
1010
|
+
break;
|
|
1011
|
+
case "reminder-overrides":
|
|
1012
|
+
this.formState.reminders = JSON.parse(e.toString());
|
|
1013
|
+
break;
|
|
1014
|
+
case "confirmation-redirect":
|
|
1015
|
+
this.formState.redirectUrl = e.toString();
|
|
1016
|
+
break;
|
|
1017
|
+
case "custom-event-slug":
|
|
1018
|
+
console.debug("custom-event-slug", e), this.formState.slug = JSON.parse(e.toString());
|
|
1019
|
+
break;
|
|
1020
|
+
case "page-styling":
|
|
1021
|
+
this.formState.appearance = JSON.parse(e.toString());
|
|
1022
|
+
break;
|
|
1023
|
+
case "page-name":
|
|
1024
|
+
this.formState.name = JSON.parse(e.toString());
|
|
1025
|
+
break;
|
|
1026
|
+
case "participants": {
|
|
1027
|
+
const a = JSON.parse(e.toString());
|
|
1028
|
+
this.formState.participants = a.map((s) => ({
|
|
1029
|
+
name: s.name,
|
|
1030
|
+
email: s.email,
|
|
1031
|
+
is_organizer: s.is_organizer
|
|
1032
|
+
}));
|
|
1033
|
+
break;
|
|
1034
|
+
}
|
|
1035
|
+
case "event-timeslot":
|
|
1036
|
+
this.formState.eventTimeslot = JSON.parse(e.toString());
|
|
1037
|
+
break;
|
|
1038
|
+
case "disable-emails": {
|
|
1039
|
+
const { disableEmails: a, organizerLocale: s } = JSON.parse(e.toString());
|
|
1040
|
+
this.formState.disableEmails = a, this.formState.organizerLocale = s;
|
|
1041
|
+
break;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
this.schedulerEditorFormUpdated.emit({
|
|
1045
|
+
value: e,
|
|
1046
|
+
name: t
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1049
|
+
updateFormState() {
|
|
1050
|
+
return new FormData(this.formRef).forEach((t, a) => {
|
|
1051
|
+
this.setFormState(t, a);
|
|
1052
|
+
}), this.formState = { ...this.formState }, this.formState;
|
|
1053
|
+
}
|
|
1054
|
+
setActiveTab(e, t) {
|
|
1055
|
+
e.preventDefault(), this.updateFormState(), this.activeTab = t;
|
|
1056
|
+
}
|
|
1057
|
+
hideTab(e) {
|
|
1058
|
+
var t;
|
|
1059
|
+
return ((t = this.hideEditorTabs) == null ? void 0 : t.includes(e)) || !1;
|
|
1060
|
+
}
|
|
1061
|
+
onFeedbackClick(e) {
|
|
1062
|
+
e.preventDefault(), this.showFeedbackModal = !0;
|
|
1063
|
+
}
|
|
1064
|
+
render() {
|
|
1065
|
+
var e, t;
|
|
1066
|
+
return b("[nylas-editor-tabs-group]", "render", this.formState), n(re, { key: "295df515ac9d639344495598d31fe333db0486f8" }, n("form", { key: "77d72751aa0e09fb012af283b19c34c193250810", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (a) => this.formRef = a, noValidate: !0 }, this.mode === "app" ? n("div", { class: "return-to-calendar-view", part: "editor__return-to-calendar-view net__return-to-calendar-view" }, n("button-component", { id: "return-to-calendar-view-button", variant: "invisible", part: "nset__header__back-button", type: "button", onClick: (a) => {
|
|
1067
|
+
this.setActiveTab(a, h.CalendarView);
|
|
1068
|
+
} }, n("chevron-icon", { width: "16", height: "16" }), n("span", null, "Return to Calendar view"))) : null, this.mode === "app" ? n("div", { class: "form-contents", part: "editor__form-contents net__form-contents" }, n("div", { class: "tabs", part: "editor__tabs net__tabs" }, n("button", { name: h.BookingOptions, class: { tab: !0, active: this.activeTab == h.BookingOptions, hide: this.hideTab(h.BookingOptions) }, part: "editortab__booking-options net__tab-booking-options", onClick: (a) => this.setActiveTab(a, h.BookingOptions) }, n("flow-icon", { width: "16", height: "16" }), p.t("bookingOptionsTab")), n("button", { name: h.BookingForm, class: { tab: !0, active: this.activeTab == h.BookingForm, hide: this.hideTab(h.BookingForm) }, part: "editortab__booking-form net__tab-booking-form", onClick: (a) => this.setActiveTab(a, h.BookingForm) }, this.activeTab == h.BookingForm ? n("calendar-agenda-fill-icon", { width: "16", height: "16" }) : n("calendar-agenda-icon", { width: "16", height: "16" }), p.t("bookingFormTab")), n("button", { name: h.Communications, class: { tab: !0, active: this.activeTab == h.Communications, hide: this.hideTab(h.Communications) }, onClick: (a) => this.setActiveTab(a, h.Communications), part: "editortab__communications net__tab-communications" }, this.activeTab == h.Communications ? n("envelope-fill-icon", { width: "16", height: "16" }) : n("envelope-icon", { width: "16", height: "16" }), p.t("communicationsTab")), n("button", { name: h.PageStyles, class: { tab: !0, active: this.activeTab == h.PageStyles, hide: this.hideTab(h.PageStyles) }, onClick: (a) => this.setActiveTab(a, h.PageStyles), part: "editortab__page-styles net__tab-page-styles" }, this.activeTab == h.PageStyles ? n("paintbrush-fill-icon", { width: "16", height: "16" }) : n("paintbrush-icon", { width: "16", height: "16" }), p.t("pageStylesTab"))), n("div", { class: "tab-content", part: "editor__tab-content net__tab-content" }, n(ut, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((e = this.selectedConfiguration) == null ? void 0 : e.id) ?? "new", i18next: p }))) : n("div", { class: "composable", key: (t = this.selectedConfiguration) == null ? void 0 : t.id }, n("slot", null)), n("div", { key: "187e6f1c8b1e6ebd75e811c7c9245f8e6be5faee", class: "footer", part: "editor__footer net__footer" }, n("div", { key: "e777b3e032cb0fbf0517817f99c5d53879339e6d", class: "preview", part: "editor__footer-preview net__footer-preview" }, this.enableUserFeedback && n("button-component", { title: "Share your feedback", id: "report-issue", variant: "basic", onClick: (a) => this.onFeedbackClick(a) }, n("feedback-icon", null)), this.activeTab === h.CalendarView && n("button-component", { title: "Go to page settings", id: "page-settings", variant: "basic", onClick: (a) => this.setActiveTab(a, h.BookingOptions) }, "Page settings")), n("div", { key: "cfc06ab3f0cd113f59219feb50a0ae173ac816b7", class: "buttons", part: "editor__footer-buttons net__footer-buttons" }, n("p", { key: "5e85280a2bb1233afe6073b646a8d2dc4064b9b1", class: {
|
|
1069
|
+
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
1070
|
+
"saved-changes": this.changesSaved,
|
|
1071
|
+
error: this.error !== "",
|
|
1072
|
+
"error-full-width": this.error !== "" && this.action === "create"
|
|
1073
|
+
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved && this.activeTab !== h.CalendarView ? p.t("unsavedChangesLabel") : this.error == "" && this.changesSaved ? `${p.t("changesSavedLabel")}!` : ""), n("div", { key: "3b667f376c83d75a4c1e16f1a962168e49ca7864", class: "footer-buttons__row" }, this.schedulerPreviewLink !== "" && this.action === "edit" && n("button-component", { title: "Preview", type: "button", disabled: this.isLoading, clickHandler: (a) => {
|
|
1074
|
+
a.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(se(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
1075
|
+
}, variant: "basic" }, n("eye-icon", null)), n("button-component", { key: "df258b8799fdf69739be838ae633aa278e54580a", type: "button", disabled: this.isLoading, clickHandler: (a) => {
|
|
1076
|
+
a.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
1077
|
+
}, variant: "basic", part: "editor__footer-cancel net__footer-cancel" }, p.t("backButton")), n("button-component", { key: "5bdea575e4aa962ac968a02d80b47086e62a5873", type: "submit", disabled: this.isLoading, part: "editor__footer-cta, net__footer-cta" }, this.isLoading ? n("span", null, p.t("savingButtonText"), n("loading-icon", null), " ") : this.action === "create" ? `${p.t("createButtonText")}` : `${p.t("saveChangesButtonText")}`))))), this.showFeedbackModal && n("nylas-feedback-form", null));
|
|
1078
|
+
}
|
|
1079
|
+
get host() {
|
|
1080
|
+
return le(this);
|
|
1081
|
+
}
|
|
1082
|
+
static get watchers() {
|
|
1083
|
+
return {
|
|
1084
|
+
selectedConfiguration: ["configChangedHandler"],
|
|
1085
|
+
selectedGroupEvent: ["selectedGroupEventChangedHandler"],
|
|
1086
|
+
currentUser: ["userChangedHandler"],
|
|
1087
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
};
|
|
1091
|
+
ft([
|
|
1092
|
+
de({
|
|
1093
|
+
name: "nylas-editor-tabs-group",
|
|
1094
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
1095
|
+
["schedulerConfig.calendars", "calendars"],
|
|
1096
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
1097
|
+
["schedulerConfig.currentUser", "currentUser"],
|
|
1098
|
+
["schedulerConfig.configurations", "configurations"],
|
|
1099
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"],
|
|
1100
|
+
["schedulerConfig.selectedEventType", "selectedEventType"],
|
|
1101
|
+
["schedulerConfig.selectedGroupEvent", "selectedGroupEvent"]
|
|
1102
|
+
]),
|
|
1103
|
+
eventToProps: {
|
|
1104
|
+
schedulerConfigChanged: async (e, t) => {
|
|
1105
|
+
const { resetLoadingState: a, host: s, action: i, config: o, groupEvent: l } = e.detail, r = (d) => {
|
|
1106
|
+
const [c, y] = d;
|
|
1107
|
+
!c && y ? s.setError(y) : c && !y && i === "create" && s.schedulerConfigCreatedEventHandler({ config: c, action: i, host: s });
|
|
1108
|
+
};
|
|
1109
|
+
if (i === "edit") {
|
|
1110
|
+
const d = await t.schedulerConfig.updateConfiguration(o);
|
|
1111
|
+
r(d), a && a(e);
|
|
1112
|
+
} else {
|
|
1113
|
+
const d = await t.schedulerConfig.createConfiguration(o);
|
|
1114
|
+
r(d);
|
|
1115
|
+
const [c, y] = d, g = c == null ? void 0 : c.id;
|
|
1116
|
+
if (g && l) {
|
|
1117
|
+
const C = await t.schedulerConfig.createGroupEvent(l, g);
|
|
1118
|
+
r(C);
|
|
1119
|
+
}
|
|
1120
|
+
a && a(e);
|
|
1121
|
+
}
|
|
1122
|
+
},
|
|
1123
|
+
cancelButtonClick: async (e, t) => {
|
|
1124
|
+
t.schedulerConfigStore.state.action = null, t.schedulerConfigStore.set("selectedEventType", void 0), t.schedulerConfigStore.set("selectedGroupEvent", void 0), t.schedulerConfigStore.set("groupEvents", []);
|
|
1125
|
+
},
|
|
1126
|
+
previewButtonClicked: async (e, t) => {
|
|
1127
|
+
b("[nylas-editor-tabs-group]", "previewButtonClicked", t);
|
|
1128
|
+
},
|
|
1129
|
+
formSubmitted: async (e, t) => {
|
|
1130
|
+
b("[nylas-editor-tabs-group]", "formSubmitted", t);
|
|
1131
|
+
},
|
|
1132
|
+
schedulerEditorFormUpdated: async (e, t) => {
|
|
1133
|
+
b("[nylas-editor-tabs-group]", "schedulerEditorFormUpdated", e);
|
|
1134
|
+
},
|
|
1135
|
+
schedulerConfigCreated: async (e, t) => {
|
|
1136
|
+
b("[nylas-editor-tabs-group]", "schedulerConfigCreated", e);
|
|
1137
|
+
},
|
|
1138
|
+
groupEventUpdateTriggered: async (e, t) => {
|
|
1139
|
+
const { groupEvent: a, host: s, chosenOption: i, configId: o } = e.detail, l = await t.schedulerConfig.updateGroupEvent(a, i, o), [r, d] = l;
|
|
1140
|
+
!r && d && s.setError(d);
|
|
1141
|
+
},
|
|
1142
|
+
groupEventDeleteTriggered: async (e, t) => {
|
|
1143
|
+
const { groupEvent: a, chosenOption: s, configId: i, host: o } = e.detail, l = await t.schedulerConfig.deleteGroupEvent(a, s, i), [r, d] = l;
|
|
1144
|
+
!r && d && o.setError(d);
|
|
1145
|
+
},
|
|
1146
|
+
groupEventCreateTriggered: async (e, t) => {
|
|
1147
|
+
const { groupEvent: a, configId: s, host: i } = e.detail, o = await t.schedulerConfig.createGroupEvent(a, s), [l, r] = o;
|
|
1148
|
+
!l && r && i.setError(r);
|
|
1149
|
+
},
|
|
1150
|
+
groupEventImportTriggered: async (e, t) => {
|
|
1151
|
+
const { groupEvent: a, configId: s, host: i } = e.detail, o = await t.schedulerConfig.importGroupEvent([a], s), [l, r] = o;
|
|
1152
|
+
if (!l && r && i.setError(r), l && l.import_failed && l.import_failed.length > 0) {
|
|
1153
|
+
const d = l.import_failed.map((c) => c.reason).join(`
|
|
1154
|
+
`);
|
|
1155
|
+
i.setError(new Error(d)), setTimeout(() => {
|
|
1156
|
+
i.resetError();
|
|
1157
|
+
}, 5e3);
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
saveGroupEventChangesError: async (e, t) => {
|
|
1161
|
+
const { error: a, host: s } = e.detail;
|
|
1162
|
+
b("[nylas-editor-tabs-group]", "saveGroupEventChangesError", a, s);
|
|
1163
|
+
}
|
|
1164
|
+
},
|
|
1165
|
+
localPropsToProp: /* @__PURE__ */ new Map([
|
|
1166
|
+
["schedulerPreviewLink", "schedulerPreviewLink"],
|
|
1167
|
+
["enableUserFeedback", "enableUserFeedback"],
|
|
1168
|
+
["hideEditorTabs", "hideEditorTabs"]
|
|
1169
|
+
]),
|
|
1170
|
+
fireRegisterEvent: !0
|
|
1171
|
+
}),
|
|
1172
|
+
ue("design:type", Function),
|
|
1173
|
+
ue("design:paramtypes", []),
|
|
1174
|
+
ue("design:returntype", void 0)
|
|
1175
|
+
], We.prototype, "render", null);
|
|
1176
|
+
We.style = yt;
|
|
1177
|
+
const gt = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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:16px;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;flex-direction:column;position:relative;overflow-y:hidden}.configurations .table-container{overflow-y:auto;flex:1}@media screen and (max-width: 768px){.configurations .table-container{min-height:624px}}.configurations .table-container table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations .table-container table.no-configurations{height:100%}.configurations .table-container table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations .table-container table tr.hide{display:none}.configurations .table-container table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations .table-container 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-container table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations .table-container table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations .table-container table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations .table-container table th,.configurations .table-container table td{text-align:left;padding:1rem;font-family:inherit}.configurations .table-container table .actions{display:flex;justify-content:flex-end;gap:1rem;text-align:right}@media screen and (max-width: 768px){.configurations .table-container table .actions{flex-direction:column;gap:0.5rem}}.configurations .table-container table .actions select-dropdown.last::part(sd_dropdown-content){bottom:54px}.configurations .table-container table .title{width:100%;max-width:300px}@media screen and (max-width: 768px){.configurations .table-container table .title{max-width:96px}}.configurations .table-container table .title div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.configurations .table-container table .title div.config-event-title{font-weight:600}.configurations .table-container table .title div.config-event-description{font-size:0.75rem}.configurations .pagination{padding:1rem;position:sticky;top:100%;display:flex;justify-content:flex-end;gap:0.5rem;background:white;width:calc(100% - 2rem);z-index:2}.configurations .pagination td.arrows{display:flex;justify-content:flex-end;gap:0.5rem}.configurations .pagination button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background-color:transparent;color:var(--nylas-base-800);cursor:pointer}.configurations .pagination button:hover:not(:disabled){border:1px solid var(--nylas-primary)}.configurations .pagination button:active{border:1px solid var(--nylas-base-800)}.configurations .pagination button:disabled{border:1px solid var(--nylas-base-100);background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.configurations .pagination button.right{transform:rotate(180deg)}.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}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){display:block;height:48px;padding:0px 16px 8px}@media screen and (max-width: 768px){select-dropdown::part(sd_dropdown-button){width:92px}}select-dropdown::part(sd_dropdown-content){width:120px;right:0}select-dropdown::part(sd_dropdown-labelhtml){display:flex;gap:0.5rem;align-items:center;color:var(--nylas-base-900)}select-dropdown::part(sd_dropdown-labelhtml):hover{color:var(--nylas-primary)}.card-wrapper{position:absolute;top:0;left:0;height:calc(100% + 4rem);width:-webkit-fill-available;width:-moz-available;width:fill-available;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.card-wrapper{justify-content:start;height:100%}}.card-modal{background:var(--nylas-base-0);display:flex;flex-direction:column;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);padding:32px;width:562px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.card-modal{width:auto;border-radius:0px}}.description.title-desc{margin-bottom:2rem}.description p{margin:0;font-size:18px;color:var(--nylas-base-600)}.footer{margin-top:1rem;padding-top:1rem;display:flex;justify-content:flex-end;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.close-button{width:100%;display:flex;justify-content:flex-end}.close-button button-component button{padding:0;height:auto}.close-button button-component button:hover{background-color:transparent !important}button-component{--dot-color:var(--nylas-base-700)}', mt = gt;
|
|
1178
|
+
var _t = function(e, t, a, s) {
|
|
1179
|
+
var i = arguments.length, o = i < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, l;
|
|
1180
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1181
|
+
o = Reflect.decorate(e, t, a, s);
|
|
1182
|
+
else
|
|
1183
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
1184
|
+
(l = e[r]) && (o = (i < 3 ? l(o) : i > 3 ? l(t, a, o) : l(t, a)) || o);
|
|
1185
|
+
return i > 3 && o && Object.defineProperty(t, a, o), o;
|
|
1186
|
+
}, he = function(e, t) {
|
|
1187
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1188
|
+
return Reflect.metadata(e, t);
|
|
1189
|
+
};
|
|
1190
|
+
const qe = class {
|
|
1191
|
+
constructor(e) {
|
|
1192
|
+
X(this, e), this.initListConfigurations = _(this, "initListConfigurations", 7), this.createButtonClick = _(this, "createButtonClick", 7), this.editButtonClick = _(this, "editButtonClick", 7), this.deleteButtonClick = _(this, "deleteButtonClick", 7), this.configurations = [], this.selectedLanguage = void 0, this.schedulerPreviewLink = "", this.listConfigurationsNextCursor = void 0, this.state = "loading", this.error = "", this.currentCursor = null, this.previousCursors = [], this.disableNextPageButton = !1, this.deleteConfigurationId = "", this.showDeleteButtonLoading = !1;
|
|
1193
|
+
}
|
|
1194
|
+
listConfigurationsNextCursorChangedHandler(e, t) {
|
|
1195
|
+
if (!e || e === t) {
|
|
1196
|
+
e === null && (this.disableNextPageButton = !0);
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
this.disableNextPageButton = !1, this.currentCursor = e;
|
|
1200
|
+
}
|
|
1201
|
+
selectedLanguageChangedHandler(e, t) {
|
|
1202
|
+
e !== t && p.changeLanguage(e);
|
|
1203
|
+
}
|
|
1204
|
+
connectedCallback() {
|
|
1205
|
+
b("[nylas-list-configurations]", "connectedCallback");
|
|
1206
|
+
}
|
|
1207
|
+
componentWillLoad() {
|
|
1208
|
+
b("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
|
|
1209
|
+
}
|
|
1210
|
+
componentDidLoad() {
|
|
1211
|
+
b("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit({
|
|
1212
|
+
host: this.host
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
disconnectedCallback() {
|
|
1216
|
+
b("[nylas-list-configurations]", "disconnectedCallback");
|
|
1217
|
+
}
|
|
1218
|
+
async handleNylasFormDropdownChanged(e) {
|
|
1219
|
+
var i;
|
|
1220
|
+
b("[nylas-list-configurations]", "handleNylasFormDropdownChanged", e.detail);
|
|
1221
|
+
const { value: t } = e.detail, [a, s] = t.split("-");
|
|
1222
|
+
switch (e.preventDefault(), a) {
|
|
1223
|
+
case "delete":
|
|
1224
|
+
this.deleteConfigurationId = (i = this.configurations[s]) == null ? void 0 : i.id;
|
|
1225
|
+
break;
|
|
1226
|
+
case "preview":
|
|
1227
|
+
window.open(se(this.schedulerPreviewLink, this.configurations[s]), "_blank");
|
|
1228
|
+
break;
|
|
1229
|
+
case "copy":
|
|
1230
|
+
await navigator.clipboard.writeText(se(this.schedulerPreviewLink, this.configurations[s]));
|
|
1231
|
+
break;
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
async registerCallback() {
|
|
1235
|
+
this.initListConfigurations.emit({
|
|
1236
|
+
host: this.host
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
1239
|
+
async getState() {
|
|
1240
|
+
return this.state;
|
|
1241
|
+
}
|
|
1242
|
+
async setState(e) {
|
|
1243
|
+
this.state = e;
|
|
1244
|
+
}
|
|
1245
|
+
async setError(e) {
|
|
1246
|
+
this.error = e;
|
|
1247
|
+
}
|
|
1248
|
+
async hideDeleteConfirmation() {
|
|
1249
|
+
this.deleteConfigurationId = "", this.showDeleteButtonLoading = !1;
|
|
1250
|
+
}
|
|
1251
|
+
closeModal(e) {
|
|
1252
|
+
e.preventDefault(), this.deleteConfigurationId = "";
|
|
1253
|
+
}
|
|
1254
|
+
handleConfirmDeleteButtonClicked(e) {
|
|
1255
|
+
e.preventDefault(), this.showDeleteButtonLoading = !0;
|
|
1256
|
+
const t = this.configurations.find((a) => a.id === this.deleteConfigurationId);
|
|
1257
|
+
t && (t != null && t.id) && this.deleteButtonClick.emit({ host: this.host, configuration: t });
|
|
1258
|
+
}
|
|
1259
|
+
getDurationString(e) {
|
|
1260
|
+
if (!e)
|
|
1261
|
+
return "—";
|
|
1262
|
+
const t = Math.floor(e / 60), a = e % 60;
|
|
1263
|
+
return `${t || ""} ${t ? `${t > 1 ? "hours" : "hour"}` : ""} ${a || ""} ${a ? `${a > 1 ? "mins" : "min"}` : ""}`;
|
|
1264
|
+
}
|
|
1265
|
+
getActionLabelHTML(e) {
|
|
1266
|
+
const t = {
|
|
1267
|
+
display: "inline-flex",
|
|
1268
|
+
alignItems: "center",
|
|
1269
|
+
gap: "0.5rem"
|
|
1270
|
+
}, a = {
|
|
1271
|
+
color: "var(--nylas-error)"
|
|
1272
|
+
};
|
|
1273
|
+
switch (e) {
|
|
1274
|
+
case "preview":
|
|
1275
|
+
return n("span", { style: t }, n("eye-icon", { width: "16", height: "16" }), p.t("nylasListConfigurations.previewButtonText"));
|
|
1276
|
+
case "copy":
|
|
1277
|
+
return n("span", { style: t }, n("copy-icon", { width: "16", height: "16" }), p.t("nylasListConfigurations.copyLinkButtonText"));
|
|
1278
|
+
case "delete":
|
|
1279
|
+
return n("span", { style: { ...t, ...a } }, n("delete-icon", { width: "15", height: "17" }), p.t("nylasListConfigurations.deleteButtonText"));
|
|
1280
|
+
default:
|
|
1281
|
+
return "";
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
previousPageClickedHandler() {
|
|
1285
|
+
if (this.previousCursors.length === 0)
|
|
1286
|
+
return;
|
|
1287
|
+
this.currentCursor = this.previousCursors.pop() || null;
|
|
1288
|
+
const e = this.previousCursors[this.previousCursors.length - 1] || void 0;
|
|
1289
|
+
this.initListConfigurations.emit({
|
|
1290
|
+
host: this.host,
|
|
1291
|
+
cursor: e
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
nextPageClickedHandler() {
|
|
1295
|
+
this.currentCursor && (this.previousCursors = [...this.previousCursors, this.currentCursor], this.initListConfigurations.emit({
|
|
1296
|
+
host: this.host,
|
|
1297
|
+
cursor: this.currentCursor
|
|
1298
|
+
}));
|
|
1299
|
+
}
|
|
1300
|
+
render() {
|
|
1301
|
+
var e;
|
|
1302
|
+
return n(re, null, n("div", { class: "header" }, n("div", { class: "description" }, n("h2", null, p.t("allSchedulingPages")), n("p", null, p.t("createAndManageSchedulingPages"))), this.configurations && this.configurations.length > 0 && n("div", { class: "actions" }, n("button-component", { part: "nlc__create-new-cta", clickHandler: () => {
|
|
1303
|
+
this.createButtonClick.emit(this.host);
|
|
1304
|
+
} }, p.t("createNewSchedulingPageButtonText")))), n("div", { class: "configurations" }, n("div", { class: "table-container" }, n("table", { class: {
|
|
1305
|
+
"no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
|
|
1306
|
+
} }, n("tr", { class: {
|
|
1307
|
+
hide: this.state === "loading" || this.configurations && this.configurations.length === 0
|
|
1308
|
+
} }, n("th", null, p.t("pageTitle")), n("th", null, p.t("durationTitle")), n("th", null)), this.state === "loading" && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("h3", null, p.t("loading"), "..."), n("p", null, p.t("loadingPagesDescription"))))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("calendar-icon", { width: "48", height: "48" }), n("h3", null, p.t("noSchedulingPages")), n("p", null, p.t("createFirstSchedulingPage")), n("button-component", { part: "nlc__create-new-cta", clickHandler: () => {
|
|
1309
|
+
this.createButtonClick.emit(this.host);
|
|
1310
|
+
} }, p.t("createNewSchedulingPageButtonText"))))), this.state !== "loading" && ((e = this.configurations) == null ? void 0 : e.map((t, a) => {
|
|
1311
|
+
var l, r, d, c;
|
|
1312
|
+
const s = (a === this.configurations.length - 1 || a === this.configurations.length - 2) && this.configurations.length > 3, i = t, o = t;
|
|
1313
|
+
return n("tr", { key: t == null ? void 0 : t.id }, n("td", null, n("div", { class: "title" }, n("div", { class: "config-event-title", title: (l = o == null ? void 0 : o.event_booking) == null ? void 0 : l.title }, ((r = o == null ? void 0 : o.event_booking) == null ? void 0 : r.title) || (i == null ? void 0 : i.name)), n("div", { class: "config-event-description" }, (d = o == null ? void 0 : o.event_booking) == null ? void 0 : d.description))), n("td", null, n("div", { class: "duration" }, this.getDurationString((c = o == null ? void 0 : o.availability) == null ? void 0 : c.duration_minutes))), n("td", null, n("div", { class: "actions" }, n("button-component", { variant: "basic", key: `edit-${a}`, clickHandler: (y) => {
|
|
1314
|
+
y.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: t });
|
|
1315
|
+
} }, n("edit-icon", { width: "16", height: "16" }), p.t("editSchedulingPageButtonText")), n("select-dropdown", { class: {
|
|
1316
|
+
last: s
|
|
1317
|
+
}, name: "actions", options: [
|
|
1318
|
+
{ value: `preview-${a}`, label: "Preview", labelHTML: this.getActionLabelHTML("preview") },
|
|
1319
|
+
{ value: `copy-${a}`, label: "Copy link", labelHTML: this.getActionLabelHTML("copy") },
|
|
1320
|
+
{ value: `delete-${a}`, label: "Delete", labelHTML: this.getActionLabelHTML("delete") }
|
|
1321
|
+
], defaultSelectedOption: { value: "", label: "" }, dropdownButtonText: "...", withSearch: !1, withChevron: !1, exportparts: "sd_dropdown: actions__dropdown, sd_dropdown-button: actions__dropdown-button, sd_dropdown-content: actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete" }))));
|
|
1322
|
+
})))), n("div", { class: "pagination" }, n("button", { class: "arrow left", onClick: () => this.previousPageClickedHandler(), disabled: this.previousCursors.length <= 0 }, n("chevron-icon", null)), n("button", { class: "arrow right", onClick: () => this.nextPageClickedHandler(), disabled: this.disableNextPageButton }, n("chevron-icon", null)))), this.state === "error" && n("div", { class: "error-container" }, n("p", { class: "error" }, this.error)), !!this.deleteConfigurationId && n("div", { class: "card-wrapper" }, n("div", { class: "card-modal" }, n("div", { class: "close-button" }, n("button-component", { tooltip: "Close", id: "close", variant: "invisible", onClick: (t) => this.closeModal(t), part: "nfbf__close-button" }, n("close-icon", null))), n("div", { class: "header" }, n("h2", { slot: "card-title", part: "nfbf__title" }, p.t("deleteSchedulingPageTitle"))), n("div", { class: "description title-desc" }, n("p", null, p.t("deleteSchedulingPageDescription"))), n("div", { class: {
|
|
1323
|
+
footer: !0
|
|
1324
|
+
} }, n("button-component", { variant: "basic", onClick: (t) => this.closeModal(t), part: "nfbf__button-outline nfbf__cancel-cta" }, `${p.t("deleteSchedulingPageCancelButton")}`), n("button-component", { variant: "destructive", onClick: (t) => this.handleConfirmDeleteButtonClicked(t), disabled: this.showDeleteButtonLoading, isLoading: this.showDeleteButtonLoading, part: "nfbf__button-outline nfbf__reschedule-cta" }, `${p.t("deleteSchedulingPageConfirmButton")}`)))));
|
|
1325
|
+
}
|
|
1326
|
+
get host() {
|
|
1327
|
+
return le(this);
|
|
1328
|
+
}
|
|
1329
|
+
static get watchers() {
|
|
1330
|
+
return {
|
|
1331
|
+
listConfigurationsNextCursor: ["listConfigurationsNextCursorChangedHandler"],
|
|
1332
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
1333
|
+
};
|
|
1334
|
+
}
|
|
1335
|
+
};
|
|
1336
|
+
_t([
|
|
1337
|
+
de({
|
|
1338
|
+
name: "nylas-list-configurations",
|
|
1339
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
1340
|
+
["schedulerConfig.configurations", "configurations"],
|
|
1341
|
+
["schedulerConfig.listConfigurationsNextCursor", "listConfigurationsNextCursor"],
|
|
1342
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"]
|
|
1343
|
+
]),
|
|
1344
|
+
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
1345
|
+
eventToProps: {
|
|
1346
|
+
initListConfigurations: async (e, t) => {
|
|
1347
|
+
const { host: a, cursor: s } = e.detail;
|
|
1348
|
+
await a.setState("loading");
|
|
1349
|
+
const [i, o] = await t.schedulerConfig.getConfigurations(s);
|
|
1350
|
+
if (!i && o && o.message) {
|
|
1351
|
+
await a.setState("error"), await a.setError(o.message);
|
|
1352
|
+
return;
|
|
1353
|
+
}
|
|
1354
|
+
await a.setState("loaded");
|
|
1355
|
+
},
|
|
1356
|
+
createButtonClick: async (e, t) => {
|
|
1357
|
+
var a;
|
|
1358
|
+
t.schedulerConfigStore.resetSelectedConfiguration(), (a = t.schedulerConfigStore.state.experimentalFeatures) != null && a.group_events ? t.schedulerConfigStore.state.action = "create-select" : t.schedulerConfigStore.state.action = "create";
|
|
1359
|
+
},
|
|
1360
|
+
deleteButtonClick: async (e, t) => {
|
|
1361
|
+
const { host: a, configuration: s } = e.detail, [i, o] = await t.schedulerConfig.deleteConfiguration(s.id);
|
|
1362
|
+
!i && o && o.message && (await a.setState("error"), await a.setError(o.message)), await a.hideDeleteConfirmation();
|
|
1363
|
+
},
|
|
1364
|
+
editButtonClick: async (e, t) => {
|
|
1365
|
+
const { configuration: a } = e.detail;
|
|
1366
|
+
if (t.schedulerConfigStore.state.selectedConfiguration = a, a.type === "group") {
|
|
1367
|
+
const { startTime: s, endTime: i } = et((/* @__PURE__ */ new Date()).toISOString(), "week");
|
|
1368
|
+
t.schedulerConfigStore.state.calendarViewDateRange = {
|
|
1369
|
+
start_time: s.toString(),
|
|
1370
|
+
end_time: i.toString()
|
|
1371
|
+
};
|
|
1372
|
+
const [o, l] = await t.schedulerConfig.getGroupEvents(a.id);
|
|
1373
|
+
if (!o && l && l.message)
|
|
1374
|
+
return;
|
|
1375
|
+
}
|
|
1376
|
+
t.schedulerConfigStore.state.action = "edit";
|
|
1377
|
+
}
|
|
1378
|
+
},
|
|
1379
|
+
fireRegisterEvent: !0
|
|
1380
|
+
}),
|
|
1381
|
+
he("design:type", Function),
|
|
1382
|
+
he("design:paramtypes", []),
|
|
1383
|
+
he("design:returntype", void 0)
|
|
1384
|
+
], qe.prototype, "render", null);
|
|
1385
|
+
qe.style = mt;
|
|
1386
|
+
const vt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-select-event-type{height:inherit;overflow-y:auto}.nylas-select-event-type div.header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--nylas-base-200)}.nylas-select-event-type div.header h2{font-size:18px;padding:0 24px;line-height:24px;margin:0;font-weight:600;color:var(--nylas-base-800)}.nylas-select-event-type div.header button-component button{background:transparent;border:none;cursor:pointer}.nylas-select-event-type div.header button-component button:hover,.nylas-select-event-type div.header button-component button:active{color:var(--nylas-primary);background-color:transparent}.nylas-select-event-type div.header button-component button:disabled{cursor:not-allowed}.nylas-select-event-type div.content{padding:40px}.nylas-select-event-type div.content h3{margin:0 0 32px 0;font-size:18px;line-height:24px;font-weight:600}.nylas-select-event-type div.content div.event-type{display:flex;flex-direction:column;gap:8px}.nylas-select-event-type div.content div.event-type div.event-type-option{padding:16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-3x);width:inherit;cursor:pointer;display:flex;flex-direction:column;gap:8px}.nylas-select-event-type div.content div.event-type div.event-type-option h4{margin:0;font-size:16px;line-height:24px;font-weight:600;color:var(--nylas-base-900)}.nylas-select-event-type div.content div.event-type div.event-type-option p{margin:0;font-size:14px;line-height:21px;font-weight:400;color:var(--nylas-base-800)}', wt = vt;
|
|
1387
|
+
var kt = function(e, t, a, s) {
|
|
1388
|
+
var i = arguments.length, o = i < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, l;
|
|
1389
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1390
|
+
o = Reflect.decorate(e, t, a, s);
|
|
1391
|
+
else
|
|
1392
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
1393
|
+
(l = e[r]) && (o = (i < 3 ? l(o) : i > 3 ? l(t, a, o) : l(t, a)) || o);
|
|
1394
|
+
return i > 3 && o && Object.defineProperty(t, a, o), o;
|
|
1395
|
+
}, ye = function(e, t) {
|
|
1396
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1397
|
+
return Reflect.metadata(e, t);
|
|
1398
|
+
};
|
|
1399
|
+
const Ye = class {
|
|
1400
|
+
constructor(e) {
|
|
1401
|
+
X(this, e), this.returnToAllSchedulingPagesEvent = _(this, "returnToAllSchedulingPagesEvent", 7), this.createEventTypeSelected = _(this, "createEventTypeSelected", 7), this.participantOptions = void 0, this.name = "select-event-type", this.selectedLanguage = void 0;
|
|
1402
|
+
}
|
|
1403
|
+
connectedCallback() {
|
|
1404
|
+
b("nylas-select-event-type", "connectedCallback");
|
|
1405
|
+
}
|
|
1406
|
+
disconnectedCallback() {
|
|
1407
|
+
b("nylas-select-event-type", "disconnectedCallback");
|
|
1408
|
+
}
|
|
1409
|
+
componentWillLoad() {
|
|
1410
|
+
b("nylas-select-event-type", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
1411
|
+
}
|
|
1412
|
+
componentDidLoad() {
|
|
1413
|
+
b("nylas-select-event-type", "componentDidLoad");
|
|
1414
|
+
}
|
|
1415
|
+
elementNameChangedHandler(e) {
|
|
1416
|
+
b("nylas-select-event-type", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
1417
|
+
}
|
|
1418
|
+
selectedLanguageChangedHandler(e, t) {
|
|
1419
|
+
e !== t && p.changeLanguage(e);
|
|
1420
|
+
}
|
|
1421
|
+
render() {
|
|
1422
|
+
var i;
|
|
1423
|
+
const e = [
|
|
1424
|
+
{ label: "1:1", value: O.one_on_one, description: "Allows 1:1 bookings" },
|
|
1425
|
+
{ label: "Collective", value: O.collective, description: "Allows n:1 bookings with additional participants" },
|
|
1426
|
+
{
|
|
1427
|
+
label: "Round-Robin Maximize Fairness",
|
|
1428
|
+
value: O.max_fairness,
|
|
1429
|
+
description: "Rotates through the list of participants you select, displaying the participant with the fewest recent bookings."
|
|
1430
|
+
},
|
|
1431
|
+
{
|
|
1432
|
+
label: "Round-Robin Maximize Availability",
|
|
1433
|
+
value: O.max_availability,
|
|
1434
|
+
description: "Rotates through the list of participants you select, prioritizing participants with the fewest recent bookings, but making as many time-slots available as possible."
|
|
1435
|
+
},
|
|
1436
|
+
{ label: "Group / Class", value: O.group, description: "These are events which generally have one organizer and multiple participants" }
|
|
1437
|
+
], t = this.participantOptions && ((i = this.participantOptions) == null ? void 0 : i.length) > 0 && !!this.participantOptions[0].email && !!this.participantOptions[0].name && !!this.participantOptions[0].calendars && this.participantOptions[0].calendars.length > 0, a = [O.collective, O.max_availability, O.max_fairness], s = [O.one_on_one, O.group];
|
|
1438
|
+
return n(re, { key: "d5aed715d0b33063596b250da816b617301f16f0" }, n("div", { key: "679668eaf49d2f68f4338fd1c83f9a27875dec79", class: "nylas-select-event-type", part: "nset" }, n("div", { key: "0fa60b4547433bd2e4395c2d05942693eae00ce8", class: "header", part: "nset__header" }, n("h2", { key: "348d27d9e2398ef6cda24e53cc9127c7f7b627fe" }, "Create an event"), n("button-component", { key: "c4420cd4d2be87567c82178620fe14dbbe3babeb", variant: "invisible", part: "nset__header__back-button", onClick: (o) => {
|
|
1439
|
+
this.returnToAllSchedulingPagesEvent.emit();
|
|
1440
|
+
} }, n("chevron-icon", { key: "4d7c919f04de328e5ad064eb802f6faa86c67c97", width: "16", height: "16" }), n("span", { key: "40204db0d92e8d1a6458ac8ce23c25222345e8de" }, "Return to all scheduling pages"))), n("div", { key: "1bf550eefbb9819f85da9884365c29120d4fa5ab", class: "content", part: "nset__content" }, n("h3", { key: "5391f331fe9ffc538ffee32af02e8be056b9eb3b" }, "Event type"), n("div", { key: "fe6612a8ee555df7bdaabb0d500a4d6671b03192", class: "event-type", part: "nset__content__event-type" }, e.filter((o) => s.includes(o.value) || t && a.includes(o.value)).map((o) => n("div", { class: "event-type-option", onClick: (l) => {
|
|
1441
|
+
this.createEventTypeSelected.emit({ eventType: o.value });
|
|
1442
|
+
}, part: `nset__content__event-type-option-${o.value}` }, n("h4", null, o.label), n("p", null, o.description)))))));
|
|
1443
|
+
}
|
|
1444
|
+
get host() {
|
|
1445
|
+
return le(this);
|
|
1446
|
+
}
|
|
1447
|
+
static get watchers() {
|
|
1448
|
+
return {
|
|
1449
|
+
name: ["elementNameChangedHandler"],
|
|
1450
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
};
|
|
1454
|
+
kt([
|
|
1455
|
+
de({
|
|
1456
|
+
name: "nylas-select-event-type",
|
|
1457
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
1458
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"],
|
|
1459
|
+
["schedulerConfig.additionalParticipants", "participantOptions"]
|
|
1460
|
+
]),
|
|
1461
|
+
eventToProps: {
|
|
1462
|
+
returnToAllSchedulingPagesEvent: async (e, t) => {
|
|
1463
|
+
t.schedulerConfigStore.state.action = null, t.schedulerConfigStore.set("selectedEventType", void 0);
|
|
1464
|
+
},
|
|
1465
|
+
createEventTypeSelected: async (e, t) => {
|
|
1466
|
+
const { eventType: a } = e.detail;
|
|
1467
|
+
t.schedulerConfigStore.state.action = "create", t.schedulerConfigStore.state.selectedEventType = a;
|
|
1468
|
+
}
|
|
1469
|
+
},
|
|
1470
|
+
fireRegisterEvent: !0
|
|
1471
|
+
}),
|
|
1472
|
+
ye("design:type", Function),
|
|
1473
|
+
ye("design:paramtypes", []),
|
|
1474
|
+
ye("design:returntype", void 0)
|
|
1475
|
+
], Ye.prototype, "render", null);
|
|
1476
|
+
Ye.style = wt;
|
|
1477
|
+
export {
|
|
1478
|
+
st as google_logo_icon,
|
|
1479
|
+
lt as microsoft_logo_icon,
|
|
1480
|
+
Ze as nylas_editor_tabs,
|
|
1481
|
+
We as nylas_editor_tabs_group,
|
|
1482
|
+
qe as nylas_list_configurations,
|
|
1483
|
+
Ye as nylas_select_event_type
|
|
1484
|
+
};
|