@anker-in/ui 0.1.4 → 0.1.5
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/demo-room.css +3 -0
- package/dist/demo-room.css.map +1 -1
- package/dist/demo-room.d.mts +11 -64
- package/dist/demo-room.d.ts +11 -64
- package/dist/demo-room.js +415 -553
- package/dist/demo-room.js.map +1 -1
- package/dist/demo-room.mjs +417 -553
- package/dist/demo-room.mjs.map +1 -1
- package/dist/index.css +3 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +3 -41
- package/dist/index.d.ts +3 -41
- package/dist/index.js +1103 -1238
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1105 -1239
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,18 +4,17 @@ var React2 = require('react');
|
|
|
4
4
|
var clsx = require('clsx');
|
|
5
5
|
var tailwindMerge = require('tailwind-merge');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var headlessUi = require('@anker-in/headless-ui');
|
|
8
7
|
var IndexBar = require('antd-mobile/es/components/index-bar');
|
|
9
8
|
var List = require('antd-mobile/es/components/list');
|
|
10
9
|
require('antd-mobile/es/components/index-bar/index-bar.css');
|
|
11
10
|
require('antd-mobile/es/components/list/list.css');
|
|
12
|
-
var react = require('swiper/react');
|
|
13
11
|
var dayjs = require('dayjs');
|
|
14
12
|
require('dayjs/locale/zh-cn');
|
|
15
13
|
var antd = require('antd');
|
|
16
14
|
var dayLocaleData = require('dayjs/plugin/localeData');
|
|
17
15
|
var weekday = require('dayjs/plugin/weekday');
|
|
18
16
|
var weekOfYear = require('dayjs/plugin/weekOfYear');
|
|
17
|
+
var react = require('swiper/react');
|
|
19
18
|
|
|
20
19
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
20
|
|
|
@@ -36,158 +35,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
36
35
|
function cn(...inputs) {
|
|
37
36
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
38
37
|
}
|
|
39
|
-
var defaultTabs = [
|
|
40
|
-
{ id: "upcoming-events", label: "Upcoming Events" },
|
|
41
|
-
{ id: "find-demoroom", label: "Find Demoroom" },
|
|
42
|
-
{ id: "4-easy-steps", label: "4 Easy Steps" },
|
|
43
|
-
{ id: "faq", label: "FAQ" }
|
|
44
|
-
];
|
|
45
|
-
var HelpNav = ({
|
|
46
|
-
tabs = defaultTabs,
|
|
47
|
-
activeTabId: controlledActiveTabId,
|
|
48
|
-
onTabChange,
|
|
49
|
-
activeBorderColor = "#3ADB67",
|
|
50
|
-
className,
|
|
51
|
-
...props
|
|
52
|
-
}) => {
|
|
53
|
-
const [internalActiveTabId, setInternalActiveTabId] = React2.useState(
|
|
54
|
-
tabs[1]?.id || tabs[0]?.id
|
|
55
|
-
);
|
|
56
|
-
const activeTabId = controlledActiveTabId ?? internalActiveTabId;
|
|
57
|
-
const handleTabClick = (tabId) => {
|
|
58
|
-
if (!controlledActiveTabId) {
|
|
59
|
-
setInternalActiveTabId(tabId);
|
|
60
|
-
}
|
|
61
|
-
onTabChange?.(tabId);
|
|
62
|
-
};
|
|
63
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
64
|
-
"div",
|
|
65
|
-
{
|
|
66
|
-
className: cn(
|
|
67
|
-
"w-full pt-5 flex items-center justify-center gap-8 pb-8",
|
|
68
|
-
className
|
|
69
|
-
),
|
|
70
|
-
...props,
|
|
71
|
-
children: tabs.map((tab) => {
|
|
72
|
-
const isActive = tab.id === activeTabId;
|
|
73
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
74
|
-
"button",
|
|
75
|
-
{
|
|
76
|
-
onClick: () => handleTabClick(tab.id),
|
|
77
|
-
className: cn(
|
|
78
|
-
"relative text-[#080A0F]",
|
|
79
|
-
"pb-4",
|
|
80
|
-
"flex items-center gap-2",
|
|
81
|
-
"transition-all duration-200",
|
|
82
|
-
"outline-none focus:outline-none"
|
|
83
|
-
),
|
|
84
|
-
style: {
|
|
85
|
-
fontSize: "18px",
|
|
86
|
-
fontWeight: 600,
|
|
87
|
-
letterSpacing: "-0.36px",
|
|
88
|
-
lineHeight: "25.2px"
|
|
89
|
-
},
|
|
90
|
-
children: [
|
|
91
|
-
tab.label,
|
|
92
|
-
isActive && /* @__PURE__ */ jsxRuntime.jsx(
|
|
93
|
-
"span",
|
|
94
|
-
{
|
|
95
|
-
className: "absolute bottom-0 left-0 right-0 h-1 rounded-t",
|
|
96
|
-
style: {
|
|
97
|
-
backgroundColor: activeBorderColor,
|
|
98
|
-
height: "4px"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
]
|
|
103
|
-
},
|
|
104
|
-
tab.id
|
|
105
|
-
);
|
|
106
|
-
})
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
};
|
|
110
|
-
HelpNav.displayName = "HelpNav";
|
|
111
|
-
var EventCard = ({
|
|
112
|
-
title,
|
|
113
|
-
description,
|
|
114
|
-
backgroundImage,
|
|
115
|
-
aspectRatio,
|
|
116
|
-
variant = "medium",
|
|
117
|
-
buttons = [],
|
|
118
|
-
subtitle,
|
|
119
|
-
className,
|
|
120
|
-
...props
|
|
121
|
-
}) => {
|
|
122
|
-
const isLarge = variant === "large";
|
|
123
|
-
const isMedium = variant === "medium";
|
|
124
|
-
const isProduct = variant === "product";
|
|
125
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
126
|
-
"div",
|
|
127
|
-
{
|
|
128
|
-
className: cn("rounded-3xl overflow-hidden relative", className),
|
|
129
|
-
style: {
|
|
130
|
-
backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0,
|
|
131
|
-
backgroundSize: "cover",
|
|
132
|
-
backgroundPosition: "center",
|
|
133
|
-
aspectRatio
|
|
134
|
-
},
|
|
135
|
-
...props,
|
|
136
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
137
|
-
"div",
|
|
138
|
-
{
|
|
139
|
-
className: cn(
|
|
140
|
-
"relative h-full flex flex-col",
|
|
141
|
-
isLarge && "justify-center pl-8",
|
|
142
|
-
!isLarge && "justify-end pl-8 pb-8"
|
|
143
|
-
),
|
|
144
|
-
children: [
|
|
145
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
146
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
147
|
-
"h3",
|
|
148
|
-
{
|
|
149
|
-
className: cn(
|
|
150
|
-
"font-semibold mb-3",
|
|
151
|
-
isLarge && "text-3xl text-gray-900",
|
|
152
|
-
isMedium && "text-2xl text-white",
|
|
153
|
-
isProduct && "text-2xl text-gray-900"
|
|
154
|
-
),
|
|
155
|
-
children: title
|
|
156
|
-
}
|
|
157
|
-
),
|
|
158
|
-
subtitle && isProduct && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-600 mb-4", children: subtitle }),
|
|
159
|
-
description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
160
|
-
"p",
|
|
161
|
-
{
|
|
162
|
-
className: cn(
|
|
163
|
-
"text-sm leading-relaxed",
|
|
164
|
-
isMedium && "text-white/90",
|
|
165
|
-
(isLarge || isProduct) && "text-gray-600"
|
|
166
|
-
),
|
|
167
|
-
children: description
|
|
168
|
-
}
|
|
169
|
-
)
|
|
170
|
-
] }),
|
|
171
|
-
buttons.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-3 mt-6", children: buttons.map((button, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
172
|
-
"button",
|
|
173
|
-
{
|
|
174
|
-
onClick: button.onClick,
|
|
175
|
-
className: cn(
|
|
176
|
-
"px-6 py-3 rounded-full font-medium text-sm transition-all duration-200",
|
|
177
|
-
button.variant === "primary" && "bg-gray-900 text-white hover:bg-gray-800",
|
|
178
|
-
button.variant === "secondary" && "bg-white text-gray-900 border border-gray-300 hover:bg-gray-50"
|
|
179
|
-
),
|
|
180
|
-
children: button.label
|
|
181
|
-
},
|
|
182
|
-
index
|
|
183
|
-
)) })
|
|
184
|
-
]
|
|
185
|
-
}
|
|
186
|
-
)
|
|
187
|
-
}
|
|
188
|
-
);
|
|
189
|
-
};
|
|
190
|
-
EventCard.displayName = "EventCard";
|
|
191
38
|
var Title = ({
|
|
192
39
|
title = "",
|
|
193
40
|
...props
|
|
@@ -195,275 +42,6 @@ var Title = ({
|
|
|
195
42
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full"), ...props, children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-[48px] font-semibold mb-12 text-[#080A0F]", children: title }) });
|
|
196
43
|
};
|
|
197
44
|
Title.displayName = "Title";
|
|
198
|
-
var defaultEvents = [
|
|
199
|
-
{
|
|
200
|
-
variant: "large",
|
|
201
|
-
title: "IFA 2025 Event Name Event Name",
|
|
202
|
-
description: "Corem ipsum dolor sit amet, consectetur adipiscing elit.",
|
|
203
|
-
backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
204
|
-
buttons: [
|
|
205
|
-
{
|
|
206
|
-
label: "Schedule Now",
|
|
207
|
-
variant: "primary"
|
|
208
|
-
}
|
|
209
|
-
],
|
|
210
|
-
aspectRatio: "1664 / 640"
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
variant: "medium",
|
|
214
|
-
title: "Local Event Name Local Event Name Local Event Name",
|
|
215
|
-
description: "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
|
|
216
|
-
backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
217
|
-
buttons: [
|
|
218
|
-
{
|
|
219
|
-
label: "Schedule Now",
|
|
220
|
-
variant: "primary"
|
|
221
|
-
}
|
|
222
|
-
],
|
|
223
|
-
aspectRatio: "824 / 640"
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
variant: "product",
|
|
227
|
-
title: "Anker Prime",
|
|
228
|
-
subtitle: "Anker Prime 240W GaN Desktop Charger (4 Ports) Feb. 5th - 16th",
|
|
229
|
-
backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
230
|
-
buttons: [
|
|
231
|
-
{
|
|
232
|
-
label: "Learn More",
|
|
233
|
-
variant: "secondary"
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
label: "Shop Now",
|
|
237
|
-
variant: "primary"
|
|
238
|
-
}
|
|
239
|
-
],
|
|
240
|
-
aspectRatio: "824 / 640"
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
variant: "medium",
|
|
244
|
-
title: "Local Event Name Local Event Name Local Event Name",
|
|
245
|
-
description: "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
|
|
246
|
-
backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
247
|
-
buttons: [
|
|
248
|
-
{
|
|
249
|
-
label: "Schedule Now",
|
|
250
|
-
variant: "primary"
|
|
251
|
-
}
|
|
252
|
-
],
|
|
253
|
-
aspectRatio: "824 / 640"
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
variant: "product",
|
|
257
|
-
title: "Anker Prime",
|
|
258
|
-
subtitle: "Anker Prime 240W GaN Desktop Charger (4 Ports) Feb. 5th - 16th",
|
|
259
|
-
backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
260
|
-
buttons: [
|
|
261
|
-
{
|
|
262
|
-
label: "Learn More",
|
|
263
|
-
variant: "secondary"
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
label: "Shop Now",
|
|
267
|
-
variant: "primary"
|
|
268
|
-
}
|
|
269
|
-
],
|
|
270
|
-
aspectRatio: "824 / 640"
|
|
271
|
-
}
|
|
272
|
-
];
|
|
273
|
-
var UpcomingEvents = ({
|
|
274
|
-
title = "Upcoming Events",
|
|
275
|
-
events = defaultEvents,
|
|
276
|
-
showViewMore = true,
|
|
277
|
-
onViewMore,
|
|
278
|
-
className,
|
|
279
|
-
...props
|
|
280
|
-
}) => {
|
|
281
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), ...props, children: [
|
|
282
|
-
/* @__PURE__ */ jsxRuntime.jsx(Title, { title }),
|
|
283
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-6 mb-[64px]", children: events.map((event, index) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(index === 0 ? "col-span-2" : ""), children: /* @__PURE__ */ jsxRuntime.jsx(EventCard, { ...event }) }, index)) }),
|
|
284
|
-
showViewMore && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
285
|
-
"button",
|
|
286
|
-
{
|
|
287
|
-
onClick: onViewMore,
|
|
288
|
-
className: "inline-flex items-center gap-2 text-gray-700 hover:text-gray-900 transition-colors duration-200",
|
|
289
|
-
children: [
|
|
290
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold", children: "View More" }),
|
|
291
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
292
|
-
"svg",
|
|
293
|
-
{
|
|
294
|
-
width: "16",
|
|
295
|
-
height: "16",
|
|
296
|
-
viewBox: "0 0 16 16",
|
|
297
|
-
fill: "none",
|
|
298
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
299
|
-
className: "transition-transform duration-200 group-hover:translate-y-0.5",
|
|
300
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
301
|
-
"path",
|
|
302
|
-
{
|
|
303
|
-
d: "M8 3L8 13M8 13L12 9M8 13L4 9",
|
|
304
|
-
stroke: "currentColor",
|
|
305
|
-
strokeWidth: "2",
|
|
306
|
-
strokeLinecap: "round",
|
|
307
|
-
strokeLinejoin: "round"
|
|
308
|
-
}
|
|
309
|
-
)
|
|
310
|
-
}
|
|
311
|
-
)
|
|
312
|
-
]
|
|
313
|
-
}
|
|
314
|
-
) })
|
|
315
|
-
] });
|
|
316
|
-
};
|
|
317
|
-
UpcomingEvents.displayName = "UpcomingEvents";
|
|
318
|
-
var defaultBannerData = {
|
|
319
|
-
title: "See it. Touch it. Make it Locally.",
|
|
320
|
-
subTitle: "Visit your local studio right around the corner.",
|
|
321
|
-
backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
322
|
-
backgroundImageMobile: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
|
|
323
|
-
};
|
|
324
|
-
var Banner = ({
|
|
325
|
-
data = defaultBannerData,
|
|
326
|
-
className,
|
|
327
|
-
style,
|
|
328
|
-
...props
|
|
329
|
-
}) => {
|
|
330
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
331
|
-
"div",
|
|
332
|
-
{
|
|
333
|
-
className: cn("relative"),
|
|
334
|
-
style: { aspectRatio: "1920/480", ...style },
|
|
335
|
-
...props,
|
|
336
|
-
children: [
|
|
337
|
-
data?.backgroundImage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
338
|
-
"img",
|
|
339
|
-
{
|
|
340
|
-
src: data.backgroundImage,
|
|
341
|
-
alt: "",
|
|
342
|
-
className: "inset-0 h-full w-full object-cover"
|
|
343
|
-
}
|
|
344
|
-
),
|
|
345
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
346
|
-
"div",
|
|
347
|
-
{
|
|
348
|
-
className: cn(
|
|
349
|
-
"absolute flex flex-col gap-4 justify-center m-auto top-0 bottom-0 left-0 right-0 z-10",
|
|
350
|
-
className
|
|
351
|
-
),
|
|
352
|
-
children: [
|
|
353
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
354
|
-
headlessUi.Text,
|
|
355
|
-
{
|
|
356
|
-
className: "text-[48px] font-bold text-white leading-[1]",
|
|
357
|
-
html: data?.title
|
|
358
|
-
}
|
|
359
|
-
),
|
|
360
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
361
|
-
headlessUi.Text,
|
|
362
|
-
{
|
|
363
|
-
className: "text-[18px] font-bold text-white leading-[1.4]",
|
|
364
|
-
html: data?.subTitle
|
|
365
|
-
}
|
|
366
|
-
)
|
|
367
|
-
]
|
|
368
|
-
}
|
|
369
|
-
)
|
|
370
|
-
]
|
|
371
|
-
}
|
|
372
|
-
);
|
|
373
|
-
};
|
|
374
|
-
Banner.displayName = "Banner";
|
|
375
|
-
var BreadCrumbs = ({
|
|
376
|
-
items,
|
|
377
|
-
className,
|
|
378
|
-
...props
|
|
379
|
-
}) => {
|
|
380
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex items-center py-6 gap-1 text-[18px]", className), ...props, children: items?.map((item, i) => {
|
|
381
|
-
const isLast = i === items?.length - 1;
|
|
382
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
383
|
-
headlessUi.Link,
|
|
384
|
-
{
|
|
385
|
-
className: cn(
|
|
386
|
-
"flex items-center gap-1 text-[#6D6D6F] no-underline",
|
|
387
|
-
isLast && "text-[#080A0F]",
|
|
388
|
-
item?.link ? "cursor-pointer" : "cursor-default hover:text-[#080A0F]"
|
|
389
|
-
),
|
|
390
|
-
href: item?.link,
|
|
391
|
-
children: [
|
|
392
|
-
item?.label,
|
|
393
|
-
!isLast && /* @__PURE__ */ jsxRuntime.jsx("span", { children: "/" })
|
|
394
|
-
]
|
|
395
|
-
},
|
|
396
|
-
i
|
|
397
|
-
);
|
|
398
|
-
}) });
|
|
399
|
-
};
|
|
400
|
-
BreadCrumbs.displayName = "BreadCrumbs";
|
|
401
|
-
var defaultSteps = [
|
|
402
|
-
{
|
|
403
|
-
stepNumber: 1,
|
|
404
|
-
title: 'Find a demo room you would like to visit, and click "Schedule Now"',
|
|
405
|
-
description: 'Find a demo room you would like to visit, and click "Schedule Now"',
|
|
406
|
-
mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
stepNumber: 2,
|
|
410
|
-
title: "Fill out the form and confirm your time of visit",
|
|
411
|
-
description: "Fill out the form and confirm your time of visit",
|
|
412
|
-
mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
stepNumber: 3,
|
|
416
|
-
title: "Once you arrive at the demo room, scan the QR code to check in",
|
|
417
|
-
description: "Once you arrive at the demo room, scan the QR code to check in",
|
|
418
|
-
mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
stepNumber: 4,
|
|
422
|
-
title: "Have fun!",
|
|
423
|
-
description: "Have fun!",
|
|
424
|
-
mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
|
|
425
|
-
}
|
|
426
|
-
];
|
|
427
|
-
var EasySteps = ({
|
|
428
|
-
title = "Schedule in 4 Easy Steps",
|
|
429
|
-
steps = defaultSteps,
|
|
430
|
-
className,
|
|
431
|
-
...props
|
|
432
|
-
}) => {
|
|
433
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), ...props, children: [
|
|
434
|
-
/* @__PURE__ */ jsxRuntime.jsx(Title, { title }),
|
|
435
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 md:grid-cols-2 gap-6", children: steps.map((step) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
436
|
-
"div",
|
|
437
|
-
{
|
|
438
|
-
className: cn(
|
|
439
|
-
"bg-white rounded-2xl overflow-hidden",
|
|
440
|
-
"border border-gray-200",
|
|
441
|
-
"hover:shadow-lg transition-shadow duration-200"
|
|
442
|
-
),
|
|
443
|
-
children: [
|
|
444
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-6 pb-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
|
|
445
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-semibold text-gray-900", children: [
|
|
446
|
-
"Step ",
|
|
447
|
-
step.stepNumber,
|
|
448
|
-
":"
|
|
449
|
-
] }),
|
|
450
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-900 font-medium flex-1", children: step.title })
|
|
451
|
-
] }) }),
|
|
452
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full aspect-[356/220] bg-gray-100", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
453
|
-
"img",
|
|
454
|
-
{
|
|
455
|
-
src: step.mapImage,
|
|
456
|
-
alt: `Step ${step.stepNumber} - ${step.title}`,
|
|
457
|
-
className: "w-full h-full object-cover"
|
|
458
|
-
}
|
|
459
|
-
) })
|
|
460
|
-
]
|
|
461
|
-
},
|
|
462
|
-
step.stepNumber
|
|
463
|
-
)) })
|
|
464
|
-
] });
|
|
465
|
-
};
|
|
466
|
-
EasySteps.displayName = "EasySteps";
|
|
467
45
|
var StudioCard = ({
|
|
468
46
|
code,
|
|
469
47
|
name,
|
|
@@ -474,25 +52,48 @@ var StudioCard = ({
|
|
|
474
52
|
zipCode,
|
|
475
53
|
country = "United States",
|
|
476
54
|
euifyMakeModel,
|
|
55
|
+
distance,
|
|
477
56
|
onSchedule,
|
|
478
57
|
className,
|
|
58
|
+
style,
|
|
479
59
|
...props
|
|
480
60
|
}) => {
|
|
481
61
|
const fullAddress = `${address}, ${city}, ${state} ${country} ${zipCode}`;
|
|
62
|
+
const [isHovered, setIsHovered] = React2__default.default.useState(false);
|
|
482
63
|
const handleScheduleClick = () => {
|
|
483
64
|
onSchedule?.(code);
|
|
484
65
|
};
|
|
66
|
+
const formatDistance = (dist) => {
|
|
67
|
+
if (dist < 1) {
|
|
68
|
+
return `${Math.round(dist * 1e3)} m`;
|
|
69
|
+
}
|
|
70
|
+
return `${dist.toFixed(1)} km`;
|
|
71
|
+
};
|
|
485
72
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
486
73
|
"div",
|
|
487
74
|
{
|
|
488
|
-
className: cn(
|
|
489
|
-
"p-6",
|
|
490
|
-
"hover:shadow-lg transition-shadow duration-200",
|
|
491
|
-
className
|
|
492
|
-
),
|
|
493
75
|
...props,
|
|
76
|
+
className: cn("p-6 cursor-pointer transition-colors duration-200", className),
|
|
77
|
+
style: {
|
|
78
|
+
backgroundColor: isHovered ? "#f3f4f6" : "transparent",
|
|
79
|
+
...style
|
|
80
|
+
},
|
|
81
|
+
onMouseEnter: (e) => {
|
|
82
|
+
setIsHovered(true);
|
|
83
|
+
props.onMouseEnter?.(e);
|
|
84
|
+
},
|
|
85
|
+
onMouseLeave: (e) => {
|
|
86
|
+
setIsHovered(false);
|
|
87
|
+
props.onMouseLeave?.(e);
|
|
88
|
+
},
|
|
494
89
|
children: [
|
|
495
|
-
/* @__PURE__ */ jsxRuntime.
|
|
90
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between mb-4", children: [
|
|
91
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-semibold text-gray-900", children: name }),
|
|
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
|
+
formatDistance(distance),
|
|
94
|
+
" away"
|
|
95
|
+
] })
|
|
96
|
+
] }),
|
|
496
97
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
|
|
497
98
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
498
99
|
"svg",
|
|
@@ -638,7 +239,7 @@ var StudioCard = ({
|
|
|
638
239
|
"w-full px-6 py-3 rounded-full",
|
|
639
240
|
"bg-white text-gray-900 border border-gray-900",
|
|
640
241
|
"font-medium text-sm",
|
|
641
|
-
"hover:bg-gray-900
|
|
242
|
+
"hover:bg-gray-900",
|
|
642
243
|
"transition-all duration-200"
|
|
643
244
|
),
|
|
644
245
|
children: "Schedule Now"
|
|
@@ -667,6 +268,7 @@ var defaultLocations = [
|
|
|
667
268
|
var StudioMap = ({
|
|
668
269
|
googleMapsApiKey,
|
|
669
270
|
locations = defaultLocations,
|
|
271
|
+
hoveredLocationId,
|
|
670
272
|
defaultCenter = { lat: 39.8283, lng: -98.5795 },
|
|
671
273
|
// US center
|
|
672
274
|
defaultZoom = 4,
|
|
@@ -815,7 +417,7 @@ var StudioMap = ({
|
|
|
815
417
|
if (btn) {
|
|
816
418
|
btn.addEventListener("click", () => {
|
|
817
419
|
if (onSchedule) {
|
|
818
|
-
onSchedule(location);
|
|
420
|
+
onSchedule(location.id);
|
|
819
421
|
}
|
|
820
422
|
});
|
|
821
423
|
}
|
|
@@ -836,6 +438,82 @@ var StudioMap = ({
|
|
|
836
438
|
googleMapRef.current.fitBounds(bounds);
|
|
837
439
|
}
|
|
838
440
|
}, [isLoaded, locations, onSchedule]);
|
|
441
|
+
React2__default.default.useEffect(() => {
|
|
442
|
+
if (!isLoaded || !googleMapRef.current || !hoveredLocationId) {
|
|
443
|
+
if (!hoveredLocationId && infoWindowRef.current) {
|
|
444
|
+
infoWindowRef.current.close();
|
|
445
|
+
}
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
const location = locations.find((loc) => loc.id === hoveredLocationId);
|
|
449
|
+
const markerIndex = locations.findIndex(
|
|
450
|
+
(loc) => loc.id === hoveredLocationId
|
|
451
|
+
);
|
|
452
|
+
const marker = markersRef.current[markerIndex];
|
|
453
|
+
if (location && marker) {
|
|
454
|
+
const content = `
|
|
455
|
+
<div style="padding: 16px; max-width: 300px; font-family: system-ui, sans-serif;">
|
|
456
|
+
<h3 style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600;">${location.name}</h3>
|
|
457
|
+
${location.availableTime ? `<div style="margin-bottom: 8px; color: #666;">
|
|
458
|
+
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
459
|
+
<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
|
+
</svg>
|
|
461
|
+
<span style="vertical-align: middle;">Available ${location.availableTime}</span>
|
|
462
|
+
</div>` : ""}
|
|
463
|
+
<div style="margin-bottom: 8px; color: #666;">
|
|
464
|
+
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
465
|
+
<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
|
+
</svg>
|
|
467
|
+
<span style="vertical-align: middle;">${location.address}, ${location.city}, ${location.state} ${location.country} ${location.zipCode}</span>
|
|
468
|
+
</div>
|
|
469
|
+
${location.euifyMakeModel ? `<div style="margin-bottom: 12px; color: #666;">
|
|
470
|
+
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
471
|
+
<path d="M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z"/>
|
|
472
|
+
</svg>
|
|
473
|
+
<span style="vertical-align: middle;">${location.euifyMakeModel}</span>
|
|
474
|
+
</div>` : ""}
|
|
475
|
+
<button
|
|
476
|
+
id="schedule-btn-hover-${location.id}"
|
|
477
|
+
style="
|
|
478
|
+
width: 100%;
|
|
479
|
+
padding: 10px 16px;
|
|
480
|
+
background: #000;
|
|
481
|
+
color: #fff;
|
|
482
|
+
border: none;
|
|
483
|
+
border-radius: 6px;
|
|
484
|
+
font-weight: 500;
|
|
485
|
+
cursor: pointer;
|
|
486
|
+
font-size: 14px;
|
|
487
|
+
"
|
|
488
|
+
onmouseover="this.style.background='#333'"
|
|
489
|
+
onmouseout="this.style.background='#000'"
|
|
490
|
+
>
|
|
491
|
+
Schedule Now
|
|
492
|
+
</button>
|
|
493
|
+
</div>
|
|
494
|
+
`;
|
|
495
|
+
if (infoWindowRef.current) {
|
|
496
|
+
infoWindowRef.current.setContent(content);
|
|
497
|
+
infoWindowRef.current.open(googleMapRef.current, marker);
|
|
498
|
+
google.maps.event.addListenerOnce(
|
|
499
|
+
infoWindowRef.current,
|
|
500
|
+
"domready",
|
|
501
|
+
() => {
|
|
502
|
+
const btn = document.getElementById(
|
|
503
|
+
`schedule-btn-hover-${location.id}`
|
|
504
|
+
);
|
|
505
|
+
if (btn) {
|
|
506
|
+
btn.addEventListener("click", () => {
|
|
507
|
+
if (onSchedule) {
|
|
508
|
+
onSchedule(location.id);
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}, [hoveredLocationId, isLoaded, locations, onSchedule]);
|
|
839
517
|
if (!googleMapsApiKey) {
|
|
840
518
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
841
519
|
"div",
|
|
@@ -1144,20 +822,58 @@ var AntdMobileIsolated = ({
|
|
|
1144
822
|
AntdMobileIsolated.displayName = "AntdMobileIsolated";
|
|
1145
823
|
|
|
1146
824
|
// 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
|
+
];
|
|
1147
850
|
function parseAddress(address) {
|
|
1148
|
-
const parts = address.split(",").map((part) => part.trim());
|
|
851
|
+
const parts = address.split(",").map((part) => part.trim()).filter(Boolean);
|
|
1149
852
|
let country = "United States";
|
|
1150
853
|
let state = "";
|
|
1151
854
|
let city = "";
|
|
1152
|
-
if (parts.length
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
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
|
+
}
|
|
1161
877
|
}
|
|
1162
878
|
return {
|
|
1163
879
|
country: country.trim(),
|
|
@@ -1245,9 +961,7 @@ var LocationFilter = ({
|
|
|
1245
961
|
items = locationData.countries;
|
|
1246
962
|
break;
|
|
1247
963
|
case "state":
|
|
1248
|
-
items = selectedCountry ? locationData.states.filter(
|
|
1249
|
-
(s) => s.parentCode === selectedCountry
|
|
1250
|
-
) : [];
|
|
964
|
+
items = selectedCountry ? locationData.states.filter((s) => s.parentCode === selectedCountry) : [];
|
|
1251
965
|
break;
|
|
1252
966
|
case "city":
|
|
1253
967
|
items = selectedState ? locationData.cities.filter((c) => c.parentCode === selectedState) : [];
|
|
@@ -1264,6 +978,7 @@ var LocationFilter = ({
|
|
|
1264
978
|
() => groupByAlphabet(filteredItems),
|
|
1265
979
|
[filteredItems]
|
|
1266
980
|
);
|
|
981
|
+
const showIndexBar = filteredItems.length >= 10;
|
|
1267
982
|
const handleItemClick = (item) => {
|
|
1268
983
|
if (currentLevel === "country") {
|
|
1269
984
|
setSelectedCountry(item.code);
|
|
@@ -1307,42 +1022,30 @@ var LocationFilter = ({
|
|
|
1307
1022
|
style: { background: "#F8F8F8" },
|
|
1308
1023
|
className: "rounded-[12px] rounded-b-none h-[72px] font-bold text-[14px] flex flex-col",
|
|
1309
1024
|
children: [
|
|
1310
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1335
|
-
"path",
|
|
1336
|
-
{
|
|
1337
|
-
d: "M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",
|
|
1338
|
-
fill: "#1D1D1F"
|
|
1339
|
-
}
|
|
1340
|
-
)
|
|
1341
|
-
}
|
|
1342
|
-
)
|
|
1343
|
-
}
|
|
1344
|
-
)
|
|
1345
|
-
] }),
|
|
1025
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end px-[20px] pt-[12px] pb-[8px]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1026
|
+
"button",
|
|
1027
|
+
{
|
|
1028
|
+
onClick: onClose,
|
|
1029
|
+
className: "ml-[12px] w-[24px] h-[24px] flex items-center justify-end",
|
|
1030
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1031
|
+
"svg",
|
|
1032
|
+
{
|
|
1033
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1034
|
+
width: "24",
|
|
1035
|
+
height: "24",
|
|
1036
|
+
viewBox: "0 0 24 24",
|
|
1037
|
+
fill: "none",
|
|
1038
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1039
|
+
"path",
|
|
1040
|
+
{
|
|
1041
|
+
d: "M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",
|
|
1042
|
+
fill: "#1D1D1F"
|
|
1043
|
+
}
|
|
1044
|
+
)
|
|
1045
|
+
}
|
|
1046
|
+
)
|
|
1047
|
+
}
|
|
1048
|
+
) }),
|
|
1346
1049
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center px-[20px] gap-[16px] pb-[8px]", children: [
|
|
1347
1050
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1348
1051
|
"button",
|
|
@@ -1385,38 +1088,26 @@ var LocationFilter = ({
|
|
|
1385
1088
|
]
|
|
1386
1089
|
}
|
|
1387
1090
|
),
|
|
1388
|
-
/* @__PURE__ */ jsxRuntime.jsx(AntdMobileIsolated, { style: { height: "calc(100% - 72px)" }, children: /* @__PURE__ */ jsxRuntime.jsx(IndexBar__default.default, { style: { height: "100%" }, children: groupedItems.map((group) => {
|
|
1091
|
+
/* @__PURE__ */ jsxRuntime.jsx(AntdMobileIsolated, { style: { height: "calc(100% - 72px)" }, children: showIndexBar ? /* @__PURE__ */ jsxRuntime.jsx(IndexBar__default.default, { style: { height: "100%" }, children: groupedItems.map((group) => {
|
|
1389
1092
|
const { title, items } = group;
|
|
1390
1093
|
return /* @__PURE__ */ jsxRuntime.jsx(IndexBar__default.default.Panel, { index: title, title, children: /* @__PURE__ */ jsxRuntime.jsx(List__default.default, { children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1391
1094
|
List__default.default.Item,
|
|
1392
1095
|
{
|
|
1393
|
-
clickable: true,
|
|
1394
1096
|
onClick: () => handleItemClick(item),
|
|
1395
|
-
|
|
1396
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[#767880] text-[14px]", children: item.count }),
|
|
1397
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1398
|
-
"svg",
|
|
1399
|
-
{
|
|
1400
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1401
|
-
width: "16",
|
|
1402
|
-
height: "16",
|
|
1403
|
-
viewBox: "0 0 16 16",
|
|
1404
|
-
fill: "none",
|
|
1405
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1406
|
-
"path",
|
|
1407
|
-
{
|
|
1408
|
-
d: "M6.4 12L5.6 11.2L9.06667 7.73333L5.6 4.26667L6.4 3.46667L10.6667 7.73333L6.4 12Z",
|
|
1409
|
-
fill: "#767880"
|
|
1410
|
-
}
|
|
1411
|
-
)
|
|
1412
|
-
}
|
|
1413
|
-
)
|
|
1414
|
-
] }),
|
|
1097
|
+
style: { cursor: "pointer" },
|
|
1415
1098
|
children: item.name
|
|
1416
1099
|
},
|
|
1417
1100
|
item.code
|
|
1418
1101
|
)) }) }, title);
|
|
1419
|
-
}) }) })
|
|
1102
|
+
}) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: "100%", overflow: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(List__default.default, { children: filteredItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1103
|
+
List__default.default.Item,
|
|
1104
|
+
{
|
|
1105
|
+
onClick: () => handleItemClick(item),
|
|
1106
|
+
style: { cursor: "pointer" },
|
|
1107
|
+
children: item.name
|
|
1108
|
+
},
|
|
1109
|
+
item.code
|
|
1110
|
+
)) }) }) })
|
|
1420
1111
|
]
|
|
1421
1112
|
}
|
|
1422
1113
|
);
|
|
@@ -1539,6 +1230,7 @@ var RoomsList = ({
|
|
|
1539
1230
|
}) => {
|
|
1540
1231
|
const [showLocationFilter, setShowLocationFilter] = React2.useState(false);
|
|
1541
1232
|
const [selectedLocation, setSelectedLocation] = React2.useState();
|
|
1233
|
+
const [hoveredRoomId, setHoveredRoomId] = React2.useState(null);
|
|
1542
1234
|
const {
|
|
1543
1235
|
data: demoRooms,
|
|
1544
1236
|
loading,
|
|
@@ -1551,25 +1243,9 @@ var RoomsList = ({
|
|
|
1551
1243
|
const studioLocations = React2.useMemo(() => {
|
|
1552
1244
|
if (!demoRooms) return defaultStudioLocations;
|
|
1553
1245
|
return demoRooms.map((room) => {
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
start_time: "2026-01-13T09:00:00-05:00",
|
|
1558
|
-
end_time: "2026-01-13T10:00:00-05:00",
|
|
1559
|
-
capacity: 5,
|
|
1560
|
-
booked_count: 2,
|
|
1561
|
-
status: "available"
|
|
1562
|
-
},
|
|
1563
|
-
{
|
|
1564
|
-
id: 131,
|
|
1565
|
-
start_time: "2026-01-13T14:00:00-05:00",
|
|
1566
|
-
end_time: "2026-01-13T15:00:00-05:00",
|
|
1567
|
-
capacity: 5,
|
|
1568
|
-
booked_count: 5,
|
|
1569
|
-
status: "full"
|
|
1570
|
-
}
|
|
1571
|
-
];
|
|
1572
|
-
const nextAvailableTimeslot = (room.timeslots?.length ? room.timeslots : timeslots)?.find((slot) => slot.status === "available");
|
|
1246
|
+
const nextAvailableTimeslot = room?.timeslots?.find(
|
|
1247
|
+
(slot) => slot.status === "available"
|
|
1248
|
+
);
|
|
1573
1249
|
const { country, state, city } = parseAddress(room.address);
|
|
1574
1250
|
return {
|
|
1575
1251
|
id: room.code,
|
|
@@ -1620,18 +1296,18 @@ var RoomsList = ({
|
|
|
1620
1296
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, ...props, children: [
|
|
1621
1297
|
/* @__PURE__ */ jsxRuntime.jsx(Title, { title: "Find a Studio Near You" }),
|
|
1622
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: "Loading demo rooms..." }) }) }),
|
|
1623
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center
|
|
1299
|
+
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: [
|
|
1624
1300
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children: "Failed to load demo rooms" }),
|
|
1625
1301
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm mt-2", children: error.message })
|
|
1626
1302
|
] }) }),
|
|
1627
|
-
!loading && !error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-[794px]
|
|
1303
|
+
!loading && !error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-[794px] gap-4", children: [
|
|
1628
1304
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1629
1305
|
"div",
|
|
1630
1306
|
{
|
|
1631
1307
|
className: "flex-none relative w-[420px]",
|
|
1632
1308
|
style: { height: "794px" },
|
|
1633
1309
|
children: [
|
|
1634
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1310
|
+
/* @__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: [
|
|
1635
1311
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1636
1312
|
"button",
|
|
1637
1313
|
{
|
|
@@ -1687,7 +1363,7 @@ var RoomsList = ({
|
|
|
1687
1363
|
}
|
|
1688
1364
|
)
|
|
1689
1365
|
] })
|
|
1690
|
-
] }),
|
|
1366
|
+
] }) }),
|
|
1691
1367
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1692
1368
|
"div",
|
|
1693
1369
|
{
|
|
@@ -1705,7 +1381,9 @@ var RoomsList = ({
|
|
|
1705
1381
|
state: item?.state,
|
|
1706
1382
|
zipCode: item?.zipCode,
|
|
1707
1383
|
euifyMakeModel: item?.euifyMakeModel || "",
|
|
1708
|
-
onSchedule
|
|
1384
|
+
onSchedule,
|
|
1385
|
+
onMouseEnter: () => setHoveredRoomId(item.id),
|
|
1386
|
+
onMouseLeave: () => setHoveredRoomId(null)
|
|
1709
1387
|
},
|
|
1710
1388
|
item.id
|
|
1711
1389
|
);
|
|
@@ -1732,9 +1410,8 @@ var RoomsList = ({
|
|
|
1732
1410
|
{
|
|
1733
1411
|
googleMapsApiKey,
|
|
1734
1412
|
locations: filteredStudioLocations,
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
},
|
|
1413
|
+
hoveredLocationId: hoveredRoomId,
|
|
1414
|
+
onSchedule,
|
|
1738
1415
|
mapHeight: "794px"
|
|
1739
1416
|
}
|
|
1740
1417
|
) })
|
|
@@ -1911,7 +1588,7 @@ function createDemoRoomApi(config) {
|
|
|
1911
1588
|
}
|
|
1912
1589
|
var DemoRoom = ({
|
|
1913
1590
|
className,
|
|
1914
|
-
layoutClassName
|
|
1591
|
+
layoutClassName,
|
|
1915
1592
|
googleMapsApiKey,
|
|
1916
1593
|
apiConfig,
|
|
1917
1594
|
teamCode,
|
|
@@ -1923,427 +1600,149 @@ var DemoRoom = ({
|
|
|
1923
1600
|
() => createDemoRoomApi(apiConfig),
|
|
1924
1601
|
[apiConfig]
|
|
1925
1602
|
);
|
|
1926
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1938
|
-
RoomsList,
|
|
1939
|
-
{
|
|
1940
|
-
className: layoutClassName,
|
|
1941
|
-
googleMapsApiKey,
|
|
1942
|
-
apiClient,
|
|
1943
|
-
teamCode,
|
|
1944
|
-
brandWebsite,
|
|
1945
|
-
onSchedule
|
|
1946
|
-
}
|
|
1947
|
-
),
|
|
1948
|
-
/* @__PURE__ */ jsxRuntime.jsx(EasySteps, { className: layoutClassName })
|
|
1949
|
-
] });
|
|
1603
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1604
|
+
RoomsList,
|
|
1605
|
+
{
|
|
1606
|
+
className: layoutClassName,
|
|
1607
|
+
googleMapsApiKey,
|
|
1608
|
+
apiClient,
|
|
1609
|
+
teamCode,
|
|
1610
|
+
brandWebsite,
|
|
1611
|
+
onSchedule
|
|
1612
|
+
}
|
|
1613
|
+
) });
|
|
1950
1614
|
};
|
|
1951
1615
|
DemoRoom.displayName = "DemoRoom";
|
|
1952
|
-
var
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1616
|
+
var QuestionnaireForm = ({
|
|
1617
|
+
questions,
|
|
1618
|
+
onSubmit,
|
|
1619
|
+
pageData,
|
|
1620
|
+
loading = false,
|
|
1621
|
+
className
|
|
1622
|
+
}) => {
|
|
1623
|
+
console.log(pageData);
|
|
1624
|
+
const [responses, setResponses] = React2.useState({});
|
|
1625
|
+
const [errors, setErrors] = React2.useState({});
|
|
1626
|
+
const [agreements, setAgreements] = React2.useState({});
|
|
1627
|
+
const [agreementError, setAgreementError] = React2.useState("");
|
|
1628
|
+
const getQuestionId = (question) => {
|
|
1629
|
+
return question.id || question.key || "";
|
|
1630
|
+
};
|
|
1631
|
+
const handleChange = (questionId, value) => {
|
|
1632
|
+
setResponses((prev) => ({
|
|
1633
|
+
...prev,
|
|
1634
|
+
[questionId]: value
|
|
1635
|
+
}));
|
|
1636
|
+
if (errors[questionId]) {
|
|
1637
|
+
setErrors((prev) => {
|
|
1638
|
+
const newErrors = { ...prev };
|
|
1639
|
+
delete newErrors[questionId];
|
|
1640
|
+
return newErrors;
|
|
1641
|
+
});
|
|
1975
1642
|
}
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
} catch (e) {
|
|
1990
|
-
try {
|
|
1991
|
-
__require("swiper/swiper.min.css");
|
|
1992
|
-
__require("swiper/modules/navigation/navigation.min.css");
|
|
1993
|
-
__require("swiper/modules/pagination/pagination.min.css");
|
|
1994
|
-
} catch (e2) {
|
|
1995
|
-
console.warn("Failed to load swiper styles");
|
|
1643
|
+
};
|
|
1644
|
+
const handleCheckboxChange = (questionId, optionValue, checked) => {
|
|
1645
|
+
const currentValues = responses[questionId] || [];
|
|
1646
|
+
const newValues = checked ? [...currentValues, optionValue] : currentValues.filter((v) => v !== optionValue);
|
|
1647
|
+
handleChange(questionId, newValues);
|
|
1648
|
+
};
|
|
1649
|
+
const handleAgreementChange = (index, checked) => {
|
|
1650
|
+
setAgreements((prev) => ({
|
|
1651
|
+
...prev,
|
|
1652
|
+
[index]: checked
|
|
1653
|
+
}));
|
|
1654
|
+
if (checked && agreementError) {
|
|
1655
|
+
setAgreementError("");
|
|
1996
1656
|
}
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
const
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2040
|
-
|
|
2041
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 bg-gray-200 rounded animate-pulse" })
|
|
2042
|
-
] }),
|
|
2043
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[400px] bg-gray-200 rounded-2xl animate-pulse" })
|
|
2044
|
-
] }) });
|
|
2045
|
-
}
|
|
2046
|
-
if (error && apiClient && demoRoomCode) {
|
|
2047
|
-
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: [
|
|
2048
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg font-medium", children: "Failed to load demo room details" }),
|
|
2049
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-2", children: error.message })
|
|
2050
|
-
] }) });
|
|
2051
|
-
}
|
|
2052
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
|
|
2053
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
2054
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-[40px] font-bold text-gray-900 leading-tight", children: title }),
|
|
2055
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: descriptions.map((desc, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2056
|
-
"p",
|
|
2057
|
-
{
|
|
2058
|
-
className: "text-base text-gray-600 leading-relaxed",
|
|
2059
|
-
children: desc
|
|
2060
|
-
},
|
|
2061
|
-
index
|
|
2062
|
-
)) }),
|
|
2063
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
2064
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2065
|
-
"svg",
|
|
1657
|
+
};
|
|
1658
|
+
const validateForm = () => {
|
|
1659
|
+
const newErrors = {};
|
|
1660
|
+
questions.forEach((question) => {
|
|
1661
|
+
if (question.required) {
|
|
1662
|
+
const questionId = getQuestionId(question);
|
|
1663
|
+
const value = responses[questionId];
|
|
1664
|
+
if (!value || Array.isArray(value) && value.length === 0) {
|
|
1665
|
+
newErrors[questionId] = "This field is required";
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
});
|
|
1669
|
+
const agrees = pageData?.agrees || [];
|
|
1670
|
+
if (agrees.length > 0) {
|
|
1671
|
+
const allAgreed = agrees.every(
|
|
1672
|
+
(_, index) => agreements[index]
|
|
1673
|
+
);
|
|
1674
|
+
if (!allAgreed) {
|
|
1675
|
+
setAgreementError(
|
|
1676
|
+
"Please agree to all terms and conditions to continue"
|
|
1677
|
+
);
|
|
1678
|
+
setErrors(newErrors);
|
|
1679
|
+
return false;
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
setErrors(newErrors);
|
|
1683
|
+
setAgreementError("");
|
|
1684
|
+
return Object.keys(newErrors).length === 0;
|
|
1685
|
+
};
|
|
1686
|
+
const handleSubmit = (e) => {
|
|
1687
|
+
e.preventDefault();
|
|
1688
|
+
if (validateForm()) {
|
|
1689
|
+
onSubmit?.(responses);
|
|
1690
|
+
}
|
|
1691
|
+
};
|
|
1692
|
+
const renderQuestion = (question) => {
|
|
1693
|
+
const questionId = getQuestionId(question);
|
|
1694
|
+
const hasError = !!errors[questionId];
|
|
1695
|
+
switch (question.type) {
|
|
1696
|
+
case "text":
|
|
1697
|
+
case "email":
|
|
1698
|
+
case "tel":
|
|
1699
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1700
|
+
"input",
|
|
2066
1701
|
{
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
1702
|
+
type: question.type,
|
|
1703
|
+
value: responses[questionId] || "",
|
|
1704
|
+
onChange: (e) => handleChange(questionId, e.target.value),
|
|
1705
|
+
placeholder: question.placeholder,
|
|
1706
|
+
className: cn(
|
|
1707
|
+
"w-full px-4 py-3 rounded-lg border text-base",
|
|
1708
|
+
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
|
|
1709
|
+
hasError ? "border-red-500" : "border-[#E4E5E6]"
|
|
1710
|
+
)
|
|
1711
|
+
}
|
|
1712
|
+
);
|
|
1713
|
+
case "textarea":
|
|
1714
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1715
|
+
"textarea",
|
|
1716
|
+
{
|
|
1717
|
+
value: responses[questionId] || "",
|
|
1718
|
+
onChange: (e) => handleChange(questionId, e.target.value),
|
|
1719
|
+
placeholder: question.placeholder,
|
|
1720
|
+
rows: 4,
|
|
1721
|
+
className: cn(
|
|
1722
|
+
"w-full px-4 py-3 rounded-lg border text-base resize-none",
|
|
1723
|
+
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
|
|
1724
|
+
hasError ? "border-red-500" : "border-[#E4E5E6]"
|
|
1725
|
+
)
|
|
1726
|
+
}
|
|
1727
|
+
);
|
|
1728
|
+
case "radio":
|
|
1729
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: question?.options?.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1730
|
+
"label",
|
|
1731
|
+
{
|
|
1732
|
+
className: "flex items-center gap-3 cursor-pointer group",
|
|
2073
1733
|
children: [
|
|
2074
1734
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2075
|
-
"
|
|
2076
|
-
{
|
|
2077
|
-
x: "3",
|
|
2078
|
-
y: "3",
|
|
2079
|
-
width: "18",
|
|
2080
|
-
height: "18",
|
|
2081
|
-
rx: "2",
|
|
2082
|
-
stroke: "currentColor",
|
|
2083
|
-
strokeWidth: "2"
|
|
2084
|
-
}
|
|
2085
|
-
),
|
|
2086
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2087
|
-
"path",
|
|
1735
|
+
"input",
|
|
2088
1736
|
{
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
1737
|
+
type: "radio",
|
|
1738
|
+
name: questionId,
|
|
1739
|
+
value: option.value || option.label,
|
|
1740
|
+
checked: responses[questionId] === (option.value || option.label),
|
|
1741
|
+
onChange: (e) => handleChange(questionId, e.target.value),
|
|
1742
|
+
className: "w-5 h-5 text-[#3ADB67] focus:ring-[#3ADB67] focus:ring-2"
|
|
2093
1743
|
}
|
|
2094
1744
|
),
|
|
2095
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2096
|
-
"path",
|
|
2097
|
-
{
|
|
2098
|
-
d: "M8 14H16",
|
|
2099
|
-
stroke: "currentColor",
|
|
2100
|
-
strokeWidth: "2",
|
|
2101
|
-
strokeLinecap: "round"
|
|
2102
|
-
}
|
|
2103
|
-
)
|
|
2104
|
-
]
|
|
2105
|
-
}
|
|
2106
|
-
),
|
|
2107
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-900", children: devices })
|
|
2108
|
-
] }),
|
|
2109
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
2110
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2111
|
-
"svg",
|
|
2112
|
-
{
|
|
2113
|
-
width: "24",
|
|
2114
|
-
height: "24",
|
|
2115
|
-
viewBox: "0 0 24 24",
|
|
2116
|
-
fill: "none",
|
|
2117
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2118
|
-
className: "flex-shrink-0 mt-0.5",
|
|
2119
|
-
children: [
|
|
2120
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2121
|
-
"path",
|
|
2122
|
-
{
|
|
2123
|
-
d: "M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2Z",
|
|
2124
|
-
stroke: "currentColor",
|
|
2125
|
-
strokeWidth: "2",
|
|
2126
|
-
strokeLinecap: "round",
|
|
2127
|
-
strokeLinejoin: "round"
|
|
2128
|
-
}
|
|
2129
|
-
),
|
|
2130
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2131
|
-
"circle",
|
|
2132
|
-
{
|
|
2133
|
-
cx: "12",
|
|
2134
|
-
cy: "9",
|
|
2135
|
-
r: "2.5",
|
|
2136
|
-
stroke: "currentColor",
|
|
2137
|
-
strokeWidth: "2"
|
|
2138
|
-
}
|
|
2139
|
-
)
|
|
2140
|
-
]
|
|
2141
|
-
}
|
|
2142
|
-
),
|
|
2143
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
2144
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-900", children: address }),
|
|
2145
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2146
|
-
"a",
|
|
2147
|
-
{
|
|
2148
|
-
href: googleMapsLink,
|
|
2149
|
-
target: "_blank",
|
|
2150
|
-
rel: "noopener noreferrer",
|
|
2151
|
-
className: "inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 mt-1 underline",
|
|
2152
|
-
children: [
|
|
2153
|
-
"Open in Google Maps",
|
|
2154
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2155
|
-
"svg",
|
|
2156
|
-
{
|
|
2157
|
-
width: "12",
|
|
2158
|
-
height: "12",
|
|
2159
|
-
viewBox: "0 0 12 12",
|
|
2160
|
-
fill: "none",
|
|
2161
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2162
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2163
|
-
"path",
|
|
2164
|
-
{
|
|
2165
|
-
d: "M3 9L9 3M9 3H3M9 3V9",
|
|
2166
|
-
stroke: "currentColor",
|
|
2167
|
-
strokeWidth: "1.5",
|
|
2168
|
-
strokeLinecap: "round",
|
|
2169
|
-
strokeLinejoin: "round"
|
|
2170
|
-
}
|
|
2171
|
-
)
|
|
2172
|
-
}
|
|
2173
|
-
)
|
|
2174
|
-
]
|
|
2175
|
-
}
|
|
2176
|
-
)
|
|
2177
|
-
] })
|
|
2178
|
-
] })
|
|
2179
|
-
] }),
|
|
2180
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative h-[400px] rounded-2xl overflow-hidden", children: images.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2181
|
-
react.Swiper,
|
|
2182
|
-
{
|
|
2183
|
-
...swiperVersion === "11+" && Navigation && Pagination && Autoplay ? { modules: [Navigation, Pagination, Autoplay] } : {},
|
|
2184
|
-
spaceBetween: 0,
|
|
2185
|
-
slidesPerView: 1,
|
|
2186
|
-
navigation: true,
|
|
2187
|
-
pagination: { clickable: true },
|
|
2188
|
-
autoplay: {
|
|
2189
|
-
delay: 3e3,
|
|
2190
|
-
disableOnInteraction: false
|
|
2191
|
-
},
|
|
2192
|
-
loop: true,
|
|
2193
|
-
className: "h-full rounded-2xl",
|
|
2194
|
-
children: images.map((img, index) => /* @__PURE__ */ jsxRuntime.jsx(react.SwiperSlide, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2195
|
-
"img",
|
|
2196
|
-
{
|
|
2197
|
-
src: img,
|
|
2198
|
-
alt: `Demo room view ${index + 1}`,
|
|
2199
|
-
className: "w-full h-full object-cover"
|
|
2200
|
-
}
|
|
2201
|
-
) }) }, index))
|
|
2202
|
-
}
|
|
2203
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full bg-gradient-to-br from-gray-100 to-gray-200 flex items-center justify-center rounded-2xl", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
2204
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 mx-auto mb-3 rounded-full bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2205
|
-
"svg",
|
|
2206
|
-
{
|
|
2207
|
-
width: "32",
|
|
2208
|
-
height: "32",
|
|
2209
|
-
viewBox: "0 0 32 32",
|
|
2210
|
-
fill: "none",
|
|
2211
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2212
|
-
children: [
|
|
2213
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2214
|
-
"rect",
|
|
2215
|
-
{
|
|
2216
|
-
x: "4",
|
|
2217
|
-
y: "8",
|
|
2218
|
-
width: "24",
|
|
2219
|
-
height: "16",
|
|
2220
|
-
rx: "2",
|
|
2221
|
-
stroke: "currentColor",
|
|
2222
|
-
strokeWidth: "2"
|
|
2223
|
-
}
|
|
2224
|
-
),
|
|
2225
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "14", r: "2", fill: "currentColor" }),
|
|
2226
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2227
|
-
"path",
|
|
2228
|
-
{
|
|
2229
|
-
d: "M28 20L22 14L16 20",
|
|
2230
|
-
stroke: "currentColor",
|
|
2231
|
-
strokeWidth: "2",
|
|
2232
|
-
strokeLinecap: "round",
|
|
2233
|
-
strokeLinejoin: "round"
|
|
2234
|
-
}
|
|
2235
|
-
)
|
|
2236
|
-
]
|
|
2237
|
-
}
|
|
2238
|
-
) }),
|
|
2239
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 text-sm", children: "Demo Room Images" })
|
|
2240
|
-
] }) }) })
|
|
2241
|
-
] }) });
|
|
2242
|
-
};
|
|
2243
|
-
DemoRoomDetail.displayName = "DemoRoomDetail";
|
|
2244
|
-
var QuestionnaireForm = ({
|
|
2245
|
-
questions,
|
|
2246
|
-
onSubmit,
|
|
2247
|
-
loading = false,
|
|
2248
|
-
className
|
|
2249
|
-
}) => {
|
|
2250
|
-
const [responses, setResponses] = React2.useState({});
|
|
2251
|
-
const [errors, setErrors] = React2.useState({});
|
|
2252
|
-
const getQuestionId = (question) => {
|
|
2253
|
-
return question.id || question.key || "";
|
|
2254
|
-
};
|
|
2255
|
-
const handleChange = (questionId, value) => {
|
|
2256
|
-
setResponses((prev) => ({
|
|
2257
|
-
...prev,
|
|
2258
|
-
[questionId]: value
|
|
2259
|
-
}));
|
|
2260
|
-
if (errors[questionId]) {
|
|
2261
|
-
setErrors((prev) => {
|
|
2262
|
-
const newErrors = { ...prev };
|
|
2263
|
-
delete newErrors[questionId];
|
|
2264
|
-
return newErrors;
|
|
2265
|
-
});
|
|
2266
|
-
}
|
|
2267
|
-
};
|
|
2268
|
-
const handleCheckboxChange = (questionId, optionValue, checked) => {
|
|
2269
|
-
const currentValues = responses[questionId] || [];
|
|
2270
|
-
const newValues = checked ? [...currentValues, optionValue] : currentValues.filter((v) => v !== optionValue);
|
|
2271
|
-
handleChange(questionId, newValues);
|
|
2272
|
-
};
|
|
2273
|
-
const validateForm = () => {
|
|
2274
|
-
const newErrors = {};
|
|
2275
|
-
questions.forEach((question) => {
|
|
2276
|
-
if (question.required) {
|
|
2277
|
-
const questionId = getQuestionId(question);
|
|
2278
|
-
const value = responses[questionId];
|
|
2279
|
-
if (!value || Array.isArray(value) && value.length === 0) {
|
|
2280
|
-
newErrors[questionId] = "This field is required";
|
|
2281
|
-
}
|
|
2282
|
-
}
|
|
2283
|
-
});
|
|
2284
|
-
setErrors(newErrors);
|
|
2285
|
-
return Object.keys(newErrors).length === 0;
|
|
2286
|
-
};
|
|
2287
|
-
const handleSubmit = (e) => {
|
|
2288
|
-
e.preventDefault();
|
|
2289
|
-
if (validateForm()) {
|
|
2290
|
-
onSubmit?.(responses);
|
|
2291
|
-
}
|
|
2292
|
-
};
|
|
2293
|
-
const renderQuestion = (question) => {
|
|
2294
|
-
const questionId = getQuestionId(question);
|
|
2295
|
-
const hasError = !!errors[questionId];
|
|
2296
|
-
switch (question.type) {
|
|
2297
|
-
case "text":
|
|
2298
|
-
case "email":
|
|
2299
|
-
case "tel":
|
|
2300
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2301
|
-
"input",
|
|
2302
|
-
{
|
|
2303
|
-
type: question.type,
|
|
2304
|
-
value: responses[questionId] || "",
|
|
2305
|
-
onChange: (e) => handleChange(questionId, e.target.value),
|
|
2306
|
-
placeholder: question.placeholder,
|
|
2307
|
-
className: cn(
|
|
2308
|
-
"w-full px-4 py-3 rounded-lg border text-base",
|
|
2309
|
-
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
|
|
2310
|
-
hasError ? "border-red-500" : "border-[#E4E5E6]"
|
|
2311
|
-
)
|
|
2312
|
-
}
|
|
2313
|
-
);
|
|
2314
|
-
case "textarea":
|
|
2315
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2316
|
-
"textarea",
|
|
2317
|
-
{
|
|
2318
|
-
value: responses[questionId] || "",
|
|
2319
|
-
onChange: (e) => handleChange(questionId, e.target.value),
|
|
2320
|
-
placeholder: question.placeholder,
|
|
2321
|
-
rows: 4,
|
|
2322
|
-
className: cn(
|
|
2323
|
-
"w-full px-4 py-3 rounded-lg border text-base resize-none",
|
|
2324
|
-
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
|
|
2325
|
-
hasError ? "border-red-500" : "border-[#E4E5E6]"
|
|
2326
|
-
)
|
|
2327
|
-
}
|
|
2328
|
-
);
|
|
2329
|
-
case "radio":
|
|
2330
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: question?.options?.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2331
|
-
"label",
|
|
2332
|
-
{
|
|
2333
|
-
className: "flex items-center gap-3 cursor-pointer group",
|
|
2334
|
-
children: [
|
|
2335
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2336
|
-
"input",
|
|
2337
|
-
{
|
|
2338
|
-
type: "radio",
|
|
2339
|
-
name: questionId,
|
|
2340
|
-
value: option.value || option.label,
|
|
2341
|
-
checked: responses[questionId] === (option.value || option.label),
|
|
2342
|
-
onChange: (e) => handleChange(questionId, e.target.value),
|
|
2343
|
-
className: "w-5 h-5 text-[#3ADB67] focus:ring-[#3ADB67] focus:ring-2"
|
|
2344
|
-
}
|
|
2345
|
-
),
|
|
2346
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-900 group-hover:text-[#3ADB67] transition-colors", children: option.label })
|
|
1745
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-900 group-hover:text-[#3ADB67] transition-colors", children: option.label })
|
|
2347
1746
|
]
|
|
2348
1747
|
},
|
|
2349
1748
|
option.value || option.label
|
|
@@ -2407,8 +1806,8 @@ var QuestionnaireForm = ({
|
|
|
2407
1806
|
return null;
|
|
2408
1807
|
}
|
|
2409
1808
|
};
|
|
2410
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("
|
|
2411
|
-
questions?.map((question) => {
|
|
1809
|
+
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?.map((question) => {
|
|
2412
1811
|
const questionId = getQuestionId(question);
|
|
2413
1812
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
2414
1813
|
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "block", children: [
|
|
@@ -2420,54 +1819,83 @@ var QuestionnaireForm = ({
|
|
|
2420
1819
|
] }),
|
|
2421
1820
|
renderQuestion(question),
|
|
2422
1821
|
question.hint && !errors[questionId] && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500", children: question.hint }),
|
|
2423
|
-
errors[questionId] && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm
|
|
1822
|
+
errors[questionId] && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", style: { color: "#FF4D4D" }, children: errors[questionId] })
|
|
2424
1823
|
] }, questionId);
|
|
2425
|
-
}),
|
|
2426
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2427
|
-
"
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
}
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
1824
|
+
}) }) }),
|
|
1825
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center", children: [
|
|
1826
|
+
pageData?.agrees && pageData.agrees.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 mt-8", children: [
|
|
1827
|
+
pageData.agrees.map((agreeContent, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1828
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1829
|
+
"input",
|
|
1830
|
+
{
|
|
1831
|
+
type: "checkbox",
|
|
1832
|
+
id: `agreement-${index}`,
|
|
1833
|
+
checked: agreements[index] || false,
|
|
1834
|
+
onChange: (e) => handleAgreementChange(index, e.target.checked),
|
|
1835
|
+
className: "w-5 h-5 rounded border-gray-300 text-[#2FC257] focus:ring-[#2FC257] cursor-pointer flex-shrink-0"
|
|
1836
|
+
}
|
|
1837
|
+
),
|
|
1838
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1839
|
+
"label",
|
|
1840
|
+
{
|
|
1841
|
+
htmlFor: `agreement-${index}`,
|
|
1842
|
+
className: "text-sm text-gray-700 cursor-pointer select-none flex-1 [&_a]:underline [&_a]:text-blue-600 [&_a:hover]:text-blue-700",
|
|
1843
|
+
dangerouslySetInnerHTML: { __html: agreeContent },
|
|
1844
|
+
"aria-label": `Agreement ${index + 1}`
|
|
1845
|
+
}
|
|
1846
|
+
)
|
|
1847
|
+
] }, index)),
|
|
1848
|
+
agreementError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-2", style: { color: "#FF4D4D" }, children: agreementError })
|
|
1849
|
+
] }),
|
|
1850
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1851
|
+
"button",
|
|
1852
|
+
{
|
|
1853
|
+
type: "submit",
|
|
1854
|
+
disabled: loading,
|
|
1855
|
+
onClick: handleSubmit,
|
|
1856
|
+
className: cn(
|
|
1857
|
+
"w-fit mt-6 px-6 py-4 rounded-full",
|
|
1858
|
+
"bg-[#080A0F] text-white font-medium text-base",
|
|
1859
|
+
"hover:bg-[#2FC257] transition-colors",
|
|
1860
|
+
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
|
|
1861
|
+
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
1862
|
+
),
|
|
1863
|
+
children: loading ? "Submitting..." : "Submit Booking"
|
|
1864
|
+
}
|
|
1865
|
+
)
|
|
1866
|
+
] })
|
|
1867
|
+
] });
|
|
1868
|
+
};
|
|
1869
|
+
dayjs__default.default.extend(dayLocaleData__default.default);
|
|
1870
|
+
dayjs__default.default.extend(weekday__default.default);
|
|
1871
|
+
dayjs__default.default.extend(weekOfYear__default.default);
|
|
1872
|
+
var DateTimePicker = ({
|
|
1873
|
+
apiClient,
|
|
1874
|
+
demoRoomCode,
|
|
1875
|
+
timezone,
|
|
1876
|
+
pageData,
|
|
1877
|
+
locale,
|
|
2451
1878
|
onBookingSuccess
|
|
2452
1879
|
}) => {
|
|
2453
1880
|
const { token } = antd.theme.useToken();
|
|
2454
1881
|
const [selectMonth, setSelectMonth] = React2.useState("");
|
|
2455
1882
|
const [selectedDate, setSelectedDate] = React2.useState(dayjs__default.default());
|
|
2456
|
-
const [selectedTimeslotId, setSelectedTimeslotId] = React2.useState(
|
|
1883
|
+
const [selectedTimeslotId, setSelectedTimeslotId] = React2.useState(
|
|
1884
|
+
null
|
|
1885
|
+
);
|
|
2457
1886
|
const [showQuestionnaire, setShowQuestionnaire] = React2.useState(false);
|
|
2458
|
-
const { createBooking, loading: bookingLoading, error: bookingError } = useCreateBooking(apiClient);
|
|
2459
1887
|
const {
|
|
2460
|
-
|
|
2461
|
-
|
|
1888
|
+
createBooking,
|
|
1889
|
+
loading: bookingLoading,
|
|
1890
|
+
error: bookingError
|
|
1891
|
+
} = useCreateBooking(apiClient);
|
|
1892
|
+
const { data: demoRoom } = useDemoRoom(
|
|
2462
1893
|
apiClient,
|
|
2463
1894
|
demoRoomCode || "",
|
|
2464
1895
|
locale,
|
|
2465
1896
|
{ enabled: !!demoRoomCode }
|
|
2466
1897
|
);
|
|
2467
|
-
const {
|
|
2468
|
-
data: questionnaire,
|
|
2469
|
-
loading: questionnaireLoading
|
|
2470
|
-
} = useQuestionnaire(
|
|
1898
|
+
const { data: questionnaire, loading: questionnaireLoading } = useQuestionnaire(
|
|
2471
1899
|
apiClient,
|
|
2472
1900
|
demoRoomCode || "",
|
|
2473
1901
|
demoRoom?.questionnaire_id,
|
|
@@ -2535,13 +1963,8 @@ var DateTimePicker = ({
|
|
|
2535
1963
|
}
|
|
2536
1964
|
}
|
|
2537
1965
|
},
|
|
2538
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2539
|
-
"
|
|
2540
|
-
{
|
|
2541
|
-
style: wrapperStyle,
|
|
2542
|
-
className: "calendar-custom-cell",
|
|
2543
|
-
children: [
|
|
2544
|
-
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
1966
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: wrapperStyle, className: "calendar-custom-cell", children: [
|
|
1967
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
2545
1968
|
.calendar-custom-cell .ant-picker-cell {
|
|
2546
1969
|
padding: 6px !important;
|
|
2547
1970
|
}
|
|
@@ -2576,136 +1999,134 @@ var DateTimePicker = ({
|
|
|
2576
1999
|
line-height: 48px !important;
|
|
2577
2000
|
}
|
|
2578
2001
|
` }),
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2002
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2003
|
+
antd.Calendar,
|
|
2004
|
+
{
|
|
2005
|
+
fullscreen: false,
|
|
2006
|
+
value: selectedDate,
|
|
2007
|
+
onChange: (date) => setSelectedDate(date),
|
|
2008
|
+
headerRender: ({ value, onChange }) => {
|
|
2009
|
+
const year = value.year();
|
|
2010
|
+
const month = value.month();
|
|
2011
|
+
const yearOptions = Array.from({ length: 20 }, (_, i) => {
|
|
2012
|
+
const label = year - 10 + i;
|
|
2013
|
+
return { label, value: label };
|
|
2014
|
+
});
|
|
2015
|
+
const monthOptions = value.localeData().months().map((label, index) => ({
|
|
2016
|
+
label,
|
|
2017
|
+
value: index
|
|
2018
|
+
}));
|
|
2019
|
+
const monthText = monthOptions?.find((item) => {
|
|
2020
|
+
return item?.value === month;
|
|
2021
|
+
});
|
|
2022
|
+
setSelectMonth(monthText?.label || "");
|
|
2023
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
2024
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2025
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2026
|
+
antd.Select,
|
|
2027
|
+
{
|
|
2028
|
+
value: month,
|
|
2029
|
+
options: monthOptions,
|
|
2030
|
+
onChange: (newMonth) => {
|
|
2031
|
+
const now = value.clone().month(newMonth);
|
|
2032
|
+
onChange(now);
|
|
2033
|
+
},
|
|
2034
|
+
variant: "borderless",
|
|
2035
|
+
className: "text-2xl font-medium",
|
|
2036
|
+
popupMatchSelectWidth: false,
|
|
2037
|
+
style: {
|
|
2038
|
+
fontSize: "24px",
|
|
2039
|
+
fontWeight: 500
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
),
|
|
2043
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2044
|
+
antd.Select,
|
|
2045
|
+
{
|
|
2046
|
+
value: year,
|
|
2047
|
+
options: yearOptions,
|
|
2048
|
+
onChange: (newYear) => {
|
|
2049
|
+
const now = value.clone().year(newYear);
|
|
2050
|
+
onChange(now);
|
|
2051
|
+
},
|
|
2052
|
+
variant: "borderless",
|
|
2053
|
+
className: "text-2xl font-medium",
|
|
2054
|
+
popupMatchSelectWidth: false,
|
|
2055
|
+
style: {
|
|
2056
|
+
fontSize: "24px",
|
|
2057
|
+
fontWeight: 500
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
)
|
|
2061
|
+
] }),
|
|
2062
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2063
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2064
|
+
"button",
|
|
2065
|
+
{
|
|
2066
|
+
onClick: () => {
|
|
2067
|
+
const newDate = value.subtract(1, "month");
|
|
2068
|
+
onChange(newDate);
|
|
2069
|
+
},
|
|
2070
|
+
className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
|
|
2071
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2072
|
+
"svg",
|
|
2642
2073
|
{
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2074
|
+
width: "20",
|
|
2075
|
+
height: "20",
|
|
2076
|
+
viewBox: "0 0 20 20",
|
|
2077
|
+
fill: "none",
|
|
2078
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2648
2079
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2649
|
-
"
|
|
2080
|
+
"path",
|
|
2650
2081
|
{
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2657
|
-
"path",
|
|
2658
|
-
{
|
|
2659
|
-
d: "M12 16L6 10L12 4",
|
|
2660
|
-
stroke: "currentColor",
|
|
2661
|
-
strokeWidth: "2",
|
|
2662
|
-
strokeLinecap: "round",
|
|
2663
|
-
strokeLinejoin: "round"
|
|
2664
|
-
}
|
|
2665
|
-
)
|
|
2082
|
+
d: "M12 16L6 10L12 4",
|
|
2083
|
+
stroke: "currentColor",
|
|
2084
|
+
strokeWidth: "2",
|
|
2085
|
+
strokeLinecap: "round",
|
|
2086
|
+
strokeLinejoin: "round"
|
|
2666
2087
|
}
|
|
2667
2088
|
)
|
|
2668
2089
|
}
|
|
2669
|
-
)
|
|
2670
|
-
|
|
2671
|
-
|
|
2090
|
+
)
|
|
2091
|
+
}
|
|
2092
|
+
),
|
|
2093
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2094
|
+
"button",
|
|
2095
|
+
{
|
|
2096
|
+
onClick: () => {
|
|
2097
|
+
const newDate = value.add(1, "month");
|
|
2098
|
+
onChange(newDate);
|
|
2099
|
+
},
|
|
2100
|
+
className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
|
|
2101
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2102
|
+
"svg",
|
|
2672
2103
|
{
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2104
|
+
width: "20",
|
|
2105
|
+
height: "20",
|
|
2106
|
+
viewBox: "0 0 20 20",
|
|
2107
|
+
fill: "none",
|
|
2108
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2678
2109
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2679
|
-
"
|
|
2110
|
+
"path",
|
|
2680
2111
|
{
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2687
|
-
"path",
|
|
2688
|
-
{
|
|
2689
|
-
d: "M8 4L14 10L8 16",
|
|
2690
|
-
stroke: "currentColor",
|
|
2691
|
-
strokeWidth: "2",
|
|
2692
|
-
strokeLinecap: "round",
|
|
2693
|
-
strokeLinejoin: "round"
|
|
2694
|
-
}
|
|
2695
|
-
)
|
|
2112
|
+
d: "M8 4L14 10L8 16",
|
|
2113
|
+
stroke: "currentColor",
|
|
2114
|
+
strokeWidth: "2",
|
|
2115
|
+
strokeLinecap: "round",
|
|
2116
|
+
strokeLinejoin: "round"
|
|
2696
2117
|
}
|
|
2697
2118
|
)
|
|
2698
2119
|
}
|
|
2699
2120
|
)
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
}
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
)
|
|
2121
|
+
}
|
|
2122
|
+
)
|
|
2123
|
+
] })
|
|
2124
|
+
] });
|
|
2125
|
+
},
|
|
2126
|
+
onPanelChange
|
|
2127
|
+
}
|
|
2128
|
+
)
|
|
2129
|
+
] })
|
|
2709
2130
|
}
|
|
2710
2131
|
),
|
|
2711
2132
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white p-[24px] rounded-[12px] flex-1", children: [
|
|
@@ -2765,91 +2186,391 @@ var DateTimePicker = ({
|
|
|
2765
2186
|
)
|
|
2766
2187
|
}
|
|
2767
2188
|
)
|
|
2768
|
-
}
|
|
2769
|
-
)
|
|
2770
|
-
] })
|
|
2771
|
-
] }),
|
|
2772
|
-
/* @__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: "Loading time slots..." }) : timeslotsError ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 text-center text-red-600 py-8", children: "Failed to load time slots" }) : dayTimeslots.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 text-center text-[#767880] py-8", children: "No available time slots for this date" }) : dayTimeslots.map((slot) => {
|
|
2773
|
-
const isAvailable = slot.status === "available";
|
|
2774
|
-
const isFull = slot.status === "full";
|
|
2775
|
-
const isSelected = selectedTimeslotId === slot.id;
|
|
2776
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2777
|
-
"button",
|
|
2778
|
-
{
|
|
2779
|
-
disabled: !isAvailable,
|
|
2780
|
-
onClick: () => {
|
|
2781
|
-
if (isAvailable) {
|
|
2782
|
-
setSelectedTimeslotId(slot.id);
|
|
2783
|
-
}
|
|
2784
|
-
},
|
|
2785
|
-
className: `
|
|
2786
|
-
rounded-[20px] w-full flex items-center justify-center gap-4 h-[76px]
|
|
2787
|
-
border text-center transition-colors
|
|
2788
|
-
${isSelected ? "border-[#3ADB67] bg-[#3ADB67] text-white cursor-pointer" : isAvailable ? "border-[#E4E5E6] hover:border-[#3ADB67] hover:bg-[#3ADB67]
|
|
2789
|
-
`,
|
|
2790
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
2791
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTimeslot(slot) }),
|
|
2792
|
-
isFull && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-[#BDBDBD] mt-1", children: "Full" }),
|
|
2793
|
-
isAvailable && !isSelected && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-[#767880] mt-1", children: [
|
|
2794
|
-
slot.capacity - slot.booked_count,
|
|
2795
|
-
" spots left"
|
|
2796
|
-
] }),
|
|
2797
|
-
isAvailable && isSelected && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-white mt-1", children: [
|
|
2798
|
-
slot.capacity - slot.booked_count,
|
|
2799
|
-
" spots left"
|
|
2800
|
-
] })
|
|
2801
|
-
] })
|
|
2802
|
-
},
|
|
2803
|
-
slot.id
|
|
2804
|
-
);
|
|
2805
|
-
}) })
|
|
2189
|
+
}
|
|
2190
|
+
)
|
|
2191
|
+
] })
|
|
2192
|
+
] }),
|
|
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: "Loading time slots..." }) : timeslotsError ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 text-center text-red-600 py-8", children: "Failed to load time slots" }) : dayTimeslots.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 text-center text-[#767880] py-8", children: "No available time slots for this date" }) : dayTimeslots.map((slot) => {
|
|
2194
|
+
const isAvailable = slot.status === "available";
|
|
2195
|
+
const isFull = slot.status === "full";
|
|
2196
|
+
const isSelected = selectedTimeslotId === slot.id;
|
|
2197
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2198
|
+
"button",
|
|
2199
|
+
{
|
|
2200
|
+
disabled: !isAvailable,
|
|
2201
|
+
onClick: () => {
|
|
2202
|
+
if (isAvailable) {
|
|
2203
|
+
setSelectedTimeslotId(slot.id);
|
|
2204
|
+
}
|
|
2205
|
+
},
|
|
2206
|
+
className: `
|
|
2207
|
+
rounded-[20px] w-full flex items-center justify-center gap-4 h-[76px]
|
|
2208
|
+
border text-center transition-colors
|
|
2209
|
+
${isSelected ? "border-[#3ADB67] bg-[#3ADB67] text-white cursor-pointer" : isAvailable ? "border-[#E4E5E6] hover:border-[#3ADB67] hover:bg-[#3ADB67] cursor-pointer" : "border-[#E4E5E6] bg-[#F5F5F5] text-[#BDBDBD] cursor-not-allowed"}
|
|
2210
|
+
`,
|
|
2211
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
2212
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTimeslot(slot) }),
|
|
2213
|
+
isFull && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-[#BDBDBD] mt-1", children: "Full" }),
|
|
2214
|
+
isAvailable && !isSelected && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-[#767880] mt-1", children: [
|
|
2215
|
+
slot.capacity - slot.booked_count,
|
|
2216
|
+
" spots left"
|
|
2217
|
+
] }),
|
|
2218
|
+
isAvailable && isSelected && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-white mt-1", children: [
|
|
2219
|
+
slot.capacity - slot.booked_count,
|
|
2220
|
+
" spots left"
|
|
2221
|
+
] })
|
|
2222
|
+
] })
|
|
2223
|
+
},
|
|
2224
|
+
slot.id
|
|
2225
|
+
);
|
|
2226
|
+
}) })
|
|
2227
|
+
] })
|
|
2228
|
+
] }),
|
|
2229
|
+
showQuestionnaire && questionnaire && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-12", children: [
|
|
2230
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[48px] font-bold text-center mb-8", children: "Fill out Form" }),
|
|
2231
|
+
questionnaireLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-[#767880] py-8", children: "Loading questionnaire..." }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2232
|
+
QuestionnaireForm,
|
|
2233
|
+
{
|
|
2234
|
+
questions: questionnaire.questions,
|
|
2235
|
+
loading: bookingLoading,
|
|
2236
|
+
pageData,
|
|
2237
|
+
onSubmit: async (responses) => {
|
|
2238
|
+
try {
|
|
2239
|
+
const customerName = responses.name || responses.customer_name || "";
|
|
2240
|
+
const customerEmail = responses.email || responses.customer_email || "";
|
|
2241
|
+
const customerPhone = responses.phone || responses.customer_phone_number || "";
|
|
2242
|
+
const customerPhoneCode = responses.phone_code || responses.customer_phone_code || "+1";
|
|
2243
|
+
const result = await createBooking({
|
|
2244
|
+
demoroom_code: demoRoomCode,
|
|
2245
|
+
timeslot_id: selectedTimeslotId,
|
|
2246
|
+
questionnaire_id: questionnaire.id,
|
|
2247
|
+
questionnaire_response: responses,
|
|
2248
|
+
customer_name: customerName,
|
|
2249
|
+
customer_email: customerEmail,
|
|
2250
|
+
customer_phone_code: customerPhoneCode,
|
|
2251
|
+
customer_phone_number: customerPhone
|
|
2252
|
+
});
|
|
2253
|
+
if (result && onBookingSuccess) {
|
|
2254
|
+
onBookingSuccess(result?.cancel_token);
|
|
2255
|
+
}
|
|
2256
|
+
} catch (error) {
|
|
2257
|
+
console.error("Booking creation failed:", error);
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
)
|
|
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
|
+
] })
|
|
2267
|
+
] });
|
|
2268
|
+
};
|
|
2269
|
+
var DateTimePicker_default = DateTimePicker;
|
|
2270
|
+
var Navigation;
|
|
2271
|
+
var Pagination;
|
|
2272
|
+
var Autoplay;
|
|
2273
|
+
var swiperVersion = "11+";
|
|
2274
|
+
try {
|
|
2275
|
+
const modules = __require("swiper/modules");
|
|
2276
|
+
Navigation = modules.Navigation;
|
|
2277
|
+
Pagination = modules.Pagination;
|
|
2278
|
+
Autoplay = modules.Autoplay;
|
|
2279
|
+
swiperVersion = "11+";
|
|
2280
|
+
} catch (e) {
|
|
2281
|
+
try {
|
|
2282
|
+
const SwiperCore = __require("swiper");
|
|
2283
|
+
const SwiperNavigation = __require("swiper/modules/navigation");
|
|
2284
|
+
const SwiperPagination = __require("swiper/modules/pagination");
|
|
2285
|
+
const SwiperAutoplay = __require("swiper/modules/autoplay");
|
|
2286
|
+
const SwiperClass = SwiperCore.default || SwiperCore;
|
|
2287
|
+
if (SwiperClass && SwiperClass.use) {
|
|
2288
|
+
SwiperClass.use([
|
|
2289
|
+
SwiperNavigation.default || SwiperNavigation,
|
|
2290
|
+
SwiperPagination.default || SwiperPagination,
|
|
2291
|
+
SwiperAutoplay.default || SwiperAutoplay
|
|
2292
|
+
]);
|
|
2293
|
+
}
|
|
2294
|
+
Navigation = SwiperNavigation.default || SwiperNavigation;
|
|
2295
|
+
Pagination = SwiperPagination.default || SwiperPagination;
|
|
2296
|
+
Autoplay = SwiperAutoplay.default || SwiperAutoplay;
|
|
2297
|
+
swiperVersion = "8";
|
|
2298
|
+
} catch (e2) {
|
|
2299
|
+
console.warn("Failed to load swiper modules:", e2);
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
if (typeof window !== "undefined") {
|
|
2303
|
+
try {
|
|
2304
|
+
__require("swiper/css");
|
|
2305
|
+
__require("swiper/css/navigation");
|
|
2306
|
+
__require("swiper/css/pagination");
|
|
2307
|
+
} catch (e) {
|
|
2308
|
+
try {
|
|
2309
|
+
__require("swiper/swiper.min.css");
|
|
2310
|
+
__require("swiper/modules/navigation/navigation.min.css");
|
|
2311
|
+
__require("swiper/modules/pagination/pagination.min.css");
|
|
2312
|
+
} catch (e2) {
|
|
2313
|
+
console.warn("Failed to load swiper styles");
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
var defaultDescriptions = [
|
|
2318
|
+
"Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
|
|
2319
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos."
|
|
2320
|
+
];
|
|
2321
|
+
var defaultImages = [
|
|
2322
|
+
"https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
2323
|
+
"https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
|
|
2324
|
+
];
|
|
2325
|
+
var DemoRoomDetail = ({
|
|
2326
|
+
apiClient,
|
|
2327
|
+
demoRoomCode,
|
|
2328
|
+
locale,
|
|
2329
|
+
title: titleProp,
|
|
2330
|
+
descriptions: descriptionsProp,
|
|
2331
|
+
devices: devicesProp,
|
|
2332
|
+
address: addressProp,
|
|
2333
|
+
mapsLink,
|
|
2334
|
+
images: imagesProp,
|
|
2335
|
+
className,
|
|
2336
|
+
...props
|
|
2337
|
+
}) => {
|
|
2338
|
+
const {
|
|
2339
|
+
data: demoRoom,
|
|
2340
|
+
loading,
|
|
2341
|
+
error
|
|
2342
|
+
} = useDemoRoom(
|
|
2343
|
+
apiClient,
|
|
2344
|
+
demoRoomCode || "",
|
|
2345
|
+
locale,
|
|
2346
|
+
{ enabled: !!apiClient && !!demoRoomCode }
|
|
2347
|
+
);
|
|
2348
|
+
const title = demoRoom?.name || titleProp || "Design District Demo Room";
|
|
2349
|
+
const descriptions = demoRoom?.description ? [demoRoom.description] : descriptionsProp || defaultDescriptions;
|
|
2350
|
+
const devices = demoRoom?.description || devicesProp || "eufyMake E1, eufyMake M5";
|
|
2351
|
+
const address = demoRoom?.address || addressProp || "1111 8th St, San Francisco, CA United States 94108";
|
|
2352
|
+
const images = demoRoom?.images && demoRoom.images.length > 0 ? demoRoom.images : imagesProp || defaultImages;
|
|
2353
|
+
const googleMapsLink = mapsLink || (() => {
|
|
2354
|
+
if (demoRoom?.latitude && demoRoom?.longitude) {
|
|
2355
|
+
return `https://www.google.com/maps/search/?api=1&query=${demoRoom.latitude},${demoRoom.longitude}`;
|
|
2356
|
+
} else {
|
|
2357
|
+
return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(address)}`;
|
|
2358
|
+
}
|
|
2359
|
+
})();
|
|
2360
|
+
if (loading && apiClient && demoRoomCode) {
|
|
2361
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
|
|
2362
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
2363
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-12 bg-gray-200 rounded animate-pulse" }),
|
|
2364
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-24 bg-gray-200 rounded animate-pulse" }),
|
|
2365
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 bg-gray-200 rounded animate-pulse" })
|
|
2366
|
+
] }),
|
|
2367
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[400px] bg-gray-200 rounded-2xl animate-pulse" })
|
|
2368
|
+
] }) });
|
|
2369
|
+
}
|
|
2370
|
+
if (error && apiClient && demoRoomCode) {
|
|
2371
|
+
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: "Failed to load demo room details" }),
|
|
2373
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-2", children: error.message })
|
|
2374
|
+
] }) });
|
|
2375
|
+
}
|
|
2376
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
|
|
2377
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
2378
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-[40px] font-bold text-gray-900 leading-tight", children: title }),
|
|
2379
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: descriptions.map((desc, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2380
|
+
"p",
|
|
2381
|
+
{
|
|
2382
|
+
className: "text-base text-gray-600 leading-relaxed",
|
|
2383
|
+
children: desc
|
|
2384
|
+
},
|
|
2385
|
+
index
|
|
2386
|
+
)) }),
|
|
2387
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
2388
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2389
|
+
"svg",
|
|
2390
|
+
{
|
|
2391
|
+
width: "24",
|
|
2392
|
+
height: "24",
|
|
2393
|
+
viewBox: "0 0 24 24",
|
|
2394
|
+
fill: "none",
|
|
2395
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2396
|
+
className: "flex-shrink-0 mt-0.5",
|
|
2397
|
+
children: [
|
|
2398
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2399
|
+
"rect",
|
|
2400
|
+
{
|
|
2401
|
+
x: "3",
|
|
2402
|
+
y: "3",
|
|
2403
|
+
width: "18",
|
|
2404
|
+
height: "18",
|
|
2405
|
+
rx: "2",
|
|
2406
|
+
stroke: "currentColor",
|
|
2407
|
+
strokeWidth: "2"
|
|
2408
|
+
}
|
|
2409
|
+
),
|
|
2410
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2411
|
+
"path",
|
|
2412
|
+
{
|
|
2413
|
+
d: "M8 10H16",
|
|
2414
|
+
stroke: "currentColor",
|
|
2415
|
+
strokeWidth: "2",
|
|
2416
|
+
strokeLinecap: "round"
|
|
2417
|
+
}
|
|
2418
|
+
),
|
|
2419
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2420
|
+
"path",
|
|
2421
|
+
{
|
|
2422
|
+
d: "M8 14H16",
|
|
2423
|
+
stroke: "currentColor",
|
|
2424
|
+
strokeWidth: "2",
|
|
2425
|
+
strokeLinecap: "round"
|
|
2426
|
+
}
|
|
2427
|
+
)
|
|
2428
|
+
]
|
|
2429
|
+
}
|
|
2430
|
+
),
|
|
2431
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-900", children: devices })
|
|
2432
|
+
] }),
|
|
2433
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
2434
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2435
|
+
"svg",
|
|
2436
|
+
{
|
|
2437
|
+
width: "24",
|
|
2438
|
+
height: "24",
|
|
2439
|
+
viewBox: "0 0 24 24",
|
|
2440
|
+
fill: "none",
|
|
2441
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2442
|
+
className: "flex-shrink-0 mt-0.5",
|
|
2443
|
+
children: [
|
|
2444
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2445
|
+
"path",
|
|
2446
|
+
{
|
|
2447
|
+
d: "M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2Z",
|
|
2448
|
+
stroke: "currentColor",
|
|
2449
|
+
strokeWidth: "2",
|
|
2450
|
+
strokeLinecap: "round",
|
|
2451
|
+
strokeLinejoin: "round"
|
|
2452
|
+
}
|
|
2453
|
+
),
|
|
2454
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2455
|
+
"circle",
|
|
2456
|
+
{
|
|
2457
|
+
cx: "12",
|
|
2458
|
+
cy: "9",
|
|
2459
|
+
r: "2.5",
|
|
2460
|
+
stroke: "currentColor",
|
|
2461
|
+
strokeWidth: "2"
|
|
2462
|
+
}
|
|
2463
|
+
)
|
|
2464
|
+
]
|
|
2465
|
+
}
|
|
2466
|
+
),
|
|
2467
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
2468
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-900", children: address }),
|
|
2469
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2470
|
+
"a",
|
|
2471
|
+
{
|
|
2472
|
+
href: googleMapsLink,
|
|
2473
|
+
target: "_blank",
|
|
2474
|
+
rel: "noopener noreferrer",
|
|
2475
|
+
className: "inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 mt-1 underline",
|
|
2476
|
+
children: [
|
|
2477
|
+
"Open in Google Maps",
|
|
2478
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2479
|
+
"svg",
|
|
2480
|
+
{
|
|
2481
|
+
width: "12",
|
|
2482
|
+
height: "12",
|
|
2483
|
+
viewBox: "0 0 12 12",
|
|
2484
|
+
fill: "none",
|
|
2485
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2486
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2487
|
+
"path",
|
|
2488
|
+
{
|
|
2489
|
+
d: "M3 9L9 3M9 3H3M9 3V9",
|
|
2490
|
+
stroke: "currentColor",
|
|
2491
|
+
strokeWidth: "1.5",
|
|
2492
|
+
strokeLinecap: "round",
|
|
2493
|
+
strokeLinejoin: "round"
|
|
2494
|
+
}
|
|
2495
|
+
)
|
|
2496
|
+
}
|
|
2497
|
+
)
|
|
2498
|
+
]
|
|
2499
|
+
}
|
|
2500
|
+
)
|
|
2501
|
+
] })
|
|
2806
2502
|
] })
|
|
2807
2503
|
] }),
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2504
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative h-[400px] rounded-2xl overflow-hidden", children: images.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2505
|
+
react.Swiper,
|
|
2506
|
+
{
|
|
2507
|
+
...swiperVersion === "11+" && Navigation && Pagination && Autoplay ? { modules: [Navigation, Pagination, Autoplay] } : {},
|
|
2508
|
+
spaceBetween: 0,
|
|
2509
|
+
slidesPerView: 1,
|
|
2510
|
+
navigation: true,
|
|
2511
|
+
pagination: { clickable: true },
|
|
2512
|
+
autoplay: {
|
|
2513
|
+
delay: 3e3,
|
|
2514
|
+
disableOnInteraction: false
|
|
2515
|
+
},
|
|
2516
|
+
loop: true,
|
|
2517
|
+
className: "h-full rounded-2xl",
|
|
2518
|
+
children: images.map((img, index) => /* @__PURE__ */ jsxRuntime.jsx(react.SwiperSlide, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2519
|
+
"img",
|
|
2520
|
+
{
|
|
2521
|
+
src: img,
|
|
2522
|
+
alt: `Demo room view ${index + 1}`,
|
|
2523
|
+
className: "w-full h-full object-cover"
|
|
2524
|
+
}
|
|
2525
|
+
) }) }, index))
|
|
2526
|
+
}
|
|
2527
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full bg-gradient-to-br from-gray-100 to-gray-200 flex items-center justify-center rounded-2xl", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
2528
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 mx-auto mb-3 rounded-full bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2529
|
+
"svg",
|
|
2812
2530
|
{
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
customer_phone_number: customerPhone
|
|
2830
|
-
});
|
|
2831
|
-
if (result && onBookingSuccess) {
|
|
2832
|
-
onBookingSuccess(result?.cancel_token);
|
|
2531
|
+
width: "32",
|
|
2532
|
+
height: "32",
|
|
2533
|
+
viewBox: "0 0 32 32",
|
|
2534
|
+
fill: "none",
|
|
2535
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2536
|
+
children: [
|
|
2537
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2538
|
+
"rect",
|
|
2539
|
+
{
|
|
2540
|
+
x: "4",
|
|
2541
|
+
y: "8",
|
|
2542
|
+
width: "24",
|
|
2543
|
+
height: "16",
|
|
2544
|
+
rx: "2",
|
|
2545
|
+
stroke: "currentColor",
|
|
2546
|
+
strokeWidth: "2"
|
|
2833
2547
|
}
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2548
|
+
),
|
|
2549
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "14", r: "2", fill: "currentColor" }),
|
|
2550
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2551
|
+
"path",
|
|
2552
|
+
{
|
|
2553
|
+
d: "M28 20L22 14L16 20",
|
|
2554
|
+
stroke: "currentColor",
|
|
2555
|
+
strokeWidth: "2",
|
|
2556
|
+
strokeLinecap: "round",
|
|
2557
|
+
strokeLinejoin: "round"
|
|
2558
|
+
}
|
|
2559
|
+
)
|
|
2560
|
+
]
|
|
2838
2561
|
}
|
|
2839
|
-
) })
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-1", children: bookingError.message })
|
|
2844
|
-
] })
|
|
2845
|
-
] });
|
|
2562
|
+
) }),
|
|
2563
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 text-sm", children: "Demo Room Images" })
|
|
2564
|
+
] }) }) })
|
|
2565
|
+
] }) });
|
|
2846
2566
|
};
|
|
2847
|
-
|
|
2567
|
+
DemoRoomDetail.displayName = "DemoRoomDetail";
|
|
2848
2568
|
var BookingForm = ({
|
|
2849
2569
|
layoutClassName,
|
|
2850
2570
|
className,
|
|
2851
2571
|
apiConfig,
|
|
2852
2572
|
demoRoomCode,
|
|
2573
|
+
pageData,
|
|
2853
2574
|
timezone,
|
|
2854
2575
|
handleBookingSuccess,
|
|
2855
2576
|
...props
|
|
@@ -2859,24 +2580,15 @@ var BookingForm = ({
|
|
|
2859
2580
|
[apiConfig]
|
|
2860
2581
|
);
|
|
2861
2582
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2862
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
DemoRoomDetail,
|
|
2872
|
-
{
|
|
2873
|
-
className: cn("mt-8", layoutClassName),
|
|
2874
|
-
apiClient,
|
|
2875
|
-
demoRoomCode,
|
|
2876
|
-
locale: apiConfig.locale
|
|
2877
|
-
}
|
|
2878
|
-
)
|
|
2879
|
-
] }),
|
|
2583
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2584
|
+
DemoRoomDetail,
|
|
2585
|
+
{
|
|
2586
|
+
className: cn("mt-8", layoutClassName),
|
|
2587
|
+
apiClient,
|
|
2588
|
+
demoRoomCode,
|
|
2589
|
+
locale: apiConfig.locale
|
|
2590
|
+
}
|
|
2591
|
+
) }),
|
|
2880
2592
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-[#f5f5f5]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2881
2593
|
DateTimePicker_default,
|
|
2882
2594
|
{
|
|
@@ -2884,7 +2596,8 @@ var BookingForm = ({
|
|
|
2884
2596
|
demoRoomCode,
|
|
2885
2597
|
timezone,
|
|
2886
2598
|
locale: apiConfig.locale,
|
|
2887
|
-
onBookingSuccess: handleBookingSuccess
|
|
2599
|
+
onBookingSuccess: handleBookingSuccess,
|
|
2600
|
+
pageData
|
|
2888
2601
|
}
|
|
2889
2602
|
) }) })
|
|
2890
2603
|
] });
|
|
@@ -2895,17 +2608,21 @@ var BookingSuccess = ({
|
|
|
2895
2608
|
token,
|
|
2896
2609
|
apiConfig,
|
|
2897
2610
|
onScheduleAgain,
|
|
2611
|
+
onCancelSuccess,
|
|
2898
2612
|
className
|
|
2899
2613
|
}) => {
|
|
2900
|
-
const [bookingData, setBookingData] = React2.useState(
|
|
2614
|
+
const [bookingData, setBookingData] = React2.useState(
|
|
2615
|
+
initialBookingData || null
|
|
2616
|
+
);
|
|
2901
2617
|
const [loading, setLoading] = React2.useState(false);
|
|
2902
|
-
const [error, setError] = React2.useState(null);
|
|
2903
2618
|
const [isCancelled, setIsCancelled] = React2.useState(false);
|
|
2619
|
+
const [showCancelDialog, setShowCancelDialog] = React2.useState(false);
|
|
2620
|
+
const [cancelLoading, setCancelLoading] = React2.useState(false);
|
|
2621
|
+
const [cancelError, setCancelError] = React2.useState(null);
|
|
2904
2622
|
React2.useEffect(() => {
|
|
2905
2623
|
if (token && apiConfig && !initialBookingData) {
|
|
2906
2624
|
const fetchBookingData = async () => {
|
|
2907
2625
|
setLoading(true);
|
|
2908
|
-
setError(null);
|
|
2909
2626
|
try {
|
|
2910
2627
|
const apiClient = createDemoRoomApi(apiConfig);
|
|
2911
2628
|
const booking = await apiClient.getBooking(token, apiConfig.locale);
|
|
@@ -2913,7 +2630,6 @@ var BookingSuccess = ({
|
|
|
2913
2630
|
setIsCancelled(booking.status === "cancelled");
|
|
2914
2631
|
} catch (err) {
|
|
2915
2632
|
console.error("Failed to fetch booking data:", err);
|
|
2916
|
-
setError("Failed to load booking information");
|
|
2917
2633
|
} finally {
|
|
2918
2634
|
setLoading(false);
|
|
2919
2635
|
}
|
|
@@ -2921,8 +2637,36 @@ var BookingSuccess = ({
|
|
|
2921
2637
|
fetchBookingData();
|
|
2922
2638
|
}
|
|
2923
2639
|
}, [token, apiConfig, initialBookingData]);
|
|
2640
|
+
const handleCancelAppointment = async () => {
|
|
2641
|
+
if (!token || !apiConfig) {
|
|
2642
|
+
setCancelError("Unable to cancel: Missing token or API configuration");
|
|
2643
|
+
return;
|
|
2644
|
+
}
|
|
2645
|
+
setCancelLoading(true);
|
|
2646
|
+
setCancelError(null);
|
|
2647
|
+
try {
|
|
2648
|
+
const apiClient = createDemoRoomApi(apiConfig);
|
|
2649
|
+
const cancelledBooking = await apiClient.cancelBooking(
|
|
2650
|
+
token,
|
|
2651
|
+
apiConfig.locale
|
|
2652
|
+
);
|
|
2653
|
+
if (cancelledBooking) {
|
|
2654
|
+
setBookingData(cancelledBooking);
|
|
2655
|
+
}
|
|
2656
|
+
setIsCancelled(true);
|
|
2657
|
+
setShowCancelDialog(false);
|
|
2658
|
+
if (onCancelSuccess && cancelledBooking) {
|
|
2659
|
+
onCancelSuccess(cancelledBooking);
|
|
2660
|
+
}
|
|
2661
|
+
} catch (err) {
|
|
2662
|
+
console.error("Failed to cancel booking:", err);
|
|
2663
|
+
setCancelError("Failed to cancel appointment. Please try again.");
|
|
2664
|
+
} finally {
|
|
2665
|
+
setCancelLoading(false);
|
|
2666
|
+
}
|
|
2667
|
+
};
|
|
2924
2668
|
if (loading) {
|
|
2925
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `min-h-screen
|
|
2669
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `min-h-screen py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-3xl mx-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "animate-pulse space-y-6", children: [
|
|
2926
2670
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 bg-gray-200 rounded w-1/3" }),
|
|
2927
2671
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-24 bg-gray-200 rounded" }),
|
|
2928
2672
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
@@ -2932,24 +2676,12 @@ var BookingSuccess = ({
|
|
|
2932
2676
|
] })
|
|
2933
2677
|
] }) }) });
|
|
2934
2678
|
}
|
|
2935
|
-
if (
|
|
2936
|
-
return
|
|
2937
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-6xl mb-4", children: "\u274C" }),
|
|
2938
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: error || "Booking Not Found" }),
|
|
2939
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-600 mb-6", children: "We couldn't find your booking information." }),
|
|
2940
|
-
onScheduleAgain && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2941
|
-
"button",
|
|
2942
|
-
{
|
|
2943
|
-
onClick: onScheduleAgain,
|
|
2944
|
-
className: "px-6 py-3 bg-black text-white rounded-full font-medium hover:bg-gray-800 transition-colors",
|
|
2945
|
-
children: "Schedule Again"
|
|
2946
|
-
}
|
|
2947
|
-
)
|
|
2948
|
-
] }) }) });
|
|
2679
|
+
if (!bookingData) {
|
|
2680
|
+
return null;
|
|
2949
2681
|
}
|
|
2950
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `min-h-screen
|
|
2682
|
+
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: [
|
|
2951
2683
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-[40px] font-bold text-gray-900 mb-8", children: "Your Appointment" }),
|
|
2952
|
-
isCancelled
|
|
2684
|
+
isCancelled && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg p-6 mb-8 flex items-center justify-between", children: [
|
|
2953
2685
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-700", children: "This appointment has been canceled." }),
|
|
2954
2686
|
onScheduleAgain && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2955
2687
|
"button",
|
|
@@ -2959,11 +2691,8 @@ var BookingSuccess = ({
|
|
|
2959
2691
|
children: "Schedule again"
|
|
2960
2692
|
}
|
|
2961
2693
|
)
|
|
2962
|
-
] })
|
|
2963
|
-
|
|
2964
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-700", children: "Your appointment has been confirmed." })
|
|
2965
|
-
] }) }),
|
|
2966
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-8", children: [
|
|
2694
|
+
] }),
|
|
2695
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-8 bg-white px-[48px] py-[32px] rounded-lg", children: [
|
|
2967
2696
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2968
2697
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Location" }),
|
|
2969
2698
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
@@ -3002,15 +2731,24 @@ var BookingSuccess = ({
|
|
|
3002
2731
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
3003
2732
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-900", children: bookingData.customer_name }),
|
|
3004
2733
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
|
|
3005
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3006
|
-
"
|
|
2734
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2735
|
+
"svg",
|
|
3007
2736
|
{
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
2737
|
+
className: "w-5 h-5",
|
|
2738
|
+
fill: "none",
|
|
2739
|
+
viewBox: "0 0 24 24",
|
|
2740
|
+
stroke: "currentColor",
|
|
2741
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2742
|
+
"path",
|
|
2743
|
+
{
|
|
2744
|
+
strokeLinecap: "round",
|
|
2745
|
+
strokeLinejoin: "round",
|
|
2746
|
+
strokeWidth: 2,
|
|
2747
|
+
d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
|
|
2748
|
+
}
|
|
2749
|
+
)
|
|
3012
2750
|
}
|
|
3013
|
-
)
|
|
2751
|
+
),
|
|
3014
2752
|
bookingData.phone_code && bookingData.phone_number ? /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
3015
2753
|
bookingData.phone_code,
|
|
3016
2754
|
" ",
|
|
@@ -3018,20 +2756,148 @@ var BookingSuccess = ({
|
|
|
3018
2756
|
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: "No phone provided" })
|
|
3019
2757
|
] }),
|
|
3020
2758
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
|
|
3021
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3022
|
-
"
|
|
2759
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2760
|
+
"svg",
|
|
3023
2761
|
{
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
2762
|
+
className: "w-5 h-5",
|
|
2763
|
+
fill: "none",
|
|
2764
|
+
viewBox: "0 0 24 24",
|
|
2765
|
+
stroke: "currentColor",
|
|
2766
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2767
|
+
"path",
|
|
2768
|
+
{
|
|
2769
|
+
strokeLinecap: "round",
|
|
2770
|
+
strokeLinejoin: "round",
|
|
2771
|
+
strokeWidth: 2,
|
|
2772
|
+
d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
|
|
2773
|
+
}
|
|
2774
|
+
)
|
|
3028
2775
|
}
|
|
3029
|
-
)
|
|
2776
|
+
),
|
|
3030
2777
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: bookingData.customer_email })
|
|
3031
2778
|
] })
|
|
3032
2779
|
] })
|
|
3033
2780
|
] })
|
|
3034
|
-
] })
|
|
2781
|
+
] }),
|
|
2782
|
+
!isCancelled && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-[64px]", children: [
|
|
2783
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2784
|
+
"button",
|
|
2785
|
+
{
|
|
2786
|
+
onClick: () => setShowCancelDialog(true),
|
|
2787
|
+
disabled: cancelLoading,
|
|
2788
|
+
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: "Cancel Appointment"
|
|
2790
|
+
}
|
|
2791
|
+
),
|
|
2792
|
+
cancelError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-2", style: { color: "#FF4D4D" }, children: cancelError })
|
|
2793
|
+
] }),
|
|
2794
|
+
showCancelDialog && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 px-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-[24px] max-w-[400px] p-8 shadow-xl relative", children: [
|
|
2795
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2796
|
+
"button",
|
|
2797
|
+
{
|
|
2798
|
+
onClick: () => setShowCancelDialog(false),
|
|
2799
|
+
disabled: cancelLoading,
|
|
2800
|
+
className: "absolute top-6 right-[30px] w-8 h-8 flex items-center justify-center text-gray-400 hover:text-gray-600 transition-colors disabled:opacity-50",
|
|
2801
|
+
"aria-label": "Close",
|
|
2802
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2803
|
+
"svg",
|
|
2804
|
+
{
|
|
2805
|
+
width: "24",
|
|
2806
|
+
height: "24",
|
|
2807
|
+
viewBox: "0 0 24 24",
|
|
2808
|
+
fill: "none",
|
|
2809
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2810
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2811
|
+
"path",
|
|
2812
|
+
{
|
|
2813
|
+
d: "M18 6L6 18M6 6L18 18",
|
|
2814
|
+
stroke: "currentColor",
|
|
2815
|
+
strokeWidth: "2",
|
|
2816
|
+
strokeLinecap: "round",
|
|
2817
|
+
strokeLinejoin: "round"
|
|
2818
|
+
}
|
|
2819
|
+
)
|
|
2820
|
+
}
|
|
2821
|
+
)
|
|
2822
|
+
}
|
|
2823
|
+
),
|
|
2824
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 rounded-full bg-[#F59E0B] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2825
|
+
"svg",
|
|
2826
|
+
{
|
|
2827
|
+
width: "32",
|
|
2828
|
+
height: "32",
|
|
2829
|
+
viewBox: "0 0 32 32",
|
|
2830
|
+
fill: "none",
|
|
2831
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2832
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2833
|
+
"path",
|
|
2834
|
+
{
|
|
2835
|
+
d: "M16 10V17M16 22H16.01",
|
|
2836
|
+
stroke: "white",
|
|
2837
|
+
strokeWidth: "3",
|
|
2838
|
+
strokeLinecap: "round",
|
|
2839
|
+
strokeLinejoin: "round"
|
|
2840
|
+
}
|
|
2841
|
+
)
|
|
2842
|
+
}
|
|
2843
|
+
) }) }),
|
|
2844
|
+
/* @__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: "Are you sure you want to cancel?" }),
|
|
2846
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[14px] text-gray-600", children: "You won't be able to restore the schedule." })
|
|
2847
|
+
] }),
|
|
2848
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 justify-center", children: [
|
|
2849
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2850
|
+
"button",
|
|
2851
|
+
{
|
|
2852
|
+
onClick: () => setShowCancelDialog(false),
|
|
2853
|
+
disabled: cancelLoading,
|
|
2854
|
+
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: "Back"
|
|
2856
|
+
}
|
|
2857
|
+
),
|
|
2858
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2859
|
+
"button",
|
|
2860
|
+
{
|
|
2861
|
+
onClick: handleCancelAppointment,
|
|
2862
|
+
disabled: cancelLoading,
|
|
2863
|
+
className: "px-8 py-3 bg-black text-white rounded-full font-medium hover:bg-gray-800 transition-colors disabled:opacity-50 flex items-center gap-2 min-w-[180px] justify-center",
|
|
2864
|
+
children: cancelLoading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2865
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2866
|
+
"svg",
|
|
2867
|
+
{
|
|
2868
|
+
className: "animate-spin h-5 w-5",
|
|
2869
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2870
|
+
fill: "none",
|
|
2871
|
+
viewBox: "0 0 24 24",
|
|
2872
|
+
children: [
|
|
2873
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2874
|
+
"circle",
|
|
2875
|
+
{
|
|
2876
|
+
className: "opacity-25",
|
|
2877
|
+
cx: "12",
|
|
2878
|
+
cy: "12",
|
|
2879
|
+
r: "10",
|
|
2880
|
+
stroke: "currentColor",
|
|
2881
|
+
strokeWidth: "4"
|
|
2882
|
+
}
|
|
2883
|
+
),
|
|
2884
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2885
|
+
"path",
|
|
2886
|
+
{
|
|
2887
|
+
className: "opacity-75",
|
|
2888
|
+
fill: "currentColor",
|
|
2889
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
2890
|
+
}
|
|
2891
|
+
)
|
|
2892
|
+
]
|
|
2893
|
+
}
|
|
2894
|
+
),
|
|
2895
|
+
"Canceling..."
|
|
2896
|
+
] }) : "Cancel Appointment"
|
|
2897
|
+
}
|
|
2898
|
+
)
|
|
2899
|
+
] })
|
|
2900
|
+
] }) })
|
|
3035
2901
|
] }) });
|
|
3036
2902
|
};
|
|
3037
2903
|
|
|
@@ -3177,7 +3043,6 @@ exports.BookingForm = BookingForm;
|
|
|
3177
3043
|
exports.BookingSuccess = BookingSuccess;
|
|
3178
3044
|
exports.DemoRoom = DemoRoom;
|
|
3179
3045
|
exports.DemoRoomApiClient = DemoRoomApiClient;
|
|
3180
|
-
exports.DemoRoomDetail = DemoRoomDetail;
|
|
3181
3046
|
exports.ThemeProvider = ThemeProvider;
|
|
3182
3047
|
exports.cn = cn;
|
|
3183
3048
|
exports.createDemoRoomApi = createDemoRoomApi;
|