@bigz-app/booking-widget 0.3.8 → 0.3.10
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/booking-widget.js +426 -107
- package/dist/booking-widget.js.map +1 -1
- package/dist/components/PromoDialog.d.ts +7 -0
- package/dist/components/PromoDialog.d.ts.map +1 -0
- package/dist/components/UniversalBookingWidget.d.ts.map +1 -1
- package/dist/index.cjs +426 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +426 -107
- package/dist/index.esm.js.map +1 -1
- package/package.json +8 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromoDialog.d.ts","sourceRoot":"","sources":["../../src/components/PromoDialog.tsx"],"names":[],"mappings":"AAKA,UAAU,gBAAgB;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,gBAAgB,sCAocpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UniversalBookingWidget.d.ts","sourceRoot":"","sources":["../../src/components/UniversalBookingWidget.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UniversalBookingWidget.d.ts","sourceRoot":"","sources":["../../src/components/UniversalBookingWidget.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,SAAS;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE;QACT,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACd,CAAC;IACF,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAA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B,CAAA;CAAE,2CA2iChG"}
|
package/dist/index.cjs
CHANGED
|
@@ -12245,6 +12245,282 @@ function NextEventsPreview({ events, onEventSelect, onShowAll, showAllButtonText
|
|
|
12245
12245
|
` })] }));
|
|
12246
12246
|
}
|
|
12247
12247
|
|
|
12248
|
+
function PromoDialog({ onClose, onCtaClick }) {
|
|
12249
|
+
const [copied, setCopied] = React__default.useState(false);
|
|
12250
|
+
const [isVisible, setIsVisible] = React__default.useState(false);
|
|
12251
|
+
const [portalContainer, setPortalContainer] = React__default.useState(null);
|
|
12252
|
+
// Hardcoded Xmas surf school content
|
|
12253
|
+
const discountCode = "X-MAS";
|
|
12254
|
+
// Create portal container on mount to escape stacking context issues
|
|
12255
|
+
React__default.useEffect(() => {
|
|
12256
|
+
const container = document.createElement("div");
|
|
12257
|
+
container.id = "bigz-promo-dialog-portal";
|
|
12258
|
+
container.style.position = "relative";
|
|
12259
|
+
container.style.zIndex = "2147483647"; // Maximum z-index value
|
|
12260
|
+
document.body.appendChild(container);
|
|
12261
|
+
setPortalContainer(container);
|
|
12262
|
+
return () => {
|
|
12263
|
+
document.body.removeChild(container);
|
|
12264
|
+
};
|
|
12265
|
+
}, []);
|
|
12266
|
+
// Animate in on mount
|
|
12267
|
+
React__default.useEffect(() => {
|
|
12268
|
+
const timer = setTimeout(() => setIsVisible(true), 50);
|
|
12269
|
+
return () => clearTimeout(timer);
|
|
12270
|
+
}, []);
|
|
12271
|
+
const handleCopyCode = async () => {
|
|
12272
|
+
try {
|
|
12273
|
+
await navigator.clipboard.writeText(discountCode);
|
|
12274
|
+
setCopied(true);
|
|
12275
|
+
setTimeout(() => setCopied(false), 2000);
|
|
12276
|
+
}
|
|
12277
|
+
catch (err) {
|
|
12278
|
+
// Fallback for older browsers
|
|
12279
|
+
const textArea = document.createElement("textarea");
|
|
12280
|
+
textArea.value = discountCode;
|
|
12281
|
+
document.body.appendChild(textArea);
|
|
12282
|
+
textArea.select();
|
|
12283
|
+
document.execCommand("copy");
|
|
12284
|
+
document.body.removeChild(textArea);
|
|
12285
|
+
setCopied(true);
|
|
12286
|
+
setTimeout(() => setCopied(false), 2000);
|
|
12287
|
+
}
|
|
12288
|
+
};
|
|
12289
|
+
const handleClose = () => {
|
|
12290
|
+
setIsVisible(false);
|
|
12291
|
+
setTimeout(onClose, 200);
|
|
12292
|
+
};
|
|
12293
|
+
const handleCtaClick = () => {
|
|
12294
|
+
setIsVisible(false);
|
|
12295
|
+
setTimeout(onCtaClick, 200);
|
|
12296
|
+
};
|
|
12297
|
+
// Don't render until portal container is ready
|
|
12298
|
+
if (!portalContainer) {
|
|
12299
|
+
return null;
|
|
12300
|
+
}
|
|
12301
|
+
const dialogContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("style", { children: `
|
|
12302
|
+
@keyframes promo-wave {
|
|
12303
|
+
0%, 100% { transform: translateX(0) translateY(0); }
|
|
12304
|
+
25% { transform: translateX(5px) translateY(-3px); }
|
|
12305
|
+
50% { transform: translateX(0) translateY(-5px); }
|
|
12306
|
+
75% { transform: translateX(-5px) translateY(-3px); }
|
|
12307
|
+
}
|
|
12308
|
+
@keyframes promo-float {
|
|
12309
|
+
0%, 100% { transform: translateY(0); }
|
|
12310
|
+
50% { transform: translateY(-8px); }
|
|
12311
|
+
}
|
|
12312
|
+
@keyframes promo-shimmer {
|
|
12313
|
+
0% { background-position: -200% center; }
|
|
12314
|
+
100% { background-position: 200% center; }
|
|
12315
|
+
}
|
|
12316
|
+
@keyframes promo-sparkle {
|
|
12317
|
+
0%, 100% { opacity: 0.3; transform: scale(1); }
|
|
12318
|
+
50% { opacity: 1; transform: scale(1.2); }
|
|
12319
|
+
}
|
|
12320
|
+
@keyframes promo-snow {
|
|
12321
|
+
0% { transform: translateY(-10px) rotate(0deg); opacity: 0; }
|
|
12322
|
+
10% { opacity: 1; }
|
|
12323
|
+
90% { opacity: 1; }
|
|
12324
|
+
100% { transform: translateY(350px) rotate(360deg); opacity: 0; }
|
|
12325
|
+
}
|
|
12326
|
+
` }), jsxRuntime.jsx("div", { onClick: handleClose, style: {
|
|
12327
|
+
position: "fixed",
|
|
12328
|
+
inset: 0,
|
|
12329
|
+
backgroundColor: "rgba(0, 20, 40, 0.85)",
|
|
12330
|
+
backdropFilter: "blur(8px)",
|
|
12331
|
+
zIndex: 60,
|
|
12332
|
+
opacity: isVisible ? 1 : 0,
|
|
12333
|
+
transition: "opacity 300ms ease-out",
|
|
12334
|
+
} }), jsxRuntime.jsx("div", { style: {
|
|
12335
|
+
position: "fixed",
|
|
12336
|
+
top: "50%",
|
|
12337
|
+
left: "50%",
|
|
12338
|
+
transform: `translate(-50%, -50%) scale(${isVisible ? 1 : 0.9})`,
|
|
12339
|
+
zIndex: 61,
|
|
12340
|
+
width: "92%",
|
|
12341
|
+
maxWidth: "440px",
|
|
12342
|
+
opacity: isVisible ? 1 : 0,
|
|
12343
|
+
transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
12344
|
+
}, children: jsxRuntime.jsxs("div", { style: {
|
|
12345
|
+
position: "relative",
|
|
12346
|
+
background: "linear-gradient(165deg, #0c4a6e 0%, #0e7490 40%, #0891b2 100%)",
|
|
12347
|
+
borderRadius: "28px",
|
|
12348
|
+
overflow: "hidden",
|
|
12349
|
+
boxShadow: "0 25px 60px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.1), inset 0 1px 0 rgba(255,255,255,0.2)",
|
|
12350
|
+
}, children: [Array.from({ length: 15 }).map((_, i) => (jsxRuntime.jsx("div", { style: {
|
|
12351
|
+
position: "absolute",
|
|
12352
|
+
left: `${5 + Math.random() * 90}%`,
|
|
12353
|
+
top: "-10px",
|
|
12354
|
+
fontSize: `${10 + Math.random() * 14}px`,
|
|
12355
|
+
color: "white",
|
|
12356
|
+
opacity: 0,
|
|
12357
|
+
animation: `promo-snow ${4 + Math.random() * 3}s linear infinite`,
|
|
12358
|
+
animationDelay: `${Math.random() * 4}s`,
|
|
12359
|
+
pointerEvents: "none",
|
|
12360
|
+
zIndex: 1,
|
|
12361
|
+
}, children: "\u2744" }, i))), jsxRuntime.jsxs("div", { style: {
|
|
12362
|
+
position: "relative",
|
|
12363
|
+
height: "180px",
|
|
12364
|
+
background: "linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(12,74,110,0.8) 100%)",
|
|
12365
|
+
display: "flex",
|
|
12366
|
+
alignItems: "center",
|
|
12367
|
+
justifyContent: "center",
|
|
12368
|
+
overflow: "hidden",
|
|
12369
|
+
}, children: [jsxRuntime.jsx("img", { src: "https://images.unsplash.com/photo-1502680390469-be75c86b636f?w=600&q=80", alt: "Surfer at sunset", style: {
|
|
12370
|
+
position: "absolute",
|
|
12371
|
+
inset: 0,
|
|
12372
|
+
width: "100%",
|
|
12373
|
+
height: "100%",
|
|
12374
|
+
objectFit: "cover",
|
|
12375
|
+
opacity: 0.6,
|
|
12376
|
+
} }), jsxRuntime.jsx("div", { style: {
|
|
12377
|
+
position: "absolute",
|
|
12378
|
+
inset: 0,
|
|
12379
|
+
background: "linear-gradient(180deg, rgba(12,74,110,0.3) 0%, rgba(12,74,110,0.95) 100%)",
|
|
12380
|
+
} }), jsxRuntime.jsx("div", { style: {
|
|
12381
|
+
position: "relative",
|
|
12382
|
+
zIndex: 2,
|
|
12383
|
+
fontSize: "64px",
|
|
12384
|
+
animation: "promo-float 3s ease-in-out infinite",
|
|
12385
|
+
filter: "drop-shadow(0 8px 16px rgba(0,0,0,0.4))",
|
|
12386
|
+
}, children: "\uD83C\uDFC4\u200D\u2642\uFE0F" }), jsxRuntime.jsx("div", { style: {
|
|
12387
|
+
position: "absolute",
|
|
12388
|
+
top: "16px",
|
|
12389
|
+
left: "20px",
|
|
12390
|
+
fontSize: "28px",
|
|
12391
|
+
animation: "promo-sparkle 2s ease-in-out infinite",
|
|
12392
|
+
}, children: "\uD83C\uDF84" }), jsxRuntime.jsx("div", { style: {
|
|
12393
|
+
position: "absolute",
|
|
12394
|
+
top: "20px",
|
|
12395
|
+
right: "20px",
|
|
12396
|
+
fontSize: "24px",
|
|
12397
|
+
animation: "promo-sparkle 2s ease-in-out infinite 0.5s",
|
|
12398
|
+
}, children: "\u2B50" })] }), jsxRuntime.jsx("button", { onClick: handleClose, style: {
|
|
12399
|
+
position: "absolute",
|
|
12400
|
+
top: "16px",
|
|
12401
|
+
right: "16px",
|
|
12402
|
+
width: "36px",
|
|
12403
|
+
height: "36px",
|
|
12404
|
+
borderRadius: "50%",
|
|
12405
|
+
border: "none",
|
|
12406
|
+
background: "rgba(0, 0, 0, 0.3)",
|
|
12407
|
+
backdropFilter: "blur(4px)",
|
|
12408
|
+
color: "white",
|
|
12409
|
+
fontSize: "22px",
|
|
12410
|
+
cursor: "pointer",
|
|
12411
|
+
display: "flex",
|
|
12412
|
+
alignItems: "center",
|
|
12413
|
+
justifyContent: "center",
|
|
12414
|
+
transition: "all 150ms ease",
|
|
12415
|
+
zIndex: 10,
|
|
12416
|
+
lineHeight: 1,
|
|
12417
|
+
}, onMouseEnter: (e) => {
|
|
12418
|
+
e.currentTarget.style.background = "rgba(0, 0, 0, 0.5)";
|
|
12419
|
+
e.currentTarget.style.transform = "scale(1.1)";
|
|
12420
|
+
}, onMouseLeave: (e) => {
|
|
12421
|
+
e.currentTarget.style.background = "rgba(0, 0, 0, 0.3)";
|
|
12422
|
+
e.currentTarget.style.transform = "scale(1)";
|
|
12423
|
+
}, children: "\u00D7" }), jsxRuntime.jsxs("div", { style: { padding: "28px 28px 32px", textAlign: "center", position: "relative", zIndex: 2 }, children: [jsxRuntime.jsx("h2", { style: {
|
|
12424
|
+
fontSize: "26px",
|
|
12425
|
+
fontWeight: "800",
|
|
12426
|
+
color: "white",
|
|
12427
|
+
marginBottom: "6px",
|
|
12428
|
+
textShadow: "0 2px 8px rgba(0,0,0,0.3)",
|
|
12429
|
+
letterSpacing: "-0.5px",
|
|
12430
|
+
}, children: "Frohe Weihnachten! \uD83C\uDF85" }), jsxRuntime.jsxs("p", { style: {
|
|
12431
|
+
fontSize: "17px",
|
|
12432
|
+
color: "rgba(255, 255, 255, 0.9)",
|
|
12433
|
+
marginBottom: "20px",
|
|
12434
|
+
lineHeight: 1.5,
|
|
12435
|
+
}, children: ["Schenk dir oder deinen Liebsten", jsxRuntime.jsx("br", {}), jsxRuntime.jsx("strong", { style: { color: "#fbbf24" }, children: "10% Rabatt" }), " auf alle Kurse!"] }), jsxRuntime.jsxs("div", { style: {
|
|
12436
|
+
background: "white",
|
|
12437
|
+
borderRadius: "16px",
|
|
12438
|
+
padding: "18px 20px",
|
|
12439
|
+
marginBottom: "20px",
|
|
12440
|
+
boxShadow: "0 8px 24px rgba(0,0,0,0.15), inset 0 -2px 0 rgba(0,0,0,0.05)",
|
|
12441
|
+
}, children: [jsxRuntime.jsx("p", { style: {
|
|
12442
|
+
fontSize: "11px",
|
|
12443
|
+
textTransform: "uppercase",
|
|
12444
|
+
letterSpacing: "1.5px",
|
|
12445
|
+
color: "#64748b",
|
|
12446
|
+
marginBottom: "10px",
|
|
12447
|
+
fontWeight: "600",
|
|
12448
|
+
}, children: "Dein Geschenk-Code" }), jsxRuntime.jsxs("div", { style: {
|
|
12449
|
+
display: "flex",
|
|
12450
|
+
alignItems: "center",
|
|
12451
|
+
justifyContent: "center",
|
|
12452
|
+
gap: "14px",
|
|
12453
|
+
}, children: [jsxRuntime.jsx("div", { style: {
|
|
12454
|
+
background: "linear-gradient(135deg, #dc2626 0%, #b91c1c 100%)",
|
|
12455
|
+
padding: "10px 20px",
|
|
12456
|
+
borderRadius: "10px",
|
|
12457
|
+
boxShadow: "0 4px 12px rgba(220, 38, 38, 0.3)",
|
|
12458
|
+
}, children: jsxRuntime.jsx("span", { style: {
|
|
12459
|
+
fontSize: "28px",
|
|
12460
|
+
fontWeight: "900",
|
|
12461
|
+
color: "white",
|
|
12462
|
+
letterSpacing: "6px",
|
|
12463
|
+
textShadow: "0 2px 4px rgba(0,0,0,0.2)",
|
|
12464
|
+
}, children: discountCode }) }), jsxRuntime.jsx("button", { onClick: handleCopyCode, style: {
|
|
12465
|
+
padding: "12px 16px",
|
|
12466
|
+
borderRadius: "10px",
|
|
12467
|
+
border: "2px solid",
|
|
12468
|
+
borderColor: copied ? "#22c55e" : "#e2e8f0",
|
|
12469
|
+
background: copied ? "#dcfce7" : "#f8fafc",
|
|
12470
|
+
color: copied ? "#15803d" : "#475569",
|
|
12471
|
+
fontSize: "13px",
|
|
12472
|
+
fontWeight: "600",
|
|
12473
|
+
cursor: "pointer",
|
|
12474
|
+
transition: "all 150ms ease",
|
|
12475
|
+
display: "flex",
|
|
12476
|
+
alignItems: "center",
|
|
12477
|
+
gap: "6px",
|
|
12478
|
+
whiteSpace: "nowrap",
|
|
12479
|
+
}, children: copied ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: "\u2713 Kopiert!" })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: [jsxRuntime.jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }), jsxRuntime.jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })] }), "Kopieren"] })) })] })] }), jsxRuntime.jsx("div", { style: {
|
|
12480
|
+
display: "flex",
|
|
12481
|
+
justifyContent: "center",
|
|
12482
|
+
gap: "8px",
|
|
12483
|
+
marginBottom: "20px",
|
|
12484
|
+
flexWrap: "wrap",
|
|
12485
|
+
}, children: ["🏄 Surfen", "🪁 Wingen", "🏄♀️ SUP", "💨 Windsurfen"].map((activity) => (jsxRuntime.jsx("span", { style: {
|
|
12486
|
+
background: "rgba(255,255,255,0.15)",
|
|
12487
|
+
backdropFilter: "blur(4px)",
|
|
12488
|
+
padding: "6px 12px",
|
|
12489
|
+
borderRadius: "20px",
|
|
12490
|
+
fontSize: "13px",
|
|
12491
|
+
color: "white",
|
|
12492
|
+
fontWeight: "500",
|
|
12493
|
+
}, children: activity }, activity))) }), jsxRuntime.jsxs("button", { onClick: handleCtaClick, style: {
|
|
12494
|
+
width: "100%",
|
|
12495
|
+
padding: "18px 24px",
|
|
12496
|
+
borderRadius: "14px",
|
|
12497
|
+
border: "none",
|
|
12498
|
+
background: "linear-gradient(135deg, #f59e0b 0%, #d97706 100%)",
|
|
12499
|
+
color: "white",
|
|
12500
|
+
fontSize: "18px",
|
|
12501
|
+
fontWeight: "700",
|
|
12502
|
+
cursor: "pointer",
|
|
12503
|
+
transition: "all 150ms ease",
|
|
12504
|
+
boxShadow: "0 8px 24px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255,255,255,0.2)",
|
|
12505
|
+
display: "flex",
|
|
12506
|
+
alignItems: "center",
|
|
12507
|
+
justifyContent: "center",
|
|
12508
|
+
gap: "10px",
|
|
12509
|
+
}, onMouseEnter: (e) => {
|
|
12510
|
+
e.currentTarget.style.transform = "translateY(-2px)";
|
|
12511
|
+
e.currentTarget.style.boxShadow = "0 12px 28px rgba(245, 158, 11, 0.5), inset 0 1px 0 rgba(255,255,255,0.2)";
|
|
12512
|
+
}, onMouseLeave: (e) => {
|
|
12513
|
+
e.currentTarget.style.transform = "translateY(0)";
|
|
12514
|
+
e.currentTarget.style.boxShadow = "0 8px 24px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255,255,255,0.2)";
|
|
12515
|
+
}, children: [jsxRuntime.jsx("span", { style: { animation: "promo-wave 2s ease-in-out infinite" }, children: "\uD83C\uDF81" }), "Jetzt Kurs buchen", jsxRuntime.jsx("span", { children: "\u2192" })] }), jsxRuntime.jsx("p", { style: {
|
|
12516
|
+
marginTop: "16px",
|
|
12517
|
+
fontSize: "12px",
|
|
12518
|
+
color: "rgba(255,255,255,0.6)",
|
|
12519
|
+
}, children: "G\u00FCltig f\u00FCr alle Buchungen bis 31. Dezember 2025" })] })] }) })] }));
|
|
12520
|
+
// Use portal to render at document body level, escaping any stacking context
|
|
12521
|
+
return ReactDOM.createPortal(dialogContent, portalContainer);
|
|
12522
|
+
}
|
|
12523
|
+
|
|
12248
12524
|
// Predefined themes & Style Provider have been moved to ../styles/StyleProvider.tsx
|
|
12249
12525
|
// Main widget component
|
|
12250
12526
|
function UniversalBookingWidget({ config: baseConfig }) {
|
|
@@ -12287,6 +12563,9 @@ function UniversalBookingWidget({ config: baseConfig }) {
|
|
|
12287
12563
|
// PERFORMANCE OPTIMIZATION: Lazy component loading
|
|
12288
12564
|
const [shouldRenderInstanceSelection, setShouldRenderInstanceSelection] = React__default.useState(false);
|
|
12289
12565
|
const [shouldRenderBookingForm, setShouldRenderBookingForm] = React__default.useState(false);
|
|
12566
|
+
// Promo dialog state
|
|
12567
|
+
const [showPromoDialog, setShowPromoDialog] = React__default.useState(false);
|
|
12568
|
+
const [widgetContainerRef, setWidgetContainerRef] = React__default.useState(null);
|
|
12290
12569
|
// Determine initial step and load data
|
|
12291
12570
|
React__default.useEffect(() => {
|
|
12292
12571
|
const initializeWidget = async () => {
|
|
@@ -12361,6 +12640,46 @@ function UniversalBookingWidget({ config: baseConfig }) {
|
|
|
12361
12640
|
setShouldRenderBookingForm(true);
|
|
12362
12641
|
}
|
|
12363
12642
|
}, [currentStep, shouldRenderInstanceSelection, shouldRenderBookingForm]);
|
|
12643
|
+
// Promo dialog: show Xmas promo once per user during holiday season, prevent double-opening across multiple widgets
|
|
12644
|
+
React__default.useEffect(() => {
|
|
12645
|
+
// Only show during holiday season (December and January)
|
|
12646
|
+
const now = new Date();
|
|
12647
|
+
const month = now.getMonth(); // 0 = January, 11 = December
|
|
12648
|
+
const isHolidaySeason = month === 11 || month === 0; // December (11) or January (0)
|
|
12649
|
+
if (!isHolidaySeason) {
|
|
12650
|
+
return;
|
|
12651
|
+
}
|
|
12652
|
+
const promoId = "xmas-2024";
|
|
12653
|
+
const storageKey = `bigz-promo-${promoId}-shown`;
|
|
12654
|
+
const globalFlagKey = `__bigzPromoShown_${promoId}`;
|
|
12655
|
+
// Check if already shown in this session (localStorage) or claimed by another widget (global flag)
|
|
12656
|
+
const alreadyShown = localStorage.getItem(storageKey) === "true";
|
|
12657
|
+
const claimedByOtherWidget = window[globalFlagKey] === true;
|
|
12658
|
+
if (alreadyShown || claimedByOtherWidget) {
|
|
12659
|
+
return;
|
|
12660
|
+
}
|
|
12661
|
+
// Claim this promo for this widget instance (prevents other widgets from showing it)
|
|
12662
|
+
window[globalFlagKey] = true;
|
|
12663
|
+
// Show the dialog after a short delay for better UX
|
|
12664
|
+
const timer = setTimeout(() => {
|
|
12665
|
+
setShowPromoDialog(true);
|
|
12666
|
+
}, 1000);
|
|
12667
|
+
return () => clearTimeout(timer);
|
|
12668
|
+
}, []);
|
|
12669
|
+
// Handle promo dialog close
|
|
12670
|
+
const handlePromoDialogClose = () => {
|
|
12671
|
+
setShowPromoDialog(false);
|
|
12672
|
+
localStorage.setItem("bigz-promo-xmas-2024-shown", "true");
|
|
12673
|
+
};
|
|
12674
|
+
// Handle promo dialog CTA click - scroll to widget
|
|
12675
|
+
const handlePromoCtaClick = () => {
|
|
12676
|
+
setShowPromoDialog(false);
|
|
12677
|
+
localStorage.setItem("bigz-promo-xmas-2024-shown", "true");
|
|
12678
|
+
// Scroll to the widget container
|
|
12679
|
+
if (widgetContainerRef) {
|
|
12680
|
+
widgetContainerRef.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
12681
|
+
}
|
|
12682
|
+
};
|
|
12364
12683
|
const loadEventTypes = async () => {
|
|
12365
12684
|
const requestBody = {
|
|
12366
12685
|
organizationId: config.organizationId,
|
|
@@ -12760,104 +13079,104 @@ function UniversalBookingWidget({ config: baseConfig }) {
|
|
|
12760
13079
|
// Main view based on view mode
|
|
12761
13080
|
if (viewMode === "next-events" && showingPreview) {
|
|
12762
13081
|
// Next events preview mode
|
|
12763
|
-
return (jsxRuntime.jsxs(StyleProvider, { config: config, children: [jsxRuntime.jsx(NextEventsPreview, { events: upcomingEvents, onEventSelect: handleUpcomingEventSelect, onShowAll: handleShowAllEvents, showAllButtonText: nextEventsSettings.showAllButtonText, showAllButton: nextEventsSettings.showAllButton, isLoadingEventDetails: isLoadingEventDetails, isLoadingShowAll: isLoadingShowAll, isLoading: isLoading }), shouldRenderBookingForm && eventDetails && (jsxRuntime.jsx(BookingForm, { config: config, eventDetails: eventDetails, stripePromise: stripePromise, onSuccess: handleBookingSuccess, onError: handleBookingError, onBackToEventInstances: () => {
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
|
|
12775
|
-
|
|
12776
|
-
|
|
12777
|
-
|
|
12778
|
-
|
|
12779
|
-
|
|
12780
|
-
|
|
12781
|
-
|
|
12782
|
-
|
|
12783
|
-
|
|
12784
|
-
|
|
12785
|
-
|
|
12786
|
-
|
|
12787
|
-
|
|
12788
|
-
|
|
12789
|
-
|
|
12790
|
-
|
|
13082
|
+
return (jsxRuntime.jsxs(StyleProvider, { config: config, children: [jsxRuntime.jsxs("div", { ref: setWidgetContainerRef, children: [jsxRuntime.jsx(NextEventsPreview, { events: upcomingEvents, onEventSelect: handleUpcomingEventSelect, onShowAll: handleShowAllEvents, showAllButtonText: nextEventsSettings.showAllButtonText, showAllButton: nextEventsSettings.showAllButton, isLoadingEventDetails: isLoadingEventDetails, isLoadingShowAll: isLoadingShowAll, isLoading: isLoading }), shouldRenderBookingForm && eventDetails && (jsxRuntime.jsx(BookingForm, { config: config, eventDetails: eventDetails, stripePromise: stripePromise, onSuccess: handleBookingSuccess, onError: handleBookingError, onBackToEventInstances: () => {
|
|
13083
|
+
setCurrentStep("eventTypes");
|
|
13084
|
+
setShowingPreview(true);
|
|
13085
|
+
setEventDetails(null);
|
|
13086
|
+
}, onBackToEventTypes: () => {
|
|
13087
|
+
setCurrentStep("eventTypes");
|
|
13088
|
+
setShowingPreview(true);
|
|
13089
|
+
setEventDetails(null);
|
|
13090
|
+
}, selectedEventType: selectedEventType, selectedEventInstance: selectedEventInstance, isOpen: currentStep === "booking" && !!eventDetails, onClose: () => {
|
|
13091
|
+
setCurrentStep("eventTypes");
|
|
13092
|
+
setShowingPreview(true);
|
|
13093
|
+
setEventDetails(null);
|
|
13094
|
+
}, systemConfig: systemConfig })), jsxRuntime.jsx(BookingSuccessModal, { isOpen: isSuccess, onClose: () => {
|
|
13095
|
+
setIsSuccess(false);
|
|
13096
|
+
setCurrentStep("eventTypes");
|
|
13097
|
+
setShowingPreview(true);
|
|
13098
|
+
// Reset state
|
|
13099
|
+
setSuccessPaymentIntentId(null);
|
|
13100
|
+
// Reset lazy loading flags
|
|
13101
|
+
setShouldRenderInstanceSelection(false);
|
|
13102
|
+
setShouldRenderBookingForm(false);
|
|
13103
|
+
// Clean up URL to remove Stripe parameters
|
|
13104
|
+
const url = new URL(window.location.href);
|
|
13105
|
+
url.searchParams.delete("payment_intent");
|
|
13106
|
+
url.searchParams.delete("payment_intent_client_secret");
|
|
13107
|
+
url.searchParams.delete("redirect_status");
|
|
13108
|
+
window.history.replaceState({}, "", url.toString());
|
|
13109
|
+
}, config: config, onError: setError, paymentIntentId: successPaymentIntentId })] }), showPromoDialog && (jsxRuntime.jsx(PromoDialog, { onClose: handlePromoDialogClose, onCtaClick: handlePromoCtaClick }))] }));
|
|
12791
13110
|
}
|
|
12792
13111
|
if (viewMode === "next-events" && !showingPreview && currentStep === "eventInstances") {
|
|
12793
13112
|
// Show all events for the single event type
|
|
12794
|
-
return (jsxRuntime.jsxs(StyleProvider, { config: config, children: [shouldRenderInstanceSelection && (jsxRuntime.jsx(EventInstanceSelection, { eventInstances: eventInstances, selectedEventType: selectedEventType, onEventInstanceSelect: handleEventInstanceSelect, onBackToEventTypes: () => {
|
|
12795
|
-
|
|
12796
|
-
|
|
12797
|
-
|
|
12798
|
-
|
|
12799
|
-
|
|
12800
|
-
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
12806
|
-
|
|
12807
|
-
|
|
12808
|
-
|
|
12809
|
-
|
|
12810
|
-
|
|
12811
|
-
|
|
12812
|
-
|
|
12813
|
-
|
|
12814
|
-
|
|
12815
|
-
|
|
13113
|
+
return (jsxRuntime.jsxs(StyleProvider, { config: config, children: [jsxRuntime.jsxs("div", { ref: setWidgetContainerRef, children: [shouldRenderInstanceSelection && (jsxRuntime.jsx(EventInstanceSelection, { eventInstances: eventInstances, selectedEventType: selectedEventType, onEventInstanceSelect: handleEventInstanceSelect, onBackToEventTypes: () => {
|
|
13114
|
+
setShowingPreview(true);
|
|
13115
|
+
setCurrentStep("eventTypes");
|
|
13116
|
+
}, isOpen: currentStep === "eventInstances", onClose: () => {
|
|
13117
|
+
setShowingPreview(true);
|
|
13118
|
+
setCurrentStep("eventTypes");
|
|
13119
|
+
}, isLoadingEventInstances: isLoadingEventInstances, isLoadingEventDetails: isLoadingEventDetails })), jsxRuntime.jsx(BookingSuccessModal, { isOpen: isSuccess, onClose: () => {
|
|
13120
|
+
setIsSuccess(false);
|
|
13121
|
+
setCurrentStep("eventTypes");
|
|
13122
|
+
setShowingPreview(true);
|
|
13123
|
+
// Reset state
|
|
13124
|
+
setSuccessPaymentIntentId(null);
|
|
13125
|
+
// Reset lazy loading flags
|
|
13126
|
+
setShouldRenderInstanceSelection(false);
|
|
13127
|
+
setShouldRenderBookingForm(false);
|
|
13128
|
+
// Clean up URL to remove Stripe parameters
|
|
13129
|
+
const url = new URL(window.location.href);
|
|
13130
|
+
url.searchParams.delete("payment_intent");
|
|
13131
|
+
url.searchParams.delete("payment_intent_client_secret");
|
|
13132
|
+
url.searchParams.delete("redirect_status");
|
|
13133
|
+
window.history.replaceState({}, "", url.toString());
|
|
13134
|
+
}, config: config, onError: setError, paymentIntentId: successPaymentIntentId })] }), showPromoDialog && (jsxRuntime.jsx(PromoDialog, { onClose: handlePromoDialogClose, onCtaClick: handlePromoCtaClick }))] }));
|
|
12816
13135
|
}
|
|
12817
13136
|
if (viewMode === "button" && (isSingleEventTypeMode || isDirectInstanceMode)) {
|
|
12818
13137
|
// Button mode - show button that opens sidebar/booking directly
|
|
12819
|
-
return (jsxRuntime.
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
|
|
12827
|
-
|
|
12828
|
-
|
|
12829
|
-
|
|
12830
|
-
|
|
12831
|
-
|
|
12832
|
-
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
|
|
12836
|
-
|
|
12837
|
-
|
|
12838
|
-
|
|
12839
|
-
|
|
12840
|
-
|
|
12841
|
-
|
|
12842
|
-
|
|
12843
|
-
|
|
12844
|
-
|
|
12845
|
-
|
|
12846
|
-
|
|
12847
|
-
|
|
12848
|
-
|
|
12849
|
-
|
|
12850
|
-
|
|
12851
|
-
|
|
12852
|
-
|
|
12853
|
-
|
|
12854
|
-
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
|
|
13138
|
+
return (jsxRuntime.jsxs(StyleProvider, { config: config, children: [jsxRuntime.jsxs("div", { ref: setWidgetContainerRef, style: {
|
|
13139
|
+
display: "flex",
|
|
13140
|
+
justifyContent: "center",
|
|
13141
|
+
alignItems: "center",
|
|
13142
|
+
minHeight: "120px",
|
|
13143
|
+
}, children: [jsxRuntime.jsx("button", { type: "button", style: {
|
|
13144
|
+
backgroundColor: "var(--bw-highlight-color)",
|
|
13145
|
+
color: "white",
|
|
13146
|
+
padding: "16px 32px",
|
|
13147
|
+
border: "none",
|
|
13148
|
+
borderRadius: "var(--bw-border-radius)",
|
|
13149
|
+
fontSize: "18px",
|
|
13150
|
+
fontWeight: 600,
|
|
13151
|
+
fontFamily: "var(--bw-font-family)",
|
|
13152
|
+
boxShadow: "var(--bw-shadow-md)",
|
|
13153
|
+
cursor: "pointer",
|
|
13154
|
+
}, onClick: () => {
|
|
13155
|
+
if (isDirectInstanceMode) {
|
|
13156
|
+
setCurrentStep("booking");
|
|
13157
|
+
setShouldRenderBookingForm(true);
|
|
13158
|
+
}
|
|
13159
|
+
else {
|
|
13160
|
+
setSidebarOpen(true);
|
|
13161
|
+
setShouldRenderInstanceSelection(true);
|
|
13162
|
+
}
|
|
13163
|
+
}, children: config.buttonText ||
|
|
13164
|
+
(isDirectInstanceMode ? "Jetzt buchen" : "Jetzt Termin auswählen") }), shouldRenderInstanceSelection && (jsxRuntime.jsx(EventInstanceSelection, { eventInstances: eventInstances, selectedEventType: selectedEventType, onEventInstanceSelect: handleEventInstanceSelect, onBackToEventTypes: () => setSidebarOpen(false), isOpen: sidebarOpen, onClose: () => setSidebarOpen(false), isLoadingEventInstances: isLoadingEventInstances, isLoadingEventDetails: isLoadingEventDetails })), shouldRenderBookingForm && eventDetails && (jsxRuntime.jsx(BookingForm, { config: config, eventDetails: eventDetails, stripePromise: stripePromise, onSuccess: handleBookingSuccess, onError: handleBookingError, onBackToEventInstances: () => setCurrentStep(isDirectInstanceMode ? "eventTypes" : "eventInstances"), onBackToEventTypes: () => setSidebarOpen(false), selectedEventType: selectedEventType, selectedEventInstance: selectedEventInstance, isOpen: currentStep === "booking" && !!eventDetails, onClose: () => setCurrentStep(isDirectInstanceMode ? "eventTypes" : "eventInstances"), systemConfig: systemConfig })), jsxRuntime.jsx(BookingSuccessModal, { isOpen: isSuccess, onClose: () => {
|
|
13165
|
+
setIsSuccess(false);
|
|
13166
|
+
setCurrentStep("eventTypes");
|
|
13167
|
+
setSidebarOpen(false);
|
|
13168
|
+
// Reset state
|
|
13169
|
+
setSuccessPaymentIntentId(null);
|
|
13170
|
+
// Reset lazy loading flags
|
|
13171
|
+
setShouldRenderInstanceSelection(false);
|
|
13172
|
+
setShouldRenderBookingForm(false);
|
|
13173
|
+
// Clean up URL to remove Stripe parameters
|
|
13174
|
+
const url = new URL(window.location.href);
|
|
13175
|
+
url.searchParams.delete("payment_intent");
|
|
13176
|
+
url.searchParams.delete("payment_intent_client_secret");
|
|
13177
|
+
url.searchParams.delete("redirect_status");
|
|
13178
|
+
window.history.replaceState({}, "", url.toString());
|
|
13179
|
+
}, config: config, onError: setError, paymentIntentId: successPaymentIntentId })] }), showPromoDialog && (jsxRuntime.jsx(PromoDialog, { onClose: handlePromoDialogClose, onCtaClick: handlePromoCtaClick }))] }));
|
|
12861
13180
|
}
|
|
12862
13181
|
// Cards mode (default) - show event type selection
|
|
12863
13182
|
const cardsView = (jsxRuntime.jsx(EventTypeSelection, { eventTypes: eventTypes, onEventTypeSelect: handleEventTypeSelect, isLoading: isLoading, skeletonCount: getSkeletonCount() }));
|
|
@@ -12890,21 +13209,21 @@ function UniversalBookingWidget({ config: baseConfig }) {
|
|
|
12890
13209
|
};
|
|
12891
13210
|
};
|
|
12892
13211
|
const backHandlers = getBackHandlers();
|
|
12893
|
-
return (jsxRuntime.jsxs(StyleProvider, { config: config, children: [cardsView, shouldRenderInstanceSelection && (jsxRuntime.jsx(EventInstanceSelection, { eventInstances: eventInstances, selectedEventType: selectedEventType, onEventInstanceSelect: handleEventInstanceSelect, onBackToEventTypes: handleBackToEventTypes, isOpen: currentStep === "eventInstances", onClose: handleBackToEventTypes, isLoadingEventInstances: isLoadingEventInstances, isLoadingEventDetails: isLoadingEventDetails })), shouldRenderBookingForm && eventDetails && (jsxRuntime.jsx(BookingForm, { config: config, eventDetails: eventDetails, stripePromise: stripePromise, onSuccess: handleBookingSuccess, onError: handleBookingError, onBackToEventInstances: backHandlers.onBackToEventInstances, onBackToEventTypes: backHandlers.onBackToEventTypes, selectedEventType: selectedEventType, selectedEventInstance: selectedEventInstance, isOpen: currentStep === "booking" && !!eventDetails, onClose: backHandlers.onClose, systemConfig: systemConfig })), jsxRuntime.jsx(BookingSuccessModal, { isOpen: isSuccess, onClose: () => {
|
|
12894
|
-
|
|
12895
|
-
|
|
12896
|
-
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
|
|
12903
|
-
|
|
12904
|
-
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
13212
|
+
return (jsxRuntime.jsxs(StyleProvider, { config: config, children: [jsxRuntime.jsxs("div", { ref: setWidgetContainerRef, children: [cardsView, shouldRenderInstanceSelection && (jsxRuntime.jsx(EventInstanceSelection, { eventInstances: eventInstances, selectedEventType: selectedEventType, onEventInstanceSelect: handleEventInstanceSelect, onBackToEventTypes: handleBackToEventTypes, isOpen: currentStep === "eventInstances", onClose: handleBackToEventTypes, isLoadingEventInstances: isLoadingEventInstances, isLoadingEventDetails: isLoadingEventDetails })), shouldRenderBookingForm && eventDetails && (jsxRuntime.jsx(BookingForm, { config: config, eventDetails: eventDetails, stripePromise: stripePromise, onSuccess: handleBookingSuccess, onError: handleBookingError, onBackToEventInstances: backHandlers.onBackToEventInstances, onBackToEventTypes: backHandlers.onBackToEventTypes, selectedEventType: selectedEventType, selectedEventInstance: selectedEventInstance, isOpen: currentStep === "booking" && !!eventDetails, onClose: backHandlers.onClose, systemConfig: systemConfig })), jsxRuntime.jsx(BookingSuccessModal, { isOpen: isSuccess, onClose: () => {
|
|
13213
|
+
setIsSuccess(false);
|
|
13214
|
+
setCurrentStep("eventTypes");
|
|
13215
|
+
// Reset state
|
|
13216
|
+
setSuccessPaymentIntentId(null);
|
|
13217
|
+
// Reset lazy loading flags
|
|
13218
|
+
setShouldRenderInstanceSelection(false);
|
|
13219
|
+
setShouldRenderBookingForm(false);
|
|
13220
|
+
// Clean up URL to remove Stripe parameters
|
|
13221
|
+
const url = new URL(window.location.href);
|
|
13222
|
+
url.searchParams.delete("payment_intent");
|
|
13223
|
+
url.searchParams.delete("payment_intent_client_secret");
|
|
13224
|
+
url.searchParams.delete("redirect_status");
|
|
13225
|
+
window.history.replaceState({}, "", url.toString());
|
|
13226
|
+
}, config: config, onError: setError, paymentIntentId: successPaymentIntentId })] }), showPromoDialog && (jsxRuntime.jsx(PromoDialog, { onClose: handlePromoDialogClose, onCtaClick: handlePromoCtaClick }))] }));
|
|
12908
13227
|
}
|
|
12909
13228
|
|
|
12910
13229
|
// Export init function for vanilla JS usage
|