@anker-in/ui 0.1.3 → 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/index.mjs CHANGED
@@ -1,19 +1,18 @@
1
1
  import React2, { createContext, useContext, useState, useEffect, useCallback, useMemo, useRef } from 'react';
2
2
  import { clsx } from 'clsx';
3
3
  import { twMerge } from 'tailwind-merge';
4
- import { jsxs, jsx } from 'react/jsx-runtime';
5
- import { Text, Link } from '@anker-in/headless-ui';
4
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
5
  import IndexBar from 'antd-mobile/es/components/index-bar';
7
6
  import List from 'antd-mobile/es/components/list';
8
7
  import 'antd-mobile/es/components/index-bar/index-bar.css';
9
8
  import 'antd-mobile/es/components/list/list.css';
10
- import { Swiper, SwiperSlide } from 'swiper/react';
11
9
  import dayjs from 'dayjs';
12
10
  import 'dayjs/locale/zh-cn';
13
11
  import { theme, ConfigProvider, Calendar, Select } from 'antd';
14
12
  import dayLocaleData from 'dayjs/plugin/localeData';
15
13
  import weekday from 'dayjs/plugin/weekday';
16
14
  import weekOfYear from 'dayjs/plugin/weekOfYear';
15
+ import { Swiper, SwiperSlide } from 'swiper/react';
17
16
 
18
17
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
19
18
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
@@ -24,158 +23,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
24
23
  function cn(...inputs) {
25
24
  return twMerge(clsx(inputs));
26
25
  }
27
- var defaultTabs = [
28
- { id: "upcoming-events", label: "Upcoming Events" },
29
- { id: "find-demoroom", label: "Find Demoroom" },
30
- { id: "4-easy-steps", label: "4 Easy Steps" },
31
- { id: "faq", label: "FAQ" }
32
- ];
33
- var HelpNav = ({
34
- tabs = defaultTabs,
35
- activeTabId: controlledActiveTabId,
36
- onTabChange,
37
- activeBorderColor = "#3ADB67",
38
- className,
39
- ...props
40
- }) => {
41
- const [internalActiveTabId, setInternalActiveTabId] = useState(
42
- tabs[1]?.id || tabs[0]?.id
43
- );
44
- const activeTabId = controlledActiveTabId ?? internalActiveTabId;
45
- const handleTabClick = (tabId) => {
46
- if (!controlledActiveTabId) {
47
- setInternalActiveTabId(tabId);
48
- }
49
- onTabChange?.(tabId);
50
- };
51
- return /* @__PURE__ */ jsx(
52
- "div",
53
- {
54
- className: cn(
55
- "w-full pt-5 flex items-center justify-center gap-8 pb-8",
56
- className
57
- ),
58
- ...props,
59
- children: tabs.map((tab) => {
60
- const isActive = tab.id === activeTabId;
61
- return /* @__PURE__ */ jsxs(
62
- "button",
63
- {
64
- onClick: () => handleTabClick(tab.id),
65
- className: cn(
66
- "relative text-[#080A0F]",
67
- "pb-4",
68
- "flex items-center gap-2",
69
- "transition-all duration-200",
70
- "outline-none focus:outline-none"
71
- ),
72
- style: {
73
- fontSize: "18px",
74
- fontWeight: 600,
75
- letterSpacing: "-0.36px",
76
- lineHeight: "25.2px"
77
- },
78
- children: [
79
- tab.label,
80
- isActive && /* @__PURE__ */ jsx(
81
- "span",
82
- {
83
- className: "absolute bottom-0 left-0 right-0 h-1 rounded-t",
84
- style: {
85
- backgroundColor: activeBorderColor,
86
- height: "4px"
87
- }
88
- }
89
- )
90
- ]
91
- },
92
- tab.id
93
- );
94
- })
95
- }
96
- );
97
- };
98
- HelpNav.displayName = "HelpNav";
99
- var EventCard = ({
100
- title,
101
- description,
102
- backgroundImage,
103
- aspectRatio,
104
- variant = "medium",
105
- buttons = [],
106
- subtitle,
107
- className,
108
- ...props
109
- }) => {
110
- const isLarge = variant === "large";
111
- const isMedium = variant === "medium";
112
- const isProduct = variant === "product";
113
- return /* @__PURE__ */ jsx(
114
- "div",
115
- {
116
- className: cn("rounded-3xl overflow-hidden relative", className),
117
- style: {
118
- backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0,
119
- backgroundSize: "cover",
120
- backgroundPosition: "center",
121
- aspectRatio
122
- },
123
- ...props,
124
- children: /* @__PURE__ */ jsxs(
125
- "div",
126
- {
127
- className: cn(
128
- "relative h-full flex flex-col",
129
- isLarge && "justify-center pl-8",
130
- !isLarge && "justify-end pl-8 pb-8"
131
- ),
132
- children: [
133
- /* @__PURE__ */ jsxs("div", { children: [
134
- /* @__PURE__ */ jsx(
135
- "h3",
136
- {
137
- className: cn(
138
- "font-semibold mb-3",
139
- isLarge && "text-3xl text-gray-900",
140
- isMedium && "text-2xl text-white",
141
- isProduct && "text-2xl text-gray-900"
142
- ),
143
- children: title
144
- }
145
- ),
146
- subtitle && isProduct && /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600 mb-4", children: subtitle }),
147
- description && /* @__PURE__ */ jsx(
148
- "p",
149
- {
150
- className: cn(
151
- "text-sm leading-relaxed",
152
- isMedium && "text-white/90",
153
- (isLarge || isProduct) && "text-gray-600"
154
- ),
155
- children: description
156
- }
157
- )
158
- ] }),
159
- buttons.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex gap-3 mt-6", children: buttons.map((button, index) => /* @__PURE__ */ jsx(
160
- "button",
161
- {
162
- onClick: button.onClick,
163
- className: cn(
164
- "px-6 py-3 rounded-full font-medium text-sm transition-all duration-200",
165
- button.variant === "primary" && "bg-gray-900 text-white hover:bg-gray-800",
166
- button.variant === "secondary" && "bg-white text-gray-900 border border-gray-300 hover:bg-gray-50"
167
- ),
168
- children: button.label
169
- },
170
- index
171
- )) })
172
- ]
173
- }
174
- )
175
- }
176
- );
177
- };
178
- EventCard.displayName = "EventCard";
179
26
  var Title = ({
180
27
  title = "",
181
28
  ...props
@@ -183,275 +30,6 @@ var Title = ({
183
30
  return /* @__PURE__ */ jsx("div", { className: cn("w-full"), ...props, children: /* @__PURE__ */ jsx("h2", { className: "text-[48px] font-semibold mb-12 text-[#080A0F]", children: title }) });
184
31
  };
185
32
  Title.displayName = "Title";
186
- var defaultEvents = [
187
- {
188
- variant: "large",
189
- title: "IFA 2025 Event Name Event Name",
190
- description: "Corem ipsum dolor sit amet, consectetur adipiscing elit.",
191
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
192
- buttons: [
193
- {
194
- label: "Schedule Now",
195
- variant: "primary"
196
- }
197
- ],
198
- aspectRatio: "1664 / 640"
199
- },
200
- {
201
- variant: "medium",
202
- title: "Local Event Name Local Event Name Local Event Name",
203
- description: "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
204
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
205
- buttons: [
206
- {
207
- label: "Schedule Now",
208
- variant: "primary"
209
- }
210
- ],
211
- aspectRatio: "824 / 640"
212
- },
213
- {
214
- variant: "product",
215
- title: "Anker Prime",
216
- subtitle: "Anker Prime 240W GaN Desktop Charger (4 Ports) Feb. 5th - 16th",
217
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
218
- buttons: [
219
- {
220
- label: "Learn More",
221
- variant: "secondary"
222
- },
223
- {
224
- label: "Shop Now",
225
- variant: "primary"
226
- }
227
- ],
228
- aspectRatio: "824 / 640"
229
- },
230
- {
231
- variant: "medium",
232
- title: "Local Event Name Local Event Name Local Event Name",
233
- description: "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
234
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
235
- buttons: [
236
- {
237
- label: "Schedule Now",
238
- variant: "primary"
239
- }
240
- ],
241
- aspectRatio: "824 / 640"
242
- },
243
- {
244
- variant: "product",
245
- title: "Anker Prime",
246
- subtitle: "Anker Prime 240W GaN Desktop Charger (4 Ports) Feb. 5th - 16th",
247
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
248
- buttons: [
249
- {
250
- label: "Learn More",
251
- variant: "secondary"
252
- },
253
- {
254
- label: "Shop Now",
255
- variant: "primary"
256
- }
257
- ],
258
- aspectRatio: "824 / 640"
259
- }
260
- ];
261
- var UpcomingEvents = ({
262
- title = "Upcoming Events",
263
- events = defaultEvents,
264
- showViewMore = true,
265
- onViewMore,
266
- className,
267
- ...props
268
- }) => {
269
- return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), ...props, children: [
270
- /* @__PURE__ */ jsx(Title, { title }),
271
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-6 mb-[64px]", children: events.map((event, index) => /* @__PURE__ */ jsx("div", { className: cn(index === 0 ? "col-span-2" : ""), children: /* @__PURE__ */ jsx(EventCard, { ...event }) }, index)) }),
272
- showViewMore && /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs(
273
- "button",
274
- {
275
- onClick: onViewMore,
276
- className: "inline-flex items-center gap-2 text-gray-700 hover:text-gray-900 transition-colors duration-200",
277
- children: [
278
- /* @__PURE__ */ jsx("span", { className: "text-base font-bold", children: "View More" }),
279
- /* @__PURE__ */ jsx(
280
- "svg",
281
- {
282
- width: "16",
283
- height: "16",
284
- viewBox: "0 0 16 16",
285
- fill: "none",
286
- xmlns: "http://www.w3.org/2000/svg",
287
- className: "transition-transform duration-200 group-hover:translate-y-0.5",
288
- children: /* @__PURE__ */ jsx(
289
- "path",
290
- {
291
- d: "M8 3L8 13M8 13L12 9M8 13L4 9",
292
- stroke: "currentColor",
293
- strokeWidth: "2",
294
- strokeLinecap: "round",
295
- strokeLinejoin: "round"
296
- }
297
- )
298
- }
299
- )
300
- ]
301
- }
302
- ) })
303
- ] });
304
- };
305
- UpcomingEvents.displayName = "UpcomingEvents";
306
- var defaultBannerData = {
307
- title: "See it. Touch it. Make it Locally.",
308
- subTitle: "Visit your local studio right around the corner.",
309
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
310
- backgroundImageMobile: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
311
- };
312
- var Banner = ({
313
- data = defaultBannerData,
314
- className,
315
- style,
316
- ...props
317
- }) => {
318
- return /* @__PURE__ */ jsxs(
319
- "div",
320
- {
321
- className: cn("relative"),
322
- style: { aspectRatio: "1920/480", ...style },
323
- ...props,
324
- children: [
325
- data?.backgroundImage && /* @__PURE__ */ jsx(
326
- "img",
327
- {
328
- src: data.backgroundImage,
329
- alt: "",
330
- className: "inset-0 h-full w-full object-cover"
331
- }
332
- ),
333
- /* @__PURE__ */ jsxs(
334
- "div",
335
- {
336
- className: cn(
337
- "absolute flex flex-col gap-4 justify-center m-auto top-0 bottom-0 left-0 right-0 z-10",
338
- className
339
- ),
340
- children: [
341
- /* @__PURE__ */ jsx(
342
- Text,
343
- {
344
- className: "text-[48px] font-bold text-white leading-[1]",
345
- html: data?.title
346
- }
347
- ),
348
- /* @__PURE__ */ jsx(
349
- Text,
350
- {
351
- className: "text-[18px] font-bold text-white leading-[1.4]",
352
- html: data?.subTitle
353
- }
354
- )
355
- ]
356
- }
357
- )
358
- ]
359
- }
360
- );
361
- };
362
- Banner.displayName = "Banner";
363
- var BreadCrumbs = ({
364
- items,
365
- className,
366
- ...props
367
- }) => {
368
- return /* @__PURE__ */ jsx("div", { className: cn("flex items-center py-6 gap-1 text-[18px]", className), ...props, children: items?.map((item, i) => {
369
- const isLast = i === items?.length - 1;
370
- return /* @__PURE__ */ jsxs(
371
- Link,
372
- {
373
- className: cn(
374
- "flex items-center gap-1 text-[#6D6D6F] no-underline",
375
- isLast && "text-[#080A0F]",
376
- item?.link ? "cursor-pointer" : "cursor-default hover:text-[#080A0F]"
377
- ),
378
- href: item?.link,
379
- children: [
380
- item?.label,
381
- !isLast && /* @__PURE__ */ jsx("span", { children: "/" })
382
- ]
383
- },
384
- i
385
- );
386
- }) });
387
- };
388
- BreadCrumbs.displayName = "BreadCrumbs";
389
- var defaultSteps = [
390
- {
391
- stepNumber: 1,
392
- title: 'Find a demo room you would like to visit, and click "Schedule Now"',
393
- description: 'Find a demo room you would like to visit, and click "Schedule Now"',
394
- mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
395
- },
396
- {
397
- stepNumber: 2,
398
- title: "Fill out the form and confirm your time of visit",
399
- description: "Fill out the form and confirm your time of visit",
400
- mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
401
- },
402
- {
403
- stepNumber: 3,
404
- title: "Once you arrive at the demo room, scan the QR code to check in",
405
- description: "Once you arrive at the demo room, scan the QR code to check in",
406
- mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
407
- },
408
- {
409
- stepNumber: 4,
410
- title: "Have fun!",
411
- description: "Have fun!",
412
- mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
413
- }
414
- ];
415
- var EasySteps = ({
416
- title = "Schedule in 4 Easy Steps",
417
- steps = defaultSteps,
418
- className,
419
- ...props
420
- }) => {
421
- return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), ...props, children: [
422
- /* @__PURE__ */ jsx(Title, { title }),
423
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-2 gap-6", children: steps.map((step) => /* @__PURE__ */ jsxs(
424
- "div",
425
- {
426
- className: cn(
427
- "bg-white rounded-2xl overflow-hidden",
428
- "border border-gray-200",
429
- "hover:shadow-lg transition-shadow duration-200"
430
- ),
431
- children: [
432
- /* @__PURE__ */ jsx("div", { className: "p-6 pb-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
433
- /* @__PURE__ */ jsxs("span", { className: "text-sm font-semibold text-gray-900", children: [
434
- "Step ",
435
- step.stepNumber,
436
- ":"
437
- ] }),
438
- /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-900 font-medium flex-1", children: step.title })
439
- ] }) }),
440
- /* @__PURE__ */ jsx("div", { className: "relative w-full aspect-[356/220] bg-gray-100", children: /* @__PURE__ */ jsx(
441
- "img",
442
- {
443
- src: step.mapImage,
444
- alt: `Step ${step.stepNumber} - ${step.title}`,
445
- className: "w-full h-full object-cover"
446
- }
447
- ) })
448
- ]
449
- },
450
- step.stepNumber
451
- )) })
452
- ] });
453
- };
454
- EasySteps.displayName = "EasySteps";
455
33
  var StudioCard = ({
456
34
  code,
457
35
  name,
@@ -462,25 +40,48 @@ var StudioCard = ({
462
40
  zipCode,
463
41
  country = "United States",
464
42
  euifyMakeModel,
43
+ distance,
465
44
  onSchedule,
466
45
  className,
46
+ style,
467
47
  ...props
468
48
  }) => {
469
49
  const fullAddress = `${address}, ${city}, ${state} ${country} ${zipCode}`;
50
+ const [isHovered, setIsHovered] = React2.useState(false);
470
51
  const handleScheduleClick = () => {
471
52
  onSchedule?.(code);
472
53
  };
54
+ const formatDistance = (dist) => {
55
+ if (dist < 1) {
56
+ return `${Math.round(dist * 1e3)} m`;
57
+ }
58
+ return `${dist.toFixed(1)} km`;
59
+ };
473
60
  return /* @__PURE__ */ jsxs(
474
61
  "div",
475
62
  {
476
- className: cn(
477
- "p-6",
478
- "hover:shadow-lg transition-shadow duration-200",
479
- className
480
- ),
481
63
  ...props,
64
+ className: cn("p-6 cursor-pointer transition-colors duration-200", className),
65
+ style: {
66
+ backgroundColor: isHovered ? "#f3f4f6" : "transparent",
67
+ ...style
68
+ },
69
+ onMouseEnter: (e) => {
70
+ setIsHovered(true);
71
+ props.onMouseEnter?.(e);
72
+ },
73
+ onMouseLeave: (e) => {
74
+ setIsHovered(false);
75
+ props.onMouseLeave?.(e);
76
+ },
482
77
  children: [
483
- /* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-gray-900 mb-4", children: name }),
78
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between mb-4", children: [
79
+ /* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-gray-900", children: name }),
80
+ distance !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-sm font-medium text-[#2E8B57] bg-[#E8F5E9] px-3 py-1 rounded-full whitespace-nowrap ml-2", children: [
81
+ formatDistance(distance),
82
+ " away"
83
+ ] })
84
+ ] }),
484
85
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
485
86
  /* @__PURE__ */ jsxs(
486
87
  "svg",
@@ -626,7 +227,7 @@ var StudioCard = ({
626
227
  "w-full px-6 py-3 rounded-full",
627
228
  "bg-white text-gray-900 border border-gray-900",
628
229
  "font-medium text-sm",
629
- "hover:bg-gray-900 hover:text-white",
230
+ "hover:bg-gray-900",
630
231
  "transition-all duration-200"
631
232
  ),
632
233
  children: "Schedule Now"
@@ -655,6 +256,7 @@ var defaultLocations = [
655
256
  var StudioMap = ({
656
257
  googleMapsApiKey,
657
258
  locations = defaultLocations,
259
+ hoveredLocationId,
658
260
  defaultCenter = { lat: 39.8283, lng: -98.5795 },
659
261
  // US center
660
262
  defaultZoom = 4,
@@ -803,7 +405,7 @@ var StudioMap = ({
803
405
  if (btn) {
804
406
  btn.addEventListener("click", () => {
805
407
  if (onSchedule) {
806
- onSchedule(location);
408
+ onSchedule(location.id);
807
409
  }
808
410
  });
809
411
  }
@@ -824,6 +426,82 @@ var StudioMap = ({
824
426
  googleMapRef.current.fitBounds(bounds);
825
427
  }
826
428
  }, [isLoaded, locations, onSchedule]);
429
+ React2.useEffect(() => {
430
+ if (!isLoaded || !googleMapRef.current || !hoveredLocationId) {
431
+ if (!hoveredLocationId && infoWindowRef.current) {
432
+ infoWindowRef.current.close();
433
+ }
434
+ return;
435
+ }
436
+ const location = locations.find((loc) => loc.id === hoveredLocationId);
437
+ const markerIndex = locations.findIndex(
438
+ (loc) => loc.id === hoveredLocationId
439
+ );
440
+ const marker = markersRef.current[markerIndex];
441
+ if (location && marker) {
442
+ const content = `
443
+ <div style="padding: 16px; max-width: 300px; font-family: system-ui, sans-serif;">
444
+ <h3 style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600;">${location.name}</h3>
445
+ ${location.availableTime ? `<div style="margin-bottom: 8px; color: #666;">
446
+ <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
447
+ <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"/>
448
+ </svg>
449
+ <span style="vertical-align: middle;">Available ${location.availableTime}</span>
450
+ </div>` : ""}
451
+ <div style="margin-bottom: 8px; color: #666;">
452
+ <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
453
+ <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"/>
454
+ </svg>
455
+ <span style="vertical-align: middle;">${location.address}, ${location.city}, ${location.state} ${location.country} ${location.zipCode}</span>
456
+ </div>
457
+ ${location.euifyMakeModel ? `<div style="margin-bottom: 12px; 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="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"/>
460
+ </svg>
461
+ <span style="vertical-align: middle;">${location.euifyMakeModel}</span>
462
+ </div>` : ""}
463
+ <button
464
+ id="schedule-btn-hover-${location.id}"
465
+ style="
466
+ width: 100%;
467
+ padding: 10px 16px;
468
+ background: #000;
469
+ color: #fff;
470
+ border: none;
471
+ border-radius: 6px;
472
+ font-weight: 500;
473
+ cursor: pointer;
474
+ font-size: 14px;
475
+ "
476
+ onmouseover="this.style.background='#333'"
477
+ onmouseout="this.style.background='#000'"
478
+ >
479
+ Schedule Now
480
+ </button>
481
+ </div>
482
+ `;
483
+ if (infoWindowRef.current) {
484
+ infoWindowRef.current.setContent(content);
485
+ infoWindowRef.current.open(googleMapRef.current, marker);
486
+ google.maps.event.addListenerOnce(
487
+ infoWindowRef.current,
488
+ "domready",
489
+ () => {
490
+ const btn = document.getElementById(
491
+ `schedule-btn-hover-${location.id}`
492
+ );
493
+ if (btn) {
494
+ btn.addEventListener("click", () => {
495
+ if (onSchedule) {
496
+ onSchedule(location.id);
497
+ }
498
+ });
499
+ }
500
+ }
501
+ );
502
+ }
503
+ }
504
+ }, [hoveredLocationId, isLoaded, locations, onSchedule]);
827
505
  if (!googleMapsApiKey) {
828
506
  return /* @__PURE__ */ jsx(
829
507
  "div",
@@ -1028,6 +706,66 @@ function useCreateBooking(client) {
1028
706
  createBooking
1029
707
  };
1030
708
  }
709
+ function useBooking(client, token, locale, options) {
710
+ const [state, setState] = useState({
711
+ data: null,
712
+ loading: true,
713
+ error: null
714
+ });
715
+ const enabled = options?.enabled !== false;
716
+ useEffect(() => {
717
+ if (!enabled || !token) return;
718
+ let cancelled = false;
719
+ const fetchData = async () => {
720
+ setState((prev) => ({ ...prev, loading: true, error: null }));
721
+ try {
722
+ const data = await client.getBooking(token, locale);
723
+ if (!cancelled) {
724
+ setState({ data, loading: false, error: null });
725
+ }
726
+ } catch (error) {
727
+ if (!cancelled) {
728
+ setState({
729
+ data: null,
730
+ loading: false,
731
+ error: error instanceof ApiError ? error : new ApiError(1006, "Unknown error")
732
+ });
733
+ }
734
+ }
735
+ };
736
+ fetchData();
737
+ return () => {
738
+ cancelled = true;
739
+ };
740
+ }, [client, token, locale, enabled]);
741
+ return state;
742
+ }
743
+ function useCancelBooking(client) {
744
+ const [state, setState] = useState({
745
+ data: null,
746
+ loading: false,
747
+ error: null
748
+ });
749
+ const cancelBooking = useCallback(
750
+ async (token, locale) => {
751
+ setState({ data: null, loading: true, error: null });
752
+ try {
753
+ const result = await client.cancelBooking(token, locale);
754
+ setState({ data: result, loading: false, error: null });
755
+ return result;
756
+ } catch (error) {
757
+ const apiError = error instanceof ApiError ? error : new ApiError(1006, "Unknown error");
758
+ setState({ data: null, loading: false, error: apiError });
759
+ throw apiError;
760
+ }
761
+ },
762
+ [client]
763
+ );
764
+ return {
765
+ ...state,
766
+ cancelBooking
767
+ };
768
+ }
1031
769
  var AntdMobileIsolated = ({
1032
770
  children,
1033
771
  className,
@@ -1072,24 +810,62 @@ var AntdMobileIsolated = ({
1072
810
  AntdMobileIsolated.displayName = "AntdMobileIsolated";
1073
811
 
1074
812
  // src/components/DemoRoom/utils/addressParser.ts
813
+ var KNOWN_COUNTRIES = [
814
+ "United States",
815
+ "United Kingdom",
816
+ "American Samoa",
817
+ "United Arab Emirates",
818
+ "Bosnia and Herzegovina",
819
+ "Trinidad and Tobago",
820
+ "Saint Kitts and Nevis",
821
+ "Antigua and Barbuda",
822
+ "Saint Vincent and the Grenadines",
823
+ "S\xE3o Tom\xE9 and Pr\xEDncipe",
824
+ "United States Minor Outlying Islands",
825
+ "British Virgin Islands",
826
+ "United States Virgin Islands",
827
+ "Cayman Islands",
828
+ "Cook Islands",
829
+ "Falkland Islands",
830
+ "Faroe Islands",
831
+ "Marshall Islands",
832
+ "Northern Mariana Islands",
833
+ "Pitcairn Islands",
834
+ "Solomon Islands",
835
+ "Turks and Caicos Islands",
836
+ "Wallis and Futuna"
837
+ ];
1075
838
  function parseAddress(address) {
1076
- const parts = address.split(",").map((part) => part.trim());
839
+ const parts = address.split(",").map((part) => part.trim()).filter(Boolean);
1077
840
  let country = "United States";
1078
841
  let state = "";
1079
842
  let city = "";
1080
- if (parts.length >= 3) {
1081
- city = parts[1] || "";
1082
- state = parts[2]?.split(" ")[0] || "";
1083
- country = parts[3] || country;
1084
- } else if (parts.length === 2) {
1085
- city = parts[0] || "";
1086
- state = parts[1]?.split(" ")[0] || "";
1087
- } else if (parts.length === 1) {
1088
- city = parts[0] || "";
843
+ if (parts.length === 0) {
844
+ return { country, state, city };
1089
845
  }
1090
- return {
1091
- country: country.trim(),
1092
- state: state.trim(),
846
+ const lastPart = parts[parts.length - 1];
847
+ const matchedCountry = KNOWN_COUNTRIES.find(
848
+ (knownCountry) => lastPart.toLowerCase() === knownCountry.toLowerCase()
849
+ );
850
+ if (matchedCountry) {
851
+ country = matchedCountry;
852
+ if (parts.length >= 2) {
853
+ state = parts[parts.length - 2].split(" ")[0];
854
+ }
855
+ if (parts.length >= 3) {
856
+ city = parts[parts.length - 3];
857
+ }
858
+ } else {
859
+ if (parts.length >= 2) {
860
+ state = parts[parts.length - 1].split(" ")[0];
861
+ city = parts[parts.length - 2];
862
+ } else if (parts.length === 1) {
863
+ city = parts[0];
864
+ }
865
+ }
866
+ return {
867
+ country: country.trim(),
868
+ state: state.trim(),
1093
869
  city: city.trim()
1094
870
  };
1095
871
  }
@@ -1173,9 +949,7 @@ var LocationFilter = ({
1173
949
  items = locationData.countries;
1174
950
  break;
1175
951
  case "state":
1176
- items = selectedCountry ? locationData.states.filter(
1177
- (s) => s.parentCode === selectedCountry
1178
- ) : [];
952
+ items = selectedCountry ? locationData.states.filter((s) => s.parentCode === selectedCountry) : [];
1179
953
  break;
1180
954
  case "city":
1181
955
  items = selectedState ? locationData.cities.filter((c) => c.parentCode === selectedState) : [];
@@ -1192,6 +966,7 @@ var LocationFilter = ({
1192
966
  () => groupByAlphabet(filteredItems),
1193
967
  [filteredItems]
1194
968
  );
969
+ const showIndexBar = filteredItems.length >= 10;
1195
970
  const handleItemClick = (item) => {
1196
971
  if (currentLevel === "country") {
1197
972
  setSelectedCountry(item.code);
@@ -1235,42 +1010,30 @@ var LocationFilter = ({
1235
1010
  style: { background: "#F8F8F8" },
1236
1011
  className: "rounded-[12px] rounded-b-none h-[72px] font-bold text-[14px] flex flex-col",
1237
1012
  children: [
1238
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-[20px] pt-[12px] pb-[8px]", children: [
1239
- /* @__PURE__ */ jsx(
1240
- "input",
1241
- {
1242
- type: "text",
1243
- placeholder: "Please enter the search city",
1244
- value: searchQuery,
1245
- onChange: (e) => setSearchQuery(e.target.value),
1246
- className: "flex-1 h-[32px] px-[12px] rounded-[6px] border border-[#E4E5E6] text-[14px] outline-none focus:border-[#2E8B57]"
1247
- }
1248
- ),
1249
- /* @__PURE__ */ jsx(
1250
- "button",
1251
- {
1252
- onClick: onClose,
1253
- className: "ml-[12px] w-[24px] h-[24px] flex items-center justify-center",
1254
- children: /* @__PURE__ */ jsx(
1255
- "svg",
1256
- {
1257
- xmlns: "http://www.w3.org/2000/svg",
1258
- width: "24",
1259
- height: "24",
1260
- viewBox: "0 0 24 24",
1261
- fill: "none",
1262
- children: /* @__PURE__ */ jsx(
1263
- "path",
1264
- {
1265
- 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",
1266
- fill: "#1D1D1F"
1267
- }
1268
- )
1269
- }
1270
- )
1271
- }
1272
- )
1273
- ] }),
1013
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end px-[20px] pt-[12px] pb-[8px]", children: /* @__PURE__ */ jsx(
1014
+ "button",
1015
+ {
1016
+ onClick: onClose,
1017
+ className: "ml-[12px] w-[24px] h-[24px] flex items-center justify-end",
1018
+ children: /* @__PURE__ */ jsx(
1019
+ "svg",
1020
+ {
1021
+ xmlns: "http://www.w3.org/2000/svg",
1022
+ width: "24",
1023
+ height: "24",
1024
+ viewBox: "0 0 24 24",
1025
+ fill: "none",
1026
+ children: /* @__PURE__ */ jsx(
1027
+ "path",
1028
+ {
1029
+ 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",
1030
+ fill: "#1D1D1F"
1031
+ }
1032
+ )
1033
+ }
1034
+ )
1035
+ }
1036
+ ) }),
1274
1037
  /* @__PURE__ */ jsxs("div", { className: "flex items-center px-[20px] gap-[16px] pb-[8px]", children: [
1275
1038
  /* @__PURE__ */ jsx(
1276
1039
  "button",
@@ -1313,38 +1076,26 @@ var LocationFilter = ({
1313
1076
  ]
1314
1077
  }
1315
1078
  ),
1316
- /* @__PURE__ */ jsx(AntdMobileIsolated, { style: { height: "calc(100% - 72px)" }, children: /* @__PURE__ */ jsx(IndexBar, { style: { height: "100%" }, children: groupedItems.map((group) => {
1079
+ /* @__PURE__ */ jsx(AntdMobileIsolated, { style: { height: "calc(100% - 72px)" }, children: showIndexBar ? /* @__PURE__ */ jsx(IndexBar, { style: { height: "100%" }, children: groupedItems.map((group) => {
1317
1080
  const { title, items } = group;
1318
1081
  return /* @__PURE__ */ jsx(IndexBar.Panel, { index: title, title, children: /* @__PURE__ */ jsx(List, { children: items.map((item) => /* @__PURE__ */ jsx(
1319
1082
  List.Item,
1320
1083
  {
1321
- clickable: true,
1322
1084
  onClick: () => handleItemClick(item),
1323
- extra: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-[8px]", children: [
1324
- /* @__PURE__ */ jsx("span", { className: "text-[#767880] text-[14px]", children: item.count }),
1325
- /* @__PURE__ */ jsx(
1326
- "svg",
1327
- {
1328
- xmlns: "http://www.w3.org/2000/svg",
1329
- width: "16",
1330
- height: "16",
1331
- viewBox: "0 0 16 16",
1332
- fill: "none",
1333
- children: /* @__PURE__ */ jsx(
1334
- "path",
1335
- {
1336
- d: "M6.4 12L5.6 11.2L9.06667 7.73333L5.6 4.26667L6.4 3.46667L10.6667 7.73333L6.4 12Z",
1337
- fill: "#767880"
1338
- }
1339
- )
1340
- }
1341
- )
1342
- ] }),
1085
+ style: { cursor: "pointer" },
1343
1086
  children: item.name
1344
1087
  },
1345
1088
  item.code
1346
1089
  )) }) }, title);
1347
- }) }) })
1090
+ }) }) : /* @__PURE__ */ jsx("div", { style: { height: "100%", overflow: "auto" }, children: /* @__PURE__ */ jsx(List, { children: filteredItems.map((item) => /* @__PURE__ */ jsx(
1091
+ List.Item,
1092
+ {
1093
+ onClick: () => handleItemClick(item),
1094
+ style: { cursor: "pointer" },
1095
+ children: item.name
1096
+ },
1097
+ item.code
1098
+ )) }) }) })
1348
1099
  ]
1349
1100
  }
1350
1101
  );
@@ -1467,6 +1218,7 @@ var RoomsList = ({
1467
1218
  }) => {
1468
1219
  const [showLocationFilter, setShowLocationFilter] = useState(false);
1469
1220
  const [selectedLocation, setSelectedLocation] = useState();
1221
+ const [hoveredRoomId, setHoveredRoomId] = useState(null);
1470
1222
  const {
1471
1223
  data: demoRooms,
1472
1224
  loading,
@@ -1479,25 +1231,9 @@ var RoomsList = ({
1479
1231
  const studioLocations = useMemo(() => {
1480
1232
  if (!demoRooms) return defaultStudioLocations;
1481
1233
  return demoRooms.map((room) => {
1482
- const timeslots = [
1483
- {
1484
- id: 130,
1485
- start_time: "2026-01-13T09:00:00-05:00",
1486
- end_time: "2026-01-13T10:00:00-05:00",
1487
- capacity: 5,
1488
- booked_count: 2,
1489
- status: "available"
1490
- },
1491
- {
1492
- id: 131,
1493
- start_time: "2026-01-13T14:00:00-05:00",
1494
- end_time: "2026-01-13T15:00:00-05:00",
1495
- capacity: 5,
1496
- booked_count: 5,
1497
- status: "full"
1498
- }
1499
- ];
1500
- const nextAvailableTimeslot = (room.timeslots?.length ? room.timeslots : timeslots)?.find((slot) => slot.status === "available");
1234
+ const nextAvailableTimeslot = room?.timeslots?.find(
1235
+ (slot) => slot.status === "available"
1236
+ );
1501
1237
  const { country, state, city } = parseAddress(room.address);
1502
1238
  return {
1503
1239
  id: room.code,
@@ -1548,18 +1284,18 @@ var RoomsList = ({
1548
1284
  return /* @__PURE__ */ jsxs("div", { className, ...props, children: [
1549
1285
  /* @__PURE__ */ jsx(Title, { title: "Find a Studio Near You" }),
1550
1286
  loading && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsx("div", { className: "text-center", children: /* @__PURE__ */ jsx("div", { className: "text-lg font-medium", children: "Loading demo rooms..." }) }) }),
1551
- error && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxs("div", { className: "text-center text-red-600", children: [
1287
+ error && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxs("div", { className: "text-center", style: { color: "#FF4D4D" }, children: [
1552
1288
  /* @__PURE__ */ jsx("div", { className: "text-lg font-medium", children: "Failed to load demo rooms" }),
1553
1289
  /* @__PURE__ */ jsx("div", { className: "text-sm mt-2", children: error.message })
1554
1290
  ] }) }),
1555
- !loading && !error && /* @__PURE__ */ jsxs("div", { className: "flex h-[794px] overflow-auto gap-4", children: [
1291
+ !loading && !error && /* @__PURE__ */ jsxs("div", { className: "flex h-[794px] gap-4", children: [
1556
1292
  /* @__PURE__ */ jsxs(
1557
1293
  "div",
1558
1294
  {
1559
1295
  className: "flex-none relative w-[420px]",
1560
1296
  style: { height: "794px" },
1561
1297
  children: [
1562
- /* @__PURE__ */ jsxs("div", { className: "rounded-[12px] items-center h-[72px] mb-4 font-bold text-[16px] gap-10 flex bg-white border border-[#E4E5E6] px-[20px] py-[16px]", children: [
1298
+ /* @__PURE__ */ jsx("div", { className: "rounded-[12px] mb-4 bg-white border border-[#E4E5E6] px-[20px] py-[16px]", children: /* @__PURE__ */ jsxs("div", { className: "h-[40px] font-bold text-[16px] gap-10 flex items-center", children: [
1563
1299
  /* @__PURE__ */ jsxs(
1564
1300
  "button",
1565
1301
  {
@@ -1615,7 +1351,7 @@ var RoomsList = ({
1615
1351
  }
1616
1352
  )
1617
1353
  ] })
1618
- ] }),
1354
+ ] }) }),
1619
1355
  /* @__PURE__ */ jsx(
1620
1356
  "div",
1621
1357
  {
@@ -1633,7 +1369,9 @@ var RoomsList = ({
1633
1369
  state: item?.state,
1634
1370
  zipCode: item?.zipCode,
1635
1371
  euifyMakeModel: item?.euifyMakeModel || "",
1636
- onSchedule
1372
+ onSchedule,
1373
+ onMouseEnter: () => setHoveredRoomId(item.id),
1374
+ onMouseLeave: () => setHoveredRoomId(null)
1637
1375
  },
1638
1376
  item.id
1639
1377
  );
@@ -1660,9 +1398,8 @@ var RoomsList = ({
1660
1398
  {
1661
1399
  googleMapsApiKey,
1662
1400
  locations: filteredStudioLocations,
1663
- onSchedule: () => {
1664
- console.log(111);
1665
- },
1401
+ hoveredLocationId: hoveredRoomId,
1402
+ onSchedule,
1666
1403
  mapHeight: "794px"
1667
1404
  }
1668
1405
  ) })
@@ -1799,11 +1536,39 @@ var DemoRoomApiClient = class {
1799
1536
  });
1800
1537
  }
1801
1538
  /**
1802
- * 根据 token 获取预约信息
1803
- * @param token 预约 token
1539
+ * 根据 token 获取预约详情(支持多语言)
1540
+ * @param token 预约凭证 (cancel_token)
1541
+ * @param locale 语言偏好(可选,也可以通过 Accept-Language Header)
1542
+ */
1543
+ async getBooking(token, locale) {
1544
+ const headers = {};
1545
+ if (locale) {
1546
+ headers["Accept-Language"] = locale;
1547
+ }
1548
+ const response = await this.request(
1549
+ `/api/v1/store/bookings/${token}`,
1550
+ { headers }
1551
+ );
1552
+ return response.booking;
1553
+ }
1554
+ /**
1555
+ * 取消预约(支持多语言邮件通知)
1556
+ * @param token 预约凭证 (cancel_token)
1557
+ * @param locale 语言偏好(可选,用于邮件通知)
1804
1558
  */
1805
- async getBooking(token) {
1806
- return this.request(`/api/v1/store/bookings/${token}`);
1559
+ async cancelBooking(token, locale) {
1560
+ const headers = {};
1561
+ if (locale) {
1562
+ headers["Accept-Language"] = locale;
1563
+ }
1564
+ const response = await this.request(
1565
+ `/api/v1/store/bookings/${token}/cancel`,
1566
+ {
1567
+ method: "POST",
1568
+ headers
1569
+ }
1570
+ );
1571
+ return response.booking;
1807
1572
  }
1808
1573
  };
1809
1574
  function createDemoRoomApi(config) {
@@ -1811,7 +1576,7 @@ function createDemoRoomApi(config) {
1811
1576
  }
1812
1577
  var DemoRoom = ({
1813
1578
  className,
1814
- layoutClassName = "w-safe11",
1579
+ layoutClassName,
1815
1580
  googleMapsApiKey,
1816
1581
  apiConfig,
1817
1582
  teamCode,
@@ -1823,382 +1588,104 @@ var DemoRoom = ({
1823
1588
  () => createDemoRoomApi(apiConfig),
1824
1589
  [apiConfig]
1825
1590
  );
1826
- return /* @__PURE__ */ jsxs("div", { className: cn(className), ...props, children: [
1827
- /* @__PURE__ */ jsx(Banner, { className: layoutClassName }),
1828
- /* @__PURE__ */ jsx(
1829
- BreadCrumbs,
1830
- {
1831
- className: layoutClassName,
1832
- items: [{ label: "Home", link: "/" }, { label: "Demo Room" }]
1833
- }
1834
- ),
1835
- /* @__PURE__ */ jsx(HelpNav, {}),
1836
- /* @__PURE__ */ jsx(UpcomingEvents, { className: layoutClassName }),
1837
- /* @__PURE__ */ jsx(
1838
- RoomsList,
1839
- {
1840
- className: layoutClassName,
1841
- googleMapsApiKey,
1842
- apiClient,
1843
- teamCode,
1844
- brandWebsite,
1845
- onSchedule
1846
- }
1847
- ),
1848
- /* @__PURE__ */ jsx(EasySteps, { className: layoutClassName })
1849
- ] });
1591
+ return /* @__PURE__ */ jsx("div", { className: cn(className), ...props, children: /* @__PURE__ */ jsx(
1592
+ RoomsList,
1593
+ {
1594
+ className: layoutClassName,
1595
+ googleMapsApiKey,
1596
+ apiClient,
1597
+ teamCode,
1598
+ brandWebsite,
1599
+ onSchedule
1600
+ }
1601
+ ) });
1850
1602
  };
1851
1603
  DemoRoom.displayName = "DemoRoom";
1852
- var Navigation;
1853
- var Pagination;
1854
- var Autoplay;
1855
- var swiperVersion = "11+";
1856
- try {
1857
- const modules = __require("swiper/modules");
1858
- Navigation = modules.Navigation;
1859
- Pagination = modules.Pagination;
1860
- Autoplay = modules.Autoplay;
1861
- swiperVersion = "11+";
1862
- } catch (e) {
1863
- try {
1864
- const SwiperCore = __require("swiper");
1865
- const SwiperNavigation = __require("swiper/modules/navigation");
1866
- const SwiperPagination = __require("swiper/modules/pagination");
1867
- const SwiperAutoplay = __require("swiper/modules/autoplay");
1868
- const SwiperClass = SwiperCore.default || SwiperCore;
1869
- if (SwiperClass && SwiperClass.use) {
1870
- SwiperClass.use([
1871
- SwiperNavigation.default || SwiperNavigation,
1872
- SwiperPagination.default || SwiperPagination,
1873
- SwiperAutoplay.default || SwiperAutoplay
1874
- ]);
1604
+ var QuestionnaireForm = ({
1605
+ questions,
1606
+ onSubmit,
1607
+ pageData,
1608
+ loading = false,
1609
+ className
1610
+ }) => {
1611
+ console.log(pageData);
1612
+ const [responses, setResponses] = useState({});
1613
+ const [errors, setErrors] = useState({});
1614
+ const [agreements, setAgreements] = useState({});
1615
+ const [agreementError, setAgreementError] = useState("");
1616
+ const getQuestionId = (question) => {
1617
+ return question.id || question.key || "";
1618
+ };
1619
+ const handleChange = (questionId, value) => {
1620
+ setResponses((prev) => ({
1621
+ ...prev,
1622
+ [questionId]: value
1623
+ }));
1624
+ if (errors[questionId]) {
1625
+ setErrors((prev) => {
1626
+ const newErrors = { ...prev };
1627
+ delete newErrors[questionId];
1628
+ return newErrors;
1629
+ });
1875
1630
  }
1876
- Navigation = SwiperNavigation.default || SwiperNavigation;
1877
- Pagination = SwiperPagination.default || SwiperPagination;
1878
- Autoplay = SwiperAutoplay.default || SwiperAutoplay;
1879
- swiperVersion = "8";
1880
- } catch (e2) {
1881
- console.warn("Failed to load swiper modules:", e2);
1882
- }
1883
- }
1884
- if (typeof window !== "undefined") {
1885
- try {
1886
- __require("swiper/css");
1887
- __require("swiper/css/navigation");
1888
- __require("swiper/css/pagination");
1889
- } catch (e) {
1890
- try {
1891
- __require("swiper/swiper.min.css");
1892
- __require("swiper/modules/navigation/navigation.min.css");
1893
- __require("swiper/modules/pagination/pagination.min.css");
1894
- } catch (e2) {
1895
- console.warn("Failed to load swiper styles");
1631
+ };
1632
+ const handleCheckboxChange = (questionId, optionValue, checked) => {
1633
+ const currentValues = responses[questionId] || [];
1634
+ const newValues = checked ? [...currentValues, optionValue] : currentValues.filter((v) => v !== optionValue);
1635
+ handleChange(questionId, newValues);
1636
+ };
1637
+ const handleAgreementChange = (index, checked) => {
1638
+ setAgreements((prev) => ({
1639
+ ...prev,
1640
+ [index]: checked
1641
+ }));
1642
+ if (checked && agreementError) {
1643
+ setAgreementError("");
1896
1644
  }
1897
- }
1898
- }
1899
- var defaultDescriptions = [
1900
- "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
1901
- "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."
1902
- ];
1903
- var defaultImages = [
1904
- "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1905
- "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
1906
- ];
1907
- var DemoRoomDetail = ({
1908
- apiClient,
1909
- demoRoomCode,
1910
- locale,
1911
- title: titleProp,
1912
- descriptions: descriptionsProp,
1913
- devices: devicesProp,
1914
- address: addressProp,
1915
- mapsLink,
1916
- images: imagesProp,
1917
- className,
1918
- ...props
1919
- }) => {
1920
- const {
1921
- data: demoRoom,
1922
- loading,
1923
- error
1924
- } = useDemoRoom(
1925
- apiClient,
1926
- demoRoomCode || "",
1927
- locale,
1928
- { enabled: !!apiClient && !!demoRoomCode }
1929
- );
1930
- const title = demoRoom?.name || titleProp || "Design District Demo Room";
1931
- const descriptions = demoRoom?.description ? [demoRoom.description] : descriptionsProp || defaultDescriptions;
1932
- const devices = demoRoom?.description || devicesProp || "eufyMake E1, eufyMake M5";
1933
- const address = demoRoom?.address || addressProp || "1111 8th St, San Francisco, CA United States 94108";
1934
- const images = demoRoom?.images && demoRoom.images.length > 0 ? demoRoom.images : imagesProp || defaultImages;
1935
- const googleMapsLink = mapsLink || (demoRoom?.latitude && demoRoom?.longitude ? `https://www.google.com/maps/search/?api=1&query=${demoRoom.latitude},${demoRoom.longitude}` : "#");
1936
- if (loading && apiClient && demoRoomCode) {
1937
- return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
1938
- /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
1939
- /* @__PURE__ */ jsx("div", { className: "h-12 bg-gray-200 rounded animate-pulse" }),
1940
- /* @__PURE__ */ jsx("div", { className: "h-24 bg-gray-200 rounded animate-pulse" }),
1941
- /* @__PURE__ */ jsx("div", { className: "h-8 bg-gray-200 rounded animate-pulse" })
1942
- ] }),
1943
- /* @__PURE__ */ jsx("div", { className: "h-[400px] bg-gray-200 rounded-2xl animate-pulse" })
1944
- ] }) });
1945
- }
1946
- if (error && apiClient && demoRoomCode) {
1947
- return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "text-center text-red-600 py-8", children: [
1948
- /* @__PURE__ */ jsx("p", { className: "text-lg font-medium", children: "Failed to load demo room details" }),
1949
- /* @__PURE__ */ jsx("p", { className: "text-sm mt-2", children: error.message })
1950
- ] }) });
1951
- }
1952
- return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
1953
- /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
1954
- /* @__PURE__ */ jsx("h1", { className: "text-[40px] font-bold text-gray-900 leading-tight", children: title }),
1955
- /* @__PURE__ */ jsx("div", { className: "space-y-4", children: descriptions.map((desc, index) => /* @__PURE__ */ jsx(
1956
- "p",
1957
- {
1958
- className: "text-base text-gray-600 leading-relaxed",
1959
- children: desc
1960
- },
1961
- index
1962
- )) }),
1963
- /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
1964
- /* @__PURE__ */ jsxs(
1965
- "svg",
1966
- {
1967
- width: "24",
1968
- height: "24",
1969
- viewBox: "0 0 24 24",
1970
- fill: "none",
1971
- xmlns: "http://www.w3.org/2000/svg",
1972
- className: "flex-shrink-0 mt-0.5",
1973
- children: [
1974
- /* @__PURE__ */ jsx(
1975
- "rect",
1976
- {
1977
- x: "3",
1978
- y: "3",
1979
- width: "18",
1980
- height: "18",
1981
- rx: "2",
1982
- stroke: "currentColor",
1983
- strokeWidth: "2"
1984
- }
1985
- ),
1986
- /* @__PURE__ */ jsx(
1987
- "path",
1988
- {
1989
- d: "M8 10H16",
1990
- stroke: "currentColor",
1991
- strokeWidth: "2",
1992
- strokeLinecap: "round"
1993
- }
1994
- ),
1995
- /* @__PURE__ */ jsx(
1996
- "path",
1997
- {
1998
- d: "M8 14H16",
1999
- stroke: "currentColor",
2000
- strokeWidth: "2",
2001
- strokeLinecap: "round"
2002
- }
2003
- )
2004
- ]
2005
- }
2006
- ),
2007
- /* @__PURE__ */ jsx("span", { className: "text-base text-gray-900", children: devices })
2008
- ] }),
2009
- /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
2010
- /* @__PURE__ */ jsxs(
2011
- "svg",
2012
- {
2013
- width: "24",
2014
- height: "24",
2015
- viewBox: "0 0 24 24",
2016
- fill: "none",
2017
- xmlns: "http://www.w3.org/2000/svg",
2018
- className: "flex-shrink-0 mt-0.5",
2019
- children: [
2020
- /* @__PURE__ */ jsx(
2021
- "path",
2022
- {
2023
- 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",
2024
- stroke: "currentColor",
2025
- strokeWidth: "2",
2026
- strokeLinecap: "round",
2027
- strokeLinejoin: "round"
2028
- }
2029
- ),
2030
- /* @__PURE__ */ jsx(
2031
- "circle",
2032
- {
2033
- cx: "12",
2034
- cy: "9",
2035
- r: "2.5",
2036
- stroke: "currentColor",
2037
- strokeWidth: "2"
2038
- }
2039
- )
2040
- ]
2041
- }
2042
- ),
2043
- /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
2044
- /* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: address }),
2045
- /* @__PURE__ */ jsxs(
2046
- "a",
2047
- {
2048
- href: googleMapsLink,
2049
- target: "_blank",
2050
- rel: "noopener noreferrer",
2051
- className: "inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 mt-1 underline",
2052
- children: [
2053
- "Open in Google Maps",
2054
- /* @__PURE__ */ jsx(
2055
- "svg",
2056
- {
2057
- width: "12",
2058
- height: "12",
2059
- viewBox: "0 0 12 12",
2060
- fill: "none",
2061
- xmlns: "http://www.w3.org/2000/svg",
2062
- children: /* @__PURE__ */ jsx(
2063
- "path",
2064
- {
2065
- d: "M3 9L9 3M9 3H3M9 3V9",
2066
- stroke: "currentColor",
2067
- strokeWidth: "1.5",
2068
- strokeLinecap: "round",
2069
- strokeLinejoin: "round"
2070
- }
2071
- )
2072
- }
2073
- )
2074
- ]
2075
- }
2076
- )
2077
- ] })
2078
- ] })
2079
- ] }),
2080
- /* @__PURE__ */ jsx("div", { className: "relative h-[400px] rounded-2xl overflow-hidden", children: images.length > 0 ? /* @__PURE__ */ jsx(
2081
- Swiper,
2082
- {
2083
- ...swiperVersion === "11+" && Navigation && Pagination && Autoplay ? { modules: [Navigation, Pagination, Autoplay] } : {},
2084
- spaceBetween: 0,
2085
- slidesPerView: 1,
2086
- navigation: true,
2087
- pagination: { clickable: true },
2088
- autoplay: {
2089
- delay: 3e3,
2090
- disableOnInteraction: false
2091
- },
2092
- loop: true,
2093
- className: "h-full rounded-2xl",
2094
- children: images.map((img, index) => /* @__PURE__ */ jsx(SwiperSlide, { children: /* @__PURE__ */ jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsx(
2095
- "img",
2096
- {
2097
- src: img,
2098
- alt: `Demo room view ${index + 1}`,
2099
- className: "w-full h-full object-cover"
2100
- }
2101
- ) }) }, index))
2102
- }
2103
- ) : /* @__PURE__ */ 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__ */ jsxs("div", { className: "text-center", children: [
2104
- /* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto mb-3 rounded-full bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxs(
2105
- "svg",
2106
- {
2107
- width: "32",
2108
- height: "32",
2109
- viewBox: "0 0 32 32",
2110
- fill: "none",
2111
- xmlns: "http://www.w3.org/2000/svg",
2112
- children: [
2113
- /* @__PURE__ */ jsx(
2114
- "rect",
2115
- {
2116
- x: "4",
2117
- y: "8",
2118
- width: "24",
2119
- height: "16",
2120
- rx: "2",
2121
- stroke: "currentColor",
2122
- strokeWidth: "2"
2123
- }
2124
- ),
2125
- /* @__PURE__ */ jsx("circle", { cx: "12", cy: "14", r: "2", fill: "currentColor" }),
2126
- /* @__PURE__ */ jsx(
2127
- "path",
2128
- {
2129
- d: "M28 20L22 14L16 20",
2130
- stroke: "currentColor",
2131
- strokeWidth: "2",
2132
- strokeLinecap: "round",
2133
- strokeLinejoin: "round"
2134
- }
2135
- )
2136
- ]
2137
- }
2138
- ) }),
2139
- /* @__PURE__ */ jsx("p", { className: "text-gray-500 text-sm", children: "Demo Room Images" })
2140
- ] }) }) })
2141
- ] }) });
2142
- };
2143
- DemoRoomDetail.displayName = "DemoRoomDetail";
2144
- var QuestionnaireForm = ({
2145
- questions,
2146
- onSubmit,
2147
- loading = false,
2148
- className
2149
- }) => {
2150
- const [responses, setResponses] = useState({});
2151
- const [errors, setErrors] = useState({});
2152
- const getQuestionId = (question) => {
2153
- return question.id || question.key || "";
2154
- };
2155
- const handleChange = (questionId, value) => {
2156
- setResponses((prev) => ({
2157
- ...prev,
2158
- [questionId]: value
2159
- }));
2160
- if (errors[questionId]) {
2161
- setErrors((prev) => {
2162
- const newErrors = { ...prev };
2163
- delete newErrors[questionId];
2164
- return newErrors;
2165
- });
2166
- }
2167
- };
2168
- const handleCheckboxChange = (questionId, optionValue, checked) => {
2169
- const currentValues = responses[questionId] || [];
2170
- const newValues = checked ? [...currentValues, optionValue] : currentValues.filter((v) => v !== optionValue);
2171
- handleChange(questionId, newValues);
2172
- };
2173
- const validateForm = () => {
2174
- const newErrors = {};
2175
- questions.forEach((question) => {
2176
- if (question.required) {
2177
- const questionId = getQuestionId(question);
2178
- const value = responses[questionId];
2179
- if (!value || Array.isArray(value) && value.length === 0) {
2180
- newErrors[questionId] = "This field is required";
2181
- }
2182
- }
2183
- });
2184
- setErrors(newErrors);
2185
- return Object.keys(newErrors).length === 0;
2186
- };
2187
- const handleSubmit = (e) => {
2188
- e.preventDefault();
2189
- if (validateForm()) {
2190
- onSubmit?.(responses);
2191
- }
2192
- };
2193
- const renderQuestion = (question) => {
2194
- const questionId = getQuestionId(question);
2195
- const hasError = !!errors[questionId];
2196
- switch (question.type) {
2197
- case "text":
2198
- case "email":
2199
- case "tel":
2200
- return /* @__PURE__ */ jsx(
2201
- "input",
1645
+ };
1646
+ const validateForm = () => {
1647
+ const newErrors = {};
1648
+ questions.forEach((question) => {
1649
+ if (question.required) {
1650
+ const questionId = getQuestionId(question);
1651
+ const value = responses[questionId];
1652
+ if (!value || Array.isArray(value) && value.length === 0) {
1653
+ newErrors[questionId] = "This field is required";
1654
+ }
1655
+ }
1656
+ });
1657
+ const agrees = pageData?.agrees || [];
1658
+ if (agrees.length > 0) {
1659
+ const allAgreed = agrees.every(
1660
+ (_, index) => agreements[index]
1661
+ );
1662
+ if (!allAgreed) {
1663
+ setAgreementError(
1664
+ "Please agree to all terms and conditions to continue"
1665
+ );
1666
+ setErrors(newErrors);
1667
+ return false;
1668
+ }
1669
+ }
1670
+ setErrors(newErrors);
1671
+ setAgreementError("");
1672
+ return Object.keys(newErrors).length === 0;
1673
+ };
1674
+ const handleSubmit = (e) => {
1675
+ e.preventDefault();
1676
+ if (validateForm()) {
1677
+ onSubmit?.(responses);
1678
+ }
1679
+ };
1680
+ const renderQuestion = (question) => {
1681
+ const questionId = getQuestionId(question);
1682
+ const hasError = !!errors[questionId];
1683
+ switch (question.type) {
1684
+ case "text":
1685
+ case "email":
1686
+ case "tel":
1687
+ return /* @__PURE__ */ jsx(
1688
+ "input",
2202
1689
  {
2203
1690
  type: question.type,
2204
1691
  value: responses[questionId] || "",
@@ -2227,7 +1714,7 @@ var QuestionnaireForm = ({
2227
1714
  }
2228
1715
  );
2229
1716
  case "radio":
2230
- return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: question.options?.map((option) => /* @__PURE__ */ jsxs(
1717
+ return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: question?.options?.map((option) => /* @__PURE__ */ jsxs(
2231
1718
  "label",
2232
1719
  {
2233
1720
  className: "flex items-center gap-3 cursor-pointer group",
@@ -2249,7 +1736,7 @@ var QuestionnaireForm = ({
2249
1736
  option.value || option.label
2250
1737
  )) });
2251
1738
  case "checkbox":
2252
- return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: question.options?.map((option) => {
1739
+ return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: question?.options?.map((option) => {
2253
1740
  const optionValue = option.value || option.label;
2254
1741
  const isChecked = (responses[questionId] || []).includes(
2255
1742
  optionValue
@@ -2307,8 +1794,8 @@ var QuestionnaireForm = ({
2307
1794
  return null;
2308
1795
  }
2309
1796
  };
2310
- return /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: [
2311
- questions.map((question) => {
1797
+ return /* @__PURE__ */ jsxs("div", { className: "pb-[80px]", children: [
1798
+ /* @__PURE__ */ jsx("div", { className: "bg-white rounded-[12px] border border-[#E4E5E6] p-8", children: /* @__PURE__ */ jsx("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: questions?.map((question) => {
2312
1799
  const questionId = getQuestionId(question);
2313
1800
  return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2314
1801
  /* @__PURE__ */ jsxs("label", { className: "block", children: [
@@ -2320,24 +1807,51 @@ var QuestionnaireForm = ({
2320
1807
  ] }),
2321
1808
  renderQuestion(question),
2322
1809
  question.hint && !errors[questionId] && /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: question.hint }),
2323
- errors[questionId] && /* @__PURE__ */ jsx("p", { className: "text-sm text-red-500", children: errors[questionId] })
1810
+ errors[questionId] && /* @__PURE__ */ jsx("p", { className: "text-sm", style: { color: "#FF4D4D" }, children: errors[questionId] })
2324
1811
  ] }, questionId);
2325
- }),
2326
- /* @__PURE__ */ jsx(
2327
- "button",
2328
- {
2329
- type: "submit",
2330
- disabled: loading,
2331
- className: cn(
2332
- "w-full px-6 py-4 rounded-full",
2333
- "bg-[#3ADB67] text-white font-medium text-base",
2334
- "hover:bg-[#2FC257] transition-colors",
2335
- "focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
2336
- "disabled:opacity-50 disabled:cursor-not-allowed"
2337
- ),
2338
- children: loading ? "Submitting..." : "Submit Booking"
2339
- }
2340
- )
1812
+ }) }) }),
1813
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center", children: [
1814
+ pageData?.agrees && pageData.agrees.length > 0 && /* @__PURE__ */ jsxs("div", { className: "space-y-4 mt-8", children: [
1815
+ pageData.agrees.map((agreeContent, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1816
+ /* @__PURE__ */ jsx(
1817
+ "input",
1818
+ {
1819
+ type: "checkbox",
1820
+ id: `agreement-${index}`,
1821
+ checked: agreements[index] || false,
1822
+ onChange: (e) => handleAgreementChange(index, e.target.checked),
1823
+ className: "w-5 h-5 rounded border-gray-300 text-[#2FC257] focus:ring-[#2FC257] cursor-pointer flex-shrink-0"
1824
+ }
1825
+ ),
1826
+ /* @__PURE__ */ jsx(
1827
+ "label",
1828
+ {
1829
+ htmlFor: `agreement-${index}`,
1830
+ className: "text-sm text-gray-700 cursor-pointer select-none flex-1 [&_a]:underline [&_a]:text-blue-600 [&_a:hover]:text-blue-700",
1831
+ dangerouslySetInnerHTML: { __html: agreeContent },
1832
+ "aria-label": `Agreement ${index + 1}`
1833
+ }
1834
+ )
1835
+ ] }, index)),
1836
+ agreementError && /* @__PURE__ */ jsx("p", { className: "text-sm mt-2", style: { color: "#FF4D4D" }, children: agreementError })
1837
+ ] }),
1838
+ /* @__PURE__ */ jsx(
1839
+ "button",
1840
+ {
1841
+ type: "submit",
1842
+ disabled: loading,
1843
+ onClick: handleSubmit,
1844
+ className: cn(
1845
+ "w-fit mt-6 px-6 py-4 rounded-full",
1846
+ "bg-[#080A0F] text-white font-medium text-base",
1847
+ "hover:bg-[#2FC257] transition-colors",
1848
+ "focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
1849
+ "disabled:opacity-50 disabled:cursor-not-allowed"
1850
+ ),
1851
+ children: loading ? "Submitting..." : "Submit Booking"
1852
+ }
1853
+ )
1854
+ ] })
2341
1855
  ] });
2342
1856
  };
2343
1857
  dayjs.extend(dayLocaleData);
@@ -2347,27 +1861,29 @@ var DateTimePicker = ({
2347
1861
  apiClient,
2348
1862
  demoRoomCode,
2349
1863
  timezone,
1864
+ pageData,
2350
1865
  locale,
2351
1866
  onBookingSuccess
2352
1867
  }) => {
2353
1868
  const { token } = theme.useToken();
2354
1869
  const [selectMonth, setSelectMonth] = useState("");
2355
1870
  const [selectedDate, setSelectedDate] = useState(dayjs());
2356
- const [selectedTimeslotId, setSelectedTimeslotId] = useState(null);
1871
+ const [selectedTimeslotId, setSelectedTimeslotId] = useState(
1872
+ null
1873
+ );
2357
1874
  const [showQuestionnaire, setShowQuestionnaire] = useState(false);
2358
- const { createBooking, loading: bookingLoading, error: bookingError } = useCreateBooking(apiClient);
2359
1875
  const {
2360
- data: demoRoom
2361
- } = useDemoRoom(
1876
+ createBooking,
1877
+ loading: bookingLoading,
1878
+ error: bookingError
1879
+ } = useCreateBooking(apiClient);
1880
+ const { data: demoRoom } = useDemoRoom(
2362
1881
  apiClient,
2363
1882
  demoRoomCode || "",
2364
1883
  locale,
2365
1884
  { enabled: !!demoRoomCode }
2366
1885
  );
2367
- const {
2368
- data: questionnaire,
2369
- loading: questionnaireLoading
2370
- } = useQuestionnaire(
1886
+ const { data: questionnaire, loading: questionnaireLoading } = useQuestionnaire(
2371
1887
  apiClient,
2372
1888
  demoRoomCode || "",
2373
1889
  demoRoom?.questionnaire_id,
@@ -2435,13 +1951,8 @@ var DateTimePicker = ({
2435
1951
  }
2436
1952
  }
2437
1953
  },
2438
- children: /* @__PURE__ */ jsxs(
2439
- "div",
2440
- {
2441
- style: wrapperStyle,
2442
- className: "calendar-custom-cell",
2443
- children: [
2444
- /* @__PURE__ */ jsx("style", { children: `
1954
+ children: /* @__PURE__ */ jsxs("div", { style: wrapperStyle, className: "calendar-custom-cell", children: [
1955
+ /* @__PURE__ */ jsx("style", { children: `
2445
1956
  .calendar-custom-cell .ant-picker-cell {
2446
1957
  padding: 6px !important;
2447
1958
  }
@@ -2476,136 +1987,134 @@ var DateTimePicker = ({
2476
1987
  line-height: 48px !important;
2477
1988
  }
2478
1989
  ` }),
2479
- /* @__PURE__ */ jsx(
2480
- Calendar,
2481
- {
2482
- fullscreen: false,
2483
- value: selectedDate,
2484
- onChange: (date) => setSelectedDate(date),
2485
- headerRender: ({ value, onChange }) => {
2486
- const year = value.year();
2487
- const month = value.month();
2488
- const yearOptions = Array.from({ length: 20 }, (_, i) => {
2489
- const label = year - 10 + i;
2490
- return { label, value: label };
2491
- });
2492
- const monthOptions = value.localeData().months().map((label, index) => ({
2493
- label,
2494
- value: index
2495
- }));
2496
- const monthText = monthOptions?.find((item) => {
2497
- return item?.value === month;
2498
- });
2499
- setSelectMonth(monthText?.label || "");
2500
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3", children: [
2501
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
2502
- /* @__PURE__ */ jsx(
2503
- Select,
2504
- {
2505
- value: month,
2506
- options: monthOptions,
2507
- onChange: (newMonth) => {
2508
- const now = value.clone().month(newMonth);
2509
- onChange(now);
2510
- },
2511
- variant: "borderless",
2512
- className: "text-2xl font-medium",
2513
- popupMatchSelectWidth: false,
2514
- style: {
2515
- fontSize: "24px",
2516
- fontWeight: 500
2517
- }
2518
- }
2519
- ),
2520
- /* @__PURE__ */ jsx(
2521
- Select,
2522
- {
2523
- value: year,
2524
- options: yearOptions,
2525
- onChange: (newYear) => {
2526
- const now = value.clone().year(newYear);
2527
- onChange(now);
2528
- },
2529
- variant: "borderless",
2530
- className: "text-2xl font-medium",
2531
- popupMatchSelectWidth: false,
2532
- style: {
2533
- fontSize: "24px",
2534
- fontWeight: 500
2535
- }
2536
- }
2537
- )
2538
- ] }),
2539
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
2540
- /* @__PURE__ */ jsx(
2541
- "button",
1990
+ /* @__PURE__ */ jsx(
1991
+ Calendar,
1992
+ {
1993
+ fullscreen: false,
1994
+ value: selectedDate,
1995
+ onChange: (date) => setSelectedDate(date),
1996
+ headerRender: ({ value, onChange }) => {
1997
+ const year = value.year();
1998
+ const month = value.month();
1999
+ const yearOptions = Array.from({ length: 20 }, (_, i) => {
2000
+ const label = year - 10 + i;
2001
+ return { label, value: label };
2002
+ });
2003
+ const monthOptions = value.localeData().months().map((label, index) => ({
2004
+ label,
2005
+ value: index
2006
+ }));
2007
+ const monthText = monthOptions?.find((item) => {
2008
+ return item?.value === month;
2009
+ });
2010
+ setSelectMonth(monthText?.label || "");
2011
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3", children: [
2012
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
2013
+ /* @__PURE__ */ jsx(
2014
+ Select,
2015
+ {
2016
+ value: month,
2017
+ options: monthOptions,
2018
+ onChange: (newMonth) => {
2019
+ const now = value.clone().month(newMonth);
2020
+ onChange(now);
2021
+ },
2022
+ variant: "borderless",
2023
+ className: "text-2xl font-medium",
2024
+ popupMatchSelectWidth: false,
2025
+ style: {
2026
+ fontSize: "24px",
2027
+ fontWeight: 500
2028
+ }
2029
+ }
2030
+ ),
2031
+ /* @__PURE__ */ jsx(
2032
+ Select,
2033
+ {
2034
+ value: year,
2035
+ options: yearOptions,
2036
+ onChange: (newYear) => {
2037
+ const now = value.clone().year(newYear);
2038
+ onChange(now);
2039
+ },
2040
+ variant: "borderless",
2041
+ className: "text-2xl font-medium",
2042
+ popupMatchSelectWidth: false,
2043
+ style: {
2044
+ fontSize: "24px",
2045
+ fontWeight: 500
2046
+ }
2047
+ }
2048
+ )
2049
+ ] }),
2050
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
2051
+ /* @__PURE__ */ jsx(
2052
+ "button",
2053
+ {
2054
+ onClick: () => {
2055
+ const newDate = value.subtract(1, "month");
2056
+ onChange(newDate);
2057
+ },
2058
+ className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
2059
+ children: /* @__PURE__ */ jsx(
2060
+ "svg",
2542
2061
  {
2543
- onClick: () => {
2544
- const newDate = value.subtract(1, "month");
2545
- onChange(newDate);
2546
- },
2547
- className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
2062
+ width: "20",
2063
+ height: "20",
2064
+ viewBox: "0 0 20 20",
2065
+ fill: "none",
2066
+ xmlns: "http://www.w3.org/2000/svg",
2548
2067
  children: /* @__PURE__ */ jsx(
2549
- "svg",
2068
+ "path",
2550
2069
  {
2551
- width: "20",
2552
- height: "20",
2553
- viewBox: "0 0 20 20",
2554
- fill: "none",
2555
- xmlns: "http://www.w3.org/2000/svg",
2556
- children: /* @__PURE__ */ jsx(
2557
- "path",
2558
- {
2559
- d: "M12 16L6 10L12 4",
2560
- stroke: "currentColor",
2561
- strokeWidth: "2",
2562
- strokeLinecap: "round",
2563
- strokeLinejoin: "round"
2564
- }
2565
- )
2070
+ d: "M12 16L6 10L12 4",
2071
+ stroke: "currentColor",
2072
+ strokeWidth: "2",
2073
+ strokeLinecap: "round",
2074
+ strokeLinejoin: "round"
2566
2075
  }
2567
2076
  )
2568
2077
  }
2569
- ),
2570
- /* @__PURE__ */ jsx(
2571
- "button",
2078
+ )
2079
+ }
2080
+ ),
2081
+ /* @__PURE__ */ jsx(
2082
+ "button",
2083
+ {
2084
+ onClick: () => {
2085
+ const newDate = value.add(1, "month");
2086
+ onChange(newDate);
2087
+ },
2088
+ className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
2089
+ children: /* @__PURE__ */ jsx(
2090
+ "svg",
2572
2091
  {
2573
- onClick: () => {
2574
- const newDate = value.add(1, "month");
2575
- onChange(newDate);
2576
- },
2577
- className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
2092
+ width: "20",
2093
+ height: "20",
2094
+ viewBox: "0 0 20 20",
2095
+ fill: "none",
2096
+ xmlns: "http://www.w3.org/2000/svg",
2578
2097
  children: /* @__PURE__ */ jsx(
2579
- "svg",
2098
+ "path",
2580
2099
  {
2581
- width: "20",
2582
- height: "20",
2583
- viewBox: "0 0 20 20",
2584
- fill: "none",
2585
- xmlns: "http://www.w3.org/2000/svg",
2586
- children: /* @__PURE__ */ jsx(
2587
- "path",
2588
- {
2589
- d: "M8 4L14 10L8 16",
2590
- stroke: "currentColor",
2591
- strokeWidth: "2",
2592
- strokeLinecap: "round",
2593
- strokeLinejoin: "round"
2594
- }
2595
- )
2100
+ d: "M8 4L14 10L8 16",
2101
+ stroke: "currentColor",
2102
+ strokeWidth: "2",
2103
+ strokeLinecap: "round",
2104
+ strokeLinejoin: "round"
2596
2105
  }
2597
2106
  )
2598
2107
  }
2599
2108
  )
2600
- ] })
2601
- ] });
2602
- },
2603
- onPanelChange
2604
- }
2605
- )
2606
- ]
2607
- }
2608
- )
2109
+ }
2110
+ )
2111
+ ] })
2112
+ ] });
2113
+ },
2114
+ onPanelChange
2115
+ }
2116
+ )
2117
+ ] })
2609
2118
  }
2610
2119
  ),
2611
2120
  /* @__PURE__ */ jsxs("div", { className: "bg-white p-[24px] rounded-[12px] flex-1", children: [
@@ -2685,7 +2194,7 @@ var DateTimePicker = ({
2685
2194
  className: `
2686
2195
  rounded-[20px] w-full flex items-center justify-center gap-4 h-[76px]
2687
2196
  border text-center transition-colors
2688
- ${isSelected ? "border-[#3ADB67] bg-[#3ADB67] text-white cursor-pointer" : isAvailable ? "border-[#E4E5E6] hover:border-[#3ADB67] hover:bg-[#3ADB67] hover:text-white cursor-pointer" : "border-[#E4E5E6] bg-[#F5F5F5] text-[#BDBDBD] cursor-not-allowed"}
2197
+ ${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"}
2689
2198
  `,
2690
2199
  children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
2691
2200
  /* @__PURE__ */ jsx("div", { children: formatTimeslot(slot) }),
@@ -2707,11 +2216,12 @@ var DateTimePicker = ({
2707
2216
  ] }),
2708
2217
  showQuestionnaire && questionnaire && /* @__PURE__ */ jsxs("div", { className: "mt-12", children: [
2709
2218
  /* @__PURE__ */ jsx("div", { className: "text-[48px] font-bold text-center mb-8", children: "Fill out Form" }),
2710
- questionnaireLoading ? /* @__PURE__ */ jsx("div", { className: "text-center text-[#767880] py-8", children: "Loading questionnaire..." }) : /* @__PURE__ */ jsx("div", { className: "bg-white rounded-[12px] border border-[#E4E5E6] p-8", children: /* @__PURE__ */ jsx(
2219
+ questionnaireLoading ? /* @__PURE__ */ jsx("div", { className: "text-center text-[#767880] py-8", children: "Loading questionnaire..." }) : /* @__PURE__ */ jsx(
2711
2220
  QuestionnaireForm,
2712
2221
  {
2713
2222
  questions: questionnaire.questions,
2714
2223
  loading: bookingLoading,
2224
+ pageData,
2715
2225
  onSubmit: async (responses) => {
2716
2226
  try {
2717
2227
  const customerName = responses.name || responses.customer_name || "";
@@ -2736,7 +2246,7 @@ var DateTimePicker = ({
2736
2246
  }
2737
2247
  }
2738
2248
  }
2739
- ) })
2249
+ )
2740
2250
  ] }),
2741
2251
  bookingError && /* @__PURE__ */ 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: [
2742
2252
  /* @__PURE__ */ jsx("p", { className: "font-medium", children: "Booking failed" }),
@@ -2745,11 +2255,310 @@ var DateTimePicker = ({
2745
2255
  ] });
2746
2256
  };
2747
2257
  var DateTimePicker_default = DateTimePicker;
2258
+ var Navigation;
2259
+ var Pagination;
2260
+ var Autoplay;
2261
+ var swiperVersion = "11+";
2262
+ try {
2263
+ const modules = __require("swiper/modules");
2264
+ Navigation = modules.Navigation;
2265
+ Pagination = modules.Pagination;
2266
+ Autoplay = modules.Autoplay;
2267
+ swiperVersion = "11+";
2268
+ } catch (e) {
2269
+ try {
2270
+ const SwiperCore = __require("swiper");
2271
+ const SwiperNavigation = __require("swiper/modules/navigation");
2272
+ const SwiperPagination = __require("swiper/modules/pagination");
2273
+ const SwiperAutoplay = __require("swiper/modules/autoplay");
2274
+ const SwiperClass = SwiperCore.default || SwiperCore;
2275
+ if (SwiperClass && SwiperClass.use) {
2276
+ SwiperClass.use([
2277
+ SwiperNavigation.default || SwiperNavigation,
2278
+ SwiperPagination.default || SwiperPagination,
2279
+ SwiperAutoplay.default || SwiperAutoplay
2280
+ ]);
2281
+ }
2282
+ Navigation = SwiperNavigation.default || SwiperNavigation;
2283
+ Pagination = SwiperPagination.default || SwiperPagination;
2284
+ Autoplay = SwiperAutoplay.default || SwiperAutoplay;
2285
+ swiperVersion = "8";
2286
+ } catch (e2) {
2287
+ console.warn("Failed to load swiper modules:", e2);
2288
+ }
2289
+ }
2290
+ if (typeof window !== "undefined") {
2291
+ try {
2292
+ __require("swiper/css");
2293
+ __require("swiper/css/navigation");
2294
+ __require("swiper/css/pagination");
2295
+ } catch (e) {
2296
+ try {
2297
+ __require("swiper/swiper.min.css");
2298
+ __require("swiper/modules/navigation/navigation.min.css");
2299
+ __require("swiper/modules/pagination/pagination.min.css");
2300
+ } catch (e2) {
2301
+ console.warn("Failed to load swiper styles");
2302
+ }
2303
+ }
2304
+ }
2305
+ var defaultDescriptions = [
2306
+ "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
2307
+ "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."
2308
+ ];
2309
+ var defaultImages = [
2310
+ "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
2311
+ "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
2312
+ ];
2313
+ var DemoRoomDetail = ({
2314
+ apiClient,
2315
+ demoRoomCode,
2316
+ locale,
2317
+ title: titleProp,
2318
+ descriptions: descriptionsProp,
2319
+ devices: devicesProp,
2320
+ address: addressProp,
2321
+ mapsLink,
2322
+ images: imagesProp,
2323
+ className,
2324
+ ...props
2325
+ }) => {
2326
+ const {
2327
+ data: demoRoom,
2328
+ loading,
2329
+ error
2330
+ } = useDemoRoom(
2331
+ apiClient,
2332
+ demoRoomCode || "",
2333
+ locale,
2334
+ { enabled: !!apiClient && !!demoRoomCode }
2335
+ );
2336
+ const title = demoRoom?.name || titleProp || "Design District Demo Room";
2337
+ const descriptions = demoRoom?.description ? [demoRoom.description] : descriptionsProp || defaultDescriptions;
2338
+ const devices = demoRoom?.description || devicesProp || "eufyMake E1, eufyMake M5";
2339
+ const address = demoRoom?.address || addressProp || "1111 8th St, San Francisco, CA United States 94108";
2340
+ const images = demoRoom?.images && demoRoom.images.length > 0 ? demoRoom.images : imagesProp || defaultImages;
2341
+ const googleMapsLink = mapsLink || (() => {
2342
+ if (demoRoom?.latitude && demoRoom?.longitude) {
2343
+ return `https://www.google.com/maps/search/?api=1&query=${demoRoom.latitude},${demoRoom.longitude}`;
2344
+ } else {
2345
+ return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(address)}`;
2346
+ }
2347
+ })();
2348
+ if (loading && apiClient && demoRoomCode) {
2349
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
2350
+ /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
2351
+ /* @__PURE__ */ jsx("div", { className: "h-12 bg-gray-200 rounded animate-pulse" }),
2352
+ /* @__PURE__ */ jsx("div", { className: "h-24 bg-gray-200 rounded animate-pulse" }),
2353
+ /* @__PURE__ */ jsx("div", { className: "h-8 bg-gray-200 rounded animate-pulse" })
2354
+ ] }),
2355
+ /* @__PURE__ */ jsx("div", { className: "h-[400px] bg-gray-200 rounded-2xl animate-pulse" })
2356
+ ] }) });
2357
+ }
2358
+ if (error && apiClient && demoRoomCode) {
2359
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "text-center text-red-600 py-8", children: [
2360
+ /* @__PURE__ */ jsx("p", { className: "text-lg font-medium", children: "Failed to load demo room details" }),
2361
+ /* @__PURE__ */ jsx("p", { className: "text-sm mt-2", children: error.message })
2362
+ ] }) });
2363
+ }
2364
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
2365
+ /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
2366
+ /* @__PURE__ */ jsx("h1", { className: "text-[40px] font-bold text-gray-900 leading-tight", children: title }),
2367
+ /* @__PURE__ */ jsx("div", { className: "space-y-4", children: descriptions.map((desc, index) => /* @__PURE__ */ jsx(
2368
+ "p",
2369
+ {
2370
+ className: "text-base text-gray-600 leading-relaxed",
2371
+ children: desc
2372
+ },
2373
+ index
2374
+ )) }),
2375
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
2376
+ /* @__PURE__ */ jsxs(
2377
+ "svg",
2378
+ {
2379
+ width: "24",
2380
+ height: "24",
2381
+ viewBox: "0 0 24 24",
2382
+ fill: "none",
2383
+ xmlns: "http://www.w3.org/2000/svg",
2384
+ className: "flex-shrink-0 mt-0.5",
2385
+ children: [
2386
+ /* @__PURE__ */ jsx(
2387
+ "rect",
2388
+ {
2389
+ x: "3",
2390
+ y: "3",
2391
+ width: "18",
2392
+ height: "18",
2393
+ rx: "2",
2394
+ stroke: "currentColor",
2395
+ strokeWidth: "2"
2396
+ }
2397
+ ),
2398
+ /* @__PURE__ */ jsx(
2399
+ "path",
2400
+ {
2401
+ d: "M8 10H16",
2402
+ stroke: "currentColor",
2403
+ strokeWidth: "2",
2404
+ strokeLinecap: "round"
2405
+ }
2406
+ ),
2407
+ /* @__PURE__ */ jsx(
2408
+ "path",
2409
+ {
2410
+ d: "M8 14H16",
2411
+ stroke: "currentColor",
2412
+ strokeWidth: "2",
2413
+ strokeLinecap: "round"
2414
+ }
2415
+ )
2416
+ ]
2417
+ }
2418
+ ),
2419
+ /* @__PURE__ */ jsx("span", { className: "text-base text-gray-900", children: devices })
2420
+ ] }),
2421
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
2422
+ /* @__PURE__ */ jsxs(
2423
+ "svg",
2424
+ {
2425
+ width: "24",
2426
+ height: "24",
2427
+ viewBox: "0 0 24 24",
2428
+ fill: "none",
2429
+ xmlns: "http://www.w3.org/2000/svg",
2430
+ className: "flex-shrink-0 mt-0.5",
2431
+ children: [
2432
+ /* @__PURE__ */ jsx(
2433
+ "path",
2434
+ {
2435
+ 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",
2436
+ stroke: "currentColor",
2437
+ strokeWidth: "2",
2438
+ strokeLinecap: "round",
2439
+ strokeLinejoin: "round"
2440
+ }
2441
+ ),
2442
+ /* @__PURE__ */ jsx(
2443
+ "circle",
2444
+ {
2445
+ cx: "12",
2446
+ cy: "9",
2447
+ r: "2.5",
2448
+ stroke: "currentColor",
2449
+ strokeWidth: "2"
2450
+ }
2451
+ )
2452
+ ]
2453
+ }
2454
+ ),
2455
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
2456
+ /* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: address }),
2457
+ /* @__PURE__ */ jsxs(
2458
+ "a",
2459
+ {
2460
+ href: googleMapsLink,
2461
+ target: "_blank",
2462
+ rel: "noopener noreferrer",
2463
+ className: "inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 mt-1 underline",
2464
+ children: [
2465
+ "Open in Google Maps",
2466
+ /* @__PURE__ */ jsx(
2467
+ "svg",
2468
+ {
2469
+ width: "12",
2470
+ height: "12",
2471
+ viewBox: "0 0 12 12",
2472
+ fill: "none",
2473
+ xmlns: "http://www.w3.org/2000/svg",
2474
+ children: /* @__PURE__ */ jsx(
2475
+ "path",
2476
+ {
2477
+ d: "M3 9L9 3M9 3H3M9 3V9",
2478
+ stroke: "currentColor",
2479
+ strokeWidth: "1.5",
2480
+ strokeLinecap: "round",
2481
+ strokeLinejoin: "round"
2482
+ }
2483
+ )
2484
+ }
2485
+ )
2486
+ ]
2487
+ }
2488
+ )
2489
+ ] })
2490
+ ] })
2491
+ ] }),
2492
+ /* @__PURE__ */ jsx("div", { className: "relative h-[400px] rounded-2xl overflow-hidden", children: images.length > 0 ? /* @__PURE__ */ jsx(
2493
+ Swiper,
2494
+ {
2495
+ ...swiperVersion === "11+" && Navigation && Pagination && Autoplay ? { modules: [Navigation, Pagination, Autoplay] } : {},
2496
+ spaceBetween: 0,
2497
+ slidesPerView: 1,
2498
+ navigation: true,
2499
+ pagination: { clickable: true },
2500
+ autoplay: {
2501
+ delay: 3e3,
2502
+ disableOnInteraction: false
2503
+ },
2504
+ loop: true,
2505
+ className: "h-full rounded-2xl",
2506
+ children: images.map((img, index) => /* @__PURE__ */ jsx(SwiperSlide, { children: /* @__PURE__ */ jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsx(
2507
+ "img",
2508
+ {
2509
+ src: img,
2510
+ alt: `Demo room view ${index + 1}`,
2511
+ className: "w-full h-full object-cover"
2512
+ }
2513
+ ) }) }, index))
2514
+ }
2515
+ ) : /* @__PURE__ */ 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__ */ jsxs("div", { className: "text-center", children: [
2516
+ /* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto mb-3 rounded-full bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxs(
2517
+ "svg",
2518
+ {
2519
+ width: "32",
2520
+ height: "32",
2521
+ viewBox: "0 0 32 32",
2522
+ fill: "none",
2523
+ xmlns: "http://www.w3.org/2000/svg",
2524
+ children: [
2525
+ /* @__PURE__ */ jsx(
2526
+ "rect",
2527
+ {
2528
+ x: "4",
2529
+ y: "8",
2530
+ width: "24",
2531
+ height: "16",
2532
+ rx: "2",
2533
+ stroke: "currentColor",
2534
+ strokeWidth: "2"
2535
+ }
2536
+ ),
2537
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "14", r: "2", fill: "currentColor" }),
2538
+ /* @__PURE__ */ jsx(
2539
+ "path",
2540
+ {
2541
+ d: "M28 20L22 14L16 20",
2542
+ stroke: "currentColor",
2543
+ strokeWidth: "2",
2544
+ strokeLinecap: "round",
2545
+ strokeLinejoin: "round"
2546
+ }
2547
+ )
2548
+ ]
2549
+ }
2550
+ ) }),
2551
+ /* @__PURE__ */ jsx("p", { className: "text-gray-500 text-sm", children: "Demo Room Images" })
2552
+ ] }) }) })
2553
+ ] }) });
2554
+ };
2555
+ DemoRoomDetail.displayName = "DemoRoomDetail";
2748
2556
  var BookingForm = ({
2749
2557
  layoutClassName,
2750
2558
  className,
2751
2559
  apiConfig,
2752
2560
  demoRoomCode,
2561
+ pageData,
2753
2562
  timezone,
2754
2563
  handleBookingSuccess,
2755
2564
  ...props
@@ -2759,24 +2568,15 @@ var BookingForm = ({
2759
2568
  [apiConfig]
2760
2569
  );
2761
2570
  return /* @__PURE__ */ jsxs("div", { children: [
2762
- /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), ...props, children: [
2763
- /* @__PURE__ */ jsx(
2764
- BreadCrumbs,
2765
- {
2766
- className: layoutClassName,
2767
- items: [{ label: "Home", link: "/" }, { label: "Demo Room" }]
2768
- }
2769
- ),
2770
- /* @__PURE__ */ jsx(
2771
- DemoRoomDetail,
2772
- {
2773
- className: cn("mt-8", layoutClassName),
2774
- apiClient,
2775
- demoRoomCode,
2776
- locale: apiConfig.locale
2777
- }
2778
- )
2779
- ] }),
2571
+ /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsx(
2572
+ DemoRoomDetail,
2573
+ {
2574
+ className: cn("mt-8", layoutClassName),
2575
+ apiClient,
2576
+ demoRoomCode,
2577
+ locale: apiConfig.locale
2578
+ }
2579
+ ) }),
2780
2580
  /* @__PURE__ */ jsx("div", { className: "bg-[#f5f5f5]", children: /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(
2781
2581
  DateTimePicker_default,
2782
2582
  {
@@ -2784,7 +2584,8 @@ var BookingForm = ({
2784
2584
  demoRoomCode,
2785
2585
  timezone,
2786
2586
  locale: apiConfig.locale,
2787
- onBookingSuccess: handleBookingSuccess
2587
+ onBookingSuccess: handleBookingSuccess,
2588
+ pageData
2788
2589
  }
2789
2590
  ) }) })
2790
2591
  ] });
@@ -2794,24 +2595,29 @@ var BookingSuccess = ({
2794
2595
  bookingData: initialBookingData,
2795
2596
  token,
2796
2597
  apiConfig,
2797
- onBackToHome,
2598
+ onScheduleAgain,
2599
+ onCancelSuccess,
2798
2600
  className
2799
2601
  }) => {
2800
- const [bookingData, setBookingData] = useState(initialBookingData || null);
2602
+ const [bookingData, setBookingData] = useState(
2603
+ initialBookingData || null
2604
+ );
2801
2605
  const [loading, setLoading] = useState(false);
2802
- const [error, setError] = useState(null);
2606
+ const [isCancelled, setIsCancelled] = useState(false);
2607
+ const [showCancelDialog, setShowCancelDialog] = useState(false);
2608
+ const [cancelLoading, setCancelLoading] = useState(false);
2609
+ const [cancelError, setCancelError] = useState(null);
2803
2610
  useEffect(() => {
2804
2611
  if (token && apiConfig && !initialBookingData) {
2805
2612
  const fetchBookingData = async () => {
2806
2613
  setLoading(true);
2807
- setError(null);
2808
2614
  try {
2809
2615
  const apiClient = createDemoRoomApi(apiConfig);
2810
- const booking = await apiClient.getBooking(token);
2616
+ const booking = await apiClient.getBooking(token, apiConfig.locale);
2811
2617
  setBookingData(booking);
2618
+ setIsCancelled(booking.status === "cancelled");
2812
2619
  } catch (err) {
2813
2620
  console.error("Failed to fetch booking data:", err);
2814
- setError("Failed to load booking information");
2815
2621
  } finally {
2816
2622
  setLoading(false);
2817
2623
  }
@@ -2819,142 +2625,267 @@ var BookingSuccess = ({
2819
2625
  fetchBookingData();
2820
2626
  }
2821
2627
  }, [token, apiConfig, initialBookingData]);
2628
+ const handleCancelAppointment = async () => {
2629
+ if (!token || !apiConfig) {
2630
+ setCancelError("Unable to cancel: Missing token or API configuration");
2631
+ return;
2632
+ }
2633
+ setCancelLoading(true);
2634
+ setCancelError(null);
2635
+ try {
2636
+ const apiClient = createDemoRoomApi(apiConfig);
2637
+ const cancelledBooking = await apiClient.cancelBooking(
2638
+ token,
2639
+ apiConfig.locale
2640
+ );
2641
+ if (cancelledBooking) {
2642
+ setBookingData(cancelledBooking);
2643
+ }
2644
+ setIsCancelled(true);
2645
+ setShowCancelDialog(false);
2646
+ if (onCancelSuccess && cancelledBooking) {
2647
+ onCancelSuccess(cancelledBooking);
2648
+ }
2649
+ } catch (err) {
2650
+ console.error("Failed to cancel booking:", err);
2651
+ setCancelError("Failed to cancel appointment. Please try again.");
2652
+ } finally {
2653
+ setCancelLoading(false);
2654
+ }
2655
+ };
2822
2656
  if (loading) {
2823
- return /* @__PURE__ */ jsx("div", { className: `min-h-screen bg-[#F5F5F5] py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxs("div", { className: "max-w-2xl mx-auto text-center", children: [
2824
- /* @__PURE__ */ jsx("div", { className: "animate-spin w-16 h-16 mx-auto mb-4 border-4 border-[#3ADB67] border-t-transparent rounded-full" }),
2825
- /* @__PURE__ */ jsx("p", { className: "text-xl text-gray-600", children: "Loading booking information..." })
2826
- ] }) });
2657
+ return /* @__PURE__ */ jsx("div", { className: `min-h-screen py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsx("div", { className: "max-w-3xl mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "animate-pulse space-y-6", children: [
2658
+ /* @__PURE__ */ jsx("div", { className: "h-8 bg-gray-200 rounded w-1/3" }),
2659
+ /* @__PURE__ */ jsx("div", { className: "h-24 bg-gray-200 rounded" }),
2660
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
2661
+ /* @__PURE__ */ jsx("div", { className: "h-20 bg-gray-200 rounded" }),
2662
+ /* @__PURE__ */ jsx("div", { className: "h-20 bg-gray-200 rounded" }),
2663
+ /* @__PURE__ */ jsx("div", { className: "h-20 bg-gray-200 rounded" })
2664
+ ] })
2665
+ ] }) }) });
2827
2666
  }
2828
- if (error || !bookingData) {
2829
- return /* @__PURE__ */ jsx("div", { className: `min-h-screen bg-[#F5F5F5] py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsx("div", { className: "max-w-2xl mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-[12px] border border-red-200 p-8 text-center", children: [
2830
- /* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto mb-4 rounded-full bg-red-100 flex items-center justify-center", children: /* @__PURE__ */ jsx(
2831
- "svg",
2667
+ if (!bookingData) {
2668
+ return null;
2669
+ }
2670
+ return /* @__PURE__ */ jsx("div", { className: `min-h-screen py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto", children: [
2671
+ /* @__PURE__ */ jsx("h1", { className: "text-[40px] font-bold text-gray-900 mb-8", children: "Your Appointment" }),
2672
+ isCancelled && /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-lg p-6 mb-8 flex items-center justify-between", children: [
2673
+ /* @__PURE__ */ jsx("p", { className: "text-base text-gray-700", children: "This appointment has been canceled." }),
2674
+ onScheduleAgain && /* @__PURE__ */ jsx(
2675
+ "button",
2832
2676
  {
2833
- width: "32",
2834
- height: "32",
2835
- viewBox: "0 0 24 24",
2836
- fill: "none",
2837
- xmlns: "http://www.w3.org/2000/svg",
2838
- children: /* @__PURE__ */ jsx(
2839
- "path",
2677
+ onClick: onScheduleAgain,
2678
+ className: "px-6 py-3 bg-black text-white rounded-full font-medium hover:bg-gray-800 transition-colors whitespace-nowrap",
2679
+ children: "Schedule again"
2680
+ }
2681
+ )
2682
+ ] }),
2683
+ /* @__PURE__ */ jsxs("div", { className: "space-y-8 bg-white px-[48px] py-[32px] rounded-lg", children: [
2684
+ /* @__PURE__ */ jsxs("div", { children: [
2685
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Location" }),
2686
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2687
+ bookingData.demoroom_name && /* @__PURE__ */ jsx("p", { className: "text-base font-medium text-gray-900", children: bookingData.demoroom_name }),
2688
+ bookingData.address && /* @__PURE__ */ jsx("p", { className: "text-base text-gray-600", children: bookingData.address }),
2689
+ bookingData.latitude && bookingData.longitude && /* @__PURE__ */ jsx(
2690
+ "a",
2840
2691
  {
2841
- d: "M12 8V12M12 16H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",
2842
- stroke: "#EF4444",
2843
- strokeWidth: "2",
2844
- strokeLinecap: "round",
2845
- strokeLinejoin: "round"
2692
+ href: `https://www.google.com/maps/search/?api=1&query=${bookingData.latitude},${bookingData.longitude}`,
2693
+ target: "_blank",
2694
+ rel: "noopener noreferrer",
2695
+ className: "inline-flex items-center gap-1 text-base text-blue-600 hover:text-blue-700 hover:underline",
2696
+ children: "Open in Google Maps \u2197"
2846
2697
  }
2847
2698
  )
2848
- }
2849
- ) }),
2850
- /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: error || "Booking Not Found" }),
2851
- /* @__PURE__ */ jsx("p", { className: "text-base text-gray-600 mb-6", children: "We couldn't find your booking information. Please check your booking confirmation email or contact support." }),
2852
- onBackToHome && /* @__PURE__ */ jsx(
2699
+ ] })
2700
+ ] }),
2701
+ /* @__PURE__ */ jsxs("div", { children: [
2702
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Date and Time" }),
2703
+ /* @__PURE__ */ jsxs("p", { className: "text-base text-gray-900", children: [
2704
+ bookingData.booking_date,
2705
+ bookingData.time_slot && `, ${bookingData.time_slot}`,
2706
+ !bookingData.time_slot && bookingData.booking_time && `, ${bookingData.booking_time}`
2707
+ ] })
2708
+ ] }),
2709
+ bookingData.equipment && /* @__PURE__ */ jsxs("div", { children: [
2710
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Event" }),
2711
+ /* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: bookingData.equipment })
2712
+ ] }),
2713
+ /* @__PURE__ */ jsxs("div", { children: [
2714
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Demo Room" }),
2715
+ /* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: bookingData.demoroom_code })
2716
+ ] }),
2717
+ /* @__PURE__ */ jsxs("div", { children: [
2718
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Visitor Info" }),
2719
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2720
+ /* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: bookingData.customer_name }),
2721
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
2722
+ /* @__PURE__ */ jsx(
2723
+ "svg",
2724
+ {
2725
+ className: "w-5 h-5",
2726
+ fill: "none",
2727
+ viewBox: "0 0 24 24",
2728
+ stroke: "currentColor",
2729
+ children: /* @__PURE__ */ jsx(
2730
+ "path",
2731
+ {
2732
+ strokeLinecap: "round",
2733
+ strokeLinejoin: "round",
2734
+ strokeWidth: 2,
2735
+ 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"
2736
+ }
2737
+ )
2738
+ }
2739
+ ),
2740
+ bookingData.phone_code && bookingData.phone_number ? /* @__PURE__ */ jsxs("span", { children: [
2741
+ bookingData.phone_code,
2742
+ " ",
2743
+ bookingData.phone_number
2744
+ ] }) : /* @__PURE__ */ jsx("span", { children: "No phone provided" })
2745
+ ] }),
2746
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
2747
+ /* @__PURE__ */ jsx(
2748
+ "svg",
2749
+ {
2750
+ className: "w-5 h-5",
2751
+ fill: "none",
2752
+ viewBox: "0 0 24 24",
2753
+ stroke: "currentColor",
2754
+ children: /* @__PURE__ */ jsx(
2755
+ "path",
2756
+ {
2757
+ strokeLinecap: "round",
2758
+ strokeLinejoin: "round",
2759
+ strokeWidth: 2,
2760
+ 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"
2761
+ }
2762
+ )
2763
+ }
2764
+ ),
2765
+ /* @__PURE__ */ jsx("span", { children: bookingData.customer_email })
2766
+ ] })
2767
+ ] })
2768
+ ] })
2769
+ ] }),
2770
+ !isCancelled && /* @__PURE__ */ jsxs("div", { className: "mt-[64px]", children: [
2771
+ /* @__PURE__ */ jsx(
2853
2772
  "button",
2854
2773
  {
2855
- onClick: onBackToHome,
2856
- className: "px-6 py-3 rounded-full bg-[#3ADB67] text-white font-medium text-base hover:bg-[#2FC257] transition-colors focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
2857
- children: "Back to Home"
2774
+ onClick: () => setShowCancelDialog(true),
2775
+ disabled: cancelLoading,
2776
+ 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",
2777
+ children: "Cancel Appointment"
2858
2778
  }
2859
- )
2860
- ] }) }) });
2861
- }
2862
- return /* @__PURE__ */ jsx("div", { className: `min-h-screen bg-[#F5F5F5] py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxs("div", { className: "max-w-2xl mx-auto", children: [
2863
- /* @__PURE__ */ jsxs("div", { className: "text-center mb-8", children: [
2864
- /* @__PURE__ */ jsx("div", { className: "w-20 h-20 mx-auto mb-6 rounded-full bg-[#3ADB67] flex items-center justify-center", children: /* @__PURE__ */ jsx(
2865
- "svg",
2779
+ ),
2780
+ cancelError && /* @__PURE__ */ jsx("p", { className: "text-sm mt-2", style: { color: "#FF4D4D" }, children: cancelError })
2781
+ ] }),
2782
+ showCancelDialog && /* @__PURE__ */ jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 px-4", children: /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-[24px] max-w-[400px] p-8 shadow-xl relative", children: [
2783
+ /* @__PURE__ */ jsx(
2784
+ "button",
2866
2785
  {
2867
- width: "48",
2868
- height: "48",
2869
- viewBox: "0 0 32 32",
2870
- fill: "none",
2871
- xmlns: "http://www.w3.org/2000/svg",
2786
+ onClick: () => setShowCancelDialog(false),
2787
+ disabled: cancelLoading,
2788
+ 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",
2789
+ "aria-label": "Close",
2872
2790
  children: /* @__PURE__ */ jsx(
2873
- "path",
2791
+ "svg",
2874
2792
  {
2875
- d: "M26.6667 8L12 22.6667L5.33334 16",
2876
- stroke: "white",
2877
- strokeWidth: "3",
2878
- strokeLinecap: "round",
2879
- strokeLinejoin: "round"
2793
+ width: "24",
2794
+ height: "24",
2795
+ viewBox: "0 0 24 24",
2796
+ fill: "none",
2797
+ xmlns: "http://www.w3.org/2000/svg",
2798
+ children: /* @__PURE__ */ jsx(
2799
+ "path",
2800
+ {
2801
+ d: "M18 6L6 18M6 6L18 18",
2802
+ stroke: "currentColor",
2803
+ strokeWidth: "2",
2804
+ strokeLinecap: "round",
2805
+ strokeLinejoin: "round"
2806
+ }
2807
+ )
2880
2808
  }
2881
2809
  )
2882
2810
  }
2883
- ) }),
2884
- /* @__PURE__ */ jsx("h1", { className: "text-[48px] font-bold text-gray-900 mb-4", children: "Booking Confirmed!" }),
2885
- /* @__PURE__ */ jsx("p", { className: "text-xl text-gray-600", children: "Your demo room booking has been successfully confirmed." })
2886
- ] }),
2887
- /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-[12px] border border-[#E4E5E6] p-8 mb-6", children: [
2888
- /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: "Booking Details" }),
2889
- /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
2890
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start py-3 border-b border-gray-100", children: [
2891
- /* @__PURE__ */ jsx("span", { className: "text-base text-gray-600 font-medium", children: "Booking ID" }),
2892
- /* @__PURE__ */ jsx("span", { className: "text-base text-gray-900 font-semibold", children: bookingData.booking_id })
2893
- ] }),
2894
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start py-3 border-b border-gray-100", children: [
2895
- /* @__PURE__ */ jsx("span", { className: "text-base text-gray-600 font-medium", children: "Date" }),
2896
- /* @__PURE__ */ jsx("span", { className: "text-base text-gray-900 font-semibold", children: bookingData.booking_date })
2897
- ] }),
2898
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start py-3 border-b border-gray-100", children: [
2899
- /* @__PURE__ */ jsx("span", { className: "text-base text-gray-600 font-medium", children: "Time" }),
2900
- /* @__PURE__ */ jsx("span", { className: "text-base text-gray-900 font-semibold", children: bookingData.booking_time })
2901
- ] }),
2902
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start py-3 border-b border-gray-100", children: [
2903
- /* @__PURE__ */ jsx("span", { className: "text-base text-gray-600 font-medium", children: "Status" }),
2904
- /* @__PURE__ */ jsx("span", { className: "inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-[#3ADB67] bg-opacity-10 text-[#3ADB67]", children: bookingData.status })
2905
- ] }),
2906
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start py-3", children: [
2907
- /* @__PURE__ */ jsx("span", { className: "text-base text-gray-600 font-medium", children: "Email" }),
2908
- /* @__PURE__ */ jsx("span", { className: "text-base text-gray-900 font-semibold", children: bookingData.customer_email })
2909
- ] })
2910
- ] })
2911
- ] }),
2912
- /* @__PURE__ */ jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-[12px] p-6 mb-8", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
2913
- /* @__PURE__ */ jsx(
2811
+ ),
2812
+ /* @__PURE__ */ jsx("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ jsx("div", { className: "w-16 h-16 rounded-full bg-[#F59E0B] flex items-center justify-center", children: /* @__PURE__ */ jsx(
2914
2813
  "svg",
2915
2814
  {
2916
- className: "w-6 h-6 text-blue-600 flex-shrink-0 mt-0.5",
2815
+ width: "32",
2816
+ height: "32",
2817
+ viewBox: "0 0 32 32",
2917
2818
  fill: "none",
2918
- viewBox: "0 0 24 24",
2919
- stroke: "currentColor",
2819
+ xmlns: "http://www.w3.org/2000/svg",
2920
2820
  children: /* @__PURE__ */ jsx(
2921
2821
  "path",
2922
2822
  {
2823
+ d: "M16 10V17M16 22H16.01",
2824
+ stroke: "white",
2825
+ strokeWidth: "3",
2923
2826
  strokeLinecap: "round",
2924
- strokeLinejoin: "round",
2925
- strokeWidth: 2,
2926
- 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"
2827
+ strokeLinejoin: "round"
2927
2828
  }
2928
2829
  )
2929
2830
  }
2930
- ),
2931
- /* @__PURE__ */ jsxs("div", { children: [
2932
- /* @__PURE__ */ jsx("h3", { className: "text-base font-semibold text-blue-900 mb-1", children: "Confirmation Email Sent" }),
2933
- /* @__PURE__ */ jsxs("p", { className: "text-sm text-blue-800", children: [
2934
- "A confirmation email has been sent to ",
2935
- /* @__PURE__ */ jsx("strong", { children: bookingData.customer_email }),
2936
- " with all the booking details and instructions."
2937
- ] })
2831
+ ) }) }),
2832
+ /* @__PURE__ */ jsxs("div", { className: "text-center mb-8", children: [
2833
+ /* @__PURE__ */ jsx("h3", { className: "text-[18px] font-semibold text-gray-900 mb-2", children: "Are you sure you want to cancel?" }),
2834
+ /* @__PURE__ */ jsx("p", { className: "text-[14px] text-gray-600", children: "You won't be able to restore the schedule." })
2835
+ ] }),
2836
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-3 justify-center", children: [
2837
+ /* @__PURE__ */ jsx(
2838
+ "button",
2839
+ {
2840
+ onClick: () => setShowCancelDialog(false),
2841
+ disabled: cancelLoading,
2842
+ 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]",
2843
+ children: "Back"
2844
+ }
2845
+ ),
2846
+ /* @__PURE__ */ jsx(
2847
+ "button",
2848
+ {
2849
+ onClick: handleCancelAppointment,
2850
+ disabled: cancelLoading,
2851
+ 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",
2852
+ children: cancelLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
2853
+ /* @__PURE__ */ jsxs(
2854
+ "svg",
2855
+ {
2856
+ className: "animate-spin h-5 w-5",
2857
+ xmlns: "http://www.w3.org/2000/svg",
2858
+ fill: "none",
2859
+ viewBox: "0 0 24 24",
2860
+ children: [
2861
+ /* @__PURE__ */ jsx(
2862
+ "circle",
2863
+ {
2864
+ className: "opacity-25",
2865
+ cx: "12",
2866
+ cy: "12",
2867
+ r: "10",
2868
+ stroke: "currentColor",
2869
+ strokeWidth: "4"
2870
+ }
2871
+ ),
2872
+ /* @__PURE__ */ jsx(
2873
+ "path",
2874
+ {
2875
+ className: "opacity-75",
2876
+ fill: "currentColor",
2877
+ 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"
2878
+ }
2879
+ )
2880
+ ]
2881
+ }
2882
+ ),
2883
+ "Canceling..."
2884
+ ] }) : "Cancel Appointment"
2885
+ }
2886
+ )
2938
2887
  ] })
2939
- ] }) }),
2940
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row gap-4", children: [
2941
- onBackToHome && /* @__PURE__ */ jsx(
2942
- "button",
2943
- {
2944
- onClick: onBackToHome,
2945
- className: "flex-1 px-6 py-4 rounded-full bg-[#3ADB67] text-white font-medium text-base hover:bg-[#2FC257] transition-colors focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
2946
- children: "Back to Home"
2947
- }
2948
- ),
2949
- /* @__PURE__ */ jsx(
2950
- "button",
2951
- {
2952
- onClick: () => window.print(),
2953
- className: "flex-1 px-6 py-4 rounded-full border-2 border-[#3ADB67] text-[#3ADB67] font-medium text-base hover:bg-[#3ADB67] hover:bg-opacity-5 transition-colors focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
2954
- children: "Print Confirmation"
2955
- }
2956
- )
2957
- ] })
2888
+ ] }) })
2958
2889
  ] }) });
2959
2890
  };
2960
2891
 
@@ -3096,6 +3027,6 @@ var ThemeProvider = ({
3096
3027
  return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: { theme: theme2 }, children });
3097
3028
  };
3098
3029
 
3099
- export { BookingForm, BookingSuccess, DemoRoom, DemoRoomApiClient, DemoRoomDetail, ThemeProvider, cn, createDemoRoomApi, useCreateBooking, useDemoRoom, useDemoRooms, useQuestionnaire, useTheme, useTimeslots };
3030
+ export { BookingForm, BookingSuccess, DemoRoom, DemoRoomApiClient, ThemeProvider, cn, createDemoRoomApi, useBooking, useCancelBooking, useCreateBooking, useDemoRoom, useDemoRooms, useQuestionnaire, useTheme, useTimeslots };
3100
3031
  //# sourceMappingURL=index.mjs.map
3101
3032
  //# sourceMappingURL=index.mjs.map