@nylas/react 1.3.0 → 1.3.2
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.entry-d2b7178c.js → add-circle-icon.entry-0ea05c5b.js} +1 -1
- package/dist/{add-circle-icon.entry-0f0cd6d8.cjs → add-circle-icon.entry-10f2c319.cjs} +1 -1
- package/dist/{archive-icon.entry-ec25f93a.cjs → archive-icon.entry-7eeea6f4.cjs} +1 -1
- package/dist/{archive-icon.entry-602d3c58.js → archive-icon.entry-a0af58f2.js} +1 -1
- package/dist/{arrow-icon.entry-d4dd38b3.js → arrow-icon.entry-7fd7c18e.js} +1 -1
- package/dist/{arrow-icon.entry-7bcb6442.cjs → arrow-icon.entry-954f2ba8.cjs} +1 -1
- package/dist/{bold-icon.entry-5fc41386.js → bold-icon.entry-690ecac8.js} +1 -1
- package/dist/{bold-icon.entry-fc1d34a6.cjs → bold-icon.entry-e970c498.cjs} +1 -1
- package/dist/{button-component_2.entry-d62ae520.js → button-component_2.entry-b57d03fc.js} +1 -1
- package/dist/{button-component_2.entry-d23be43d.cjs → button-component_2.entry-b7d39903.cjs} +1 -1
- package/dist/{calendar-agenda-fill-icon_54.entry-1a42103a.js → calendar-agenda-fill-icon_53.entry-7792b45c.js} +448 -447
- package/dist/calendar-agenda-fill-icon_53.entry-89e5ac45.cjs +9 -0
- package/dist/{calendar-cancel-icon.entry-1566c286.js → calendar-cancel-icon.entry-5757c056.js} +1 -1
- package/dist/{calendar-cancel-icon.entry-bf9fc719.cjs → calendar-cancel-icon.entry-8cd02237.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-4c3e78a6.cjs → calendar-check-icon_2.entry-4f59d206.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-82407a92.js → calendar-check-icon_2.entry-6864b9d5.js} +1 -1
- package/dist/{calendar-icon.entry-359c064c.cjs → calendar-icon.entry-0b1edb49.cjs} +1 -1
- package/dist/{calendar-icon.entry-c3c23413.js → calendar-icon.entry-3798880d.js} +1 -1
- package/dist/checkbox-component_3.entry-10293364.cjs +1 -0
- package/dist/checkbox-component_3.entry-3d9fa7b5.js +140 -0
- package/dist/{chevron-icon_3.entry-a6189c37.js → chevron-icon_3.entry-43e83594.js} +11 -11
- package/dist/{chevron-icon_3.entry-2453084c.cjs → chevron-icon_3.entry-a5175d87.cjs} +1 -1
- package/dist/{clock-icon_4.entry-ad679142.js → clock-icon_4.entry-219733d8.js} +1 -1
- package/dist/{clock-icon_4.entry-5162dfec.cjs → clock-icon_4.entry-76751b46.cjs} +1 -1
- package/dist/{close-icon.entry-2c6cdf35.js → close-icon.entry-286fc5ca.js} +1 -1
- package/dist/{close-icon.entry-38dc2638.cjs → close-icon.entry-cecd3cdd.cjs} +1 -1
- package/dist/{constants-35df11e7-b37e3406.js → constants-54af2051-767e8462.js} +28 -4
- package/dist/{constants-35df11e7-d87ad6d9.cjs → constants-54af2051-a3596673.cjs} +1 -1
- package/dist/{copy-icon.entry-6630ce5a.js → copy-icon.entry-121dd297.js} +1 -1
- package/dist/{copy-icon.entry-79df1d0e.cjs → copy-icon.entry-d4835d9a.cjs} +1 -1
- package/dist/{delete-icon.entry-f9a265b6.cjs → delete-icon.entry-14249f70.cjs} +1 -1
- package/dist/{delete-icon.entry-716f906c.js → delete-icon.entry-497ac8a2.js} +1 -1
- package/dist/{document-refresh-icon.entry-bb91822a.cjs → document-refresh-icon.entry-c0eacb66.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-fa775295.js → document-refresh-icon.entry-f265bb1b.js} +1 -1
- package/dist/elements/index.d.ts +1 -0
- package/dist/{feedbackSync-adc893c2-5965d5ba.js → feedbackSync-e5cb0245-d84015c5.js} +1 -1
- package/dist/{feedbackSync-adc893c2-70d06afc.cjs → feedbackSync-e5cb0245-ea7ddac9.cjs} +1 -1
- package/dist/{folder-icon.entry-9cf7590f.js → folder-icon.entry-d22b3e80.js} +1 -1
- package/dist/{folder-icon.entry-82a02de7.cjs → folder-icon.entry-e4806f0a.cjs} +1 -1
- package/dist/{forward-icon.entry-034ec3be.cjs → forward-icon.entry-42b98c73.cjs} +1 -1
- package/dist/{forward-icon.entry-ebd5e108.js → forward-icon.entry-b6711af7.js} +1 -1
- package/dist/{globe-icon.entry-b67c68d5.cjs → globe-icon.entry-18605371.cjs} +1 -1
- package/dist/{globe-icon.entry-48837e22.js → globe-icon.entry-4c5d6be0.js} +1 -1
- package/dist/google-logo-icon_4.entry-007f2813.cjs +1 -0
- package/dist/{google-logo-icon_4.entry-819d7d0d.js → google-logo-icon_4.entry-c3bae7b7.js} +176 -168
- package/dist/{inbox-icon.entry-7f91d971.cjs → inbox-icon.entry-02c59267.cjs} +1 -1
- package/dist/{inbox-icon.entry-c611c154.js → inbox-icon.entry-ae4383af.js} +1 -1
- package/dist/{index-72501df0.js → index-ad112f6a.js} +167 -161
- package/dist/{index-92ba1b80.cjs → index-bbbc79ad.cjs} +17 -17
- package/dist/{index.es-28b1b2ec-5a87db22.js → index.es-e9d66a9b-62be34ce.js} +214 -211
- package/dist/{index.es-28b1b2ec-595c0513.cjs → index.es-e9d66a9b-a29322e0.cjs} +5 -5
- package/dist/{info-icon_2.entry-4ad69286.js → info-icon_2.entry-3f143408.js} +5 -5
- package/dist/{info-icon_2.entry-4c70ab61.cjs → info-icon_2.entry-d10f1df5.cjs} +1 -1
- package/dist/{input-color-picker.entry-46bf04e1.cjs → input-color-picker.entry-45caaa1d.cjs} +1 -1
- package/dist/{input-color-picker.entry-4e5760ce.js → input-color-picker.entry-8ce41f49.js} +1 -1
- package/dist/{input-component.entry-1019ce99.cjs → input-component.entry-37b106dc.cjs} +1 -1
- package/dist/{input-component.entry-dca1013f.js → input-component.entry-6db98fb0.js} +1 -1
- package/dist/{input-dropdown.entry-e535fb5e.cjs → input-dropdown.entry-1a2cdf40.cjs} +1 -1
- package/dist/{input-dropdown.entry-f14c59e7.js → input-dropdown.entry-ec3d04ad.js} +1 -1
- package/dist/{italic-icon.entry-2ab53839.js → italic-icon.entry-36d1e644.js} +1 -1
- package/dist/{italic-icon.entry-726cc194.cjs → italic-icon.entry-b5e4eec9.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-6820d249.cjs → multi-select-dropdown.entry-00e43a89.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-a097d3cb.js → multi-select-dropdown.entry-6f22740f.js} +1 -1
- package/dist/nylas-booked-event-card_12.entry-4f115674.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-ccd85ff4.js → nylas-booked-event-card_12.entry-cb6b2ce6.js} +428 -423
- package/dist/{nylas-form-card.entry-afdfee47.js → nylas-form-card.entry-07e46491.js} +11 -11
- package/dist/{nylas-form-card.entry-8eb47f3d.cjs → nylas-form-card.entry-e2749723.cjs} +1 -1
- package/dist/{nylas-if-state.entry-be7978de.cjs → nylas-if-state.entry-88e01248.cjs} +1 -1
- package/dist/{nylas-if-state.entry-7caad39f.js → nylas-if-state.entry-e34c5cbb.js} +2 -2
- package/dist/{nylas-login.entry-dcf85f93.js → nylas-login.entry-a30bbd87.js} +3 -3
- package/dist/{nylas-login.entry-bce4f689.cjs → nylas-login.entry-ab50ca6a.cjs} +1 -1
- package/dist/{nylas-provider.entry-97882e4b.js → nylas-provider.entry-070f8090.js} +5 -5
- package/dist/{nylas-provider.entry-f02017da.cjs → nylas-provider.entry-7f4a1520.cjs} +1 -1
- package/dist/{nylas-scheduler-editor.entry-dcfdd6bf.js → nylas-scheduler-editor.entry-23e68865.js} +12 -12
- package/dist/nylas-scheduler-editor.entry-287ca230.cjs +2 -0
- package/dist/{nylas-scheduling.entry-2b842e93.js → nylas-scheduling.entry-19fca55a.js} +10 -10
- package/dist/{nylas-scheduling.entry-e0e9c8e8.cjs → nylas-scheduling.entry-c882ee9a.cjs} +1 -1
- package/dist/nylas-time-window-picker_2.entry-3d24eec4.js +336 -0
- package/dist/nylas-time-window-picker_2.entry-9a216230.cjs +1 -0
- package/dist/{person-icon.entry-3ec67feb.js → person-icon.entry-a6d86572.js} +1 -1
- package/dist/{person-icon.entry-2f8e00fd.cjs → person-icon.entry-b26a199b.cjs} +1 -1
- package/dist/{play-icon.entry-1abf79e9.cjs → play-icon.entry-5fc66fe6.cjs} +1 -1
- package/dist/{play-icon.entry-a840bdca.js → play-icon.entry-87939760.js} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +73 -72
- package/dist/{refresh-icon.entry-af7f54b4.cjs → refresh-icon.entry-3a8ae0f6.cjs} +1 -1
- package/dist/{refresh-icon.entry-11fcb673.js → refresh-icon.entry-820111be.js} +1 -1
- package/dist/{register-component-75f530bc-0e4e3d7a.js → register-component-5d7bcc15-35e4a5a0.js} +12 -12
- package/dist/{register-component-75f530bc-61b6f2dd.cjs → register-component-5d7bcc15-d9900fbc.cjs} +1 -1
- package/dist/{reply-all-icon.entry-5c8b3356.js → reply-all-icon.entry-5fbf1103.js} +1 -1
- package/dist/{reply-all-icon.entry-cc2ad940.cjs → reply-all-icon.entry-864494e2.cjs} +1 -1
- package/dist/{reply-icon.entry-d048736f.js → reply-icon.entry-7c136d06.js} +1 -1
- package/dist/{reply-icon.entry-840acade.cjs → reply-icon.entry-93084ffd.cjs} +1 -1
- package/dist/{scheduler-config-store-ed4a8dfd-161a3efd.cjs → scheduler-config-store-ed4a8dfd-b2986359.cjs} +1 -1
- package/dist/{scheduler-config-store-ed4a8dfd-f74e58ae.js → scheduler-config-store-ed4a8dfd-f7f53255.js} +1 -1
- package/dist/scheduler-store-20151a77-2dfd28c2.cjs +1 -0
- package/dist/{scheduler-store-d84b82a0-11faba86.js → scheduler-store-20151a77-4f7ffb6f.js} +127 -124
- package/dist/{sent-icon.entry-987760ce.cjs → sent-icon.entry-18afc1f9.cjs} +1 -1
- package/dist/{sent-icon.entry-fd3b9ad9.js → sent-icon.entry-60f1b814.js} +1 -1
- package/dist/{spam-icon.entry-3ce4f9fc.cjs → spam-icon.entry-9d41427e.cjs} +1 -1
- package/dist/{spam-icon.entry-4665415c.js → spam-icon.entry-b580b108.js} +1 -1
- package/dist/{star-icon.entry-0f446ac7.js → star-icon.entry-7cbe5a81.js} +1 -1
- package/dist/{star-icon.entry-a3ba4703.cjs → star-icon.entry-8792026f.cjs} +1 -1
- package/dist/{stop-icon.entry-9c13e00a.cjs → stop-icon.entry-5b605364.cjs} +1 -1
- package/dist/{stop-icon.entry-72c964b2.js → stop-icon.entry-ae629874.js} +1 -1
- package/dist/{textarea-component.entry-ff04b5fa.cjs → textarea-component.entry-2dae13db.cjs} +1 -1
- package/dist/{textarea-component.entry-d414e219.js → textarea-component.entry-fa87a032.js} +2 -2
- package/dist/{time-period-selector.entry-53edc0ba.js → time-period-selector.entry-0de79682.js} +2 -2
- package/dist/{time-period-selector.entry-2ce3347a.cjs → time-period-selector.entry-b1f5523b.cjs} +1 -1
- package/dist/{translate-icon.entry-84a78b9a.js → translate-icon.entry-07e9c2cf.js} +1 -1
- package/dist/{translate-icon.entry-9bab13ad.cjs → translate-icon.entry-22ef3602.cjs} +1 -1
- package/dist/{trash-fill-icon.entry-2881a44c.js → trash-fill-icon.entry-81ee0fdf.js} +1 -1
- package/dist/{trash-fill-icon.entry-84f52290.cjs → trash-fill-icon.entry-d332cf5d.cjs} +1 -1
- package/dist/{underline-icon.entry-23eca319.js → underline-icon.entry-dce1c48b.js} +1 -1
- package/dist/{underline-icon.entry-5a8410ef.cjs → underline-icon.entry-e381e3d2.cjs} +1 -1
- package/dist/{warning-icon.entry-abf9e5dc.js → warning-icon.entry-76d03910.js} +1 -1
- package/dist/{warning-icon.entry-1966042d.cjs → warning-icon.entry-b55e52d0.cjs} +1 -1
- package/package.json +3 -3
- package/dist/calendar-agenda-fill-icon_54.entry-95ccb99e.cjs +0 -9
- package/dist/checkbox-component_2.entry-97e97789.js +0 -79
- package/dist/checkbox-component_2.entry-f974e789.cjs +0 -1
- package/dist/google-logo-icon_4.entry-b637470a.cjs +0 -1
- package/dist/nylas-booked-event-card_12.entry-c684905b.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-cc6f4060.cjs +0 -2
- package/dist/nylas-time-window-picker.entry-96f5fe9a.js +0 -316
- package/dist/nylas-time-window-picker.entry-a8780f2e.cjs +0 -1
- package/dist/scheduler-store-d84b82a0-7a7fe186.cjs +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { d as L, a as F, i as
|
|
1
|
+
import { d as L, a as F, i as d, j as R } from "./index-ad112f6a.js";
|
|
2
2
|
var B;
|
|
3
|
-
(function(
|
|
4
|
-
|
|
3
|
+
(function(o) {
|
|
4
|
+
o.Component = "component", o.Api = "api", o.Auth = "auth";
|
|
5
5
|
})(B || (B = {}));
|
|
6
6
|
var M;
|
|
7
|
-
(function(
|
|
8
|
-
|
|
7
|
+
(function(o) {
|
|
8
|
+
o.endtime_not_in_future = "endtime_not_in_future", o.no_booking_info = "no_booking_info", o.no_timeslot_selected = "no_timeslot_selected", o.no_timezone_selected = "no_timezone_selected", o.no_booking_id = "no_booking_id", o.no_salt = "no_salt", o.invalid_start_time = "invalid_start_time", o.invalid_end_time = "invalid_end_time", o.invalid_timezone = "invalid_timezone";
|
|
9
9
|
})(M || (M = {}));
|
|
10
|
-
var
|
|
11
|
-
(function(
|
|
12
|
-
|
|
13
|
-
})(
|
|
10
|
+
var $;
|
|
11
|
+
(function(o) {
|
|
12
|
+
o.invalid_session = "invalid_session", o.general_error = "general_error", o.internal_error = "internal_error", o.invalid_request_error = "invalid_request_error", o.timeslot_not_available = "timeslot_not_available", o.provider_error = "provider_error", o.not_found_error = "not_found_error";
|
|
13
|
+
})($ || ($ = {}));
|
|
14
14
|
class C {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.component = (e) => {
|
|
@@ -105,8 +105,8 @@ class C {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
class N {
|
|
108
|
-
constructor({ schedulerAPIURL: e, schedulerStore: t, sessionId: s, configId: i, slug:
|
|
109
|
-
this.errors = new C(), this.schedulerStore = t, this.schedulerAPIURL = e, this.sessionId = s, this.configId = i, this.slug =
|
|
108
|
+
constructor({ schedulerAPIURL: e, schedulerStore: t, sessionId: s, configId: i, slug: r, clientId: n }) {
|
|
109
|
+
this.errors = new C(), this.schedulerStore = t, this.schedulerAPIURL = e, this.sessionId = s, this.configId = i, this.slug = r, this.clientId = n;
|
|
110
110
|
}
|
|
111
111
|
getHeaders() {
|
|
112
112
|
return this.sessionId ? {
|
|
@@ -115,22 +115,22 @@ class N {
|
|
|
115
115
|
}
|
|
116
116
|
async makeAPIRequest(e, t, s, i = {}) {
|
|
117
117
|
try {
|
|
118
|
-
const
|
|
119
|
-
return
|
|
118
|
+
const r = new URL(this.schedulerAPIURL), n = "1.3.2";
|
|
119
|
+
return r.pathname = e, await (await fetch(decodeURIComponent(r.toString()), {
|
|
120
120
|
method: t,
|
|
121
121
|
headers: {
|
|
122
122
|
"Content-Type": "application/json",
|
|
123
123
|
Origin: window.location.origin,
|
|
124
124
|
"X-Source": "nylas-scheduling",
|
|
125
|
-
"X-Nylas-Web-Elements-Version":
|
|
125
|
+
"X-Nylas-Web-Elements-Version": n,
|
|
126
126
|
...i
|
|
127
127
|
},
|
|
128
128
|
body: s
|
|
129
129
|
})).json();
|
|
130
|
-
} catch (
|
|
130
|
+
} catch (r) {
|
|
131
131
|
return {
|
|
132
132
|
error: {
|
|
133
|
-
message:
|
|
133
|
+
message: r.message,
|
|
134
134
|
title: "API request failed",
|
|
135
135
|
type: "api"
|
|
136
136
|
}
|
|
@@ -138,9 +138,9 @@ class N {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
getErrorMessage(e) {
|
|
141
|
-
var s, i,
|
|
141
|
+
var s, i, r, n;
|
|
142
142
|
let t = (e == null ? void 0 : e.message) || (e == null ? void 0 : e.title) || "Something went wrong";
|
|
143
|
-
return (e == null ? void 0 : e.type) === "provider_error" && (t = ((i = (s = e == null ? void 0 : e.provider_error) == null ? void 0 : s.error) == null ? void 0 : i.message) || ((
|
|
143
|
+
return (e == null ? void 0 : e.type) === "provider_error" && (t = ((i = (s = e == null ? void 0 : e.provider_error) == null ? void 0 : s.error) == null ? void 0 : i.message) || ((n = (r = e == null ? void 0 : e.provider_error) == null ? void 0 : r.error) == null ? void 0 : n.title) || "Something went wrong"), t;
|
|
144
144
|
}
|
|
145
145
|
setConfigId(e) {
|
|
146
146
|
this.configId = e;
|
|
@@ -155,7 +155,7 @@ class N {
|
|
|
155
155
|
this.schedulerStore.set("selectedTimezone", e);
|
|
156
156
|
}
|
|
157
157
|
selectLanguage(e) {
|
|
158
|
-
this.schedulerStore.set("selectedLanguage", e),
|
|
158
|
+
this.schedulerStore.set("selectedLanguage", e), d.changeLanguage(e);
|
|
159
159
|
}
|
|
160
160
|
async toggleAdditionalData(e) {
|
|
161
161
|
e || await this.refetchAvailability(), this.schedulerStore.set("showBookingForm", e);
|
|
@@ -185,14 +185,14 @@ class N {
|
|
|
185
185
|
return await this.getAvailability(s, i);
|
|
186
186
|
}
|
|
187
187
|
async resetStoreStateAndFetchAvailability() {
|
|
188
|
-
const e = /* @__PURE__ */ new Date(), t = await this.refetchAvailability(), s = this.schedulerStore.get("availability").find((
|
|
188
|
+
const e = /* @__PURE__ */ new Date(), t = await this.refetchAvailability(), s = this.schedulerStore.get("availability").find((r) => new Date(r.start_time) > /* @__PURE__ */ new Date());
|
|
189
189
|
let i = e;
|
|
190
190
|
return s && (i = s.start_time), this.schedulerStore.set("selectedDate", i), this.schedulerStore.set("eventInfo", null), this.schedulerStore.set("showBookingForm", !1), this.schedulerStore.set("selectedTimeslot", null), t;
|
|
191
191
|
}
|
|
192
192
|
async setReschedule(e) {
|
|
193
193
|
this.schedulerStore.set("isLoading", !0);
|
|
194
194
|
const t = this.schedulerStore.state.eventInfo;
|
|
195
|
-
return t && this.schedulerStore.set("reschedulingEventInfo", t), this.schedulerStore.set("rescheduleBookingId", e), await this.resetStoreStateAndFetchAvailability().finally(() => {
|
|
195
|
+
return t && this.schedulerStore.set("reschedulingEventInfo", t), this.schedulerStore.set("rescheduleBookingId", e), await this.getUISettings(), await this.resetStoreStateAndFetchAvailability().finally(() => {
|
|
196
196
|
this.schedulerStore.set("isLoading", !1);
|
|
197
197
|
});
|
|
198
198
|
}
|
|
@@ -216,85 +216,88 @@ class N {
|
|
|
216
216
|
async bookTimeslot(e) {
|
|
217
217
|
var I;
|
|
218
218
|
this.schedulerStore.set("isLoading", !0);
|
|
219
|
-
const { selectedTimeslot: t, selectedTimezone: s, bookingInfo: i, selectedLanguage:
|
|
219
|
+
const { selectedTimeslot: t, selectedTimezone: s, bookingInfo: i, selectedLanguage: r } = this.schedulerStore.state;
|
|
220
220
|
if (!e && !i)
|
|
221
|
-
return { error: this.errors.component(
|
|
222
|
-
const
|
|
223
|
-
if (!
|
|
224
|
-
return { error: this.errors.component(
|
|
225
|
-
const
|
|
226
|
-
if (!
|
|
227
|
-
return { error: this.errors.component(
|
|
228
|
-
const
|
|
229
|
-
let
|
|
230
|
-
if (
|
|
231
|
-
const k = (
|
|
232
|
-
for (let f = 0; f <
|
|
233
|
-
if (k.includes(
|
|
234
|
-
|
|
221
|
+
return { error: this.errors.component(d.t("createBookingErrorTitle")).no_booking_info() };
|
|
222
|
+
const n = (e == null ? void 0 : e.timeslot) || t;
|
|
223
|
+
if (!n)
|
|
224
|
+
return { error: this.errors.component(d.t("createBookingErrorTitle")).no_timeslot_selected() };
|
|
225
|
+
const a = e && (e != null && e.timezone) ? e == null ? void 0 : e.timezone : s, l = r || "en-US";
|
|
226
|
+
if (!a)
|
|
227
|
+
return { error: this.errors.component(d.t("createBookingErrorTitle")).no_timezone_selected() };
|
|
228
|
+
const u = this.schedulerStore.get("availabilityOrderEmails");
|
|
229
|
+
let c = "";
|
|
230
|
+
if (u.length > 0) {
|
|
231
|
+
const k = (n == null ? void 0 : n.emails) || [];
|
|
232
|
+
for (let f = 0; f < u.length; f++)
|
|
233
|
+
if (k.includes(u[f])) {
|
|
234
|
+
c = u[f];
|
|
235
235
|
break;
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const h = {};
|
|
239
239
|
Object.entries((i == null ? void 0 : i.additionalFields) || {}).forEach(([k, f]) => {
|
|
240
|
-
|
|
240
|
+
h[k] = f.value;
|
|
241
241
|
});
|
|
242
|
-
const _ = e ? e == null ? void 0 : e.primaryParticipant : i == null ? void 0 : i.primaryParticipant, S = e ? (e == null ? void 0 : e.guests) || [] : (i == null ? void 0 : i.guests) || [], p = e ? e == null ? void 0 : e.additionalFields :
|
|
243
|
-
participants:
|
|
242
|
+
const _ = e ? e == null ? void 0 : e.primaryParticipant : i == null ? void 0 : i.primaryParticipant, S = e ? (e == null ? void 0 : e.guests) || [] : (i == null ? void 0 : i.guests) || [], p = e ? e == null ? void 0 : e.additionalFields : h, T = this.getHeaders(), v = `/v3/scheduling/bookings${!this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : ""}`, g = await this.makeAPIRequest(decodeURIComponent(v), "POST", JSON.stringify({
|
|
243
|
+
participants: c ? [{ email: c }] : void 0,
|
|
244
244
|
additional_fields: p,
|
|
245
245
|
additional_guests: S,
|
|
246
246
|
guest: { ..._ },
|
|
247
|
-
start_time:
|
|
248
|
-
end_time:
|
|
249
|
-
timezone:
|
|
250
|
-
email_language: this.getTwoLetterLanguageCode(
|
|
247
|
+
start_time: n.start_time.getTime() / 1e3,
|
|
248
|
+
end_time: n.end_time.getTime() / 1e3,
|
|
249
|
+
timezone: a,
|
|
250
|
+
email_language: this.getTwoLetterLanguageCode(l)
|
|
251
251
|
}), T);
|
|
252
|
-
if ("error" in
|
|
252
|
+
if ("error" in g) {
|
|
253
253
|
this.schedulerStore.set("isLoading", !1);
|
|
254
|
-
const k = (I =
|
|
255
|
-
let f =
|
|
254
|
+
const k = (I = g.error) == null ? void 0 : I.type;
|
|
255
|
+
let f = g.error;
|
|
256
256
|
if (k && k in this.errors.api("Create Booking")) {
|
|
257
257
|
const E = this.getErrorMessage(f);
|
|
258
258
|
f = this.errors.api("Create Booking")[k](E);
|
|
259
259
|
}
|
|
260
260
|
return { error: f };
|
|
261
261
|
}
|
|
262
|
-
return "data" in
|
|
262
|
+
return "data" in g && this.schedulerStore.set("eventInfo", g == null ? void 0 : g.data), this.schedulerStore.set("isLoading", !1), g;
|
|
263
263
|
}
|
|
264
264
|
async getUISettings() {
|
|
265
265
|
var n;
|
|
266
266
|
this.schedulerStore.set("isLoading", !0);
|
|
267
|
-
const e = this.
|
|
268
|
-
|
|
267
|
+
const e = this.schedulerStore.get("rescheduleBookingId"), t = this.getHeaders();
|
|
268
|
+
let s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "";
|
|
269
|
+
e && s ? s += `&booking_id=${e}` : e && (s += `?booking_id=${e}`);
|
|
270
|
+
const i = `/v3/scheduling/ui-settings${s}`, r = await this.makeAPIRequest(i, "GET", void 0, t);
|
|
271
|
+
if ("error" in r) {
|
|
269
272
|
this.schedulerStore.set("isLoading", !1);
|
|
270
|
-
const
|
|
271
|
-
let
|
|
272
|
-
return
|
|
273
|
+
const a = (n = r.error) == null ? void 0 : n.type;
|
|
274
|
+
let l = r.error;
|
|
275
|
+
return a && a in this.errors.api(d.t("getUISettingErrorTitle")) && (l = this.errors.api(d.t("getUISettingErrorTitle"))[a]((l == null ? void 0 : l.message) || (l == null ? void 0 : l.title) || "Something went wrong")), { error: l };
|
|
273
276
|
}
|
|
274
|
-
return "data" in
|
|
277
|
+
return "data" in r && this.schedulerStore.set("configSettings", r.data), this.schedulerStore.set("isLoading", !1), r;
|
|
275
278
|
}
|
|
276
279
|
getTwoLetterLanguageCode(e) {
|
|
277
280
|
return e.split("-")[0];
|
|
278
281
|
}
|
|
279
282
|
getStartTimeWithMinBookingNotice(e) {
|
|
280
|
-
var
|
|
281
|
-
const t = (
|
|
283
|
+
var r;
|
|
284
|
+
const t = (r = this.schedulerStore.get("configSettings")) == null ? void 0 : r.scheduler, s = t == null ? void 0 : t.min_booking_notice;
|
|
282
285
|
if (!s)
|
|
283
286
|
return e;
|
|
284
287
|
const i = (/* @__PURE__ */ new Date()).getTime();
|
|
285
288
|
return e < (i + s * 60 * 1e3) / 1e3 ? Math.floor((i + s * 60 * 1e3) / 1e3) : e;
|
|
286
289
|
}
|
|
287
290
|
getEndTimeForAvailableDaysInFuture(e) {
|
|
288
|
-
var
|
|
289
|
-
const t = /* @__PURE__ */ new Date(), s = (
|
|
291
|
+
var n, a;
|
|
292
|
+
const t = /* @__PURE__ */ new Date(), s = (a = (n = this.schedulerStore.get("configSettings")) == null ? void 0 : n.scheduler) == null ? void 0 : a.available_days_in_future, i = Math.floor(R(t, s).getTime() / 1e3);
|
|
290
293
|
return Math.min(i, e);
|
|
291
294
|
}
|
|
292
295
|
async getAvailability(e = 0, t = 0) {
|
|
293
296
|
var _, S, p, T;
|
|
294
297
|
this.schedulerStore.set("isLoading", !0);
|
|
295
|
-
const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(),
|
|
296
|
-
if (t && t <
|
|
297
|
-
return this.schedulerStore.set("isLoading", !1), { error: this.errors.component(
|
|
298
|
+
const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(), r = i.getTime();
|
|
299
|
+
if (t && t < r / 1e3)
|
|
300
|
+
return this.schedulerStore.set("isLoading", !1), { error: this.errors.component(d.t("getAvailabilityErrorTitle")).endtime_not_in_future() };
|
|
298
301
|
if (!e) {
|
|
299
302
|
const m = new Date(i.getFullYear(), i.getMonth(), 1);
|
|
300
303
|
e = Math.floor(m.getTime() / 1e3);
|
|
@@ -304,99 +307,99 @@ class N {
|
|
|
304
307
|
t = Math.floor(m.getTime() / 1e3);
|
|
305
308
|
}
|
|
306
309
|
t = this.getEndTimeForAvailableDaysInFuture(t);
|
|
307
|
-
const
|
|
308
|
-
e =
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
if ("error" in
|
|
310
|
+
const n = this.getStartTimeWithMinBookingNotice(e);
|
|
311
|
+
e = n, t = n > t ? n + 1 : t, s.append("start_time", encodeURIComponent(e.toString())), s.append("end_time", encodeURIComponent(t.toString())), this.configId && !this.sessionId ? s.append("configuration_id", encodeURIComponent(this.configId)) : this.slug && this.clientId && !this.sessionId && (s.append("slug", encodeURIComponent(this.slug)), s.append("client_id", encodeURIComponent(this.clientId)));
|
|
312
|
+
const a = this.schedulerStore.get("rescheduleBookingId");
|
|
313
|
+
a && s.append("booking_id", encodeURIComponent(a));
|
|
314
|
+
const l = s.toString(), u = `/v3/scheduling/availability${l ? `?${l}` : ""}`, c = this.getHeaders(), h = await this.makeAPIRequest(decodeURIComponent(u), "GET", void 0, c);
|
|
315
|
+
if ("error" in h) {
|
|
313
316
|
this.schedulerStore.set("availability", []), this.schedulerStore.set("isLoading", !1);
|
|
314
|
-
const m = (_ =
|
|
315
|
-
let v =
|
|
316
|
-
if (m && m in this.errors.api(
|
|
317
|
-
const
|
|
318
|
-
v = this.errors.api(
|
|
317
|
+
const m = (_ = h.error) == null ? void 0 : _.type;
|
|
318
|
+
let v = h.error;
|
|
319
|
+
if (m && m in this.errors.api(d.t("getAvailabilityErrorTitle"))) {
|
|
320
|
+
const g = this.getErrorMessage(v);
|
|
321
|
+
v = this.errors.api(d.t("getAvailabilityErrorTitle"))[m](g);
|
|
319
322
|
}
|
|
320
323
|
return { error: v };
|
|
321
324
|
}
|
|
322
|
-
if ("data" in
|
|
323
|
-
const v = (((p = (S =
|
|
325
|
+
if ("data" in h) {
|
|
326
|
+
const v = (((p = (S = h.data) == null ? void 0 : S.time_slots) == null ? void 0 : p.map((I) => ({
|
|
324
327
|
...I,
|
|
325
328
|
start_time: new Date(I.start_time * 1e3),
|
|
326
329
|
end_time: new Date(I.end_time * 1e3)
|
|
327
|
-
}))) || []).filter((I) => I.start_time.getTime() >
|
|
330
|
+
}))) || []).filter((I) => I.start_time.getTime() > r);
|
|
328
331
|
this.schedulerStore.set("availability", v);
|
|
329
|
-
const
|
|
330
|
-
this.schedulerStore.set("availabilityOrderEmails",
|
|
332
|
+
const g = ((T = h.data) == null ? void 0 : T.order) || [];
|
|
333
|
+
this.schedulerStore.set("availabilityOrderEmails", g);
|
|
331
334
|
}
|
|
332
|
-
return this.schedulerStore.set("isLoading", !1),
|
|
335
|
+
return this.schedulerStore.set("isLoading", !1), h;
|
|
333
336
|
}
|
|
334
337
|
async cancelBooking(e, t) {
|
|
335
|
-
var
|
|
338
|
+
var a;
|
|
336
339
|
if (this.schedulerStore.set("isLoading", !0), !e)
|
|
337
|
-
return { error: this.errors.component(
|
|
338
|
-
const s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", i = `/v3/scheduling/bookings/${e}${s}`,
|
|
340
|
+
return { error: this.errors.component(d.t("cancelBookingErrorTitle")).no_booking_id() };
|
|
341
|
+
const s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", i = `/v3/scheduling/bookings/${e}${s}`, r = this.getHeaders(), n = await this.makeAPIRequest(decodeURIComponent(i), "DELETE", JSON.stringify({
|
|
339
342
|
action: "cancel",
|
|
340
343
|
cancellation_reason: t
|
|
341
|
-
}),
|
|
342
|
-
if ("error" in
|
|
344
|
+
}), r);
|
|
345
|
+
if ("error" in n) {
|
|
343
346
|
this.schedulerStore.set("isLoading", !1);
|
|
344
|
-
const
|
|
345
|
-
let
|
|
346
|
-
if (
|
|
347
|
-
const
|
|
348
|
-
|
|
347
|
+
const l = (a = n.error) == null ? void 0 : a.type;
|
|
348
|
+
let u = n.error;
|
|
349
|
+
if (l && l in this.errors.api(d.t("cancelBookingErrorTitle"))) {
|
|
350
|
+
const c = this.getErrorMessage(u);
|
|
351
|
+
u = this.errors.api(d.t("cancelBookingErrorTitle"))[l](c);
|
|
349
352
|
}
|
|
350
|
-
return { error:
|
|
353
|
+
return { error: u };
|
|
351
354
|
}
|
|
352
355
|
return this.schedulerStore.set("cancelledEventInfo", {
|
|
353
356
|
booking_id: e
|
|
354
|
-
}), this.schedulerStore.set("rescheduleBookingId", ""), this.schedulerStore.set("isLoading", !1),
|
|
357
|
+
}), this.schedulerStore.set("rescheduleBookingId", ""), this.schedulerStore.set("isLoading", !1), n;
|
|
355
358
|
}
|
|
356
359
|
async rescheduleBooking(e, t) {
|
|
357
360
|
var A;
|
|
358
361
|
if (this.schedulerStore.set("isLoading", !0), !e)
|
|
359
|
-
return { error: this.errors.component(
|
|
360
|
-
const s = this.errors.api(
|
|
362
|
+
return { error: this.errors.component(d.t("rescheduleBookingErrorTitle")).no_booking_id() };
|
|
363
|
+
const s = this.errors.api(d.t("rescheduleBookingErrorTitle")), i = this.errors.component(d.t("rescheduleBookingErrorTitle")), { bookingInfo: r, selectedTimeslot: n, selectedTimezone: a, selectedLanguage: l } = this.schedulerStore.state, { startTime: u, endTime: c, timezone: h } = t, _ = u || (n == null ? void 0 : n.start_time);
|
|
361
364
|
if (!_)
|
|
362
365
|
return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
363
|
-
const S =
|
|
366
|
+
const S = c || (n == null ? void 0 : n.end_time);
|
|
364
367
|
if (!S)
|
|
365
368
|
return { error: i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
366
369
|
const p = this.schedulerStore.get("availabilityOrderEmails");
|
|
367
370
|
let T = "";
|
|
368
371
|
if (p.length > 0) {
|
|
369
|
-
const b = (
|
|
372
|
+
const b = (n == null ? void 0 : n.emails) || [];
|
|
370
373
|
for (let y = 0; y < p.length; y++)
|
|
371
374
|
if (b.includes(p[y])) {
|
|
372
375
|
T = p[y];
|
|
373
376
|
break;
|
|
374
377
|
}
|
|
375
378
|
}
|
|
376
|
-
const m =
|
|
379
|
+
const m = h || a;
|
|
377
380
|
if (!m)
|
|
378
381
|
return { error: i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.') };
|
|
379
382
|
const v = {};
|
|
380
|
-
Object.entries((
|
|
383
|
+
Object.entries((r == null ? void 0 : r.additionalFields) || {}).forEach(([b, y]) => {
|
|
381
384
|
v[b] = y.value;
|
|
382
385
|
});
|
|
383
|
-
const
|
|
386
|
+
const g = t ? t == null ? void 0 : t.primaryParticipant : r == null ? void 0 : r.primaryParticipant, I = t ? (t == null ? void 0 : t.guests) || [] : (r == null ? void 0 : r.guests) || [], k = t ? t == null ? void 0 : t.additionalFields : v, f = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", E = `/v3/scheduling/bookings/${e}${f}`, P = this.getHeaders(), w = await this.makeAPIRequest(decodeURIComponent(E), "PATCH", JSON.stringify({
|
|
384
387
|
start_time: _.getTime() / 1e3,
|
|
385
388
|
end_time: S.getTime() / 1e3,
|
|
386
389
|
timezone: m,
|
|
387
390
|
additional_fields: k,
|
|
388
|
-
guest: { ...
|
|
391
|
+
guest: { ...g },
|
|
389
392
|
additional_guests: I,
|
|
390
393
|
participants: T ? [{ email: T }] : void 0,
|
|
391
|
-
email_language: this.getTwoLetterLanguageCode(
|
|
392
|
-
}),
|
|
394
|
+
email_language: this.getTwoLetterLanguageCode(l)
|
|
395
|
+
}), P);
|
|
393
396
|
if ("error" in w) {
|
|
394
397
|
this.schedulerStore.set("isLoading", !1);
|
|
395
398
|
const b = (A = w.error) == null ? void 0 : A.type;
|
|
396
399
|
let y = w.error;
|
|
397
400
|
if (b && b in s) {
|
|
398
|
-
const
|
|
399
|
-
y = s[b](
|
|
401
|
+
const z = this.getErrorMessage(y);
|
|
402
|
+
y = s[b](z);
|
|
400
403
|
}
|
|
401
404
|
return { error: y };
|
|
402
405
|
}
|
|
@@ -414,34 +417,34 @@ class N {
|
|
|
414
417
|
return this.schedulerStore.set("isLoading", !1), w;
|
|
415
418
|
}
|
|
416
419
|
async updateBooking(e) {
|
|
417
|
-
var
|
|
420
|
+
var h;
|
|
418
421
|
this.schedulerStore.set("isLoading", !0);
|
|
419
|
-
const { bookingId: t, status: s, reason: i } = e,
|
|
422
|
+
const { bookingId: t, status: s, reason: i } = e, r = this.schedulerStore.get("organizerConfirmationSalt"), n = s === "confirmed" ? d.t("confirmBookingErrorTitle") : d.t("rejectBookingErrorTitle");
|
|
420
423
|
if (!t)
|
|
421
|
-
return { error: this.errors.component(
|
|
422
|
-
if (!
|
|
423
|
-
return { error: this.errors.component(
|
|
424
|
-
const
|
|
424
|
+
return { error: this.errors.component(n).no_booking_id() };
|
|
425
|
+
if (!r)
|
|
426
|
+
return { error: this.errors.component(n).no_salt() };
|
|
427
|
+
const a = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", l = `/v3/scheduling/bookings/${t}${a}`, u = this.getHeaders(), c = await this.makeAPIRequest(decodeURIComponent(l), "PUT", JSON.stringify({
|
|
425
428
|
status: s,
|
|
426
429
|
cancellation_reason: i,
|
|
427
|
-
salt:
|
|
428
|
-
}),
|
|
429
|
-
if ("error" in
|
|
430
|
+
salt: r
|
|
431
|
+
}), u);
|
|
432
|
+
if ("error" in c) {
|
|
430
433
|
this.schedulerStore.set("isLoading", !1);
|
|
431
|
-
const _ = (
|
|
432
|
-
let S =
|
|
433
|
-
if (_ && _ in this.errors.api(
|
|
434
|
+
const _ = (h = c.error) == null ? void 0 : h.type;
|
|
435
|
+
let S = c.error;
|
|
436
|
+
if (_ && _ in this.errors.api(n)) {
|
|
434
437
|
const p = this.getErrorMessage(S);
|
|
435
|
-
S = this.errors.api(
|
|
438
|
+
S = this.errors.api(n)[_](p);
|
|
436
439
|
}
|
|
437
440
|
return { error: S };
|
|
438
441
|
}
|
|
439
|
-
return "data" in
|
|
442
|
+
return "data" in c && s === "confirmed" ? this.schedulerStore.set("confirmedEventInfo", c == null ? void 0 : c.data) : "request_id" in c && s === "cancelled" && this.schedulerStore.set("cancelledEventInfo", {
|
|
440
443
|
booking_id: t
|
|
441
|
-
}), this.schedulerStore.set("organizerConfirmationBookingId", ""), this.schedulerStore.set("isLoading", !1),
|
|
444
|
+
}), this.schedulerStore.set("organizerConfirmationBookingId", ""), this.schedulerStore.set("isLoading", !1), c;
|
|
442
445
|
}
|
|
443
446
|
}
|
|
444
|
-
function O(
|
|
447
|
+
function O(o = {}) {
|
|
445
448
|
const e = {
|
|
446
449
|
selectedDate: null,
|
|
447
450
|
selectedLanguage: navigator.language,
|
|
@@ -457,19 +460,19 @@ function O(a = {}) {
|
|
|
457
460
|
cancelledEventInfo: null,
|
|
458
461
|
isLoading: !1,
|
|
459
462
|
nylasBranding: !0,
|
|
460
|
-
...
|
|
463
|
+
...o
|
|
461
464
|
};
|
|
462
465
|
L("[defaultNylasStoreState]: ", e);
|
|
463
466
|
const t = F(e);
|
|
464
467
|
return t.onChange("availability", (s) => {
|
|
465
468
|
L("[availability]: ", s);
|
|
466
|
-
const i = s.map((
|
|
469
|
+
const i = s.map((a) => a.start_time);
|
|
467
470
|
L("[selectableDates]: ", i), t.set("selectableDates", i);
|
|
468
|
-
const
|
|
469
|
-
if (!
|
|
471
|
+
const r = s[0];
|
|
472
|
+
if (!r)
|
|
470
473
|
return;
|
|
471
|
-
const
|
|
472
|
-
L("[durationMinutes]: ",
|
|
474
|
+
const n = Math.floor((r.end_time.getTime() - r.start_time.getTime()) / 6e4);
|
|
475
|
+
L("[durationMinutes]: ", n), t.set("eventDuration", n);
|
|
473
476
|
}), t.reset = () => {
|
|
474
477
|
for (const s in e) {
|
|
475
478
|
const i = e[s];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-bbbc79ad.cjs");require("react");require("react-dom");const i=".sc-sent-icon-h{display:flex}",o=i,e=class{constructor(s){t.registerInstance(this,s),this.width="15",this.height="15"}render(){return t.h("svg",{key:"ca3a664814e986f46006171c0fb63441478ef5b8",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"e4d9309797e02ca60918d49c55854d51f93c1a2b",d:"M21.5 12L3.5 3.5L3.5 20.5L21.5 12Z",stroke:"auto","stroke-width":"1.5"}),t.h("path",{key:"082bf637872a00ba8abe224cc7c8092dc371ea75",d:"M3.5 3.5L12 10.5",stroke:"auto","stroke-width":"1.5"}),t.h("path",{key:"dd3f5647d7cdb9dfbdb480ab332917564969f546",d:"M3.5 20.5L12 13.5",stroke:"auto","stroke-width":"1.5"}))}};e.style=o;exports.sent_icon=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-bbbc79ad.cjs");require("react");require("react-dom");const c=".sc-spam-icon-h{display:flex}",i=c,t=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"a8e87346312ed75a47b88790585e07d8c518c3e9",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"5cb3444afa08fc37a8cf2e268c62faf5c97379f5",d:"M20 3H4C2.89543 3 2 3.89543 2 5V19C2 20.1046 2.89543 21 4 21H20C21.1046 21 22 20.1046 22 19V5C22 3.89543 21.1046 3 20 3Z",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"b695c0e7aa34cf44da99cce51c17ff98b3ad8906",d:"M2 5L12 12.5L22 5",stroke:"auto","stroke-width":"1.5"}))}};t.style=i;exports.spam_icon=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-bbbc79ad.cjs");require("react");require("react-dom");const i=".sc-star-icon-h{display:flex}",c=i,e=class{constructor(s){t.registerInstance(this,s),this.width="15",this.height="15"}render(){return t.h("svg",{key:"acc7e88e0901acac79fd0bf4a3a355ea82b46934",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"a3a8ed61cce35a1f67c5aa22cb0aee42c965474e",d:"M9.15316 5.40838C10.4198 3.13613 11.0531 2 12 2C12.9469 2 13.5802 3.13612 14.8468 5.40837L15.1745 5.99623C15.5345 6.64193 15.7144 6.96479 15.9951 7.17781C16.2757 7.39083 16.6251 7.4699 17.3241 7.62805L17.9605 7.77203C20.4201 8.32856 21.65 8.60682 21.9426 9.54773C22.2352 10.4886 21.3968 11.4691 19.7199 13.4299L19.2861 13.9372C18.8096 14.4944 18.5713 14.773 18.4641 15.1177C18.357 15.4624 18.393 15.8341 18.465 16.5776L18.5306 17.2544C18.7841 19.8706 18.9109 21.1787 18.1449 21.7602C17.3788 22.3417 16.2273 21.8115 13.9243 20.7512L13.3285 20.4768C12.6741 20.1755 12.3469 20.0248 12 20.0248C11.6531 20.0248 11.3259 20.1755 10.6715 20.4768L10.0757 20.7512C7.77268 21.8115 6.62118 22.3417 5.85515 21.7602C5.08912 21.1787 5.21588 19.8706 5.4694 17.2544L5.53498 16.5776C5.60703 15.8341 5.64305 15.4624 5.53586 15.1177C5.42868 14.773 5.19043 14.4944 4.71392 13.9372L4.2801 13.4299C2.60325 11.4691 1.76482 10.4886 2.05742 9.54773C2.35002 8.60682 3.57986 8.32856 6.03954 7.77203L6.67589 7.62805C7.37485 7.4699 7.72433 7.39083 8.00494 7.17781C8.28555 6.96479 8.46553 6.64194 8.82547 5.99623L9.15316 5.40838Z",stroke:"auto","stroke-width":"1.5"}))}};e.style=c;exports.star_icon=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-bbbc79ad.cjs");require("react");require("react-dom");const s=".sc-stop-icon-h{display:flex}",i=s,e=class{constructor(o){t.registerInstance(this,o),this.width="15",this.height="15"}render(){return t.h("svg",{key:"f70cc744dde889a32cc0339cf4be41ae38237d0b",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"f7bd4f78d4e2efc797932d91aac355e0f9d4f309",d:"M4 4H20V20H4V4Z",stroke:"auto","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}};e.style=i;exports.stop_icon=e;
|
package/dist/{textarea-component.entry-ff04b5fa.cjs → textarea-component.entry-2dae13db.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-bbbc79ad.cjs");require("react");require("react-dom");const s=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0;display:flex;gap:4px;align-items:center}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}',l=s,r=class{constructor(a){e.registerInstance(this,a),this.nylasFormInputChanged=e.createEvent(this,"nylasFormInputChanged",7),this.name="textarea",this.defaultValue=void 0,this.label="",this.placeholder="",this.required=!1,this.readOnly=!1,this.autoFocus=!1,this.maxLength=255,this.type="multi_line_text",this.tooltip="",this.value="",this.error=""}componentDidLoad(){this.value=e.sanitize(this.defaultValue||"")}handleBookingFormSubmitted(a){this.validate(this.value),this.error&&a.preventDefault()}handletriggerValidation(a){this.validate(this.value),this.error&&a.preventDefault()}handleInput(a){const t=a.target;this.value=e.sanitize(t.value),this.nylasFormInputChanged.emit({value:this.value,name:this.name,error:this.error,label:this.label,type:this.type})}validate(a){this.required&&!a?this.error=`${this.label} is required.`:a.length>this.maxLength?this.error=`${this.label} cannot exceed ${this.maxLength} characters.`:this.error=""}render(){return e.h("label",{key:"f68b9ffeb13cb29f04876ab2bc489accd1092ea0",part:"tc__label",class:{error:!!this.error}},e.h("p",{key:"696005e9c6c2771febe67cfd957cfc03b78c9c00"},e.h("span",{key:"918df732d2500973be9aec48dc1ffd428b0f0e14",class:"label"},this.label),this.required&&e.h("span",{class:"required"},"*"),this.tooltip&&e.h("tooltip-component",null,e.h("info-icon",{slot:"tooltip-icon"}),e.h("span",{slot:"tooltip-content"},this.tooltip))),e.h("textarea",{key:"352c87be35d8315e99e2bf4889275c6daf59fb0e",name:this.name,placeholder:this.placeholder,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,maxLength:this.maxLength,onInput:a=>this.handleInput(a),class:{error:!!this.error},part:"tc__textarea"}),this.error&&e.h("span",{class:"error help-text"},this.error))}};r.style=l;exports.textarea_component=r;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as s, c as l, t as r, h as a } from "./index-
|
|
1
|
+
import { r as s, c as l, t as r, h as a } from "./index-ad112f6a.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
const i = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0;display:flex;gap:4px;align-items:center}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}', n = i, o = class {
|
|
@@ -28,7 +28,7 @@ const i = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--n
|
|
|
28
28
|
this.required && !e ? this.error = `${this.label} is required.` : e.length > this.maxLength ? this.error = `${this.label} cannot exceed ${this.maxLength} characters.` : this.error = "";
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
|
-
return a("label", { key: "
|
|
31
|
+
return a("label", { key: "f68b9ffeb13cb29f04876ab2bc489accd1092ea0", part: "tc__label", class: { error: !!this.error } }, a("p", { key: "696005e9c6c2771febe67cfd957cfc03b78c9c00" }, a("span", { key: "918df732d2500973be9aec48dc1ffd428b0f0e14", class: "label" }, this.label), this.required && a("span", { class: "required" }, "*"), this.tooltip && a("tooltip-component", null, a("info-icon", { slot: "tooltip-icon" }), a("span", { slot: "tooltip-content" }, this.tooltip))), a("textarea", { key: "352c87be35d8315e99e2bf4889275c6daf59fb0e", name: this.name, placeholder: this.placeholder, readOnly: this.readOnly, autoFocus: this.autoFocus, value: this.value, maxLength: this.maxLength, onInput: (e) => this.handleInput(e), class: { error: !!this.error }, part: "tc__textarea" }), this.error && a("span", { class: "error help-text" }, this.error));
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
o.style = n;
|
package/dist/{time-period-selector.entry-53edc0ba.js → time-period-selector.entry-0de79682.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as s, c as n, d, h as o, g as p } from "./index-
|
|
1
|
+
import { r as s, c as n, d, h as o, g as p } from "./index-ad112f6a.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
const l = ".time-period-selector.sc-time-period-selector{display:grid;gap:0.5rem;grid-template-columns:auto 1fr}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector,.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector{width:116px}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector{width:84px;display:flex;align-items:center}.time-period-selector.sc-time-period-selector select-dropdown#time-period.sc-time-period-selector::part(sd_dropdown-button){width:100%}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown){width:inherit;height:100%}.time-period-selector.sc-time-period-selector input-dropdown#time-number.sc-time-period-selector::part(id_dropdown-input){border:none;border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown-input){padding:17px;gap:1rem}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown-content){width:100%;max-height:200px}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown){width:inherit}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-button){padding:1rem;gap:1rem;justify-content:space-between}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-content){width:100%;max-height:200px}", c = l, m = {
|
|
@@ -68,7 +68,7 @@ const l = ".time-period-selector.sc-time-period-selector{display:grid;gap:0.5rem
|
|
|
68
68
|
})), this.selectedNumber = parseInt(this.numberOptions[0].value);
|
|
69
69
|
}
|
|
70
70
|
render() {
|
|
71
|
-
return o("div", { key: "
|
|
71
|
+
return o("div", { key: "76ed6c36ebbcfbb8b8d54edc6a26a9d2a6d6f7fb", class: "time-period-selector" }, typeof this.selectedNumber == "number" && o("input-dropdown", { id: "time-number", name: "time-number", inputValue: this.selectedNumber.toString(), exportparts: "id_dropdown: tps__number-dropdown, id_dropdown-input: tps__number-dropdown-button, id_dropdown-content: tps__number-dropdown-content", options: this.numberOptions, defaultInputOption: this.numberOptions.find((r) => r.value == this.selectedNumber.toString()) }), typeof this.selectedPeriod == "string" && o("select-dropdown", { id: "time-period", name: "time-period", options: this.timePeriodOptions, exportparts: "sd_dropdown: tps__period-dropdown, sd_dropdown-button: tps__period-dropdown-button, sd_dropdown-content: tps__period-dropdown-content", pluralizedLabel: this.selectedNumber > 1 ? "s" : "", defaultSelectedOption: this.timePeriodOptions.find((r) => r.value == this.selectedPeriod), withSearch: !1 }));
|
|
72
72
|
}
|
|
73
73
|
get host() {
|
|
74
74
|
return p(this);
|