@meetelise/chat 1.75.0 → 1.76.0
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/src/WebComponent/Scheduler/time-picker.d.ts +6 -0
- package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +1 -1
- package/dist/src/WebComponent/SchedulerV2/contact-form.d.ts +9 -3
- package/dist/src/WebComponent/SchedulerV2/itinerary-editor.d.ts +15 -1
- package/dist/src/WebComponent/SchedulerV2/itineraryStopStyles.d.ts +1 -2
- package/dist/src/WebComponent/SchedulerV2/schedulerIcons.d.ts +18 -0
- package/dist/src/WebComponent/SchedulerV2/schedulerV2Styles.d.ts +9 -0
- package/dist/src/WebComponent/SchedulerV2/tour-scheduler-v2.d.ts +13 -1
- package/dist/src/WebComponent/SchedulerV2/tourTimes.d.ts +1 -1
- package/dist/src/WebComponent/actions/international-phone-input.d.ts +7 -0
- package/dist/src/WebComponent/me-select.d.ts +2 -0
- package/package.json +1 -1
- package/public/dist/index.js +2280 -1309
- package/src/WebComponent/Scheduler/date-picker.ts +130 -51
- package/src/WebComponent/Scheduler/time-picker.ts +62 -0
- package/src/WebComponent/Scheduler/tour-type-option.ts +31 -10
- package/src/WebComponent/SchedulerV2/booking-confirmation.ts +42 -38
- package/src/WebComponent/SchedulerV2/community-picker.ts +222 -160
- package/src/WebComponent/SchedulerV2/contact-form.ts +100 -70
- package/src/WebComponent/SchedulerV2/itinerary-editor.ts +280 -138
- package/src/WebComponent/SchedulerV2/itineraryStopStyles.ts +44 -21
- package/src/WebComponent/SchedulerV2/scheduler-popover.ts +6 -6
- package/src/WebComponent/SchedulerV2/schedulerIcons.ts +143 -0
- package/src/WebComponent/SchedulerV2/schedulerV2Styles.ts +347 -0
- package/src/WebComponent/SchedulerV2/tour-scheduler-v2.ts +443 -175
- package/src/WebComponent/SchedulerV2/tourTimes.ts +4 -3
- package/src/WebComponent/actions/action-confirm-button.ts +4 -3
- package/src/WebComponent/actions/international-phone-input.ts +84 -1
- package/src/WebComponent/me-select.ts +74 -0
- package/src/tourSchedulerV2Booking.test.ts +35 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { css, html, LitElement, PropertyValues, TemplateResult } from "lit";
|
|
2
2
|
import { customElement, property, state } from "lit/decorators.js";
|
|
3
3
|
import { classMap } from "lit/directives/class-map.js";
|
|
4
|
+
import { ref } from "lit/directives/ref.js";
|
|
4
5
|
import { v4 as uuid } from "uuid";
|
|
5
6
|
import "./community-picker";
|
|
6
7
|
import "./itinerary-editor";
|
|
@@ -9,11 +10,13 @@ import "./booking-confirmation";
|
|
|
9
10
|
import "../actions/action-confirm-button";
|
|
10
11
|
import "../loaders/mega-loader";
|
|
11
12
|
import "../mini-loader";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import { schedulerV2Styles, schedulerV2Tokens } from "./schedulerV2Styles";
|
|
14
|
+
import {
|
|
15
|
+
CheckCircleLineIcon,
|
|
16
|
+
ChevronLeftLineIcon,
|
|
17
|
+
CloseLineIcon,
|
|
18
|
+
MapLineIcon,
|
|
19
|
+
} from "./schedulerIcons";
|
|
17
20
|
import formDisclaimer from "../../disclaimers";
|
|
18
21
|
import {
|
|
19
22
|
BookingResponse,
|
|
@@ -186,6 +189,20 @@ export class TourSchedulerV2 extends LitElement {
|
|
|
186
189
|
private planRequestId = 0;
|
|
187
190
|
private idempotency: { booking: string; key: string } | null = null;
|
|
188
191
|
private cleanupMobileListener?: () => void;
|
|
192
|
+
/**
|
|
193
|
+
* Below this width the modal can't fit the schedule step's three columns
|
|
194
|
+
* (the chat beside it, or a narrow window), so the step stacks.
|
|
195
|
+
*/
|
|
196
|
+
private static readonly THREE_COLUMN_MIN_WIDTH = 840;
|
|
197
|
+
@state() private narrow = false;
|
|
198
|
+
private readonly modalResize = new ResizeObserver(([entry]) => {
|
|
199
|
+
this.narrow =
|
|
200
|
+
entry.contentRect.width < TourSchedulerV2.THREE_COLUMN_MIN_WIDTH;
|
|
201
|
+
});
|
|
202
|
+
private observeModal = (modal?: Element): void => {
|
|
203
|
+
this.modalResize.disconnect();
|
|
204
|
+
if (modal) this.modalResize.observe(modal);
|
|
205
|
+
};
|
|
189
206
|
|
|
190
207
|
connectedCallback(): void {
|
|
191
208
|
super.connectedCallback();
|
|
@@ -1095,7 +1112,7 @@ export class TourSchedulerV2 extends LitElement {
|
|
|
1095
1112
|
});
|
|
1096
1113
|
}
|
|
1097
1114
|
|
|
1098
|
-
/**
|
|
1115
|
+
/** The body area, which scrolls the whole sheet on phones. */
|
|
1099
1116
|
private container(content: TemplateResult): TemplateResult {
|
|
1100
1117
|
return html`<div
|
|
1101
1118
|
id=${this.mobile ? "mobile-body-container" : "scheduler-container"}
|
|
@@ -1124,8 +1141,9 @@ export class TourSchedulerV2 extends LitElement {
|
|
|
1124
1141
|
|
|
1125
1142
|
/** Adding stops to a booking: the design's itinerary heading. */
|
|
1126
1143
|
private renderItineraryHeading(): TemplateResult {
|
|
1127
|
-
return html`<div class="itinerary-heading">
|
|
1128
|
-
|
|
1144
|
+
return html`<div class="page-intro itinerary-heading">
|
|
1145
|
+
${MapLineIcon(32)}
|
|
1146
|
+
<h2 class="page-heading">
|
|
1129
1147
|
Create Your Tour Itinerary
|
|
1130
1148
|
${this.planLoading ? html`<mini-loader></mini-loader>` : ""}
|
|
1131
1149
|
</h2>
|
|
@@ -1136,13 +1154,6 @@ export class TourSchedulerV2 extends LitElement {
|
|
|
1136
1154
|
/** "Add another stop": the nearby communities, under the itinerary. */
|
|
1137
1155
|
private renderAddStop(): TemplateResult {
|
|
1138
1156
|
return html`<div class="add-stop-picker">
|
|
1139
|
-
<button
|
|
1140
|
-
class="close-add-stop"
|
|
1141
|
-
aria-label="Close nearby communities"
|
|
1142
|
-
@click=${() => (this.addingStop = false)}
|
|
1143
|
-
>
|
|
1144
|
-
${XOutlineIcon("#737373")}
|
|
1145
|
-
</button>
|
|
1146
1157
|
<community-picker
|
|
1147
1158
|
variant="extend"
|
|
1148
1159
|
.load=${this.loadAddStopCommunities}
|
|
@@ -1151,130 +1162,162 @@ export class TourSchedulerV2 extends LitElement {
|
|
|
1151
1162
|
@selection-change=${(
|
|
1152
1163
|
e: CustomEvent<{ communities: CommunitySummary[] }>
|
|
1153
1164
|
) => this.onStopAdded(e.detail.communities)}
|
|
1154
|
-
|
|
1165
|
+
>
|
|
1166
|
+
<button
|
|
1167
|
+
slot="heading-action"
|
|
1168
|
+
class="icon-button close-add-stop"
|
|
1169
|
+
aria-label="Close nearby communities"
|
|
1170
|
+
@click=${() => (this.addingStop = false)}
|
|
1171
|
+
>
|
|
1172
|
+
${CloseLineIcon(16)}
|
|
1173
|
+
</button>
|
|
1174
|
+
</community-picker>
|
|
1155
1175
|
</div>`;
|
|
1156
1176
|
}
|
|
1157
1177
|
|
|
1158
|
-
private
|
|
1159
|
-
if (this.reschedulePrompt !== null) return this.renderReschedulePrompt();
|
|
1178
|
+
private renderEditor(): TemplateResult {
|
|
1160
1179
|
const plan = this.plan;
|
|
1161
|
-
return html
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1180
|
+
return html` <itinerary-editor
|
|
1181
|
+
.stops=${plan?.stops ?? []}
|
|
1182
|
+
.communities=${this.communities}
|
|
1183
|
+
.problems=${this.problems()}
|
|
1184
|
+
.tourTypes=${this.tourTypeChoices()}
|
|
1185
|
+
.tourType=${this.shownTourType}
|
|
1186
|
+
.bookableDates=${plan?.bookable_dates ?? []}
|
|
1187
|
+
.date=${this.date}
|
|
1188
|
+
?single=${!this.isMultiStop()}
|
|
1189
|
+
?stopsOnly=${this.extending}
|
|
1190
|
+
?canAddStop=${this.extending && !this.addingStop && this.canAddStop}
|
|
1191
|
+
?canEditCommunities=${this.group !== null && !this.extending}
|
|
1192
|
+
?loading=${this.planLoading}
|
|
1193
|
+
?planned=${plan !== null}
|
|
1194
|
+
.primaryColor=${this.primaryColor}
|
|
1195
|
+
.foregroundColorOnPrimaryBackgroundColor=${this
|
|
1196
|
+
.foregroundColorOnPrimaryBackgroundColor}
|
|
1197
|
+
@tour-type-change=${(e: CustomEvent<{ tourType: TourTypeId }>) =>
|
|
1198
|
+
this.onTourType(e.detail.tourType)}
|
|
1199
|
+
@date-change=${(e: CustomEvent<{ date: string }>) =>
|
|
1200
|
+
this.onDate(e.detail.date)}
|
|
1201
|
+
@stop-time-change=${(
|
|
1202
|
+
e: CustomEvent<{ buildingId: number; start: string }>
|
|
1203
|
+
) => this.onStopTime(e.detail.buildingId, e.detail.start)}
|
|
1204
|
+
@stop-date-change=${(
|
|
1205
|
+
e: CustomEvent<{ buildingId: number; date: string }>
|
|
1206
|
+
) => this.onStopDate(e.detail.buildingId, e.detail.date)}
|
|
1207
|
+
@stops-reorder=${(e: CustomEvent<{ buildingIds: number[] }>) =>
|
|
1208
|
+
this.onReorder(e.detail.buildingIds)}
|
|
1209
|
+
@stop-remove=${(e: CustomEvent<{ buildingId: number }>) =>
|
|
1210
|
+
this.onRemove(e.detail.buildingId)}
|
|
1211
|
+
@edit-communities=${() => this.onEditCommunities()}
|
|
1212
|
+
@add-stop=${() => (this.addingStop = true)}
|
|
1213
|
+
@open-tour-link=${() =>
|
|
1214
|
+
this.activeLinkType && this.openTourLink(this.activeLinkType)}
|
|
1215
|
+
></itinerary-editor>`;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
private renderContactForm(): TemplateResult {
|
|
1219
|
+
return html`<contact-form
|
|
1220
|
+
.values=${this.formValues}
|
|
1221
|
+
.layoutOptions=${this.bedroomOptions}
|
|
1222
|
+
?bedroomsRequired=${this.bedroomsRequired}
|
|
1223
|
+
.leadSources=${this.leadSources}
|
|
1224
|
+
?showLeadSourceDropdown=${this.showLeadSourceDropdown()}
|
|
1225
|
+
currentLeadSource=${this.currentLeadSource}
|
|
1226
|
+
.country=${this.country}
|
|
1227
|
+
?mobile=${this.mobile}
|
|
1228
|
+
@contact-change=${(e: CustomEvent<{ values: ContactValues }>) =>
|
|
1229
|
+
this.onContactChange(e.detail.values)}
|
|
1230
|
+
@lead-source-selected=${(e: CustomEvent<{ leadSource: string }>) =>
|
|
1231
|
+
pushGtmEvent("tourLeadSourceSelected", {
|
|
1232
|
+
leadSource: e.detail.leadSource,
|
|
1233
|
+
buildingId: this.buildingId,
|
|
1234
|
+
})}
|
|
1235
|
+
></contact-form>`;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/** The consent text and the submit button, under the form or the itinerary. */
|
|
1239
|
+
private renderFooter(): TemplateResult {
|
|
1240
|
+
return html`<div
|
|
1241
|
+
id="tour-scheduler-footer"
|
|
1242
|
+
class=${classMap({ itinerary: this.extending })}
|
|
1243
|
+
>
|
|
1244
|
+
<div class="explanation consent">
|
|
1245
|
+
We'll send a confirmation and any follow-ups to your email address,
|
|
1246
|
+
please reply to the email to make any appointment changes.
|
|
1247
|
+
${this.disclaimer()}
|
|
1248
|
+
${this.bookingError
|
|
1249
|
+
? html`<p class="error-message" role="alert">${this.bookingError}</p>`
|
|
1173
1250
|
: ""}
|
|
1251
|
+
</div>
|
|
1252
|
+
<action-confirm-button
|
|
1253
|
+
id="schedule-bttn"
|
|
1254
|
+
.onClick=${() => this.submit()}
|
|
1255
|
+
.isLoading=${this.submitting}
|
|
1256
|
+
height="36px"
|
|
1257
|
+
width="100%"
|
|
1258
|
+
text=${this.extending
|
|
1259
|
+
? "Confirm Tour Itinerary"
|
|
1260
|
+
: this.isMultiStop()
|
|
1261
|
+
? "Schedule Tours"
|
|
1262
|
+
: "Schedule Tour"}
|
|
1263
|
+
?disabled=${!this.canSubmit()}
|
|
1264
|
+
></action-confirm-button>
|
|
1265
|
+
</div>`;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
private renderSchedule(): TemplateResult {
|
|
1269
|
+
if (this.reschedulePrompt !== null) return this.renderReschedulePrompt();
|
|
1270
|
+
const main = html`${this.planError
|
|
1271
|
+
? html`<p class="error-message plan-error" role="alert">
|
|
1272
|
+
${this.planError}
|
|
1273
|
+
<button class="link-button" @click=${() => this.runPlan()}>
|
|
1274
|
+
Try again
|
|
1275
|
+
</button>
|
|
1276
|
+
</p>`
|
|
1277
|
+
: ""}
|
|
1278
|
+
${this.extending ? this.renderItineraryHeading() : ""}
|
|
1279
|
+
${this.notice
|
|
1280
|
+
? html`<p class="explanation notice" role="status">${this.notice}</p>`
|
|
1281
|
+
: ""}`;
|
|
1282
|
+
// Adding stops, phones and narrow modals: one column that scrolls, with
|
|
1283
|
+
// the footer under it.
|
|
1284
|
+
if (this.extending || this.mobile || this.narrow) {
|
|
1285
|
+
return html`${this.container(html`${main}
|
|
1174
1286
|
<div
|
|
1175
1287
|
id="book-tour-journey-items"
|
|
1176
1288
|
class=${classMap({ itinerary: this.extending })}
|
|
1177
1289
|
>
|
|
1178
|
-
|
|
1179
|
-
.stops=${plan?.stops ?? []}
|
|
1180
|
-
.communities=${this.communities}
|
|
1181
|
-
.problems=${this.problems()}
|
|
1182
|
-
.tourTypes=${this.tourTypeChoices()}
|
|
1183
|
-
.tourType=${this.shownTourType}
|
|
1184
|
-
.bookableDates=${plan?.bookable_dates ?? []}
|
|
1185
|
-
.date=${this.date}
|
|
1186
|
-
?single=${!this.isMultiStop()}
|
|
1187
|
-
?stopsOnly=${this.extending}
|
|
1188
|
-
?canAddStop=${this.extending && !this.addingStop && this.canAddStop}
|
|
1189
|
-
?canEditCommunities=${this.group !== null && !this.extending}
|
|
1190
|
-
?loading=${this.planLoading}
|
|
1191
|
-
?planned=${plan !== null}
|
|
1192
|
-
.primaryColor=${this.primaryColor}
|
|
1193
|
-
.foregroundColorOnPrimaryBackgroundColor=${this
|
|
1194
|
-
.foregroundColorOnPrimaryBackgroundColor}
|
|
1195
|
-
@tour-type-change=${(e: CustomEvent<{ tourType: TourTypeId }>) =>
|
|
1196
|
-
this.onTourType(e.detail.tourType)}
|
|
1197
|
-
@date-change=${(e: CustomEvent<{ date: string }>) =>
|
|
1198
|
-
this.onDate(e.detail.date)}
|
|
1199
|
-
@stop-time-change=${(
|
|
1200
|
-
e: CustomEvent<{ buildingId: number; start: string }>
|
|
1201
|
-
) => this.onStopTime(e.detail.buildingId, e.detail.start)}
|
|
1202
|
-
@stop-date-change=${(
|
|
1203
|
-
e: CustomEvent<{ buildingId: number; date: string }>
|
|
1204
|
-
) => this.onStopDate(e.detail.buildingId, e.detail.date)}
|
|
1205
|
-
@stops-reorder=${(e: CustomEvent<{ buildingIds: number[] }>) =>
|
|
1206
|
-
this.onReorder(e.detail.buildingIds)}
|
|
1207
|
-
@stop-remove=${(e: CustomEvent<{ buildingId: number }>) =>
|
|
1208
|
-
this.onRemove(e.detail.buildingId)}
|
|
1209
|
-
@edit-communities=${() => this.onEditCommunities()}
|
|
1210
|
-
@add-stop=${() => (this.addingStop = true)}
|
|
1211
|
-
@open-tour-link=${() =>
|
|
1212
|
-
this.activeLinkType && this.openTourLink(this.activeLinkType)}
|
|
1213
|
-
></itinerary-editor>
|
|
1290
|
+
${this.renderEditor()}
|
|
1214
1291
|
${this.extending
|
|
1215
1292
|
? ""
|
|
1216
|
-
: html`<
|
|
1217
|
-
.values=${this.formValues}
|
|
1218
|
-
.layoutOptions=${this.bedroomOptions}
|
|
1219
|
-
?bedroomsRequired=${this.bedroomsRequired}
|
|
1220
|
-
.leadSources=${this.leadSources}
|
|
1221
|
-
?showLeadSourceDropdown=${this.showLeadSourceDropdown()}
|
|
1222
|
-
currentLeadSource=${this.currentLeadSource}
|
|
1223
|
-
.country=${this.country}
|
|
1224
|
-
?mobile=${this.mobile}
|
|
1225
|
-
@contact-change=${(e: CustomEvent<{ values: ContactValues }>) =>
|
|
1226
|
-
this.onContactChange(e.detail.values)}
|
|
1227
|
-
@lead-source-selected=${(
|
|
1228
|
-
e: CustomEvent<{ leadSource: string }>
|
|
1229
|
-
) =>
|
|
1230
|
-
pushGtmEvent("tourLeadSourceSelected", {
|
|
1231
|
-
leadSource: e.detail.leadSource,
|
|
1232
|
-
buildingId: this.buildingId,
|
|
1233
|
-
})}
|
|
1234
|
-
></contact-form>`}
|
|
1293
|
+
: html`<div class="info-row">${this.renderContactForm()}</div>`}
|
|
1235
1294
|
</div>
|
|
1236
|
-
${this.extending && this.addingStop ? this.renderAddStop() : ""}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
>
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
: ""}
|
|
1251
|
-
</div>
|
|
1252
|
-
<action-confirm-button
|
|
1253
|
-
id="schedule-bttn"
|
|
1254
|
-
.onClick=${() => this.submit()}
|
|
1255
|
-
.isLoading=${this.submitting}
|
|
1256
|
-
height="50px"
|
|
1257
|
-
width=${this.mobile ? "100%" : this.extending ? "200px" : "145px"}
|
|
1258
|
-
text=${this.extending
|
|
1259
|
-
? "Confirm tour itinerary"
|
|
1260
|
-
: this.isMultiStop()
|
|
1261
|
-
? "Schedule tours"
|
|
1262
|
-
: "Schedule tour"}
|
|
1263
|
-
?disabled=${!this.canSubmit()}
|
|
1264
|
-
></action-confirm-button>
|
|
1265
|
-
</div>`;
|
|
1295
|
+
${this.extending && this.addingStop ? this.renderAddStop() : ""}`)}
|
|
1296
|
+
${this.renderFooter()}`;
|
|
1297
|
+
}
|
|
1298
|
+
// The design's three columns: the form and its footer in the right one.
|
|
1299
|
+
return html`<div class="schedule-body">
|
|
1300
|
+
<div id="scheduler-container">
|
|
1301
|
+
${main}
|
|
1302
|
+
<div id="book-tour-journey-items">${this.renderEditor()}</div>
|
|
1303
|
+
</div>
|
|
1304
|
+
<div class="info-column">
|
|
1305
|
+
<div class="info-scroll">${this.renderContactForm()}</div>
|
|
1306
|
+
${this.renderFooter()}
|
|
1307
|
+
</div>
|
|
1308
|
+
</div>`;
|
|
1266
1309
|
}
|
|
1267
1310
|
|
|
1268
1311
|
/** Today's reschedule prompt, with the server's reason. */
|
|
1269
1312
|
private renderReschedulePrompt(): TemplateResult {
|
|
1270
|
-
return html`${this.container(html`<div>
|
|
1271
|
-
<h2 class="
|
|
1272
|
-
<
|
|
1313
|
+
return html`${this.container(html`<div class="page-intro">
|
|
1314
|
+
<h2 class="page-heading">Reschedule Tour</h2>
|
|
1315
|
+
<p class="explanation">
|
|
1273
1316
|
${this.reschedulePrompt} Would you like to reschedule?
|
|
1274
|
-
</
|
|
1317
|
+
</p>
|
|
1275
1318
|
</div>`)}
|
|
1276
|
-
<div id="tour-scheduler-footer">
|
|
1277
|
-
<div class="explanation">${this.disclaimer()}</div>
|
|
1319
|
+
<div id="tour-scheduler-footer" class="itinerary">
|
|
1320
|
+
<div class="explanation consent">${this.disclaimer()}</div>
|
|
1278
1321
|
<div class="reschedule-buttons-wrapper">
|
|
1279
1322
|
<action-confirm-button
|
|
1280
1323
|
id="cancel-reschedule-bttn"
|
|
@@ -1285,16 +1328,16 @@ export class TourSchedulerV2 extends LitElement {
|
|
|
1285
1328
|
else this.rescheduleCanceled = true;
|
|
1286
1329
|
}}
|
|
1287
1330
|
.isLoading=${this.submitting}
|
|
1288
|
-
height="
|
|
1289
|
-
width="
|
|
1331
|
+
height="36px"
|
|
1332
|
+
width="100%"
|
|
1290
1333
|
text="Cancel"
|
|
1291
1334
|
></action-confirm-button>
|
|
1292
1335
|
<action-confirm-button
|
|
1293
1336
|
id="reschedule-button"
|
|
1294
1337
|
.onClick=${() => this.submit(true)}
|
|
1295
1338
|
.isLoading=${this.submitting}
|
|
1296
|
-
height="
|
|
1297
|
-
width="
|
|
1339
|
+
height="36px"
|
|
1340
|
+
width="100%"
|
|
1298
1341
|
text="Reschedule"
|
|
1299
1342
|
></action-confirm-button>
|
|
1300
1343
|
</div>
|
|
@@ -1302,11 +1345,13 @@ export class TourSchedulerV2 extends LitElement {
|
|
|
1302
1345
|
}
|
|
1303
1346
|
|
|
1304
1347
|
private renderRescheduleCanceled(): TemplateResult {
|
|
1305
|
-
return html`<div id="confirmationMessage">
|
|
1306
|
-
${
|
|
1307
|
-
<
|
|
1308
|
-
<p
|
|
1309
|
-
|
|
1348
|
+
return this.container(html`<div id="confirmationMessage" class="page-intro">
|
|
1349
|
+
${CheckCircleLineIcon(32)}
|
|
1350
|
+
<h2 class="page-heading">Thank you!</h2>
|
|
1351
|
+
<p class="explanation">
|
|
1352
|
+
We'll see you at your originally scheduled tour time.
|
|
1353
|
+
</p>
|
|
1354
|
+
</div>`);
|
|
1310
1355
|
}
|
|
1311
1356
|
|
|
1312
1357
|
private renderBooked(): TemplateResult {
|
|
@@ -1317,6 +1362,7 @@ export class TourSchedulerV2 extends LitElement {
|
|
|
1317
1362
|
>
|
|
1318
1363
|
${this.extendInitial
|
|
1319
1364
|
? html`<community-picker
|
|
1365
|
+
class="nearby"
|
|
1320
1366
|
variant="extend"
|
|
1321
1367
|
.load=${this.loadExtendCommunities}
|
|
1322
1368
|
.initial=${this.extendInitial}
|
|
@@ -1335,17 +1381,16 @@ export class TourSchedulerV2 extends LitElement {
|
|
|
1335
1381
|
switch (this.step) {
|
|
1336
1382
|
case "loading":
|
|
1337
1383
|
return html`<div class="center-tour-not-avail" role="status">
|
|
1338
|
-
<
|
|
1339
|
-
<
|
|
1340
|
-
<mega-loader size="48"></mega-loader>
|
|
1341
|
-
</div>
|
|
1384
|
+
<mega-loader size="48"></mega-loader>
|
|
1385
|
+
<h1 class="explanation">Searching for availabilities...</h1>
|
|
1342
1386
|
</div>`;
|
|
1343
1387
|
case "error":
|
|
1344
1388
|
return html`<div class="center-tour-not-avail">
|
|
1345
1389
|
<p class="error-message" role="alert">${this.loadError}</p>
|
|
1346
1390
|
<action-confirm-button
|
|
1347
1391
|
text="Try again"
|
|
1348
|
-
height="
|
|
1392
|
+
height="36px"
|
|
1393
|
+
width="160px"
|
|
1349
1394
|
.onClick=${() => this.start()}
|
|
1350
1395
|
></action-confirm-button>
|
|
1351
1396
|
</div>`;
|
|
@@ -1361,6 +1406,7 @@ export class TourSchedulerV2 extends LitElement {
|
|
|
1361
1406
|
render(): TemplateResult {
|
|
1362
1407
|
const back = this.backStep();
|
|
1363
1408
|
return html`<div
|
|
1409
|
+
${ref(this.observeModal)}
|
|
1364
1410
|
class=${classMap({
|
|
1365
1411
|
"tour-scheduler-full": !this.compactDesign && !this.mobile,
|
|
1366
1412
|
"tour-scheduler-compact": !!this.compactDesign && !this.mobile,
|
|
@@ -1375,17 +1421,17 @@ export class TourSchedulerV2 extends LitElement {
|
|
|
1375
1421
|
aria-label="Back"
|
|
1376
1422
|
@click=${() => this.goTo(back)}
|
|
1377
1423
|
>
|
|
1378
|
-
${
|
|
1424
|
+
${ChevronLeftLineIcon(18)}
|
|
1379
1425
|
</button>`
|
|
1380
1426
|
: ""}
|
|
1381
|
-
<h1 id="tour-header-title">Schedule
|
|
1427
|
+
<h1 id="tour-header-title">Schedule Tour</h1>
|
|
1382
1428
|
</div>
|
|
1383
1429
|
<button
|
|
1384
1430
|
id="close-button"
|
|
1385
1431
|
aria-label="Close scheduler"
|
|
1386
1432
|
@click=${(e: MouseEvent) => this.onCloseClicked?.(e)}
|
|
1387
1433
|
>
|
|
1388
|
-
${
|
|
1434
|
+
${CloseLineIcon(16)}
|
|
1389
1435
|
</button>
|
|
1390
1436
|
</div>
|
|
1391
1437
|
${this.renderBody()}
|
|
@@ -1393,83 +1439,305 @@ export class TourSchedulerV2 extends LitElement {
|
|
|
1393
1439
|
}
|
|
1394
1440
|
|
|
1395
1441
|
static styles = [
|
|
1396
|
-
|
|
1397
|
-
|
|
1442
|
+
schedulerV2Tokens,
|
|
1443
|
+
schedulerV2Styles,
|
|
1398
1444
|
css`
|
|
1399
|
-
/*
|
|
1445
|
+
/* The design's modal: 920px wide, a fixed height, its body scrolling. */
|
|
1446
|
+
.tour-scheduler-full,
|
|
1447
|
+
.tour-scheduler-compact,
|
|
1448
|
+
.tour-scheduler-mobile {
|
|
1449
|
+
background: #ffffff;
|
|
1450
|
+
border-radius: 16px;
|
|
1451
|
+
box-shadow: var(--tsv2-shadow);
|
|
1452
|
+
color: var(--tsv2-text);
|
|
1453
|
+
display: flex;
|
|
1454
|
+
flex-direction: column;
|
|
1455
|
+
font-family: var(--tsv2-font);
|
|
1456
|
+
letter-spacing: -0.01em;
|
|
1457
|
+
overflow: hidden;
|
|
1458
|
+
-webkit-font-smoothing: antialiased;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
.tour-scheduler-full {
|
|
1462
|
+
height: min(640px, calc(100vh - 64px));
|
|
1463
|
+
left: 50%;
|
|
1464
|
+
max-width: 920px;
|
|
1465
|
+
position: fixed;
|
|
1466
|
+
top: 50%;
|
|
1467
|
+
transform: translate(-50%, -50%);
|
|
1468
|
+
width: calc(100% - 32px);
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
.tour-scheduler-compact {
|
|
1472
|
+
height: min(640px, calc(100vh - 64px));
|
|
1473
|
+
left: 5%;
|
|
1474
|
+
max-width: min(920px, calc(90% - 340px)); /* 340px is the chat popup */
|
|
1475
|
+
position: fixed;
|
|
1476
|
+
top: 50%;
|
|
1477
|
+
transform: translate(0%, -50%);
|
|
1478
|
+
width: 100%;
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
.tour-scheduler-mobile {
|
|
1482
|
+
bottom: 0;
|
|
1483
|
+
height: calc(100vh - 12px);
|
|
1484
|
+
height: calc(100svh - 12px);
|
|
1485
|
+
left: 6px;
|
|
1486
|
+
position: fixed;
|
|
1487
|
+
right: 0;
|
|
1488
|
+
top: 6px;
|
|
1489
|
+
width: calc(100% - 12px);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
#top-header {
|
|
1493
|
+
align-items: center;
|
|
1494
|
+
border-bottom: 1px solid var(--tsv2-line);
|
|
1495
|
+
display: flex;
|
|
1496
|
+
flex: none;
|
|
1497
|
+
justify-content: space-between;
|
|
1498
|
+
padding: 16px;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1400
1501
|
.title {
|
|
1401
1502
|
align-items: center;
|
|
1402
1503
|
display: flex;
|
|
1403
|
-
gap:
|
|
1504
|
+
gap: 4px;
|
|
1404
1505
|
}
|
|
1405
1506
|
|
|
1406
|
-
#
|
|
1507
|
+
#tour-header-title {
|
|
1508
|
+
font-size: 16px;
|
|
1509
|
+
font-weight: 400;
|
|
1510
|
+
line-height: 24px;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
#back-button,
|
|
1514
|
+
#close-button {
|
|
1407
1515
|
align-items: center;
|
|
1408
1516
|
background: none;
|
|
1409
1517
|
border: none;
|
|
1518
|
+
border-radius: 4px;
|
|
1519
|
+
color: #212529;
|
|
1410
1520
|
cursor: pointer;
|
|
1411
1521
|
display: inline-flex;
|
|
1412
|
-
height: 24px;
|
|
1413
1522
|
justify-content: center;
|
|
1414
1523
|
padding: 0;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
#back-button {
|
|
1527
|
+
color: #000000;
|
|
1528
|
+
height: 24px;
|
|
1529
|
+
margin: -4px 0 -4px -6px;
|
|
1415
1530
|
width: 24px;
|
|
1416
1531
|
}
|
|
1417
1532
|
|
|
1418
|
-
#back-button
|
|
1419
|
-
|
|
1420
|
-
width: 8px;
|
|
1533
|
+
#back-button:hover {
|
|
1534
|
+
background: var(--tsv2-hover);
|
|
1421
1535
|
}
|
|
1422
1536
|
|
|
1423
|
-
|
|
1424
|
-
margin:
|
|
1537
|
+
#close-button {
|
|
1538
|
+
margin-right: -3px;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
#scheduler-container,
|
|
1542
|
+
#mobile-body-container {
|
|
1543
|
+
flex: 1;
|
|
1544
|
+
min-height: 0;
|
|
1545
|
+
overflow-y: auto;
|
|
1546
|
+
position: relative;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
#scheduler-container {
|
|
1550
|
+
padding: 24px 20px;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
#mobile-body-container {
|
|
1554
|
+
padding: 20px 16px;
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
/* The schedule step: the editor's two columns, then "Your Information". */
|
|
1558
|
+
.schedule-body {
|
|
1559
|
+
display: flex;
|
|
1560
|
+
flex: 1;
|
|
1561
|
+
min-height: 0;
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
.schedule-body #scheduler-container {
|
|
1565
|
+
padding: 20px;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
#book-tour-journey-items {
|
|
1569
|
+
display: grid;
|
|
1570
|
+
gap: 16px;
|
|
1571
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
/* A narrow modal: the editor's two columns, then "Your Information". */
|
|
1575
|
+
.info-row {
|
|
1576
|
+
grid-column: 1 / -1;
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
.tour-scheduler-mobile #book-tour-journey-items {
|
|
1580
|
+
display: flex;
|
|
1581
|
+
flex-direction: column;
|
|
1582
|
+
gap: 24px;
|
|
1425
1583
|
}
|
|
1426
1584
|
|
|
1427
|
-
/* Adding stops: the design's one centred column of stops. */
|
|
1428
1585
|
#book-tour-journey-items.itinerary {
|
|
1429
1586
|
display: block;
|
|
1430
1587
|
margin: 0 auto;
|
|
1431
|
-
max-width:
|
|
1588
|
+
max-width: 360px;
|
|
1432
1589
|
}
|
|
1433
1590
|
|
|
1434
|
-
.
|
|
1435
|
-
|
|
1591
|
+
.info-column {
|
|
1592
|
+
border-left: 1px solid var(--tsv2-line);
|
|
1593
|
+
display: flex;
|
|
1594
|
+
flex: 0 0 320px;
|
|
1595
|
+
flex-direction: column;
|
|
1596
|
+
min-height: 0;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
.info-scroll {
|
|
1600
|
+
flex: 1;
|
|
1601
|
+
min-height: 0;
|
|
1602
|
+
overflow-y: auto;
|
|
1603
|
+
padding: 20px;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
#tour-scheduler-footer {
|
|
1607
|
+
background: #ffffff;
|
|
1608
|
+
border-top: 1px solid var(--tsv2-line);
|
|
1609
|
+
display: flex;
|
|
1610
|
+
flex: none;
|
|
1611
|
+
flex-direction: column;
|
|
1612
|
+
gap: 16px;
|
|
1613
|
+
padding: 16px;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
#tour-scheduler-footer.itinerary {
|
|
1617
|
+
align-items: center;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
#tour-scheduler-footer.itinerary > * {
|
|
1621
|
+
max-width: 360px;
|
|
1622
|
+
width: 100%;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
/* The consent runs wider than the button, so it takes fewer lines. */
|
|
1626
|
+
#tour-scheduler-footer.itinerary > .consent {
|
|
1627
|
+
max-width: 568px;
|
|
1436
1628
|
text-align: center;
|
|
1437
1629
|
}
|
|
1438
1630
|
|
|
1439
|
-
|
|
1440
|
-
|
|
1631
|
+
.consent {
|
|
1632
|
+
font-size: 10px;
|
|
1633
|
+
line-height: 14px;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
/* formDisclaimer's own block: the design runs it on as one paragraph. */
|
|
1637
|
+
.consent > div {
|
|
1638
|
+
display: inline;
|
|
1639
|
+
padding-top: 0 !important;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
/* formDisclaimer colours its links inline; the design's are the accent. */
|
|
1643
|
+
.consent a {
|
|
1644
|
+
color: var(--tsv2-accent) !important;
|
|
1645
|
+
text-decoration: none;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
.consent a:hover {
|
|
1649
|
+
text-decoration: underline;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
action-confirm-button {
|
|
1653
|
+
--action-confirm-button-font: var(--tsv2-font);
|
|
1654
|
+
--action-confirm-button-radius: 4px;
|
|
1655
|
+
--action-confirm-button-disabled-background: var(--tsv2-line);
|
|
1656
|
+
display: block;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
.reschedule-buttons-wrapper {
|
|
1660
|
+
display: grid;
|
|
1661
|
+
gap: 8px;
|
|
1662
|
+
grid-template-columns: 1fr 1fr;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
.notice {
|
|
1666
|
+
margin: 0 0 16px;
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
.plan-error {
|
|
1670
|
+
font-size: 12px;
|
|
1671
|
+
line-height: 16px;
|
|
1672
|
+
margin: 0 0 16px;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
/* A page's centred icon, title and line under it. */
|
|
1676
|
+
.page-intro {
|
|
1677
|
+
align-items: center;
|
|
1678
|
+
display: flex;
|
|
1679
|
+
flex-direction: column;
|
|
1680
|
+
text-align: center;
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
.page-intro > svg {
|
|
1684
|
+
flex: none;
|
|
1685
|
+
margin-bottom: 12px;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
.page-intro .page-heading {
|
|
1441
1689
|
align-items: center;
|
|
1442
1690
|
display: flex;
|
|
1443
|
-
font-size: 20px;
|
|
1444
|
-
font-weight: 400;
|
|
1445
1691
|
gap: 8px;
|
|
1446
1692
|
justify-content: center;
|
|
1447
|
-
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
.page-intro .explanation {
|
|
1696
|
+
margin-top: 8px;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
.itinerary-heading {
|
|
1700
|
+
margin-bottom: 24px;
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
.itinerary-heading .page-heading {
|
|
1704
|
+
line-height: 24px;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
.itinerary-heading .explanation {
|
|
1708
|
+
margin-top: 2px;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
.center-tour-not-avail {
|
|
1712
|
+
align-items: center;
|
|
1713
|
+
display: flex;
|
|
1714
|
+
flex: 1;
|
|
1715
|
+
flex-direction: column;
|
|
1716
|
+
gap: 16px;
|
|
1717
|
+
justify-content: center;
|
|
1718
|
+
padding: 24px;
|
|
1719
|
+
text-align: center;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
.center-tour-not-avail h1 {
|
|
1723
|
+
font-weight: 400;
|
|
1448
1724
|
}
|
|
1449
1725
|
|
|
1450
1726
|
.add-stop-picker {
|
|
1451
|
-
margin
|
|
1452
|
-
|
|
1727
|
+
margin: 24px auto 0;
|
|
1728
|
+
max-width: 568px;
|
|
1453
1729
|
}
|
|
1454
1730
|
|
|
1455
|
-
/* The extend picker's top rule and padding put its heading 24px down. */
|
|
1456
1731
|
.close-add-stop {
|
|
1457
|
-
|
|
1458
|
-
border: none;
|
|
1459
|
-
cursor: pointer;
|
|
1460
|
-
padding: 4px;
|
|
1461
|
-
position: absolute;
|
|
1462
|
-
right: 0;
|
|
1463
|
-
top: 24px;
|
|
1732
|
+
margin-left: 4px;
|
|
1464
1733
|
}
|
|
1465
1734
|
|
|
1466
|
-
.
|
|
1467
|
-
|
|
1468
|
-
border:
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
text-decoration: underline;
|
|
1735
|
+
/* The nearby list under a booking, below a rule. */
|
|
1736
|
+
community-picker.nearby {
|
|
1737
|
+
border-top: 1px solid var(--tsv2-line);
|
|
1738
|
+
margin: 24px auto 0;
|
|
1739
|
+
max-width: 568px;
|
|
1740
|
+
padding-top: 24px;
|
|
1473
1741
|
}
|
|
1474
1742
|
`,
|
|
1475
1743
|
];
|