@anker-in/ui 0.1.5 → 0.1.8
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/README.md +162 -37
- package/dist/DemoRoom-Dx3PluHP.d.mts +85 -0
- package/dist/DemoRoom-Dx3PluHP.d.ts +85 -0
- package/dist/demo-room.d.mts +18 -1
- package/dist/demo-room.d.ts +18 -1
- package/dist/demo-room.js +120 -113
- package/dist/demo-room.js.map +1 -1
- package/dist/demo-room.mjs +120 -113
- package/dist/demo-room.mjs.map +1 -1
- package/dist/index.d.mts +116 -2
- package/dist/index.d.ts +116 -2
- package/dist/index.js +227 -175
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +227 -175
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +0 -1
- package/package.json +1 -1
- package/dist/DemoRoom-CZyrsxWe.d.mts +0 -30
- package/dist/DemoRoom-CZyrsxWe.d.ts +0 -30
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var Title = ({
|
|
|
39
39
|
title = "",
|
|
40
40
|
...props
|
|
41
41
|
}) => {
|
|
42
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full"), ...props, children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-[48px] font-
|
|
42
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full"), ...props, children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-[32px] min-l:text-[48px] font-bold mb-12 text-[#080A0F]", children: title }) });
|
|
43
43
|
};
|
|
44
44
|
Title.displayName = "Title";
|
|
45
45
|
var StudioCard = ({
|
|
@@ -47,18 +47,18 @@ var StudioCard = ({
|
|
|
47
47
|
name,
|
|
48
48
|
availableTime,
|
|
49
49
|
address,
|
|
50
|
-
city,
|
|
51
|
-
state,
|
|
52
|
-
zipCode,
|
|
53
|
-
country = "United States",
|
|
54
50
|
euifyMakeModel,
|
|
55
51
|
distance,
|
|
56
52
|
onSchedule,
|
|
53
|
+
pageData = {
|
|
54
|
+
scheduleNow: "Schedule Now",
|
|
55
|
+
available: "Available",
|
|
56
|
+
away: "away"
|
|
57
|
+
},
|
|
57
58
|
className,
|
|
58
59
|
style,
|
|
59
60
|
...props
|
|
60
61
|
}) => {
|
|
61
|
-
const fullAddress = `${address}, ${city}, ${state} ${country} ${zipCode}`;
|
|
62
62
|
const [isHovered, setIsHovered] = React2__default.default.useState(false);
|
|
63
63
|
const handleScheduleClick = () => {
|
|
64
64
|
onSchedule?.(code);
|
|
@@ -91,7 +91,8 @@ var StudioCard = ({
|
|
|
91
91
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-semibold text-gray-900", children: name }),
|
|
92
92
|
distance !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-medium text-[#2E8B57] bg-[#E8F5E9] px-3 py-1 rounded-full whitespace-nowrap ml-2", children: [
|
|
93
93
|
formatDistance(distance),
|
|
94
|
-
"
|
|
94
|
+
" ",
|
|
95
|
+
pageData.away
|
|
95
96
|
] })
|
|
96
97
|
] }),
|
|
97
98
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
|
|
@@ -148,7 +149,8 @@ var StudioCard = ({
|
|
|
148
149
|
}
|
|
149
150
|
),
|
|
150
151
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-600", children: [
|
|
151
|
-
|
|
152
|
+
pageData.available,
|
|
153
|
+
" ",
|
|
152
154
|
availableTime
|
|
153
155
|
] }) })
|
|
154
156
|
] }),
|
|
@@ -182,7 +184,7 @@ var StudioCard = ({
|
|
|
182
184
|
]
|
|
183
185
|
}
|
|
184
186
|
),
|
|
185
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-600", children:
|
|
187
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-600 break-words", children: address }) })
|
|
186
188
|
] }),
|
|
187
189
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 mb-6", children: [
|
|
188
190
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -239,10 +241,10 @@ var StudioCard = ({
|
|
|
239
241
|
"w-full px-6 py-3 rounded-full",
|
|
240
242
|
"bg-white text-gray-900 border border-gray-900",
|
|
241
243
|
"font-medium text-sm",
|
|
242
|
-
"hover:bg-gray-900",
|
|
244
|
+
"hover:bg-gray-900 hover:text-white",
|
|
243
245
|
"transition-all duration-200"
|
|
244
246
|
),
|
|
245
|
-
children:
|
|
247
|
+
children: pageData.scheduleNow
|
|
246
248
|
}
|
|
247
249
|
)
|
|
248
250
|
]
|
|
@@ -274,6 +276,12 @@ var StudioMap = ({
|
|
|
274
276
|
defaultZoom = 4,
|
|
275
277
|
mapHeight = "600px",
|
|
276
278
|
onSchedule,
|
|
279
|
+
pageData = {
|
|
280
|
+
apiKeyRequired: "Google Maps API Key is required",
|
|
281
|
+
loadingMap: "Loading map...",
|
|
282
|
+
scheduleNow: "Schedule Now",
|
|
283
|
+
available: "Available"
|
|
284
|
+
},
|
|
277
285
|
className,
|
|
278
286
|
...props
|
|
279
287
|
}) => {
|
|
@@ -372,13 +380,13 @@ var StudioMap = ({
|
|
|
372
380
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
373
381
|
<path d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"/>
|
|
374
382
|
</svg>
|
|
375
|
-
<span style="vertical-align: middle;"
|
|
383
|
+
<span style="vertical-align: middle;">${pageData.available} ${location.availableTime}</span>
|
|
376
384
|
</div>` : ""}
|
|
377
385
|
<div style="margin-bottom: 8px; color: #666;">
|
|
378
386
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
379
387
|
<path fill-rule="evenodd" d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z" clip-rule="evenodd"/>
|
|
380
388
|
</svg>
|
|
381
|
-
<span style="vertical-align: middle;">${location.address}
|
|
389
|
+
<span style="vertical-align: middle;">${location.address}</span>
|
|
382
390
|
</div>
|
|
383
391
|
${location.euifyMakeModel ? `<div style="margin-bottom: 12px; color: #666;">
|
|
384
392
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
@@ -402,7 +410,7 @@ var StudioMap = ({
|
|
|
402
410
|
onmouseover="this.style.background='#333'"
|
|
403
411
|
onmouseout="this.style.background='#000'"
|
|
404
412
|
>
|
|
405
|
-
|
|
413
|
+
${pageData.scheduleNow}
|
|
406
414
|
</button>
|
|
407
415
|
</div>
|
|
408
416
|
`;
|
|
@@ -458,13 +466,13 @@ var StudioMap = ({
|
|
|
458
466
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
459
467
|
<path d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"/>
|
|
460
468
|
</svg>
|
|
461
|
-
<span style="vertical-align: middle;"
|
|
469
|
+
<span style="vertical-align: middle;">${pageData.available} ${location.availableTime}</span>
|
|
462
470
|
</div>` : ""}
|
|
463
471
|
<div style="margin-bottom: 8px; color: #666;">
|
|
464
472
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
465
473
|
<path fill-rule="evenodd" d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z" clip-rule="evenodd"/>
|
|
466
474
|
</svg>
|
|
467
|
-
<span style="vertical-align: middle;">${location.address}
|
|
475
|
+
<span style="vertical-align: middle;">${location.address}</span>
|
|
468
476
|
</div>
|
|
469
477
|
${location.euifyMakeModel ? `<div style="margin-bottom: 12px; color: #666;">
|
|
470
478
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
@@ -488,7 +496,7 @@ var StudioMap = ({
|
|
|
488
496
|
onmouseover="this.style.background='#333'"
|
|
489
497
|
onmouseout="this.style.background='#000'"
|
|
490
498
|
>
|
|
491
|
-
|
|
499
|
+
${pageData.scheduleNow}
|
|
492
500
|
</button>
|
|
493
501
|
</div>
|
|
494
502
|
`;
|
|
@@ -524,7 +532,7 @@ var StudioMap = ({
|
|
|
524
532
|
),
|
|
525
533
|
style: { height: mapHeight },
|
|
526
534
|
...props,
|
|
527
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children:
|
|
535
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: pageData.apiKeyRequired })
|
|
528
536
|
}
|
|
529
537
|
);
|
|
530
538
|
}
|
|
@@ -537,7 +545,7 @@ var StudioMap = ({
|
|
|
537
545
|
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: mapRef, style: { height: mapHeight } }),
|
|
538
546
|
!isLoaded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-gray-100", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
539
547
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-gray-900 mb-2" }),
|
|
540
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children:
|
|
548
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: pageData.loadingMap })
|
|
541
549
|
] }) })
|
|
542
550
|
]
|
|
543
551
|
}
|
|
@@ -666,7 +674,14 @@ function useQuestionnaire(client, code, questionnaire_id, locale, options) {
|
|
|
666
674
|
});
|
|
667
675
|
const enabled = options?.enabled !== false;
|
|
668
676
|
React2.useEffect(() => {
|
|
669
|
-
if (!enabled || !code || !questionnaire_id)
|
|
677
|
+
if (!enabled || !code || !questionnaire_id) {
|
|
678
|
+
setState({
|
|
679
|
+
data: null,
|
|
680
|
+
loading: false,
|
|
681
|
+
error: null
|
|
682
|
+
});
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
670
685
|
let cancelled = false;
|
|
671
686
|
const fetchData = async () => {
|
|
672
687
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
@@ -822,65 +837,6 @@ var AntdMobileIsolated = ({
|
|
|
822
837
|
AntdMobileIsolated.displayName = "AntdMobileIsolated";
|
|
823
838
|
|
|
824
839
|
// src/components/DemoRoom/utils/addressParser.ts
|
|
825
|
-
var KNOWN_COUNTRIES = [
|
|
826
|
-
"United States",
|
|
827
|
-
"United Kingdom",
|
|
828
|
-
"American Samoa",
|
|
829
|
-
"United Arab Emirates",
|
|
830
|
-
"Bosnia and Herzegovina",
|
|
831
|
-
"Trinidad and Tobago",
|
|
832
|
-
"Saint Kitts and Nevis",
|
|
833
|
-
"Antigua and Barbuda",
|
|
834
|
-
"Saint Vincent and the Grenadines",
|
|
835
|
-
"S\xE3o Tom\xE9 and Pr\xEDncipe",
|
|
836
|
-
"United States Minor Outlying Islands",
|
|
837
|
-
"British Virgin Islands",
|
|
838
|
-
"United States Virgin Islands",
|
|
839
|
-
"Cayman Islands",
|
|
840
|
-
"Cook Islands",
|
|
841
|
-
"Falkland Islands",
|
|
842
|
-
"Faroe Islands",
|
|
843
|
-
"Marshall Islands",
|
|
844
|
-
"Northern Mariana Islands",
|
|
845
|
-
"Pitcairn Islands",
|
|
846
|
-
"Solomon Islands",
|
|
847
|
-
"Turks and Caicos Islands",
|
|
848
|
-
"Wallis and Futuna"
|
|
849
|
-
];
|
|
850
|
-
function parseAddress(address) {
|
|
851
|
-
const parts = address.split(",").map((part) => part.trim()).filter(Boolean);
|
|
852
|
-
let country = "United States";
|
|
853
|
-
let state = "";
|
|
854
|
-
let city = "";
|
|
855
|
-
if (parts.length === 0) {
|
|
856
|
-
return { country, state, city };
|
|
857
|
-
}
|
|
858
|
-
const lastPart = parts[parts.length - 1];
|
|
859
|
-
const matchedCountry = KNOWN_COUNTRIES.find(
|
|
860
|
-
(knownCountry) => lastPart.toLowerCase() === knownCountry.toLowerCase()
|
|
861
|
-
);
|
|
862
|
-
if (matchedCountry) {
|
|
863
|
-
country = matchedCountry;
|
|
864
|
-
if (parts.length >= 2) {
|
|
865
|
-
state = parts[parts.length - 2].split(" ")[0];
|
|
866
|
-
}
|
|
867
|
-
if (parts.length >= 3) {
|
|
868
|
-
city = parts[parts.length - 3];
|
|
869
|
-
}
|
|
870
|
-
} else {
|
|
871
|
-
if (parts.length >= 2) {
|
|
872
|
-
state = parts[parts.length - 1].split(" ")[0];
|
|
873
|
-
city = parts[parts.length - 2];
|
|
874
|
-
} else if (parts.length === 1) {
|
|
875
|
-
city = parts[0];
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
return {
|
|
879
|
-
country: country.trim(),
|
|
880
|
-
state: state.trim(),
|
|
881
|
-
city: city.trim()
|
|
882
|
-
};
|
|
883
|
-
}
|
|
884
840
|
function groupByAlphabet(items) {
|
|
885
841
|
const groups = /* @__PURE__ */ new Map();
|
|
886
842
|
items.forEach((item) => {
|
|
@@ -907,7 +863,15 @@ var LocationFilter = ({
|
|
|
907
863
|
locations,
|
|
908
864
|
onSelect,
|
|
909
865
|
visible = false,
|
|
910
|
-
onClose
|
|
866
|
+
onClose,
|
|
867
|
+
pageData = {
|
|
868
|
+
allLocations: "All Locations",
|
|
869
|
+
clear: "Clear",
|
|
870
|
+
country: "Country",
|
|
871
|
+
state: "State",
|
|
872
|
+
city: "City",
|
|
873
|
+
noStudiosFound: "No studios found in this location"
|
|
874
|
+
}
|
|
911
875
|
}) => {
|
|
912
876
|
const [currentLevel, setCurrentLevel] = React2.useState("country");
|
|
913
877
|
const [selectedCountry, setSelectedCountry] = React2.useState();
|
|
@@ -918,7 +882,7 @@ var LocationFilter = ({
|
|
|
918
882
|
const states = /* @__PURE__ */ new Map();
|
|
919
883
|
const cities = /* @__PURE__ */ new Map();
|
|
920
884
|
locations.forEach((location) => {
|
|
921
|
-
const { country, state, city } =
|
|
885
|
+
const { country, state, city } = location;
|
|
922
886
|
if (country) {
|
|
923
887
|
const existing = countries.get(country);
|
|
924
888
|
countries.set(country, {
|
|
@@ -1055,7 +1019,7 @@ var LocationFilter = ({
|
|
|
1055
1019
|
"pb-[4px] transition-colors",
|
|
1056
1020
|
currentLevel === "country" ? "text-[#1D1D1F] border-b-2 border-[#2E8B57]" : "text-[#767880]"
|
|
1057
1021
|
),
|
|
1058
|
-
children:
|
|
1022
|
+
children: pageData.country
|
|
1059
1023
|
}
|
|
1060
1024
|
),
|
|
1061
1025
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1068,7 +1032,7 @@ var LocationFilter = ({
|
|
|
1068
1032
|
currentLevel === "state" ? "text-[#1D1D1F] border-b-2 border-[#2E8B57]" : "text-[#767880]",
|
|
1069
1033
|
!selectedCountry && "opacity-50 cursor-not-allowed"
|
|
1070
1034
|
),
|
|
1071
|
-
children:
|
|
1035
|
+
children: pageData.state
|
|
1072
1036
|
}
|
|
1073
1037
|
),
|
|
1074
1038
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1081,7 +1045,7 @@ var LocationFilter = ({
|
|
|
1081
1045
|
currentLevel === "city" ? "text-[#1D1D1F] border-b-2 border-[#2E8B57]" : "text-[#767880]",
|
|
1082
1046
|
!selectedState && "opacity-50 cursor-not-allowed"
|
|
1083
1047
|
),
|
|
1084
|
-
children:
|
|
1048
|
+
children: pageData.city
|
|
1085
1049
|
}
|
|
1086
1050
|
)
|
|
1087
1051
|
] })
|
|
@@ -1113,11 +1077,37 @@ var LocationFilter = ({
|
|
|
1113
1077
|
);
|
|
1114
1078
|
};
|
|
1115
1079
|
LocationFilter.displayName = "LocationFilter";
|
|
1080
|
+
var defaultPageData = {
|
|
1081
|
+
title: "Find a Studio Near You",
|
|
1082
|
+
loadingText: "Loading demo rooms...",
|
|
1083
|
+
errorTitle: "Failed to load demo rooms",
|
|
1084
|
+
locationFilter: {
|
|
1085
|
+
allLocations: "All Locations",
|
|
1086
|
+
clear: "Clear",
|
|
1087
|
+
country: "Country",
|
|
1088
|
+
state: "State",
|
|
1089
|
+
city: "City",
|
|
1090
|
+
noStudiosFound: "No studios found in this location"
|
|
1091
|
+
},
|
|
1092
|
+
studioCard: {
|
|
1093
|
+
scheduleNow: "Schedule Now",
|
|
1094
|
+
available: "Available",
|
|
1095
|
+
away: "away"
|
|
1096
|
+
},
|
|
1097
|
+
map: {
|
|
1098
|
+
apiKeyRequired: "Google Maps API Key is required",
|
|
1099
|
+
loadingMap: "Loading map...",
|
|
1100
|
+
scheduleNow: "Schedule Now",
|
|
1101
|
+
available: "Available"
|
|
1102
|
+
},
|
|
1103
|
+
defaultCountry: "United States",
|
|
1104
|
+
noAvailableTime: "No available time"
|
|
1105
|
+
};
|
|
1116
1106
|
var defaultStudioLocations = [
|
|
1117
1107
|
{
|
|
1118
1108
|
id: "1",
|
|
1119
1109
|
name: "Design District Demo Room",
|
|
1120
|
-
address: "111 8th St",
|
|
1110
|
+
address: "111 8th St, San Francisco, CA, United States",
|
|
1121
1111
|
city: "San Francisco",
|
|
1122
1112
|
state: "CA",
|
|
1123
1113
|
zipCode: "94108",
|
|
@@ -1130,7 +1120,7 @@ var defaultStudioLocations = [
|
|
|
1130
1120
|
{
|
|
1131
1121
|
id: "2",
|
|
1132
1122
|
name: "Brooklyn Creative Studio",
|
|
1133
|
-
address: "456 Broadway",
|
|
1123
|
+
address: "456 Broadway, Brooklyn, NY, United States",
|
|
1134
1124
|
city: "Brooklyn",
|
|
1135
1125
|
state: "NY",
|
|
1136
1126
|
zipCode: "11211",
|
|
@@ -1143,7 +1133,7 @@ var defaultStudioLocations = [
|
|
|
1143
1133
|
{
|
|
1144
1134
|
id: "3",
|
|
1145
1135
|
name: "Austin Innovation Hub",
|
|
1146
|
-
address: "789 Tech Blvd",
|
|
1136
|
+
address: "789 Tech Blvd, Austin, TX, United States",
|
|
1147
1137
|
city: "Austin",
|
|
1148
1138
|
state: "TX",
|
|
1149
1139
|
zipCode: "78701",
|
|
@@ -1156,7 +1146,7 @@ var defaultStudioLocations = [
|
|
|
1156
1146
|
{
|
|
1157
1147
|
id: "4",
|
|
1158
1148
|
name: "Seattle Maker Space",
|
|
1159
|
-
address: "321 Pine St",
|
|
1149
|
+
address: "321 Pine St, Seattle, WA, United States",
|
|
1160
1150
|
city: "Seattle",
|
|
1161
1151
|
state: "WA",
|
|
1162
1152
|
zipCode: "98101",
|
|
@@ -1169,7 +1159,7 @@ var defaultStudioLocations = [
|
|
|
1169
1159
|
{
|
|
1170
1160
|
id: "5",
|
|
1171
1161
|
name: "Chicago Design Center",
|
|
1172
|
-
address: "654 Michigan Ave",
|
|
1162
|
+
address: "654 Michigan Ave, Chicago, IL, United States",
|
|
1173
1163
|
city: "Chicago",
|
|
1174
1164
|
state: "IL",
|
|
1175
1165
|
zipCode: "60611",
|
|
@@ -1182,7 +1172,7 @@ var defaultStudioLocations = [
|
|
|
1182
1172
|
{
|
|
1183
1173
|
id: "6",
|
|
1184
1174
|
name: "Miami Beach Studio",
|
|
1185
|
-
address: "987 Ocean Drive",
|
|
1175
|
+
address: "987 Ocean Drive, Miami Beach, FL, United States",
|
|
1186
1176
|
city: "Miami Beach",
|
|
1187
1177
|
state: "FL",
|
|
1188
1178
|
zipCode: "33139",
|
|
@@ -1195,7 +1185,7 @@ var defaultStudioLocations = [
|
|
|
1195
1185
|
{
|
|
1196
1186
|
id: "7",
|
|
1197
1187
|
name: "Denver Mountain Studio",
|
|
1198
|
-
address: "147 16th St",
|
|
1188
|
+
address: "147 16th St, Denver, CO, United States",
|
|
1199
1189
|
city: "Denver",
|
|
1200
1190
|
state: "CO",
|
|
1201
1191
|
zipCode: "80202",
|
|
@@ -1208,7 +1198,7 @@ var defaultStudioLocations = [
|
|
|
1208
1198
|
{
|
|
1209
1199
|
id: "8",
|
|
1210
1200
|
name: "Los Angeles Creative Lab",
|
|
1211
|
-
address: "258 Main St",
|
|
1201
|
+
address: "258 Main St, Los Angeles, CA, United States",
|
|
1212
1202
|
city: "Los Angeles",
|
|
1213
1203
|
state: "CA",
|
|
1214
1204
|
zipCode: "90012",
|
|
@@ -1226,8 +1216,22 @@ var RoomsList = ({
|
|
|
1226
1216
|
teamCode,
|
|
1227
1217
|
brandWebsite,
|
|
1228
1218
|
onSchedule,
|
|
1219
|
+
pageData,
|
|
1229
1220
|
...props
|
|
1230
1221
|
}) => {
|
|
1222
|
+
const mergedPageData = React2.useMemo(
|
|
1223
|
+
() => ({
|
|
1224
|
+
...defaultPageData,
|
|
1225
|
+
...pageData,
|
|
1226
|
+
locationFilter: {
|
|
1227
|
+
...defaultPageData.locationFilter,
|
|
1228
|
+
...pageData?.locationFilter
|
|
1229
|
+
},
|
|
1230
|
+
studioCard: { ...defaultPageData.studioCard, ...pageData?.studioCard },
|
|
1231
|
+
map: { ...defaultPageData.map, ...pageData?.map }
|
|
1232
|
+
}),
|
|
1233
|
+
[pageData]
|
|
1234
|
+
);
|
|
1231
1235
|
const [showLocationFilter, setShowLocationFilter] = React2.useState(false);
|
|
1232
1236
|
const [selectedLocation, setSelectedLocation] = React2.useState();
|
|
1233
1237
|
const [hoveredRoomId, setHoveredRoomId] = React2.useState(null);
|
|
@@ -1246,18 +1250,22 @@ var RoomsList = ({
|
|
|
1246
1250
|
const nextAvailableTimeslot = room?.timeslots?.find(
|
|
1247
1251
|
(slot) => slot.status === "available"
|
|
1248
1252
|
);
|
|
1249
|
-
const
|
|
1253
|
+
const country = room.location?.country || mergedPageData.defaultCountry;
|
|
1254
|
+
const state = room.location?.state || "";
|
|
1255
|
+
const city = room.location?.city || "";
|
|
1256
|
+
const addressParts = [room.address, city, state, country].filter(Boolean);
|
|
1257
|
+
const fullAddress = addressParts.join(", ");
|
|
1250
1258
|
return {
|
|
1251
1259
|
id: room.code,
|
|
1252
1260
|
name: room.name,
|
|
1253
|
-
address:
|
|
1261
|
+
address: fullAddress,
|
|
1254
1262
|
city,
|
|
1255
1263
|
state,
|
|
1256
1264
|
zipCode: "",
|
|
1257
1265
|
country,
|
|
1258
1266
|
lat: Number(room.latitude) || 34.0522,
|
|
1259
1267
|
lng: Number(room.longitude) || -118.2437,
|
|
1260
|
-
availableTime: nextAvailableTimeslot ? `${nextAvailableTimeslot.start_time}` :
|
|
1268
|
+
availableTime: nextAvailableTimeslot ? `${nextAvailableTimeslot.start_time}` : mergedPageData.noAvailableTime,
|
|
1261
1269
|
euifyMakeModel: room?.description
|
|
1262
1270
|
};
|
|
1263
1271
|
});
|
|
@@ -1265,25 +1273,24 @@ var RoomsList = ({
|
|
|
1265
1273
|
const filteredStudioLocations = React2.useMemo(() => {
|
|
1266
1274
|
if (!selectedLocation) return studioLocations;
|
|
1267
1275
|
return studioLocations.filter((location) => {
|
|
1268
|
-
const { country, state, city } = parseAddress(location.address);
|
|
1269
1276
|
if (selectedLocation.city) {
|
|
1270
|
-
return country === selectedLocation.country && state === selectedLocation.state && city === selectedLocation.city;
|
|
1277
|
+
return location.country === selectedLocation.country && location.state === selectedLocation.state && location.city === selectedLocation.city;
|
|
1271
1278
|
}
|
|
1272
1279
|
if (selectedLocation.state) {
|
|
1273
|
-
return country === selectedLocation.country && state === selectedLocation.state;
|
|
1280
|
+
return location.country === selectedLocation.country && location.state === selectedLocation.state;
|
|
1274
1281
|
}
|
|
1275
1282
|
if (selectedLocation.country) {
|
|
1276
|
-
return country === selectedLocation.country;
|
|
1283
|
+
return location.country === selectedLocation.country;
|
|
1277
1284
|
}
|
|
1278
1285
|
return true;
|
|
1279
1286
|
});
|
|
1280
1287
|
}, [studioLocations, selectedLocation]);
|
|
1281
1288
|
const getSelectedLocationName = () => {
|
|
1282
|
-
if (!selectedLocation) return
|
|
1289
|
+
if (!selectedLocation) return mergedPageData.locationFilter.allLocations;
|
|
1283
1290
|
if (selectedLocation.city) return selectedLocation.city;
|
|
1284
1291
|
if (selectedLocation.state) return selectedLocation.state;
|
|
1285
1292
|
if (selectedLocation.country) return selectedLocation.country;
|
|
1286
|
-
return
|
|
1293
|
+
return mergedPageData.locationFilter.allLocations;
|
|
1287
1294
|
};
|
|
1288
1295
|
const handleLocationSelect = (selection) => {
|
|
1289
1296
|
setSelectedLocation(selection);
|
|
@@ -1294,17 +1301,17 @@ var RoomsList = ({
|
|
|
1294
1301
|
};
|
|
1295
1302
|
console.log(filteredStudioLocations);
|
|
1296
1303
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, ...props, children: [
|
|
1297
|
-
/* @__PURE__ */ jsxRuntime.jsx(Title, { title:
|
|
1298
|
-
loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children:
|
|
1304
|
+
/* @__PURE__ */ jsxRuntime.jsx(Title, { title: mergedPageData.title }),
|
|
1305
|
+
loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children: mergedPageData.loadingText }) }) }),
|
|
1299
1306
|
error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", style: { color: "#FF4D4D" }, children: [
|
|
1300
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children:
|
|
1307
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children: mergedPageData.errorTitle }),
|
|
1301
1308
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm mt-2", children: error.message })
|
|
1302
1309
|
] }) }),
|
|
1303
1310
|
!loading && !error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-[794px] gap-4", children: [
|
|
1304
1311
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1305
1312
|
"div",
|
|
1306
1313
|
{
|
|
1307
|
-
className: "flex-none relative w-[420px]",
|
|
1314
|
+
className: "flex-none relative w-[420px] l:!w-full",
|
|
1308
1315
|
style: { height: "794px" },
|
|
1309
1316
|
children: [
|
|
1310
1317
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-[12px] mb-4 bg-white border border-[#E4E5E6] px-[20px] py-[16px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-[40px] font-bold text-[16px] gap-10 flex items-center", children: [
|
|
@@ -1340,7 +1347,7 @@ var RoomsList = ({
|
|
|
1340
1347
|
{
|
|
1341
1348
|
onClick: handleClearFilter,
|
|
1342
1349
|
className: "ml-auto text-[14px] text-[#2E8B57] hover:underline",
|
|
1343
|
-
children:
|
|
1350
|
+
children: mergedPageData.locationFilter.clear
|
|
1344
1351
|
}
|
|
1345
1352
|
),
|
|
1346
1353
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex text-[#767880] cursor-not-allowed", children: [
|
|
@@ -1369,7 +1376,7 @@ var RoomsList = ({
|
|
|
1369
1376
|
{
|
|
1370
1377
|
style: { maxHeight: "706px", overflow: "auto" },
|
|
1371
1378
|
className: "rounded-[12px] bg-white border border-[#E4E5E6]",
|
|
1372
|
-
children: filteredStudioLocations.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[200px] text-[#767880]", children:
|
|
1379
|
+
children: filteredStudioLocations.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[200px] text-[#767880]", children: mergedPageData.locationFilter.noStudiosFound }) : filteredStudioLocations.map((item) => {
|
|
1373
1380
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1374
1381
|
StudioCard,
|
|
1375
1382
|
{
|
|
@@ -1383,7 +1390,8 @@ var RoomsList = ({
|
|
|
1383
1390
|
euifyMakeModel: item?.euifyMakeModel || "",
|
|
1384
1391
|
onSchedule,
|
|
1385
1392
|
onMouseEnter: () => setHoveredRoomId(item.id),
|
|
1386
|
-
onMouseLeave: () => setHoveredRoomId(null)
|
|
1393
|
+
onMouseLeave: () => setHoveredRoomId(null),
|
|
1394
|
+
pageData: mergedPageData.studioCard
|
|
1387
1395
|
},
|
|
1388
1396
|
item.id
|
|
1389
1397
|
);
|
|
@@ -1394,25 +1402,29 @@ var RoomsList = ({
|
|
|
1394
1402
|
LocationFilter,
|
|
1395
1403
|
{
|
|
1396
1404
|
locations: studioLocations.map((loc) => ({
|
|
1397
|
-
|
|
1398
|
-
|
|
1405
|
+
id: loc.id,
|
|
1406
|
+
country: loc.country,
|
|
1407
|
+
state: loc.state,
|
|
1408
|
+
city: loc.city
|
|
1399
1409
|
})),
|
|
1400
1410
|
visible: showLocationFilter,
|
|
1401
1411
|
onSelect: handleLocationSelect,
|
|
1402
|
-
onClose: () => setShowLocationFilter(false)
|
|
1412
|
+
onClose: () => setShowLocationFilter(false),
|
|
1413
|
+
pageData: mergedPageData.locationFilter
|
|
1403
1414
|
}
|
|
1404
1415
|
)
|
|
1405
1416
|
]
|
|
1406
1417
|
}
|
|
1407
1418
|
),
|
|
1408
|
-
googleMapsApiKey && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1419
|
+
googleMapsApiKey && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1 l:!hidden"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1409
1420
|
StudioMap,
|
|
1410
1421
|
{
|
|
1411
1422
|
googleMapsApiKey,
|
|
1412
1423
|
locations: filteredStudioLocations,
|
|
1413
1424
|
hoveredLocationId: hoveredRoomId,
|
|
1414
1425
|
onSchedule,
|
|
1415
|
-
mapHeight: "794px"
|
|
1426
|
+
mapHeight: "794px",
|
|
1427
|
+
pageData: mergedPageData.map
|
|
1416
1428
|
}
|
|
1417
1429
|
) })
|
|
1418
1430
|
] })
|
|
@@ -1594,6 +1606,7 @@ var DemoRoom = ({
|
|
|
1594
1606
|
teamCode,
|
|
1595
1607
|
brandWebsite,
|
|
1596
1608
|
onSchedule,
|
|
1609
|
+
pageData,
|
|
1597
1610
|
...props
|
|
1598
1611
|
}) => {
|
|
1599
1612
|
const apiClient = React2.useMemo(
|
|
@@ -1608,7 +1621,8 @@ var DemoRoom = ({
|
|
|
1608
1621
|
apiClient,
|
|
1609
1622
|
teamCode,
|
|
1610
1623
|
brandWebsite,
|
|
1611
|
-
onSchedule
|
|
1624
|
+
onSchedule,
|
|
1625
|
+
pageData
|
|
1612
1626
|
}
|
|
1613
1627
|
) });
|
|
1614
1628
|
};
|
|
@@ -1617,10 +1631,10 @@ var QuestionnaireForm = ({
|
|
|
1617
1631
|
questions,
|
|
1618
1632
|
onSubmit,
|
|
1619
1633
|
pageData,
|
|
1634
|
+
selectedTimeslotId,
|
|
1620
1635
|
loading = false,
|
|
1621
1636
|
className
|
|
1622
1637
|
}) => {
|
|
1623
|
-
console.log(pageData);
|
|
1624
1638
|
const [responses, setResponses] = React2.useState({});
|
|
1625
1639
|
const [errors, setErrors] = React2.useState({});
|
|
1626
1640
|
const [agreements, setAgreements] = React2.useState({});
|
|
@@ -1807,7 +1821,7 @@ var QuestionnaireForm = ({
|
|
|
1807
1821
|
}
|
|
1808
1822
|
};
|
|
1809
1823
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pb-[80px]", children: [
|
|
1810
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white rounded-[12px] border border-[#E4E5E6] p-8", children: /* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: questions
|
|
1824
|
+
questions && questions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white rounded-[12px] border border-[#E4E5E6] p-8", children: /* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: questions.map((question) => {
|
|
1811
1825
|
const questionId = getQuestionId(question);
|
|
1812
1826
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
1813
1827
|
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "block", children: [
|
|
@@ -1822,7 +1836,7 @@ var QuestionnaireForm = ({
|
|
|
1822
1836
|
errors[questionId] && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", style: { color: "#FF4D4D" }, children: errors[questionId] })
|
|
1823
1837
|
] }, questionId);
|
|
1824
1838
|
}) }) }),
|
|
1825
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center", children: [
|
|
1839
|
+
!!selectedTimeslotId && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center", children: [
|
|
1826
1840
|
pageData?.agrees && pageData.agrees.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 mt-8", children: [
|
|
1827
1841
|
pageData.agrees.map((agreeContent, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1828
1842
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1860,7 +1874,7 @@ var QuestionnaireForm = ({
|
|
|
1860
1874
|
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
|
|
1861
1875
|
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
1862
1876
|
),
|
|
1863
|
-
children: loading ? "Submitting..." : "Submit Booking"
|
|
1877
|
+
children: loading ? pageData?.submitting || "Submitting..." : pageData?.submit || "Submit Booking"
|
|
1864
1878
|
}
|
|
1865
1879
|
)
|
|
1866
1880
|
] })
|
|
@@ -1873,7 +1887,18 @@ var DateTimePicker = ({
|
|
|
1873
1887
|
apiClient,
|
|
1874
1888
|
demoRoomCode,
|
|
1875
1889
|
timezone,
|
|
1876
|
-
pageData
|
|
1890
|
+
pageData = {
|
|
1891
|
+
scheduleYourVisit: "Schedule Your Visit",
|
|
1892
|
+
timeSlot: "Time Slot",
|
|
1893
|
+
loadingTimeSlots: "Loading time slots...",
|
|
1894
|
+
failedToLoadTimeSlots: "Failed to load time slots",
|
|
1895
|
+
noAvailableTimeSlots: "No available time slots for this date",
|
|
1896
|
+
full: "Full",
|
|
1897
|
+
spotsLeft: "spots left",
|
|
1898
|
+
fillOutForm: "Fill out Form",
|
|
1899
|
+
loadingQuestionnaire: "Loading questionnaire...",
|
|
1900
|
+
bookingFailed: "Booking failed"
|
|
1901
|
+
},
|
|
1877
1902
|
locale,
|
|
1878
1903
|
onBookingSuccess
|
|
1879
1904
|
}) => {
|
|
@@ -1883,7 +1908,6 @@ var DateTimePicker = ({
|
|
|
1883
1908
|
const [selectedTimeslotId, setSelectedTimeslotId] = React2.useState(
|
|
1884
1909
|
null
|
|
1885
1910
|
);
|
|
1886
|
-
const [showQuestionnaire, setShowQuestionnaire] = React2.useState(false);
|
|
1887
1911
|
const {
|
|
1888
1912
|
createBooking,
|
|
1889
1913
|
loading: bookingLoading,
|
|
@@ -1902,11 +1926,6 @@ var DateTimePicker = ({
|
|
|
1902
1926
|
locale,
|
|
1903
1927
|
{ enabled: !!demoRoomCode && !!demoRoom?.questionnaire_id }
|
|
1904
1928
|
);
|
|
1905
|
-
React2.useEffect(() => {
|
|
1906
|
-
if (questionnaire) {
|
|
1907
|
-
setShowQuestionnaire(true);
|
|
1908
|
-
}
|
|
1909
|
-
}, [questionnaire]);
|
|
1910
1929
|
const startDate = selectedDate.startOf("month").format("YYYY-MM-DD");
|
|
1911
1930
|
const endDate = selectedDate.endOf("month").format("YYYY-MM-DD");
|
|
1912
1931
|
const {
|
|
@@ -1946,7 +1965,7 @@ var DateTimePicker = ({
|
|
|
1946
1965
|
borderRadius: token.borderRadiusLG
|
|
1947
1966
|
};
|
|
1948
1967
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1949
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[48px] py-[64px] font-bold text-center", children:
|
|
1968
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[48px] py-[64px] font-bold text-center", children: pageData.scheduleYourVisit }),
|
|
1950
1969
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4", children: [
|
|
1951
1970
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1952
1971
|
antd.ConfigProvider,
|
|
@@ -2131,7 +2150,7 @@ var DateTimePicker = ({
|
|
|
2131
2150
|
),
|
|
2132
2151
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white p-[24px] rounded-[12px] flex-1", children: [
|
|
2133
2152
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
|
|
2134
|
-
|
|
2153
|
+
pageData.timeSlot,
|
|
2135
2154
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
2136
2155
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2137
2156
|
"button",
|
|
@@ -2190,7 +2209,7 @@ var DateTimePicker = ({
|
|
|
2190
2209
|
)
|
|
2191
2210
|
] })
|
|
2192
2211
|
] }),
|
|
2193
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 mt-[40px] gap-4", children: timeslotsLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 text-center text-[#767880] py-8", children:
|
|
2212
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 mt-[40px] gap-4", children: timeslotsLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 text-center text-[#767880] py-8", children: pageData.loadingTimeSlots }) : timeslotsError ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 text-center text-red-600 py-8", children: pageData.failedToLoadTimeSlots }) : dayTimeslots.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 text-center text-[#767880] py-8", children: pageData.noAvailableTimeSlots }) : dayTimeslots.map((slot) => {
|
|
2194
2213
|
const isAvailable = slot.status === "available";
|
|
2195
2214
|
const isFull = slot.status === "full";
|
|
2196
2215
|
const isSelected = selectedTimeslotId === slot.id;
|
|
@@ -2210,14 +2229,16 @@ var DateTimePicker = ({
|
|
|
2210
2229
|
`,
|
|
2211
2230
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
2212
2231
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTimeslot(slot) }),
|
|
2213
|
-
isFull && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-[#BDBDBD] mt-1", children:
|
|
2232
|
+
isFull && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-[#BDBDBD] mt-1", children: pageData.full }),
|
|
2214
2233
|
isAvailable && !isSelected && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-[#767880] mt-1", children: [
|
|
2215
2234
|
slot.capacity - slot.booked_count,
|
|
2216
|
-
"
|
|
2235
|
+
" ",
|
|
2236
|
+
pageData.spotsLeft
|
|
2217
2237
|
] }),
|
|
2218
2238
|
isAvailable && isSelected && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-white mt-1", children: [
|
|
2219
2239
|
slot.capacity - slot.booked_count,
|
|
2220
|
-
"
|
|
2240
|
+
" ",
|
|
2241
|
+
pageData.spotsLeft
|
|
2221
2242
|
] })
|
|
2222
2243
|
] })
|
|
2223
2244
|
},
|
|
@@ -2226,32 +2247,35 @@ var DateTimePicker = ({
|
|
|
2226
2247
|
}) })
|
|
2227
2248
|
] })
|
|
2228
2249
|
] }),
|
|
2229
|
-
|
|
2230
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[48px] font-bold text-center mb-8", children:
|
|
2231
|
-
questionnaireLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-[#767880] py-8", children:
|
|
2250
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-12", children: [
|
|
2251
|
+
!!questionnaire?.questions?.length && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[48px] font-bold text-center mb-8", children: pageData.fillOutForm }),
|
|
2252
|
+
questionnaireLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-[#767880] py-8", children: pageData.loadingQuestionnaire }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2232
2253
|
QuestionnaireForm,
|
|
2233
2254
|
{
|
|
2234
|
-
questions: questionnaire
|
|
2255
|
+
questions: questionnaire?.questions || [],
|
|
2235
2256
|
loading: bookingLoading,
|
|
2236
2257
|
pageData,
|
|
2258
|
+
selectedTimeslotId,
|
|
2237
2259
|
onSubmit: async (responses) => {
|
|
2238
2260
|
try {
|
|
2239
2261
|
const customerName = responses.name || responses.customer_name || "";
|
|
2240
2262
|
const customerEmail = responses.email || responses.customer_email || "";
|
|
2241
2263
|
const customerPhone = responses.phone || responses.customer_phone_number || "";
|
|
2242
2264
|
const customerPhoneCode = responses.phone_code || responses.customer_phone_code || "+1";
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2265
|
+
if (selectedTimeslotId) {
|
|
2266
|
+
const result = await createBooking({
|
|
2267
|
+
demoroom_code: demoRoomCode,
|
|
2268
|
+
timeslot_id: selectedTimeslotId,
|
|
2269
|
+
questionnaire_id: questionnaire?.id,
|
|
2270
|
+
questionnaire_response: responses,
|
|
2271
|
+
customer_name: customerName,
|
|
2272
|
+
customer_email: customerEmail,
|
|
2273
|
+
customer_phone_code: customerPhoneCode,
|
|
2274
|
+
customer_phone_number: customerPhone
|
|
2275
|
+
});
|
|
2276
|
+
if (result && onBookingSuccess) {
|
|
2277
|
+
onBookingSuccess(result?.cancel_token);
|
|
2278
|
+
}
|
|
2255
2279
|
}
|
|
2256
2280
|
} catch (error) {
|
|
2257
2281
|
console.error("Booking creation failed:", error);
|
|
@@ -2259,10 +2283,6 @@ var DateTimePicker = ({
|
|
|
2259
2283
|
}
|
|
2260
2284
|
}
|
|
2261
2285
|
)
|
|
2262
|
-
] }),
|
|
2263
|
-
bookingError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-8 p-4 bg-red-50 border border-red-200 rounded-lg text-red-600 max-w-2xl mx-auto", children: [
|
|
2264
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium", children: "Booking failed" }),
|
|
2265
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-1", children: bookingError.message })
|
|
2266
2286
|
] })
|
|
2267
2287
|
] });
|
|
2268
2288
|
};
|
|
@@ -2332,6 +2352,12 @@ var DemoRoomDetail = ({
|
|
|
2332
2352
|
address: addressProp,
|
|
2333
2353
|
mapsLink,
|
|
2334
2354
|
images: imagesProp,
|
|
2355
|
+
pageData = {
|
|
2356
|
+
loadingText: "Loading...",
|
|
2357
|
+
errorTitle: "Failed to load demo room details",
|
|
2358
|
+
openInGoogleMaps: "Open in Google Maps",
|
|
2359
|
+
demoRoomImages: "Demo Room Images"
|
|
2360
|
+
},
|
|
2335
2361
|
className,
|
|
2336
2362
|
...props
|
|
2337
2363
|
}) => {
|
|
@@ -2369,7 +2395,7 @@ var DemoRoomDetail = ({
|
|
|
2369
2395
|
}
|
|
2370
2396
|
if (error && apiClient && demoRoomCode) {
|
|
2371
2397
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center text-red-600 py-8", children: [
|
|
2372
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg font-medium", children:
|
|
2398
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg font-medium", children: pageData.errorTitle }),
|
|
2373
2399
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-2", children: error.message })
|
|
2374
2400
|
] }) });
|
|
2375
2401
|
}
|
|
@@ -2474,7 +2500,7 @@ var DemoRoomDetail = ({
|
|
|
2474
2500
|
rel: "noopener noreferrer",
|
|
2475
2501
|
className: "inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 mt-1 underline",
|
|
2476
2502
|
children: [
|
|
2477
|
-
|
|
2503
|
+
pageData.openInGoogleMaps,
|
|
2478
2504
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2479
2505
|
"svg",
|
|
2480
2506
|
{
|
|
@@ -2560,7 +2586,7 @@ var DemoRoomDetail = ({
|
|
|
2560
2586
|
]
|
|
2561
2587
|
}
|
|
2562
2588
|
) }),
|
|
2563
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 text-sm", children:
|
|
2589
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 text-sm", children: pageData.demoRoomImages })
|
|
2564
2590
|
] }) }) })
|
|
2565
2591
|
] }) });
|
|
2566
2592
|
};
|
|
@@ -2579,6 +2605,10 @@ var BookingForm = ({
|
|
|
2579
2605
|
() => createDemoRoomApi(apiConfig),
|
|
2580
2606
|
[apiConfig]
|
|
2581
2607
|
);
|
|
2608
|
+
const dateTimePickerPageData = React2.useMemo(() => ({
|
|
2609
|
+
...pageData?.dateTimePicker,
|
|
2610
|
+
...pageData?.questionnaireForm
|
|
2611
|
+
}), [pageData?.dateTimePicker, pageData?.questionnaireForm]);
|
|
2582
2612
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2583
2613
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2584
2614
|
DemoRoomDetail,
|
|
@@ -2586,7 +2616,8 @@ var BookingForm = ({
|
|
|
2586
2616
|
className: cn("mt-8", layoutClassName),
|
|
2587
2617
|
apiClient,
|
|
2588
2618
|
demoRoomCode,
|
|
2589
|
-
locale: apiConfig.locale
|
|
2619
|
+
locale: apiConfig.locale,
|
|
2620
|
+
pageData: pageData?.demoRoomDetail
|
|
2590
2621
|
}
|
|
2591
2622
|
) }),
|
|
2592
2623
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-[#f5f5f5]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2597,7 +2628,7 @@ var BookingForm = ({
|
|
|
2597
2628
|
timezone,
|
|
2598
2629
|
locale: apiConfig.locale,
|
|
2599
2630
|
onBookingSuccess: handleBookingSuccess,
|
|
2600
|
-
pageData
|
|
2631
|
+
pageData: dateTimePickerPageData
|
|
2601
2632
|
}
|
|
2602
2633
|
) }) })
|
|
2603
2634
|
] });
|
|
@@ -2609,7 +2640,28 @@ var BookingSuccess = ({
|
|
|
2609
2640
|
apiConfig,
|
|
2610
2641
|
onScheduleAgain,
|
|
2611
2642
|
onCancelSuccess,
|
|
2612
|
-
className
|
|
2643
|
+
className,
|
|
2644
|
+
pageData = {
|
|
2645
|
+
yourAppointment: "Your Appointment",
|
|
2646
|
+
appointmentCanceled: "This appointment has been canceled.",
|
|
2647
|
+
scheduleAgain: "Schedule again",
|
|
2648
|
+
location: "Location",
|
|
2649
|
+
openInGoogleMaps: "Open in Google Maps \u2197",
|
|
2650
|
+
dateAndTime: "Date and Time",
|
|
2651
|
+
event: "Event",
|
|
2652
|
+
demoRoom: "Demo Room",
|
|
2653
|
+
visitorInfo: "Visitor Info",
|
|
2654
|
+
noPhoneProvided: "No phone provided",
|
|
2655
|
+
cancelAppointment: "Cancel Appointment",
|
|
2656
|
+
cancelDialog: {
|
|
2657
|
+
title: "Are you sure you want to cancel?",
|
|
2658
|
+
description: "You won't be able to restore the schedule.",
|
|
2659
|
+
backButton: "Back",
|
|
2660
|
+
confirmButton: "Cancel Appointment",
|
|
2661
|
+
canceling: "Canceling..."
|
|
2662
|
+
},
|
|
2663
|
+
cancelError: "Failed to cancel appointment. Please try again."
|
|
2664
|
+
}
|
|
2613
2665
|
}) => {
|
|
2614
2666
|
const [bookingData, setBookingData] = React2.useState(
|
|
2615
2667
|
initialBookingData || null
|
|
@@ -2639,7 +2691,7 @@ var BookingSuccess = ({
|
|
|
2639
2691
|
}, [token, apiConfig, initialBookingData]);
|
|
2640
2692
|
const handleCancelAppointment = async () => {
|
|
2641
2693
|
if (!token || !apiConfig) {
|
|
2642
|
-
setCancelError("Unable to cancel: Missing token or API configuration");
|
|
2694
|
+
setCancelError(pageData.cancelError || "Unable to cancel: Missing token or API configuration");
|
|
2643
2695
|
return;
|
|
2644
2696
|
}
|
|
2645
2697
|
setCancelLoading(true);
|
|
@@ -2660,7 +2712,7 @@ var BookingSuccess = ({
|
|
|
2660
2712
|
}
|
|
2661
2713
|
} catch (err) {
|
|
2662
2714
|
console.error("Failed to cancel booking:", err);
|
|
2663
|
-
setCancelError("Failed to cancel appointment. Please try again.");
|
|
2715
|
+
setCancelError(pageData.cancelError || "Failed to cancel appointment. Please try again.");
|
|
2664
2716
|
} finally {
|
|
2665
2717
|
setCancelLoading(false);
|
|
2666
2718
|
}
|
|
@@ -2680,21 +2732,21 @@ var BookingSuccess = ({
|
|
|
2680
2732
|
return null;
|
|
2681
2733
|
}
|
|
2682
2734
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `min-h-screen py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-3xl mx-auto", children: [
|
|
2683
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-[40px] font-bold text-gray-900 mb-8", children:
|
|
2735
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-[40px] font-bold text-gray-900 mb-8", children: pageData.yourAppointment }),
|
|
2684
2736
|
isCancelled && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg p-6 mb-8 flex items-center justify-between", children: [
|
|
2685
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-700", children:
|
|
2737
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-700", children: pageData.appointmentCanceled }),
|
|
2686
2738
|
onScheduleAgain && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2687
2739
|
"button",
|
|
2688
2740
|
{
|
|
2689
2741
|
onClick: onScheduleAgain,
|
|
2690
2742
|
className: "px-6 py-3 bg-black text-white rounded-full font-medium hover:bg-gray-800 transition-colors whitespace-nowrap",
|
|
2691
|
-
children:
|
|
2743
|
+
children: pageData.scheduleAgain
|
|
2692
2744
|
}
|
|
2693
2745
|
)
|
|
2694
2746
|
] }),
|
|
2695
2747
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-8 bg-white px-[48px] py-[32px] rounded-lg", children: [
|
|
2696
2748
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2697
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children:
|
|
2749
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: pageData.location }),
|
|
2698
2750
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
2699
2751
|
bookingData.demoroom_name && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base font-medium text-gray-900", children: bookingData.demoroom_name }),
|
|
2700
2752
|
bookingData.address && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-600", children: bookingData.address }),
|
|
@@ -2705,13 +2757,13 @@ var BookingSuccess = ({
|
|
|
2705
2757
|
target: "_blank",
|
|
2706
2758
|
rel: "noopener noreferrer",
|
|
2707
2759
|
className: "inline-flex items-center gap-1 text-base text-blue-600 hover:text-blue-700 hover:underline",
|
|
2708
|
-
children:
|
|
2760
|
+
children: pageData.openInGoogleMaps
|
|
2709
2761
|
}
|
|
2710
2762
|
)
|
|
2711
2763
|
] })
|
|
2712
2764
|
] }),
|
|
2713
2765
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2714
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children:
|
|
2766
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: pageData.dateAndTime }),
|
|
2715
2767
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-base text-gray-900", children: [
|
|
2716
2768
|
bookingData.booking_date,
|
|
2717
2769
|
bookingData.time_slot && `, ${bookingData.time_slot}`,
|
|
@@ -2719,15 +2771,15 @@ var BookingSuccess = ({
|
|
|
2719
2771
|
] })
|
|
2720
2772
|
] }),
|
|
2721
2773
|
bookingData.equipment && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2722
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children:
|
|
2774
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: pageData.event }),
|
|
2723
2775
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-900", children: bookingData.equipment })
|
|
2724
2776
|
] }),
|
|
2725
2777
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2726
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children:
|
|
2778
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: pageData.demoRoom }),
|
|
2727
2779
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-900", children: bookingData.demoroom_code })
|
|
2728
2780
|
] }),
|
|
2729
2781
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2730
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children:
|
|
2782
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: pageData.visitorInfo }),
|
|
2731
2783
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
2732
2784
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-900", children: bookingData.customer_name }),
|
|
2733
2785
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
|
|
@@ -2753,7 +2805,7 @@ var BookingSuccess = ({
|
|
|
2753
2805
|
bookingData.phone_code,
|
|
2754
2806
|
" ",
|
|
2755
2807
|
bookingData.phone_number
|
|
2756
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
2808
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: pageData.noPhoneProvided })
|
|
2757
2809
|
] }),
|
|
2758
2810
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
|
|
2759
2811
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2786,7 +2838,7 @@ var BookingSuccess = ({
|
|
|
2786
2838
|
onClick: () => setShowCancelDialog(true),
|
|
2787
2839
|
disabled: cancelLoading,
|
|
2788
2840
|
className: "text-[14px] cursor-pointer w-fit rounded-full text-[#080A0F] border border-[#080A0F] px-[20px] py-[10px] leading-[1] hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2789
|
-
children:
|
|
2841
|
+
children: pageData.cancelAppointment
|
|
2790
2842
|
}
|
|
2791
2843
|
),
|
|
2792
2844
|
cancelError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-2", style: { color: "#FF4D4D" }, children: cancelError })
|
|
@@ -2842,8 +2894,8 @@ var BookingSuccess = ({
|
|
|
2842
2894
|
}
|
|
2843
2895
|
) }) }),
|
|
2844
2896
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center mb-8", children: [
|
|
2845
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[18px] font-semibold text-gray-900 mb-2", children:
|
|
2846
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[14px] text-gray-600", children:
|
|
2897
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[18px] font-semibold text-gray-900 mb-2", children: pageData.cancelDialog?.title }),
|
|
2898
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[14px] text-gray-600", children: pageData.cancelDialog?.description })
|
|
2847
2899
|
] }),
|
|
2848
2900
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 justify-center", children: [
|
|
2849
2901
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2852,7 +2904,7 @@ var BookingSuccess = ({
|
|
|
2852
2904
|
onClick: () => setShowCancelDialog(false),
|
|
2853
2905
|
disabled: cancelLoading,
|
|
2854
2906
|
className: "px-8 py-3 border-2 border-black rounded-full text-black font-medium hover:bg-gray-50 transition-colors disabled:opacity-50 min-w-[120px]",
|
|
2855
|
-
children:
|
|
2907
|
+
children: pageData.cancelDialog?.backButton
|
|
2856
2908
|
}
|
|
2857
2909
|
),
|
|
2858
2910
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2892,8 +2944,8 @@ var BookingSuccess = ({
|
|
|
2892
2944
|
]
|
|
2893
2945
|
}
|
|
2894
2946
|
),
|
|
2895
|
-
|
|
2896
|
-
] }) :
|
|
2947
|
+
pageData.cancelDialog?.canceling
|
|
2948
|
+
] }) : pageData.cancelDialog?.confirmButton
|
|
2897
2949
|
}
|
|
2898
2950
|
)
|
|
2899
2951
|
] })
|