@getmicdrop/venue-calendar 4.0.25 → 4.0.26

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.
Files changed (54) hide show
  1. package/dist/{AirbnbSplitMain-CDM_Jj-4.js → AirbnbSplitMain-oIv0QO5G.js} +4 -4
  2. package/dist/{AirbnbSplitMain-CDM_Jj-4.js.map → AirbnbSplitMain-oIv0QO5G.js.map} +1 -1
  3. package/dist/{CarouselView.legacy-BCnk_sPR.js → CarouselView.legacy-9ekZRVlC.js} +3 -3
  4. package/dist/{CarouselView.legacy-BCnk_sPR.js.map → CarouselView.legacy-9ekZRVlC.js.map} +1 -1
  5. package/dist/{CartView-CcxFHimp.js → CartView-RbrCkauC.js} +4 -4
  6. package/dist/CartView-RbrCkauC.js.map +1 -0
  7. package/dist/{Checkout-eHnoyiLt.js → Checkout-BXrnaaTj.js} +4 -4
  8. package/dist/{Checkout-eHnoyiLt.js.map → Checkout-BXrnaaTj.js.map} +1 -1
  9. package/dist/{Checkout.legacy-rkXtfchW.js → Checkout.legacy-EdqilWBC.js} +4 -4
  10. package/dist/{Checkout.legacy-rkXtfchW.js.map → Checkout.legacy-EdqilWBC.js.map} +1 -1
  11. package/dist/{CheckoutMain-DkxO_-du.js → CheckoutMain-C1pZjZd4.js} +4 -4
  12. package/dist/{CheckoutMain-DkxO_-du.js.map → CheckoutMain-C1pZjZd4.js.map} +1 -1
  13. package/dist/{CheckoutTimer-DE8MT4_A.js → CheckoutTimer-BKt80FcV.js} +2 -2
  14. package/dist/{CheckoutTimer-DE8MT4_A.js.map → CheckoutTimer-BKt80FcV.js.map} +1 -1
  15. package/dist/{CollectionView-B67Gg3E0.js → CollectionView-D4btOQm1.js} +5 -5
  16. package/dist/{CollectionView-B67Gg3E0.js.map → CollectionView-D4btOQm1.js.map} +1 -1
  17. package/dist/{CollectionView.legacy-BqNKpXKj.js → CollectionView.legacy-CwBblIfH.js} +3 -3
  18. package/dist/{CollectionView.legacy-BqNKpXKj.js.map → CollectionView.legacy-CwBblIfH.js.map} +1 -1
  19. package/dist/{EventDetailsView-BeVvl1GT.js → EventDetailsView-DgGaC0Mt.js} +2 -2
  20. package/dist/{EventDetailsView-BeVvl1GT.js.map → EventDetailsView-DgGaC0Mt.js.map} +1 -1
  21. package/dist/{FeaturedView.legacy-Colp5HBH.js → FeaturedView.legacy-DYbLS36M.js} +2 -2
  22. package/dist/{FeaturedView.legacy-Colp5HBH.js.map → FeaturedView.legacy-DYbLS36M.js.map} +1 -1
  23. package/dist/{GalleryCard-aFAAmKN7.js → GalleryCard-xTfDJu7o.js} +2 -2
  24. package/dist/{GalleryCard-aFAAmKN7.js.map → GalleryCard-xTfDJu7o.js.map} +1 -1
  25. package/dist/{GalleryView.legacy-BnjAkz76.js → GalleryView.legacy-xVCiMBqk.js} +3 -3
  26. package/dist/{GalleryView.legacy-BnjAkz76.js.map → GalleryView.legacy-xVCiMBqk.js.map} +1 -1
  27. package/dist/{GroupedListView.legacy-nkYQcMAt.js → GroupedListView.legacy-D_USPryc.js} +2 -2
  28. package/dist/{GroupedListView.legacy-nkYQcMAt.js.map → GroupedListView.legacy-D_USPryc.js.map} +1 -1
  29. package/dist/{SeriesPage-DHJdQJH9.js → SeriesPage-iw_GFbx2.js} +5 -5
  30. package/dist/{SeriesPage-DHJdQJH9.js.map → SeriesPage-iw_GFbx2.js.map} +1 -1
  31. package/dist/{SeriesPage.legacy-CT5Yh_c1.js → SeriesPage.legacy-CM5kYBMh.js} +2 -2
  32. package/dist/{SeriesPage.legacy-CT5Yh_c1.js.map → SeriesPage.legacy-CM5kYBMh.js.map} +1 -1
  33. package/dist/{Success-Br9Gm0iD.js → Success-oygKQRPA.js} +5 -5
  34. package/dist/{Success-Br9Gm0iD.js.map → Success-oygKQRPA.js.map} +1 -1
  35. package/dist/{Success.legacy-B2JxPdrC.js → Success.legacy-CdEdSTsP.js} +2 -2
  36. package/dist/{Success.legacy-B2JxPdrC.js.map → Success.legacy-CdEdSTsP.js.map} +1 -1
  37. package/dist/{VenueCalendar-c5GDxqM9.js → VenueCalendar-ByT4N7rW.js} +2922 -2908
  38. package/dist/VenueCalendar-ByT4N7rW.js.map +1 -0
  39. package/dist/{ViewTicketsEmbed-BCQLxR2D.js → ViewTicketsEmbed-pGmp7lol.js} +2 -2
  40. package/dist/{ViewTicketsEmbed-BCQLxR2D.js.map → ViewTicketsEmbed-pGmp7lol.js.map} +1 -1
  41. package/dist/api/api.cjs.map +1 -1
  42. package/dist/api/api.mjs.map +1 -1
  43. package/dist/{labels-Be0hYWW_.js → labels-CLf3t6N8.js} +2 -2
  44. package/dist/{labels-Be0hYWW_.js.map → labels-CLf3t6N8.js.map} +1 -1
  45. package/dist/{transform-D7RXKMkr.js → transform-L7FxlbrT.js} +2 -2
  46. package/dist/{transform-D7RXKMkr.js.map → transform-L7FxlbrT.js.map} +1 -1
  47. package/dist/venue-calendar.es.js +1 -1
  48. package/dist/venue-calendar.iife.js +25 -25
  49. package/dist/venue-calendar.iife.js.map +1 -1
  50. package/dist/venue-calendar.umd.js +25 -25
  51. package/dist/venue-calendar.umd.js.map +1 -1
  52. package/package.json +164 -164
  53. package/dist/CartView-CcxFHimp.js.map +0 -1
  54. package/dist/VenueCalendar-c5GDxqM9.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutMain-DkxO_-du.js","sources":["../__SKIP_ENVIRONMENT__","../node_modules/@getmicdrop/svelte-components/dist/stripe/useStripeTheme.svelte.js","../src/lib/premium-ticket-experience/variants/v3-airbnb-split/CheckoutForm.svelte","../src/lib/premium-ticket-experience/variants/v3-airbnb-split/CheckoutSidebar.svelte","../src/lib/premium-ticket-experience/variants/v3-airbnb-split/CheckoutMobileFooter.svelte","../src/lib/premium-ticket-experience/variants/v3-airbnb-split/CheckoutMain.svelte"],"sourcesContent":["\n export const browser = typeof window !== 'undefined';\n export const dev = false;\n export const building = false;\n export const version = '';\n ","/**\n * Stripe Theme Utility\n *\n * Provides reactive dark mode detection for Stripe Elements.\n * Automatically watches for theme changes via MutationObserver.\n *\n * @example\n * ```svelte\n * <script>\n * import { useStripeTheme } from '@getmicdrop/svelte-components/stripe';\n *\n * const stripeTheme = useStripeTheme();\n * // stripeTheme.current is 'stripe' | 'night'\n * // Automatically updates when theme changes\n * </script>\n *\n * <Elements theme={stripeTheme.current} {stripe} clientSecret={paymentIntent}>\n * <PaymentElement />\n * </Elements>\n * ```\n */\nimport { onMount, onDestroy } from 'svelte';\n/**\n * Detects if dark mode is active.\n *\n * Checks in order:\n * 1. localStorage 'theme' value\n * 2. Container element classes (.dark, [data-theme=\"dark\"])\n * 3. System preference (prefers-color-scheme)\n */\nexport function detectDarkMode(containerSelector) {\n if (typeof window === 'undefined')\n return false;\n try {\n // Check localStorage first\n const saved = localStorage.getItem('theme');\n if (saved === 'dark')\n return true;\n if (saved === 'light')\n return false;\n // Check for data-theme on common containers\n const selector = containerSelector || '[data-theme=\"dark\"], [data-theme=\"light\"], .micdrop, [data-theme]';\n const containers = document.querySelectorAll(selector);\n for (const container of containers) {\n if (container.getAttribute('data-theme') === 'dark')\n return true;\n }\n // Check document root\n if (document.documentElement.getAttribute('data-theme') === 'dark')\n return true;\n // Fallback to system preference\n return window.matchMedia?.('(prefers-color-scheme: dark)')?.matches ?? false;\n }\n catch {\n return false;\n }\n}\n/**\n * Maps dark mode state to Stripe theme.\n */\nexport function getStripeTheme(isDark) {\n return isDark ? 'night' : 'stripe';\n}\n/**\n * Creates a reactive Stripe theme that watches for dark mode changes.\n *\n * Returns an object with a `current` property that is reactive and\n * automatically updates when the theme changes.\n *\n * @example\n * ```svelte\n * <script>\n * import { useStripeTheme } from '@getmicdrop/svelte-components/stripe';\n * const stripeTheme = useStripeTheme();\n * </script>\n *\n * <Elements theme={stripeTheme.current} ...>\n * ```\n */\nexport function useStripeTheme(options = {}) {\n const { containerSelector = '[data-theme=\"dark\"], [data-theme=\"light\"], .micdrop, [data-theme]', watchChanges = true, fallback = 'stripe', } = options;\n let current = $state(fallback);\n let observer = null;\n function updateTheme() {\n current = getStripeTheme(detectDarkMode(containerSelector));\n }\n onMount(() => {\n // Initial detection\n updateTheme();\n if (watchChanges && typeof MutationObserver !== 'undefined') {\n // Watch for class changes on potential theme containers\n const containers = document.querySelectorAll(containerSelector);\n const root = document.documentElement;\n observer = new MutationObserver(() => {\n updateTheme();\n });\n // Observe document root\n observer.observe(root, {\n attributes: true,\n attributeFilter: ['class', 'data-theme'],\n });\n // Observe other containers\n containers.forEach(container => {\n observer?.observe(container, {\n attributes: true,\n attributeFilter: ['class', 'data-theme'],\n });\n });\n // Also listen for system preference changes\n const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n mediaQuery.addEventListener('change', updateTheme);\n }\n });\n onDestroy(() => {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n });\n return {\n get current() {\n return current;\n },\n /** Force refresh the theme detection */\n refresh: updateTheme,\n };\n}\n/**\n * Simple synchronous dark mode detection without reactivity.\n * Use this when you only need a one-time check.\n */\nexport function getInitialStripeTheme(containerSelector) {\n return getStripeTheme(detectDarkMode(containerSelector));\n}\n","<script lang=\"ts\">\r\n import { onMount, onDestroy } from 'svelte';\r\n import { browser } from '$app/environment';\r\n import { ChevronLeft, Warning } from 'carbon-icons-svelte';\r\n import {\r\n Button,\r\n Heading,\r\n Text,\r\n Input,\r\n Checkbox,\r\n } from '@getmicdrop/svelte-components';\r\n import { useStripeTheme } from '@getmicdrop/svelte-components/stripe';\r\n import type {\r\n EventData,\r\n OrderTotals,\r\n CheckoutFormData,\r\n } from '$lib/premium-ticket-experience/types';\r\n import CheckoutTimer from './CheckoutTimer.svelte';\r\n\r\n interface Props {\r\n event: EventData;\r\n orderTotals: OrderTotals;\r\n timerSeconds: number;\r\n isExpired: boolean;\r\n isRegistration: boolean;\r\n isFreeOrder: boolean;\r\n promoApplied: boolean;\r\n promoDiscount: number;\r\n onBack: () => void;\r\n onPlaceOrder: (formData: CheckoutFormData) => void;\r\n processing: boolean;\r\n /** Incremented by parent to trigger form validation + submit from external buttons (sidebar, mobile footer) */\r\n submitRequested: number;\r\n /** Stripe instance for production mode (absence = showcase mock inputs) */\r\n stripe?: any;\r\n /** Stripe client secret for PaymentElement */\r\n paymentIntent?: string;\r\n /** Bindable Stripe elements reference for the wrapper to use during payment confirmation */\r\n elements?: any;\r\n /** Payment error message from the wrapper */\r\n paymentError?: string;\r\n labels?: Record<string, string>;\r\n }\r\n\r\n let {\r\n event,\r\n orderTotals,\r\n timerSeconds,\r\n isExpired,\r\n isRegistration,\r\n isFreeOrder,\r\n promoApplied,\r\n promoDiscount,\r\n onBack,\r\n onPlaceOrder,\r\n processing,\r\n submitRequested,\r\n stripe = undefined,\r\n paymentIntent = undefined,\r\n elements = $bindable(undefined),\r\n paymentError = '',\r\n labels = {},\r\n }: Props = $props();\r\n\r\n // Use direct Stripe.js API instead of svelte-stripe (Svelte 5 compatibility bug).\r\n const stripeTheme = browser ? useStripeTheme() : { current: \"stripe\" as const };\r\n let paymentMountDiv = $state<HTMLElement | null>(null);\r\n let paymentElement: any = null;\r\n let stripeMounted = $state(false);\r\n\r\n function mountStripePayment() {\r\n if (\r\n !browser ||\r\n !stripe ||\r\n !paymentIntent ||\r\n !paymentMountDiv ||\r\n stripeMounted\r\n )\r\n return;\r\n elements = stripe.elements({\r\n clientSecret: paymentIntent,\r\n appearance: { theme: stripeTheme.current },\r\n });\r\n paymentElement = elements.create('payment');\r\n paymentElement.mount(paymentMountDiv);\r\n stripeMounted = true;\r\n }\r\n\r\n $effect(() => {\r\n if (stripe && paymentIntent && paymentMountDiv && !stripeMounted) {\r\n mountStripePayment();\r\n }\r\n });\r\n\r\n // Re-skin Stripe Elements when the theme changes (data-theme toggle).\r\n $effect(() => {\r\n if (stripeMounted && elements && stripeTheme.current) {\r\n try {\r\n elements.update({ appearance: { theme: stripeTheme.current } });\r\n } catch (_) {\r\n // Stripe Elements is finicky about post-mount updates; ignore.\r\n }\r\n }\r\n });\r\n\r\n onDestroy(() => {\r\n if (paymentElement) {\r\n paymentElement.destroy();\r\n paymentElement = null;\r\n }\r\n stripeMounted = false;\r\n });\r\n\r\n // --- Form state ---\r\n let firstName = $state('');\r\n let lastName = $state('');\r\n let email = $state('');\r\n let keepUpdated = $state(false);\r\n let agreeTerms = $state(false);\r\n\r\n // Payment fields (mock)\r\n let cardNumber = $state('');\r\n let cardExpiry = $state('');\r\n let cardCvc = $state('');\r\n\r\n // Per-ticket attendee fields (for registration events)\r\n let attendees = $state<\r\n Array<{\r\n firstName: string;\r\n lastName: string;\r\n email: string;\r\n sameAsPurchaser: boolean;\r\n }>\r\n >([]);\r\n\r\n // Validation state\r\n let submitted = $state(false);\r\n let errors = $derived(\r\n (() => {\r\n if (!submitted) return {};\r\n const e: Record<string, string> = {};\r\n if (!firstName.trim())\r\n e.firstName = labels.firstNameRequired || 'First name is required';\r\n if (!lastName.trim())\r\n e.lastName = labels.lastNameRequired || 'Last name is required';\r\n if (!email.trim()) e.email = labels.emailRequired || 'Email is required';\r\n else if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email))\r\n e.email = labels.emailInvalid || 'Enter a valid email address';\r\n if (!isFreeOrder && !stripe) {\r\n // Only validate mock card fields in showcase mode\r\n if (!cardNumber.trim())\r\n e.cardNumber = labels.cardNumberRequired || 'Card number is required';\r\n if (!cardExpiry.trim())\r\n e.cardExpiry = labels.expiryRequired || 'Expiry date is required';\r\n if (!cardCvc.trim())\r\n e.cardCvc = labels.cvcRequired || 'CVC is required';\r\n }\r\n if (!agreeTerms)\r\n e.agreeTerms = labels.mustAgreeTerms || 'You must agree to the terms';\r\n\r\n // Validate attendee fields for registration events\r\n if (isRegistration) {\r\n for (let i = 0; i < attendees.length; i++) {\r\n const att = attendees[i];\r\n if (!att.sameAsPurchaser) {\r\n if (!att.firstName.trim())\r\n e[`attendee_${i}_firstName`] = 'First name is required';\r\n if (!att.lastName.trim())\r\n e[`attendee_${i}_lastName`] = 'Last name is required';\r\n if (!att.email.trim())\r\n e[`attendee_${i}_email`] =\r\n labels.emailRequired || 'Email is required';\r\n else if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(att.email))\r\n e[`attendee_${i}_email`] =\r\n labels.emailInvalidShort || 'Enter a valid email';\r\n }\r\n }\r\n }\r\n\r\n return e;\r\n })()\r\n );\r\n\r\n let hasErrors = $derived(Object.keys(errors).length > 0);\r\n\r\n let isTimerUrgent = $derived(timerSeconds > 0 && timerSeconds <= 120);\r\n\r\n // Initialize attendee list based on order lines\r\n $effect(() => {\r\n if (isRegistration) {\r\n const totalTickets = orderTotals.lines.reduce(\r\n (sum, l) => sum + l.quantity,\r\n 0\r\n );\r\n if (attendees.length !== totalTickets) {\r\n attendees = Array.from({ length: totalTickets }, (_, i) => ({\r\n firstName: '',\r\n lastName: '',\r\n email: '',\r\n sameAsPurchaser: i === 0,\r\n }));\r\n }\r\n }\r\n });\r\n\r\n // Watch for external submit requests (from sidebar/mobile footer buttons)\r\n let lastSubmitRequest = $state(0);\r\n $effect(() => {\r\n if (submitRequested > lastSubmitRequest) {\r\n lastSubmitRequest = submitRequested;\r\n handleSubmit();\r\n }\r\n });\r\n\r\n function handleSameAsPurchaser(index: number, checked: boolean) {\r\n attendees = attendees.map((att, i) => {\r\n if (i !== index) return att;\r\n return {\r\n ...att,\r\n sameAsPurchaser: checked,\r\n firstName: checked ? firstName : att.firstName,\r\n lastName: checked ? lastName : att.lastName,\r\n email: checked ? email : att.email,\r\n };\r\n });\r\n }\r\n\r\n function handleSubmit() {\r\n submitted = true;\r\n if (hasErrors) return;\r\n onPlaceOrder({\r\n firstName,\r\n lastName,\r\n email,\r\n keepMeUpdated: keepUpdated,\r\n attendees: isRegistration\r\n ? attendees.map(a => ({\r\n firstName: a.sameAsPurchaser ? firstName : a.firstName,\r\n lastName: a.sameAsPurchaser ? lastName : a.lastName,\r\n email: a.sameAsPurchaser ? email : a.email,\r\n sameAsPurchaser: a.sameAsPurchaser,\r\n }))\r\n : undefined,\r\n });\r\n }\r\n</script>\r\n\r\n<div class=\"space-y-6\">\r\n <!-- Timer header bar -->\r\n <div class=\"timer-header border-default bg-surface-secondary\">\r\n <Button\r\n variant=\"icon\"\r\n size=\"icon-sm\"\r\n onclick={onBack}\r\n aria-label={labels.goBack || 'Go back'}\r\n >\r\n <ChevronLeft size={20} />\r\n </Button>\r\n <CheckoutTimer seconds={timerSeconds} isUrgent={isTimerUrgent} />\r\n </div>\r\n\r\n <!-- Personal details -->\r\n <section class=\"space-y-4\">\r\n <Heading level={2} size=\"lg\" weight=\"semibold\">\r\n {labels.yourDetails || 'Your details'}\r\n </Heading>\r\n\r\n <div class=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\r\n <Input\r\n label={labels.firstName || 'First name'}\r\n placeholder={labels.firstName || 'First name'}\r\n required\r\n bind:value={firstName}\r\n errorText={errors.firstName ?? ''}\r\n color={errors.firstName ? 'red' : 'base'}\r\n />\r\n <Input\r\n label={labels.lastName || 'Last name'}\r\n placeholder={labels.lastName || 'Last name'}\r\n required\r\n bind:value={lastName}\r\n errorText={errors.lastName ?? ''}\r\n color={errors.lastName ? 'red' : 'base'}\r\n />\r\n </div>\r\n\r\n <Input\r\n label={labels.emailAddress || 'Email address'}\r\n type=\"email\"\r\n placeholder={labels.emailPlaceholder || 'you@example.com'}\r\n required\r\n bind:value={email}\r\n errorText={errors.email ?? ''}\r\n color={errors.email ? 'red' : 'base'}\r\n />\r\n\r\n <Checkbox bind:checked={keepUpdated}>\r\n {labels.keepMeUpdated ||\r\n 'Keep me updated about this event and similar events'}\r\n </Checkbox>\r\n </section>\r\n\r\n <!-- Per-ticket attendee details (registration events) -->\r\n {#if isRegistration && attendees.length > 0}\r\n <section class=\"space-y-5\">\r\n <Heading level={2} size=\"lg\" weight=\"semibold\">\r\n {labels.attendeeDetails || 'Attendee details'}\r\n </Heading>\r\n\r\n {#each attendees as attendee, i}\r\n <div class=\"attendee-card border-default bg-surface-secondary\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <Text size=\"sm\" class=\"font-semibold\">\r\n {labels.attendee || 'Attendee'}\r\n {i + 1}\r\n </Text>\r\n <Checkbox\r\n checked={attendee.sameAsPurchaser}\r\n onchange={({ checked }) => handleSameAsPurchaser(i, checked)}\r\n >\r\n {labels.sameAsPurchaser || 'Same as purchaser'}\r\n </Checkbox>\r\n </div>\r\n\r\n <div class=\"space-y-3\">\r\n <div class=\"grid grid-cols-1 sm:grid-cols-2 gap-3\">\r\n <Input\r\n label={labels.firstName || 'First name'}\r\n placeholder={labels.firstName || 'First name'}\r\n required\r\n disabled={attendee.sameAsPurchaser}\r\n bind:value={attendee.firstName}\r\n errorText={!attendee.sameAsPurchaser\r\n ? (errors[`attendee_${i}_firstName`] ?? '')\r\n : ''}\r\n color={!attendee.sameAsPurchaser &&\r\n errors[`attendee_${i}_firstName`]\r\n ? 'red'\r\n : 'base'}\r\n />\r\n <Input\r\n label={labels.lastName || 'Last name'}\r\n placeholder={labels.lastName || 'Last name'}\r\n required\r\n disabled={attendee.sameAsPurchaser}\r\n bind:value={attendee.lastName}\r\n errorText={!attendee.sameAsPurchaser\r\n ? (errors[`attendee_${i}_lastName`] ?? '')\r\n : ''}\r\n color={!attendee.sameAsPurchaser &&\r\n errors[`attendee_${i}_lastName`]\r\n ? 'red'\r\n : 'base'}\r\n />\r\n </div>\r\n <Input\r\n label={labels.email || 'Email'}\r\n type=\"email\"\r\n placeholder={labels.attendeeEmailPlaceholder ||\r\n 'attendee@example.com'}\r\n required\r\n disabled={attendee.sameAsPurchaser}\r\n bind:value={attendee.email}\r\n errorText={!attendee.sameAsPurchaser\r\n ? (errors[`attendee_${i}_email`] ?? '')\r\n : ''}\r\n color={!attendee.sameAsPurchaser && errors[`attendee_${i}_email`]\r\n ? 'red'\r\n : 'base'}\r\n />\r\n </div>\r\n </div>\r\n {/each}\r\n </section>\r\n {/if}\r\n\r\n <!-- Payment section -->\r\n <section class=\"space-y-4\">\r\n {#if isFreeOrder}\r\n <div class=\"free-order-notice border-default bg-surface-secondary\">\r\n <Text size=\"sm\" color=\"secondary\" class=\"font-medium block\">\r\n {labels.noPaymentRequired || 'No payment required'}\r\n </Text>\r\n <Text size=\"xs\" color=\"muted\" class=\"block mt-1\">\r\n {labels.freeEventMessage ||\r\n 'This is a free event. Complete the form above to reserve your spot.'}\r\n </Text>\r\n </div>\r\n {:else if stripe && paymentIntent}\r\n <!-- Production: Real Stripe PaymentElement -->\r\n <Heading level={2} size=\"lg\" weight=\"semibold\">Payment</Heading>\r\n {#if browser}\r\n <div bind:this={paymentMountDiv}></div>\r\n {#if !stripeMounted}\r\n <p class=\"text-sm text-color-muted py-2\">\r\n {labels.loadingPaymentForm || 'Loading secure payment form...'}\r\n </p>\r\n {/if}\r\n {:else}\r\n <p class=\"text-sm text-color-muted py-2\">\r\n {labels.loadingPaymentForm || 'Loading secure payment form...'}\r\n </p>\r\n {/if}\r\n {#if paymentError}\r\n <p class=\"text-sm text-accent-danger mt-2\">{paymentError}</p>\r\n {/if}\r\n {:else}\r\n <!-- Showcase: Mock card inputs -->\r\n <Heading level={2} size=\"lg\" weight=\"semibold\">Payment</Heading>\r\n\r\n <Input\r\n label={labels.cardNumber || 'Card number'}\r\n placeholder={labels.cardPlaceholder || '4242 4242 4242 4242'}\r\n type=\"creditCardNumber\"\r\n required\r\n bind:value={cardNumber}\r\n errorText={errors.cardNumber ?? ''}\r\n color={errors.cardNumber ? 'red' : 'base'}\r\n />\r\n\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <Input\r\n label={labels.expiryDate || 'Expiry date'}\r\n placeholder={labels.expiryPlaceholder || 'MM / YY'}\r\n required\r\n bind:value={cardExpiry}\r\n errorText={errors.cardExpiry ?? ''}\r\n color={errors.cardExpiry ? 'red' : 'base'}\r\n />\r\n <Input\r\n label={labels.cvc || 'CVC'}\r\n placeholder={labels.cvcPlaceholder || '123'}\r\n required\r\n maxlength={4}\r\n bind:value={cardCvc}\r\n errorText={errors.cardCvc ?? ''}\r\n color={errors.cardCvc ? 'red' : 'base'}\r\n />\r\n </div>\r\n {/if}\r\n </section>\r\n\r\n <!-- Terms -->\r\n <section class=\"space-y-2\">\r\n <Checkbox bind:checked={agreeTerms}>\r\n {labels.agreeToTerms || 'I agree to the terms and conditions'}\r\n </Checkbox>\r\n {#if errors.agreeTerms}\r\n <div class=\"flex items-center gap-1.5\">\r\n <Warning size={16} class=\"text-accent-danger shrink-0\" />\r\n <Text size=\"xs\" class=\"text-accent-danger\">{errors.agreeTerms}</Text>\r\n </div>\r\n {/if}\r\n </section>\r\n\r\n <!-- Mobile submit is handled by CheckoutMobileFooter -->\r\n</div>\r\n\r\n<style>\r\n .timer-header {\r\n display: flex;\r\n align-items: center;\r\n gap: 0.75rem;\r\n padding: 0.75rem 1rem;\r\n margin-left: -1rem;\r\n margin-right: -1rem;\r\n border-bottom-width: 1px;\r\n border-bottom-style: solid;\r\n border-radius: 0.5rem 0.5rem 0 0;\r\n }\r\n\r\n .attendee-card {\r\n padding: 1rem;\r\n border-radius: 0.5rem;\r\n border-width: 1px;\r\n border-style: solid;\r\n }\r\n\r\n .free-order-notice {\r\n padding: 1rem;\r\n border-radius: 0.5rem;\r\n border-width: 1px;\r\n border-style: solid;\r\n }\r\n</style>\r\n","<script lang=\"ts\">\r\n\timport type { USD } from '@getmicdrop/svelte-components';\r\nimport { Calendar } from 'carbon-icons-svelte';\r\n\timport { Button, Card, Text, formatCurrency } from '@getmicdrop/svelte-components';\r\n\timport type { EventData, OrderTotals } from '$lib/premium-ticket-experience/types';\r\n\timport { formatBrowseDate, formatEventTime } from '$lib/premium-ticket-experience/defaults';\r\n\timport OrderSummary from './OrderSummary.svelte';\r\n\r\n\tinterface Props {\r\n\t\tevent: EventData;\r\n\t\torderTotals: OrderTotals;\r\n\t\tisFreeOrder: boolean;\r\n\t\tonPlaceOrder: () => void;\r\n\t\tprocessing: boolean;\r\n\t\t\tlabels?: Record<string, string>;\r\n\t}\r\n\r\n\tlet { event, orderTotals, isFreeOrder, onPlaceOrder, processing, labels = {}, }: Props = $props();\r\n</script>\r\n\r\n<!--\r\n\tCap the sidebar card to the viewport so the Place Order button never\r\n\tfalls below the fold when many ticket types + fees + taxes + gift-card\r\n\tlines stack up. Body scrolls, button stays pinned at the bottom.\r\n-->\r\n<Card border padding={false} class=\"flex flex-col max-h-[calc(100vh-3rem)] rounded-xl shadow-lg overflow-hidden bg-surface-secondary\">\r\n\t<div class=\"p-5 flex-1 overflow-y-auto min-h-0 space-y-4\">\r\n\t\t<!-- Event info -->\r\n\t\t<div class=\"flex gap-3\">\r\n\t\t\t<div class=\"shrink-0 w-20 h-14 rounded-lg overflow-hidden bg-surface-tertiary\">\r\n\t\t\t\t<img\r\n\t\t\t\t\tsrc={event.imageUrl}\r\n\t\t\t\t\talt={event.title}\r\n\t\t\t\t\tclass=\"w-full h-full object-contain\"\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"flex-1 min-w-0\">\r\n\t\t\t\t<Text size=\"sm\" class=\"font-semibold block leading-tight line-clamp-2\">\r\n\t\t\t\t\t{event.title}\r\n\t\t\t\t</Text>\r\n\t\t\t\t<div class=\"flex items-center gap-1.5 mt-1\">\r\n\t\t\t\t\t<Calendar size={16} class=\"shrink-0 icon-muted\" />\r\n\t\t\t\t\t<Text size=\"xs\" color=\"muted\">\r\n\t\t\t\t\t\t{formatBrowseDate(event.startDateTime, event.timezone)}\r\n\t\t\t\t\t\t{#if event.displayStartTime !== false}\r\n\t\t\t\t\t\t\t&middot; {formatEventTime(event.startDateTime, event.timezone)}\r\n\t\t\t\t\t\t{/if}\r\n\t\t\t\t\t</Text>\r\n\t\t\t\t</div>\r\n\t\t\t\t<Text size=\"xs\" color=\"muted\" class=\"block mt-0.5\">\r\n\t\t\t\t\t{event.venue.name}\r\n\t\t\t\t</Text>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\r\n\t\t<!-- Divider -->\r\n\t\t<div class=\"divider\"></div>\r\n\r\n\t\t<!-- Order summary -->\r\n\t\t<OrderSummary {orderTotals}\r\n\t\t\t\t{labels} />\r\n\t</div>\r\n\r\n\t<!-- Pinned action footer: Place Order always visible -->\r\n\t<div class=\"p-5 pt-3 shrink-0 border-t border-default\">\r\n\t\t<Button\r\n\t\t\tvariant=\"default\"\r\n\t\t\tsize=\"lg\"\r\n\t\t\tclass=\"w-full\"\r\n\t\t\tdisabled={processing}\r\n\t\t\tloading={processing}\r\n\t\t\tonclick={onPlaceOrder}\r\n\t\t>\r\n\t\t\t{#if processing}\r\n\t\t\t\t{labels.placingOrder || 'Placing order...'}\r\n\t\t\t{:else if isFreeOrder}\r\n\t\t\t\t{labels.completeOrder || 'Complete order'} &middot; {labels.free || 'Free'}\r\n\t\t\t{:else}\r\n\t\t\t\t{labels.placeOrder || 'Place order'} &middot; {formatCurrency(orderTotals.total as USD /* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */)}\r\n\t\t\t{/if}\r\n\t\t</Button>\r\n\t</div>\r\n</Card>\r\n\r\n","<script lang=\"ts\">\r\n\timport type { USD } from '@getmicdrop/svelte-components';\r\nimport { Button, Text, formatCurrency } from '@getmicdrop/svelte-components';\r\n\timport type { OrderTotals } from '$lib/premium-ticket-experience/types';\r\n\r\n\tinterface Props {\r\n\t\torderTotals: OrderTotals;\r\n\t\tisFreeOrder: boolean;\r\n\t\tonPlaceOrder: () => void;\r\n\t\tprocessing: boolean;\r\n\t\t\tlabels?: Record<string, string>;\r\n\t}\r\n\r\n\tlet { orderTotals, isFreeOrder, onPlaceOrder, processing, labels = {}, }: Props = $props();\r\n\r\n\tlet totalTicketCount = $derived(\r\n\t\torderTotals.lines.reduce((sum, l) => sum + l.quantity, 0)\r\n\t);\r\n</script>\r\n\r\n<div\r\n\tclass=\"fixed bottom-0 left-0 right-0 z-40 md:hidden bg-surface-primary border-t border-default shadow-lg\"\r\n\tstyle=\"padding-bottom: env(safe-area-inset-bottom, 0);\"\r\n>\r\n\t<div class=\"flex items-center justify-between gap-3 px-4 py-3\">\r\n\t\t<!-- Left: total info -->\r\n\t\t<div class=\"flex-1 min-w-0\">\r\n\t\t\t<Text size=\"sm\" class=\"font-semibold tabular-nums block\">\r\n\t\t\t\t{#if isFreeOrder}\r\n\t\t\t\t\t{totalTicketCount} {totalTicketCount === 1 ? (labels.ticket || 'ticket') : (labels.tickets || 'tickets')} &middot; Free\r\n\t\t\t\t{:else}\r\n\t\t\t\t\t{formatCurrency(orderTotals.total as USD /* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */)}\r\n\t\t\t\t{/if}\r\n\t\t\t</Text>\r\n\t\t</div>\r\n\r\n\t\t<!-- Right: Place order button -->\r\n\t\t<Button\r\n\t\t\tvariant=\"default\"\r\n\t\t\tsize=\"lg\"\r\n\t\t\tdisabled={processing}\r\n\t\t\tloading={processing}\r\n\t\t\tonclick={onPlaceOrder}\r\n\t\t\tclass=\"shrink-0 min-w-36\"\r\n\t\t>\r\n\t\t\t{#if processing}\r\n\t\t\t\t{labels.placingOrder || 'Placing order...'}\r\n\t\t\t{:else if isFreeOrder}\r\n\t\t\t\t{labels.completeOrder || 'Complete order'}\r\n\t\t\t{:else}\r\n\t\t\t\t{labels.placeOrder || 'Place order'}\r\n\t\t\t{/if}\r\n\t\t</Button>\r\n\t</div>\r\n</div>\r\n\r\n","<script module>\r\n import {\r\n type USD,\r\n createLogger,\r\n formatCurrency,\r\n } from '@getmicdrop/svelte-components';\r\n const logger = createLogger('CheckoutMain');\r\n</script>\r\n\r\n<script lang=\"ts\">\r\n import { Warning, Time } from 'carbon-icons-svelte';\r\n import { AppError, Button, Heading, Modal, Text } from '@getmicdrop/svelte-components';\r\n import { toast } from '@getmicdrop/svelte-components/toast';\r\n import { roundCurrency } from '$lib/utils/currency.js';\r\n import type {\r\n EventData,\r\n OrderTotals,\r\n OrderLine,\r\n CheckoutConfig,\r\n CheckoutFormData,\r\n } from '$lib/premium-ticket-experience/types';\r\n import {\r\n mockEvent,\r\n mockFreeEvent,\r\n mockDonationEvent,\r\n mockRegistrationEvent,\r\n } from '$lib/premium-ticket-experience/mock-data';\r\n import { calculateTax } from '$lib/premium-ticket-experience/defaults';\r\n import { getSessionStatus } from '$lib/api/orders';\r\n\r\n import CheckoutForm from './CheckoutForm.svelte';\r\n import CheckoutSidebar from './CheckoutSidebar.svelte';\r\n import CheckoutMobileFooter from './CheckoutMobileFooter.svelte';\r\n import OrderSummary from './OrderSummary.svelte';\r\n import { mergeLabels } from '$lib/premium-ticket-experience/i18n/labels.js';\r\n\r\n // mergedLabels initialized after props destructuring below\r\n\r\n // --- DataToggle types ---\r\n type CheckoutVariant =\r\n | 'default'\r\n | 'free'\r\n | 'donation'\r\n | 'registration'\r\n | 'timer_warning'\r\n | 'expired'\r\n | 'promo';\r\n let dataVariant = $state<CheckoutVariant>('default');\r\n\r\n const toggleOptions: {\r\n value: CheckoutVariant;\r\n label: string;\r\n color: string;\r\n }[] = [\r\n { value: 'default', label: 'Standard', color: 'bg-accent-success' },\r\n { value: 'free', label: 'Free', color: 'bg-sky-500' },\r\n { value: 'donation', label: 'Donation', color: 'bg-accent-danger' },\r\n { value: 'registration', label: 'Registration', color: 'bg-brand-primary' },\r\n {\r\n value: 'timer_warning',\r\n label: 'Timer warning',\r\n color: 'bg-status-warning-bg0',\r\n },\r\n { value: 'expired', label: 'Expired', color: 'bg-accent-danger' },\r\n { value: 'promo', label: 'Promo discount', color: 'bg-accent-success' },\r\n ];\r\n\r\n // --- Props (dual-mode: showcase vs production) ---\r\n interface Props {\r\n /** Pre-built checkout config for production mode. Absence = showcase. */\r\n config?: CheckoutConfig;\r\n /** Production order submission handler. Receives form data for the wrapper to submit. */\r\n onPlaceOrder?: (formData: CheckoutFormData) => Promise<void>;\r\n /** Production back navigation handler. */\r\n onBack?: () => void;\r\n /** Production retry handler for expired sessions. */\r\n onRetryExpired?: () => void;\r\n /** Production session extension handler. Returns extension result with newExpiryTime and remainingExtensions. */\r\n onExtendSession?: () => Promise<{\r\n newExpiryTime?: string;\r\n remainingExtensions?: number;\r\n } | null | void>;\r\n /** Stripe instance passed through to CheckoutForm */\r\n stripe?: any;\r\n /** Stripe client secret passed through to CheckoutForm */\r\n paymentIntent?: string;\r\n /** Bindable Stripe elements for wrapper to access */\r\n elements?: any;\r\n /** Payment error message to display */\r\n paymentError?: string;\r\n labels?: Record<string, string>;\r\n }\r\n\r\n let {\r\n config: configProp = undefined,\r\n onPlaceOrder: onPlaceOrderProp = undefined,\r\n onBack: onBackProp = undefined,\r\n onRetryExpired: onRetryExpiredProp = undefined,\r\n onExtendSession: onExtendSessionProp = undefined,\r\n stripe = undefined,\r\n paymentIntent = undefined,\r\n elements = $bindable(undefined),\r\n paymentError = '',\r\n labels = {},\r\n }: Props = $props();\r\n\r\n const mergedLabels = $derived(mergeLabels(labels));\r\n let isShowcaseMode = $derived(!configProp);\r\n\r\n // --- Mock order configurations per variant ---\r\n function buildConfig(variant: CheckoutVariant): CheckoutConfig {\r\n switch (variant) {\r\n case 'free':\r\n return {\r\n event: mockFreeEvent,\r\n lines: [\r\n {\r\n ticketId: 201,\r\n ticketName: 'Free Entry',\r\n quantity: 2,\r\n unitPrice: 0,\r\n fee: 0,\r\n subtotal: 0,\r\n },\r\n ],\r\n timerStart: 900,\r\n promoApplied: false,\r\n promoDiscount: 0,\r\n forceExpired: false,\r\n };\r\n\r\n case 'donation':\r\n return {\r\n event: mockDonationEvent,\r\n lines: [\r\n {\r\n ticketId: 401,\r\n ticketName: 'Donation',\r\n quantity: 1,\r\n unitPrice: 25,\r\n fee: 0,\r\n subtotal: 25,\r\n },\r\n {\r\n ticketId: 402,\r\n ticketName: 'Standard Admission',\r\n quantity: 1,\r\n unitPrice: 30,\r\n fee: 3,\r\n subtotal: 30,\r\n },\r\n ],\r\n timerStart: 900,\r\n promoApplied: false,\r\n promoDiscount: 0,\r\n forceExpired: false,\r\n };\r\n\r\n case 'registration':\r\n return {\r\n event: mockRegistrationEvent,\r\n lines: [\r\n {\r\n ticketId: 301,\r\n ticketName: 'Workshop Seat',\r\n quantity: 1,\r\n unitPrice: 75,\r\n fee: 7.5,\r\n subtotal: 75,\r\n },\r\n ],\r\n timerStart: 900,\r\n promoApplied: false,\r\n promoDiscount: 0,\r\n forceExpired: false,\r\n };\r\n\r\n case 'timer_warning':\r\n return {\r\n event: mockEvent,\r\n lines: [\r\n {\r\n ticketId: 101,\r\n ticketName: 'General Admission',\r\n quantity: 2,\r\n unitPrice: 25,\r\n fee: 2.5,\r\n subtotal: 50,\r\n },\r\n {\r\n ticketId: 102,\r\n ticketName: 'VIP Front Row',\r\n quantity: 1,\r\n unitPrice: 55,\r\n fee: 5.5,\r\n subtotal: 55,\r\n },\r\n ],\r\n timerStart: 33, // Just over 30s — warning modal triggers at 30s\r\n promoApplied: false,\r\n promoDiscount: 0,\r\n forceExpired: false,\r\n };\r\n\r\n case 'expired':\r\n return {\r\n event: mockEvent,\r\n lines: [\r\n {\r\n ticketId: 101,\r\n ticketName: 'General Admission',\r\n quantity: 2,\r\n unitPrice: 25,\r\n fee: 2.5,\r\n subtotal: 50,\r\n },\r\n {\r\n ticketId: 102,\r\n ticketName: 'VIP Front Row',\r\n quantity: 1,\r\n unitPrice: 55,\r\n fee: 5.5,\r\n subtotal: 55,\r\n },\r\n ],\r\n timerStart: 0,\r\n promoApplied: false,\r\n promoDiscount: 0,\r\n forceExpired: true,\r\n };\r\n\r\n case 'promo':\r\n return {\r\n event: mockEvent,\r\n lines: [\r\n {\r\n ticketId: 101,\r\n ticketName: 'General Admission',\r\n quantity: 2,\r\n unitPrice: 25,\r\n fee: 2.5,\r\n subtotal: 50,\r\n },\r\n {\r\n ticketId: 102,\r\n ticketName: 'VIP Front Row',\r\n quantity: 1,\r\n unitPrice: 55,\r\n fee: 5.5,\r\n subtotal: 55,\r\n },\r\n ],\r\n timerStart: 900,\r\n promoApplied: true,\r\n promoDiscount: 10,\r\n forceExpired: false,\r\n };\r\n\r\n default:\r\n // Standard checkout\r\n return {\r\n event: mockEvent,\r\n lines: [\r\n {\r\n ticketId: 101,\r\n ticketName: 'General Admission',\r\n quantity: 2,\r\n unitPrice: 25,\r\n fee: 2.5,\r\n subtotal: 50,\r\n },\r\n {\r\n ticketId: 102,\r\n ticketName: 'VIP Front Row',\r\n quantity: 1,\r\n unitPrice: 55,\r\n fee: 5.5,\r\n subtotal: 55,\r\n },\r\n ],\r\n timerStart: 900,\r\n promoApplied: false,\r\n promoDiscount: 0,\r\n forceExpired: false,\r\n };\r\n }\r\n }\r\n\r\n // --- State ---\r\n let config: CheckoutConfig = $derived(\r\n isShowcaseMode ? buildConfig(dataVariant) : configProp!\r\n );\r\n // Deadline-based timer model.\r\n //\r\n // We track an absolute deadline timestamp (ms since epoch) and compute\r\n // the displayed seconds from `deadlineMs - Date.now()` on each tick.\r\n // This is immune to backgrounded-tab throttling: when the browser\r\n // suspends our setInterval, the displayed value falls behind, but the\r\n // very next tick (or the visibilitychange handler) recomputes from\r\n // wall-clock time and the display jumps to truth. Previously we\r\n // decremented `timerSeconds -= 1`, which drifted arbitrarily far from\r\n // reality whenever the tab was backgrounded (Chrome throttles 1Hz\r\n // intervals to ~1/min after a few minutes, then pauses them entirely).\r\n //\r\n // `timerSeconds` remains an explicit state var (rather than `$derived`)\r\n // because legacy code paths still write to it (legacy demo modes); the\r\n // canonical writer is now the deadline-driven tick effect below.\r\n let deadlineMs = $state<number | null>(null);\r\n let timerSeconds = $state(900);\r\n let isExpired = $state(false);\r\n let processing = $state(false);\r\n let submitRequested = $state(0);\r\n\r\n // Cart expiration warning/expired modal states\r\n let showWarningModal = $state(false);\r\n let showExpiredModal = $state(false);\r\n let warningShown = $state(false);\r\n let isExtendingSession = $state(false);\r\n let remainingExtensions = $state(3);\r\n let canExtend = $state(true);\r\n\r\n const WARNING_THRESHOLD = 30; // Show warning modal at 30 seconds remaining\r\n\r\n // Formatted timer display for the modal\r\n let timerDisplay = $derived(\r\n (() => {\r\n const m = Math.floor(timerSeconds / 60);\r\n const s = timerSeconds % 60;\r\n return `${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`;\r\n })()\r\n );\r\n\r\n // Order totals — the server's payment-intent response is the source\r\n // of truth (it's what Stripe will actually charge). Fall back to a\r\n // local estimate only when the server hasn't responded yet (showcase\r\n // mode, or while the initial /payment-intent is in flight) so the\r\n // skeleton has something to render.\r\n let orderTotals: OrderTotals = $derived(\r\n (() => {\r\n const lines = config.lines;\r\n if (config.serverTotals) {\r\n return {\r\n lines,\r\n subtotal: config.serverTotals.subtotal,\r\n fees: config.serverTotals.fees,\r\n taxes: config.serverTotals.taxes,\r\n total: config.serverTotals.total,\r\n promoDiscount: config.serverTotals.promoDiscount,\r\n giftCardAmount: config.serverTotals.giftCardAmount,\r\n };\r\n }\r\n const subtotal = roundCurrency(\r\n lines.reduce((sum, l) => sum + l.subtotal, 0)\r\n );\r\n const fees = roundCurrency(\r\n lines.reduce((sum, l) => sum + l.fee * l.quantity, 0)\r\n );\r\n const promoDiscount = config.promoApplied ? config.promoDiscount : 0;\r\n const adjustedSubtotal = roundCurrency(\r\n Math.max(0, subtotal - promoDiscount)\r\n );\r\n const taxes = calculateTax(\r\n adjustedSubtotal + fees,\r\n config.event.venue.taxPercentage\r\n );\r\n return {\r\n lines,\r\n subtotal,\r\n fees,\r\n taxes,\r\n total: roundCurrency(adjustedSubtotal + fees + taxes),\r\n promoDiscount,\r\n giftCardAmount: 0,\r\n };\r\n })()\r\n );\r\n\r\n // Disable Place-order until the server has confirmed the totals.\r\n // Showing \"Place order · $55\" while the actual Stripe charge will be\r\n // $63.55 is worse than briefly disabling the button. Free orders\r\n // never call the payment-intent endpoint, so they're exempt.\r\n let totalsLocked = $derived(!!config.serverTotals);\r\n\r\n let isFreeOrder = $derived(\r\n orderTotals.total === 0 && orderTotals.subtotal === 0\r\n );\r\n let isRegistration = $derived(config.event.isRegistrationEvent);\r\n\r\n // Set timer ONCE on initial mount — not on every config change.\r\n // Config changes frequently (Stripe loads, quantities update, etc.)\r\n // and must not reset the timer.\r\n let timerInitialized = false;\r\n $effect(() => {\r\n const c = config;\r\n if (!timerInitialized) {\r\n timerInitialized = true;\r\n // Convert the incoming \"seconds from now\" into an absolute deadline.\r\n // From this point on, deadlineMs is the source of truth.\r\n deadlineMs = Date.now() + c.timerStart * 1000;\r\n timerSeconds = c.timerStart;\r\n isExpired = c.forceExpired;\r\n }\r\n // These are safe to reset on config change (UI state, not timer)\r\n processing = false;\r\n submitRequested = 0;\r\n });\r\n\r\n function getCartIdFromCookie(): string | null {\r\n if (typeof document === 'undefined') return null;\r\n return document.cookie.match(/checkout-cartid=([^;]+)/)?.[1] ?? null;\r\n }\r\n\r\n function recomputeFromDeadline(): number {\r\n if (deadlineMs == null) return timerSeconds;\r\n return Math.max(0, Math.floor((deadlineMs - Date.now()) / 1000));\r\n }\r\n\r\n /**\r\n * Re-sync the deadline from the orders-service. Called on tab focus —\r\n * a backgrounded tab might have missed an extension granted in another\r\n * tab, or the server may have already expired the cart while we slept.\r\n *\r\n * Silent on any error: the existing deadlineMs continues to drive the\r\n * display, which is no worse than the pre-resync state.\r\n */\r\n async function resyncDeadlineFromServer(): Promise<void> {\r\n const cartId = getCartIdFromCookie();\r\n if (!cartId) return;\r\n try {\r\n const status = await getSessionStatus(cartId);\r\n if (status.notFound) {\r\n // Server has already released the reservation. Surface the\r\n // expired modal so the user isn't staring at a phantom timer.\r\n deadlineMs = Date.now();\r\n timerSeconds = 0;\r\n isExpired = true;\r\n showWarningModal = false;\r\n showExpiredModal = true;\r\n return;\r\n }\r\n if (status.expiresAt) {\r\n deadlineMs = new Date(status.expiresAt).getTime();\r\n timerSeconds = recomputeFromDeadline();\r\n }\r\n } catch {\r\n /* network error — keep current deadlineMs */\r\n }\r\n }\r\n\r\n // Timer countdown with warning and expired modal triggers.\r\n //\r\n // The interval ticks at 1 Hz, but its job is to *recompute* timerSeconds\r\n // from deadlineMs, not to decrement a counter. Backgrounded tabs throttle\r\n // this interval — that's fine; when the tab regains focus the\r\n // visibilitychange handler runs the recompute immediately and the display\r\n // jumps to truth.\r\n $effect(() => {\r\n if (isExpired || timerSeconds <= 0) {\r\n if (timerSeconds <= 0 && !isExpired) {\r\n isExpired = true;\r\n showWarningModal = false;\r\n showExpiredModal = true;\r\n }\r\n return;\r\n }\r\n\r\n const tick = () => {\r\n const next = recomputeFromDeadline();\r\n timerSeconds = next;\r\n\r\n // Persist deadline to localStorage every 10 displayed seconds.\r\n // (Storing the deadline directly — not a recomputed end-time —\r\n // keeps reads consistent across tabs.)\r\n if (\r\n next % 10 === 0 &&\r\n deadlineMs != null &&\r\n typeof localStorage !== 'undefined'\r\n ) {\r\n try {\r\n const cartId = getCartIdFromCookie();\r\n if (cartId) {\r\n localStorage.setItem(\r\n `checkout-expiry-${cartId}`,\r\n String(deadlineMs)\r\n );\r\n }\r\n } catch {\r\n /* ignore */\r\n }\r\n }\r\n\r\n // Show warning modal at 30 seconds remaining (only once per session).\r\n // We compare with <= because a backgrounded tab may have skipped over\r\n // the exact === WARNING_THRESHOLD boundary while throttled.\r\n if (next <= WARNING_THRESHOLD && next > 0 && !warningShown) {\r\n showWarningModal = true;\r\n warningShown = true;\r\n }\r\n\r\n if (next <= 0) {\r\n isExpired = true;\r\n showWarningModal = false;\r\n showExpiredModal = true;\r\n clearInterval(interval);\r\n }\r\n };\r\n\r\n const interval = setInterval(tick, 1000);\r\n\r\n // Recompute immediately whenever the tab becomes visible — a\r\n // throttled/paused interval may have left the display many minutes\r\n // behind reality. Also kick a server resync to catch the case where\r\n // the reservation already expired (or was extended in another tab).\r\n const onVisible = () => {\r\n if (\r\n typeof document !== 'undefined' &&\r\n document.visibilityState === 'visible'\r\n ) {\r\n tick();\r\n void resyncDeadlineFromServer();\r\n }\r\n };\r\n if (typeof document !== 'undefined') {\r\n document.addEventListener('visibilitychange', onVisible);\r\n }\r\n if (typeof window !== 'undefined') {\r\n window.addEventListener('pageshow', onVisible);\r\n }\r\n\r\n // Initial server resync — catches the case where the user landed on\r\n // checkout with a stale cookie whose cart has already been released.\r\n void resyncDeadlineFromServer();\r\n\r\n return () => {\r\n clearInterval(interval);\r\n if (typeof document !== 'undefined') {\r\n document.removeEventListener('visibilitychange', onVisible);\r\n }\r\n if (typeof window !== 'undefined') {\r\n window.removeEventListener('pageshow', onVisible);\r\n }\r\n };\r\n });\r\n\r\n // --- Handlers ---\r\n function handleBack() {\r\n if (onBackProp) {\r\n onBackProp();\r\n } else {\r\n toast.info('Back button pressed — would navigate to ticket selection');\r\n }\r\n }\r\n\r\n /** Called from sidebar/mobile footer — signals the form to validate + submit */\r\n function requestPlaceOrder() {\r\n submitRequested += 1;\r\n }\r\n\r\n /** Called by CheckoutForm after successful validation */\r\n function handlePlaceOrder(formData: CheckoutFormData) {\r\n if (processing) return;\r\n processing = true;\r\n\r\n if (onPlaceOrderProp) {\r\n // Production mode: delegate to wrapper with form data\r\n onPlaceOrderProp(formData)\r\n .catch(() => {\r\n // Error handling is done by the wrapper; just reset processing\r\n })\r\n .finally(() => {\r\n processing = false;\r\n });\r\n return;\r\n }\r\n\r\n // Showcase mode: existing mock delay\r\n setTimeout(() => {\r\n processing = false;\r\n const count = orderTotals.lines.reduce((s, l) => s + l.quantity, 0);\r\n toast.success(\r\n `Order placed! ${count} ticket(s) for ${formatCurrency(orderTotals.total as USD /* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */)}`\r\n );\r\n }, 1500);\r\n }\r\n\r\n function handleRetryExpired() {\r\n showExpiredModal = false;\r\n if (onRetryExpiredProp) {\r\n onRetryExpiredProp();\r\n } else {\r\n toast.info('Would navigate back to ticket selection to start over');\r\n }\r\n }\r\n\r\n /** Extend the checkout session via the parent wrapper's onExtendSession callback */\r\n async function handleExtendSession() {\r\n if (!canExtend || isExtendingSession) return;\r\n isExtendingSession = true;\r\n\r\n try {\r\n if (onExtendSessionProp) {\r\n const result = await onExtendSessionProp();\r\n // The parent wrapper (Checkout.svelte) returns `null` when the\r\n // extend-session API call fails — e.g. when the reservation\r\n // has already expired server-side past its grace window, or\r\n // the user has used all 3 extensions. Treat null/undefined as\r\n // an unambiguous failure: don't reset the timer to +15min\r\n // locally (that would falsely show the user they still have a\r\n // valid cart when the server has already released the tickets).\r\n if (result == null) {\r\n throw new AppError('Extension request returned no result', 'lib/premium-ticket-experience/variants/v3-airbnb-split/CheckoutMain/handleExtendSession');\r\n }\r\n if (typeof result === 'object') {\r\n if (result.newExpiryTime) {\r\n // Server gave us an absolute new expiry — use it directly.\r\n deadlineMs = new Date(result.newExpiryTime).getTime();\r\n } else {\r\n // Fallback: add 15 minutes from now\r\n deadlineMs = Date.now() + 15 * 60 * 1000;\r\n }\r\n timerSeconds = recomputeFromDeadline();\r\n if (result.remainingExtensions !== undefined) {\r\n remainingExtensions = result.remainingExtensions;\r\n canExtend = remainingExtensions > 0;\r\n }\r\n } else {\r\n // Truthy non-object: legacy callers that just return `true`\r\n // on success. Treat as a simple 15-minute extension.\r\n deadlineMs = Date.now() + 15 * 60 * 1000;\r\n timerSeconds = recomputeFromDeadline();\r\n }\r\n } else {\r\n // Showcase mode: just add 15 minutes\r\n deadlineMs = Date.now() + 15 * 60 * 1000;\r\n timerSeconds = recomputeFromDeadline();\r\n }\r\n\r\n isExpired = false;\r\n warningShown = false;\r\n showWarningModal = false;\r\n showExpiredModal = false;\r\n } catch (err) {\r\n logger.error('Failed to extend session:', err);\r\n // Extension failed — close the warning but keep the expired\r\n // modal open so the user is offered \"Select tickets again\".\r\n // Disable further extend attempts on this dead cart.\r\n showWarningModal = false;\r\n canExtend = false;\r\n if (timerSeconds <= 0) {\r\n isExpired = true;\r\n showExpiredModal = true;\r\n }\r\n } finally {\r\n isExtendingSession = false;\r\n }\r\n }\r\n\r\n /** Dismiss warning modal without extending (user will hurry) */\r\n function dismissWarning() {\r\n showWarningModal = false;\r\n }\r\n\r\n function handleVariantChange(v: string) {\r\n dataVariant = v as CheckoutVariant;\r\n }\r\n</script>\r\n\r\n<div class=\"w-full min-h-screen bg-surface-primary text-color-primary\">\r\n <!-- Dev: mock data toggle (showcase mode only) -->\r\n {#if isShowcaseMode}\r\n <div class=\"toggle-bar bg-surface-primary border-default\">\r\n <span class=\"toggle-label text-color-muted\">Checkout</span>\r\n {#each toggleOptions as option}\r\n {@const isActive = dataVariant === option.value}\r\n <button\r\n type=\"button\"\r\n class=\"toggle-btn {isActive\r\n ? 'active bg-surface-secondary text-color-primary font-medium'\r\n : 'text-color-tertiary hover:bg-surface-secondary hover:text-color-secondary'}\"\r\n onclick={() => handleVariantChange(option.value)}\r\n >\r\n <span class=\"w-1.5 h-1.5 rounded-full {option.color} shrink-0\"></span>\r\n {option.label}\r\n </button>\r\n {/each}\r\n </div>\r\n {/if}\r\n\r\n <div class=\"max-w-6xl mx-auto px-4 py-6 md:px-6 md:py-8\">\r\n <!-- Single CheckoutForm shared between desktop and mobile layouts.\r\n\t\t Previously there were two instances (one hidden md:grid, one md:hidden)\r\n\t\t which caused duplicate Stripe elements and broken form submission. -->\r\n <div class=\"max-w-6xl\">\r\n <!-- Desktop: two-column grid; Mobile: single column -->\r\n <!-- @tokens-px-escape: grid-template-columns uses a custom 360px sidebar width that has no space-token equivalent; arbitrary Tailwind JIT class unavailable in VC bundle -->\r\n <div\r\n class=\"md:grid gap-8 items-start\"\r\n style=\"grid-template-columns: 1fr 360px;\"\r\n >\r\n <!-- LEFT COLUMN (or full width on mobile): Checkout form -->\r\n <div class=\"pb-24 md:pb-0\">\r\n <CheckoutForm\r\n event={config.event}\r\n {orderTotals}\r\n {timerSeconds}\r\n {isExpired}\r\n {isRegistration}\r\n {isFreeOrder}\r\n promoApplied={config.promoApplied}\r\n promoDiscount={config.promoDiscount}\r\n onBack={handleBack}\r\n onPlaceOrder={handlePlaceOrder}\r\n {processing}\r\n {submitRequested}\r\n {stripe}\r\n {paymentIntent}\r\n bind:elements\r\n {paymentError}\r\n labels={mergedLabels}\r\n />\r\n\r\n <!-- Inline order summary for mobile (below form) -->\r\n <section\r\n class=\"md:hidden mobile-order-summary border-default bg-surface-secondary mt-6\"\r\n >\r\n <Heading level={3} size=\"sm\" weight=\"semibold\" class=\"mb-3\">\r\n {mergedLabels.orderSummary || 'Order summary'}\r\n </Heading>\r\n <OrderSummary {orderTotals} />\r\n </section>\r\n </div>\r\n\r\n <!-- RIGHT COLUMN: Sticky order summary sidebar (desktop only) -->\r\n <div class=\"hidden md:block sticky top-6\">\r\n <CheckoutSidebar\r\n event={config.event}\r\n {orderTotals}\r\n {isFreeOrder}\r\n onPlaceOrder={requestPlaceOrder}\r\n processing={processing || (!isFreeOrder && !totalsLocked)}\r\n labels={mergedLabels}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Mobile: Fixed bottom bar -->\r\n <div class=\"md:hidden\">\r\n <CheckoutMobileFooter\r\n {orderTotals}\r\n {isFreeOrder}\r\n onPlaceOrder={requestPlaceOrder}\r\n processing={processing || (!isFreeOrder && !totalsLocked)}\r\n labels={mergedLabels}\r\n />\r\n </div>\r\n </div>\r\n\r\n <!-- Session Warning Modal (30 seconds remaining).\r\n Wrapped in `{#if}` (instead of relying on `bind:open` alone) so\r\n the Modal fully mounts/unmounts each time showWarningModal\r\n transitions. Surfaced by a wall-clock test where, after the\r\n user clicked \"Continue checkout\" on a first warning, the Modal\r\n component's internal open-state never reset cleanly — on the\r\n NEXT 30s threshold the timer text in DOM updated but the modal\r\n stayed visually hidden, so the user lost the cart with no\r\n chance to re-extend. Forcing remount with #if sidesteps that. -->\r\n {#if showWarningModal}\r\n <Modal\r\n open={true}\r\n oncancel={() => (showWarningModal = false)}\r\n size=\"sm\"\r\n role=\"alertdialog\"\r\n aria-labelledby=\"warning-modal-title\"\r\n aria-describedby=\"warning-modal-description\"\r\n >\r\n {#snippet body()}\r\n <div class=\"timer-modal\" id=\"warning-modal-description\">\r\n <div class=\"timer-modal-icon warning\">\r\n <Warning size={32} />\r\n </div>\r\n <h3 id=\"warning-modal-title\" class=\"timer-modal-title\">\r\n {mergedLabels.sessionExpiringSoon || 'Session expiring soon'}\r\n </h3>\r\n <p class=\"timer-modal-text\">\r\n {(\r\n mergedLabels.sessionExpiringSoonMessage ||\r\n 'Your checkout session will expire in {time}. Your selected tickets will be released back to inventory.'\r\n ).replace('{time}', timerDisplay)}\r\n </p>\r\n {#if canExtend && remainingExtensions > 0}\r\n <p class=\"timer-modal-hint\">\r\n {(\r\n mergedLabels.extensionsRemaining ||\r\n '{count} extension{plural} remaining'\r\n )\r\n .replace('{count}', String(remainingExtensions))\r\n .replace('{plural}', remainingExtensions === 1 ? '' : 's')}\r\n </p>\r\n {/if}\r\n </div>\r\n {/snippet}\r\n {#snippet footer()}\r\n <div class=\"timer-modal-actions\">\r\n {#if canExtend}\r\n <Button\r\n variant=\"default\"\r\n size=\"lg\"\r\n class=\"w-full\"\r\n onclick={handleExtendSession}\r\n disabled={isExtendingSession}\r\n loading={isExtendingSession}\r\n >\r\n {isExtendingSession\r\n ? mergedLabels.extendingSession || 'Extending...'\r\n : mergedLabels.continueCheckout || 'Continue checkout'}\r\n </Button>\r\n {:else}\r\n <Button\r\n variant=\"default\"\r\n size=\"lg\"\r\n class=\"w-full\"\r\n onclick={dismissWarning}\r\n >\r\n {mergedLabels.okIllHurry || \"OK, I'll hurry\"}\r\n </Button>\r\n <p class=\"timer-modal-hint\">\r\n {mergedLabels.maxExtensionsReached ||\r\n 'Maximum extensions reached'}\r\n </p>\r\n {/if}\r\n </div>\r\n {/snippet}\r\n </Modal>\r\n {/if}\r\n\r\n <!-- Session Expired Modal (\"Want to keep your tickets?\").\r\n Same `{#if}` wrap as the warning modal — forces a fresh\r\n Modal mount each time so reopening after a previous extend\r\n cycle actually re-displays the dialog. -->\r\n {#if showExpiredModal}\r\n <Modal\r\n open={true}\r\n oncancel={() => (showExpiredModal = false)}\r\n size=\"sm\"\r\n role=\"alertdialog\"\r\n aria-labelledby=\"expired-modal-title\"\r\n aria-describedby=\"expired-modal-description\"\r\n >\r\n {#snippet body()}\r\n <div class=\"timer-modal\" id=\"expired-modal-description\">\r\n <div class=\"timer-modal-icon expired\">\r\n <Time size={32} />\r\n </div>\r\n <h3 id=\"expired-modal-title\" class=\"timer-modal-title\">\r\n {canExtend\r\n ? mergedLabels.wantToKeepTickets || 'Want to keep your tickets?'\r\n : mergedLabels.sessionExpired || 'Session expired'}\r\n </h3>\r\n <p class=\"timer-modal-text\">\r\n {canExtend\r\n ? mergedLabels.sessionExpiredMessage ||\r\n 'Your checkout session has expired and your selected tickets have been released.'\r\n : mergedLabels.reservationTimedOut ||\r\n 'Your reservation has timed out. Please select your tickets again to continue.'}\r\n </p>\r\n </div>\r\n {/snippet}\r\n {#snippet footer()}\r\n <div class=\"timer-modal-actions\">\r\n {#if canExtend}\r\n <Button\r\n variant=\"default\"\r\n size=\"lg\"\r\n class=\"w-full\"\r\n onclick={handleExtendSession}\r\n disabled={isExtendingSession}\r\n loading={isExtendingSession}\r\n >\r\n {isExtendingSession\r\n ? mergedLabels.extendingSession || 'Extending...'\r\n : mergedLabels.keepMyTickets || 'Keep my tickets'}\r\n </Button>\r\n <Button\r\n variant=\"alternative\"\r\n size=\"lg\"\r\n class=\"w-full\"\r\n onclick={handleRetryExpired}\r\n >\r\n {mergedLabels.selectTicketsAgain || 'Select tickets again'}\r\n </Button>\r\n {:else}\r\n <Button\r\n variant=\"default\"\r\n size=\"lg\"\r\n class=\"w-full\"\r\n onclick={handleRetryExpired}\r\n >\r\n {mergedLabels.selectTicketsAgain || 'Select tickets again'}\r\n </Button>\r\n {/if}\r\n </div>\r\n {/snippet}\r\n </Modal>\r\n {/if}\r\n</div>\r\n\r\n<style>\r\n /* DataToggle inline (matches DataToggle.svelte pattern) */\r\n .toggle-bar {\r\n position: sticky;\r\n top: 0;\r\n z-index: var(--z-dropdown);\r\n display: flex;\r\n align-items: center;\r\n gap: 0.25rem;\r\n padding: 0.5rem 0.75rem;\r\n overflow-x: auto;\r\n border-bottom-width: 1px;\r\n border-bottom-style: solid;\r\n }\r\n\r\n .toggle-label {\r\n padding-left: 0.375rem;\r\n padding-right: 0.375rem;\r\n flex-shrink: 0;\r\n text-transform: uppercase;\r\n letter-spacing: 0.05em;\r\n font-size: 0.625rem;\r\n }\r\n\r\n .toggle-btn {\r\n display: flex;\r\n align-items: center;\r\n gap: 0.375rem;\r\n padding: 0.25rem 0.5rem;\r\n border-radius: 0.375rem;\r\n font-size: 0.75rem;\r\n line-height: 1rem;\r\n white-space: nowrap;\r\n transition-property: all;\r\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\r\n transition-duration: 150ms;\r\n }\r\n\r\n /* Mobile order summary */\r\n .mobile-order-summary {\r\n padding: 1rem;\r\n border-radius: 0.5rem;\r\n border-width: 1px;\r\n border-style: solid;\r\n }\r\n\r\n /* Timer modals */\r\n .timer-modal {\r\n text-align: center;\r\n padding: 0.5rem 0;\r\n }\r\n\r\n .timer-modal-icon {\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 3.5rem;\r\n height: 3.5rem;\r\n border-radius: 9999px;\r\n margin: 0 auto 1rem;\r\n }\r\n\r\n .timer-modal-icon.warning {\r\n background-color: hsl(var(--accent-warning) / 8%);\r\n color: hsl(var(--accent-warning));\r\n }\r\n\r\n .timer-modal-icon.expired {\r\n background-color: hsl(var(--accent-danger) / 5%);\r\n color: hsl(var(--accent-danger));\r\n }\r\n\r\n .timer-modal-title {\r\n font-size: 1.125rem;\r\n font-weight: 600;\r\n margin-bottom: 0.5rem;\r\n }\r\n\r\n .timer-modal-text {\r\n font-size: 0.875rem;\r\n line-height: 1.4;\r\n color: hsl(var(--text-tertiary)); /* gray-500 */\r\n }\r\n\r\n .timer-modal-hint {\r\n font-size: 0.75rem;\r\n color: hsl(var(--text-head)); /* gray-400 */\r\n margin-top: 0.5rem;\r\n }\r\n\r\n .timer-modal-actions {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 0.5rem;\r\n }\r\n /* The Button component's class=\"w-full\" is a Tailwind utility that\r\n isn't always emitted in the venue-calendar bundle (no scanner\r\n pass over node_modules), so force full width at the layout\r\n level. Applies to both <button> and the anchor variant. */\r\n .timer-modal-actions :global(button),\r\n .timer-modal-actions :global(a) {\r\n width: 100%;\r\n }\r\n</style>\r\n"],"names":["browser","detectDarkMode","containerSelector","saved","selector","containers","container","getStripeTheme","isDark","useStripeTheme","options","watchChanges","fallback","current","$","observer","updateTheme","onMount","root","onDestroy","stripe","paymentIntent","elements","paymentError","labels","$$props","stripeTheme","paymentMountDiv","paymentElement","stripeMounted","mountStripePayment","firstName","lastName","email","keepUpdated","agreeTerms","cardNumber","cardExpiry","cardCvc","attendees","submitted","errors","e","i","att","hasErrors","isTimerUrgent","totalTickets","sum","l","_","lastSubmitRequest","handleSubmit","handleSameAsPurchaser","index","checked","a","div","div_1","Button","node","ChevronLeft","CheckoutTimer","node_1","section","Heading","node_2","div_2","$3","Input","node_3","$$value","node_4","node_5","Checkbox","node_6","section_1","root_4","node_8","node_9","attendee","div_3","root_6","div_4","Text","node_10","node_11","div_5","div_6","node_12","node_13","node_14","$$render","consequent","section_2","node_7","div_7","root_9","node_16","node_17","node_18","div_8","fragment_9","p","root_15","consequent_2","p_1","root_16","consequent_3","alternate","p_2","root_17","consequent_4","node_22","node_23","div_9","node_24","node_25","consequent_1","consequent_5","alternate_1","section_3","node_26","div_10","root_21","Warning","node_29","text_13","consequent_6","Card","$$anchor","fragment_1","img","Calendar","formatEventTime","formatBrowseDate","text_3","OrderSummary","$0","text_6","formatCurrency","totalTicketCount","text_1","logger","createLogger","dataVariant","toggleOptions","configProp","onPlaceOrderProp","onBackProp","onRetryExpiredProp","onExtendSessionProp","mergedLabels","mergeLabels","isShowcaseMode","buildConfig","variant","mockFreeEvent","mockDonationEvent","mockRegistrationEvent","mockEvent","config","deadlineMs","timerSeconds","isExpired","processing","submitRequested","showWarningModal","showExpiredModal","warningShown","isExtendingSession","remainingExtensions","canExtend","WARNING_THRESHOLD","timerDisplay","m","s","orderTotals","lines","subtotal","roundCurrency","fees","promoDiscount","adjustedSubtotal","taxes","calculateTax","totalsLocked","isFreeOrder","isRegistration","timerInitialized","c","getCartIdFromCookie","recomputeFromDeadline","resyncDeadlineFromServer","cartId","status","getSessionStatus","tick","next","interval","onVisible","handleBack","toast","requestPlaceOrder","handlePlaceOrder","formData","count","handleRetryExpired","handleExtendSession","result","AppError","err","dismissWarning","handleVariantChange","v","root_1","option","isActive","button","root_2","span","text","CheckoutForm","CheckoutSidebar","CheckoutMobileFooter","Modal","root_5","h3","root_7","div_11","root_13","div_12","Time","h3_1","p_3","div_13","root_14","node_15"],"mappings":";;;;;;;;;;;AACoB,MAACA,KAAU,OAAO,SAAW;SC6BjCC,GAAeC,GAAmB;aACnC,SAAW,IAAW,QACtB;MACP;AAEM,UAAAC,IAAQ,aAAa,QAAQ,OAAO;QACtCA,MAAU,OAAM,QACT;QACPA,MAAU,QAAO,QACV;UAELC,IAAWF,KAAqB,qEAChCG,IAAa,SAAS,iBAAiBD,CAAQ;eAC1CE,KAAaD;AAChB,UAAAC,EAAU,aAAa,YAAY,MAAM,eAClC;WAGX,SAAS,gBAAgB,aAAa,YAAY,MAAM,SACjD,KAEJ,OAAO,aAAa,8BAA8B,GAAG,WAAW;AAAA,EAC3E,QACM;WACK;AAAA,EACX;AACJ;SAIgBC,GAAeC,GAAQ;SAC5BA,IAAS,UAAU;AAC9B;SAiBgBC,GAAeC,IAAO,IAAO;;IACjC,mBAAAR,IAAoB;AAAA,IAAqE,cAAAS,IAAe;AAAA,IAAM,UAAAC,IAAW;AAAA,MAAcF;MAC3IG,IAAUC,EAAA,MAAMA,EAAA,MAACF,CAAQ,CAAA,GACzBG,IAAW;AACN,WAAAC,IAAc;AACnB,IAAAF,EAAA,IAAAD,GAAUN,GAAeN,GAAeC,CAAiB,CAAA,GAAA,EAAA;AAAA,EAC7D;AACA,SAAAe,SAAc;AAGN,QADJD,EAAW,GACPL,KAAY,OAAW,mBAAqB,KAAa;AAEnD,YAAAN,IAAa,SAAS,iBA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AC,sBAAsB,sBAAsB,CAAA;;;;;AAG3D,cAAA7F,GAAMuE,GAAA;AAAA;;;yBAII6E;AAAA;;;8DAERvD,CAAY,EAAC,sBAAsB,sBAAsB,CAAA;;;;;;oBA5BzDoB,CAAS,IAAAhF,EAAAoB,CAAA,IAAApB,EAAA4B,GAAA,EAAA;AAAA;;kBADfmH,CAAG,eAAHA,CAAG;AAAA;;;;;YA7BLnE,CAAgB,KAAA5E,EAAA2B,EAAA;AAAA;;UA7KtB9D,EAAG,eAAHA,EAAG;AAFI;;;;;;","x_google_ignoreList":[1]}
1
+ {"version":3,"file":"CheckoutMain-C1pZjZd4.js","sources":["../__SKIP_ENVIRONMENT__","../node_modules/@getmicdrop/svelte-components/dist/stripe/useStripeTheme.svelte.js","../src/lib/premium-ticket-experience/variants/v3-airbnb-split/CheckoutForm.svelte","../src/lib/premium-ticket-experience/variants/v3-airbnb-split/CheckoutSidebar.svelte","../src/lib/premium-ticket-experience/variants/v3-airbnb-split/CheckoutMobileFooter.svelte","../src/lib/premium-ticket-experience/variants/v3-airbnb-split/CheckoutMain.svelte"],"sourcesContent":["\n export const browser = typeof window !== 'undefined';\n export const dev = false;\n export const building = false;\n export const version = '';\n ","/**\n * Stripe Theme Utility\n *\n * Provides reactive dark mode detection for Stripe Elements.\n * Automatically watches for theme changes via MutationObserver.\n *\n * @example\n * ```svelte\n * <script>\n * import { useStripeTheme } from '@getmicdrop/svelte-components/stripe';\n *\n * const stripeTheme = useStripeTheme();\n * // stripeTheme.current is 'stripe' | 'night'\n * // Automatically updates when theme changes\n * </script>\n *\n * <Elements theme={stripeTheme.current} {stripe} clientSecret={paymentIntent}>\n * <PaymentElement />\n * </Elements>\n * ```\n */\nimport { onMount, onDestroy } from 'svelte';\n/**\n * Detects if dark mode is active.\n *\n * Checks in order:\n * 1. localStorage 'theme' value\n * 2. Container element classes (.dark, [data-theme=\"dark\"])\n * 3. System preference (prefers-color-scheme)\n */\nexport function detectDarkMode(containerSelector) {\n if (typeof window === 'undefined')\n return false;\n try {\n // Check localStorage first\n const saved = localStorage.getItem('theme');\n if (saved === 'dark')\n return true;\n if (saved === 'light')\n return false;\n // Check for data-theme on common containers\n const selector = containerSelector || '[data-theme=\"dark\"], [data-theme=\"light\"], .micdrop, [data-theme]';\n const containers = document.querySelectorAll(selector);\n for (const container of containers) {\n if (container.getAttribute('data-theme') === 'dark')\n return true;\n }\n // Check document root\n if (document.documentElement.getAttribute('data-theme') === 'dark')\n return true;\n // Fallback to system preference\n return window.matchMedia?.('(prefers-color-scheme: dark)')?.matches ?? false;\n }\n catch {\n return false;\n }\n}\n/**\n * Maps dark mode state to Stripe theme.\n */\nexport function getStripeTheme(isDark) {\n return isDark ? 'night' : 'stripe';\n}\n/**\n * Creates a reactive Stripe theme that watches for dark mode changes.\n *\n * Returns an object with a `current` property that is reactive and\n * automatically updates when the theme changes.\n *\n * @example\n * ```svelte\n * <script>\n * import { useStripeTheme } from '@getmicdrop/svelte-components/stripe';\n * const stripeTheme = useStripeTheme();\n * </script>\n *\n * <Elements theme={stripeTheme.current} ...>\n * ```\n */\nexport function useStripeTheme(options = {}) {\n const { containerSelector = '[data-theme=\"dark\"], [data-theme=\"light\"], .micdrop, [data-theme]', watchChanges = true, fallback = 'stripe', } = options;\n let current = $state(fallback);\n let observer = null;\n function updateTheme() {\n current = getStripeTheme(detectDarkMode(containerSelector));\n }\n onMount(() => {\n // Initial detection\n updateTheme();\n if (watchChanges && typeof MutationObserver !== 'undefined') {\n // Watch for class changes on potential theme containers\n const containers = document.querySelectorAll(containerSelector);\n const root = document.documentElement;\n observer = new MutationObserver(() => {\n updateTheme();\n });\n // Observe document root\n observer.observe(root, {\n attributes: true,\n attributeFilter: ['class', 'data-theme'],\n });\n // Observe other containers\n containers.forEach(container => {\n observer?.observe(container, {\n attributes: true,\n attributeFilter: ['class', 'data-theme'],\n });\n });\n // Also listen for system preference changes\n const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n mediaQuery.addEventListener('change', updateTheme);\n }\n });\n onDestroy(() => {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n });\n return {\n get current() {\n return current;\n },\n /** Force refresh the theme detection */\n refresh: updateTheme,\n };\n}\n/**\n * Simple synchronous dark mode detection without reactivity.\n * Use this when you only need a one-time check.\n */\nexport function getInitialStripeTheme(containerSelector) {\n return getStripeTheme(detectDarkMode(containerSelector));\n}\n","<script lang=\"ts\">\r\n import { onMount, onDestroy } from 'svelte';\r\n import { browser } from '$app/environment';\r\n import { ChevronLeft, Warning } from 'carbon-icons-svelte';\r\n import {\r\n Button,\r\n Heading,\r\n Text,\r\n Input,\r\n Checkbox,\r\n } from '@getmicdrop/svelte-components';\r\n import { useStripeTheme } from '@getmicdrop/svelte-components/stripe';\r\n import type {\r\n EventData,\r\n OrderTotals,\r\n CheckoutFormData,\r\n } from '$lib/premium-ticket-experience/types';\r\n import CheckoutTimer from './CheckoutTimer.svelte';\r\n\r\n interface Props {\r\n event: EventData;\r\n orderTotals: OrderTotals;\r\n timerSeconds: number;\r\n isExpired: boolean;\r\n isRegistration: boolean;\r\n isFreeOrder: boolean;\r\n promoApplied: boolean;\r\n promoDiscount: number;\r\n onBack: () => void;\r\n onPlaceOrder: (formData: CheckoutFormData) => void;\r\n processing: boolean;\r\n /** Incremented by parent to trigger form validation + submit from external buttons (sidebar, mobile footer) */\r\n submitRequested: number;\r\n /** Stripe instance for production mode (absence = showcase mock inputs) */\r\n stripe?: any;\r\n /** Stripe client secret for PaymentElement */\r\n paymentIntent?: string;\r\n /** Bindable Stripe elements reference for the wrapper to use during payment confirmation */\r\n elements?: any;\r\n /** Payment error message from the wrapper */\r\n paymentError?: string;\r\n labels?: Record<string, string>;\r\n }\r\n\r\n let {\r\n event,\r\n orderTotals,\r\n timerSeconds,\r\n isExpired,\r\n isRegistration,\r\n isFreeOrder,\r\n promoApplied,\r\n promoDiscount,\r\n onBack,\r\n onPlaceOrder,\r\n processing,\r\n submitRequested,\r\n stripe = undefined,\r\n paymentIntent = undefined,\r\n elements = $bindable(undefined),\r\n paymentError = '',\r\n labels = {},\r\n }: Props = $props();\r\n\r\n // Use direct Stripe.js API instead of svelte-stripe (Svelte 5 compatibility bug).\r\n const stripeTheme = browser ? useStripeTheme() : { current: \"stripe\" as const };\r\n let paymentMountDiv = $state<HTMLElement | null>(null);\r\n let paymentElement: any = null;\r\n let stripeMounted = $state(false);\r\n\r\n function mountStripePayment() {\r\n if (\r\n !browser ||\r\n !stripe ||\r\n !paymentIntent ||\r\n !paymentMountDiv ||\r\n stripeMounted\r\n )\r\n return;\r\n elements = stripe.elements({\r\n clientSecret: paymentIntent,\r\n appearance: { theme: stripeTheme.current },\r\n });\r\n paymentElement = elements.create('payment');\r\n paymentElement.mount(paymentMountDiv);\r\n stripeMounted = true;\r\n }\r\n\r\n $effect(() => {\r\n if (stripe && paymentIntent && paymentMountDiv && !stripeMounted) {\r\n mountStripePayment();\r\n }\r\n });\r\n\r\n // Re-skin Stripe Elements when the theme changes (data-theme toggle).\r\n $effect(() => {\r\n if (stripeMounted && elements && stripeTheme.current) {\r\n try {\r\n elements.update({ appearance: { theme: stripeTheme.current } });\r\n } catch (_) {\r\n // Stripe Elements is finicky about post-mount updates; ignore.\r\n }\r\n }\r\n });\r\n\r\n onDestroy(() => {\r\n if (paymentElement) {\r\n paymentElement.destroy();\r\n paymentElement = null;\r\n }\r\n stripeMounted = false;\r\n });\r\n\r\n // --- Form state ---\r\n let firstName = $state('');\r\n let lastName = $state('');\r\n let email = $state('');\r\n let keepUpdated = $state(false);\r\n let agreeTerms = $state(false);\r\n\r\n // Payment fields (mock)\r\n let cardNumber = $state('');\r\n let cardExpiry = $state('');\r\n let cardCvc = $state('');\r\n\r\n // Per-ticket attendee fields (for registration events)\r\n let attendees = $state<\r\n Array<{\r\n firstName: string;\r\n lastName: string;\r\n email: string;\r\n sameAsPurchaser: boolean;\r\n }>\r\n >([]);\r\n\r\n // Validation state\r\n let submitted = $state(false);\r\n let errors = $derived(\r\n (() => {\r\n if (!submitted) return {};\r\n const e: Record<string, string> = {};\r\n if (!firstName.trim())\r\n e.firstName = labels.firstNameRequired || 'First name is required';\r\n if (!lastName.trim())\r\n e.lastName = labels.lastNameRequired || 'Last name is required';\r\n if (!email.trim()) e.email = labels.emailRequired || 'Email is required';\r\n else if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email))\r\n e.email = labels.emailInvalid || 'Enter a valid email address';\r\n if (!isFreeOrder && !stripe) {\r\n // Only validate mock card fields in showcase mode\r\n if (!cardNumber.trim())\r\n e.cardNumber = labels.cardNumberRequired || 'Card number is required';\r\n if (!cardExpiry.trim())\r\n e.cardExpiry = labels.expiryRequired || 'Expiry date is required';\r\n if (!cardCvc.trim())\r\n e.cardCvc = labels.cvcRequired || 'CVC is required';\r\n }\r\n if (!agreeTerms)\r\n e.agreeTerms = labels.mustAgreeTerms || 'You must agree to the terms';\r\n\r\n // Validate attendee fields for registration events\r\n if (isRegistration) {\r\n for (let i = 0; i < attendees.length; i++) {\r\n const att = attendees[i];\r\n if (!att.sameAsPurchaser) {\r\n if (!att.firstName.trim())\r\n e[`attendee_${i}_firstName`] = 'First name is required';\r\n if (!att.lastName.trim())\r\n e[`attendee_${i}_lastName`] = 'Last name is required';\r\n if (!att.email.trim())\r\n e[`attendee_${i}_email`] =\r\n labels.emailRequired || 'Email is required';\r\n else if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(att.email))\r\n e[`attendee_${i}_email`] =\r\n labels.emailInvalidShort || 'Enter a valid email';\r\n }\r\n }\r\n }\r\n\r\n return e;\r\n })()\r\n );\r\n\r\n let hasErrors = $derived(Object.keys(errors).length > 0);\r\n\r\n let isTimerUrgent = $derived(timerSeconds > 0 && timerSeconds <= 120);\r\n\r\n // Initialize attendee list based on order lines\r\n $effect(() => {\r\n if (isRegistration) {\r\n const totalTickets = orderTotals.lines.reduce(\r\n (sum, l) => sum + l.quantity,\r\n 0\r\n );\r\n if (attendees.length !== totalTickets) {\r\n attendees = Array.from({ length: totalTickets }, (_, i) => ({\r\n firstName: '',\r\n lastName: '',\r\n email: '',\r\n sameAsPurchaser: i === 0,\r\n }));\r\n }\r\n }\r\n });\r\n\r\n // Watch for external submit requests (from sidebar/mobile footer buttons)\r\n let lastSubmitRequest = $state(0);\r\n $effect(() => {\r\n if (submitRequested > lastSubmitRequest) {\r\n lastSubmitRequest = submitRequested;\r\n handleSubmit();\r\n }\r\n });\r\n\r\n function handleSameAsPurchaser(index: number, checked: boolean) {\r\n attendees = attendees.map((att, i) => {\r\n if (i !== index) return att;\r\n return {\r\n ...att,\r\n sameAsPurchaser: checked,\r\n firstName: checked ? firstName : att.firstName,\r\n lastName: checked ? lastName : att.lastName,\r\n email: checked ? email : att.email,\r\n };\r\n });\r\n }\r\n\r\n function handleSubmit() {\r\n submitted = true;\r\n if (hasErrors) return;\r\n onPlaceOrder({\r\n firstName,\r\n lastName,\r\n email,\r\n keepMeUpdated: keepUpdated,\r\n attendees: isRegistration\r\n ? attendees.map(a => ({\r\n firstName: a.sameAsPurchaser ? firstName : a.firstName,\r\n lastName: a.sameAsPurchaser ? lastName : a.lastName,\r\n email: a.sameAsPurchaser ? email : a.email,\r\n sameAsPurchaser: a.sameAsPurchaser,\r\n }))\r\n : undefined,\r\n });\r\n }\r\n</script>\r\n\r\n<div class=\"space-y-6\">\r\n <!-- Timer header bar -->\r\n <div class=\"timer-header border-default bg-surface-secondary\">\r\n <Button\r\n variant=\"icon\"\r\n size=\"icon-sm\"\r\n onclick={onBack}\r\n aria-label={labels.goBack || 'Go back'}\r\n >\r\n <ChevronLeft size={20} />\r\n </Button>\r\n <CheckoutTimer seconds={timerSeconds} isUrgent={isTimerUrgent} />\r\n </div>\r\n\r\n <!-- Personal details -->\r\n <section class=\"space-y-4\">\r\n <Heading level={2} size=\"lg\" weight=\"semibold\">\r\n {labels.yourDetails || 'Your details'}\r\n </Heading>\r\n\r\n <div class=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\r\n <Input\r\n label={labels.firstName || 'First name'}\r\n placeholder={labels.firstName || 'First name'}\r\n required\r\n bind:value={firstName}\r\n errorText={errors.firstName ?? ''}\r\n color={errors.firstName ? 'red' : 'base'}\r\n />\r\n <Input\r\n label={labels.lastName || 'Last name'}\r\n placeholder={labels.lastName || 'Last name'}\r\n required\r\n bind:value={lastName}\r\n errorText={errors.lastName ?? ''}\r\n color={errors.lastName ? 'red' : 'base'}\r\n />\r\n </div>\r\n\r\n <Input\r\n label={labels.emailAddress || 'Email address'}\r\n type=\"email\"\r\n placeholder={labels.emailPlaceholder || 'you@example.com'}\r\n required\r\n bind:value={email}\r\n errorText={errors.email ?? ''}\r\n color={errors.email ? 'red' : 'base'}\r\n />\r\n\r\n <Checkbox bind:checked={keepUpdated}>\r\n {labels.keepMeUpdated ||\r\n 'Keep me updated about this event and similar events'}\r\n </Checkbox>\r\n </section>\r\n\r\n <!-- Per-ticket attendee details (registration events) -->\r\n {#if isRegistration && attendees.length > 0}\r\n <section class=\"space-y-5\">\r\n <Heading level={2} size=\"lg\" weight=\"semibold\">\r\n {labels.attendeeDetails || 'Attendee details'}\r\n </Heading>\r\n\r\n {#each attendees as attendee, i}\r\n <div class=\"attendee-card border-default bg-surface-secondary\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <Text size=\"sm\" class=\"font-semibold\">\r\n {labels.attendee || 'Attendee'}\r\n {i + 1}\r\n </Text>\r\n <Checkbox\r\n checked={attendee.sameAsPurchaser}\r\n onchange={({ checked }) => handleSameAsPurchaser(i, checked)}\r\n >\r\n {labels.sameAsPurchaser || 'Same as purchaser'}\r\n </Checkbox>\r\n </div>\r\n\r\n <div class=\"space-y-3\">\r\n <div class=\"grid grid-cols-1 sm:grid-cols-2 gap-3\">\r\n <Input\r\n label={labels.firstName || 'First name'}\r\n placeholder={labels.firstName || 'First name'}\r\n required\r\n disabled={attendee.sameAsPurchaser}\r\n bind:value={attendee.firstName}\r\n errorText={!attendee.sameAsPurchaser\r\n ? (errors[`attendee_${i}_firstName`] ?? '')\r\n : ''}\r\n color={!attendee.sameAsPurchaser &&\r\n errors[`attendee_${i}_firstName`]\r\n ? 'red'\r\n : 'base'}\r\n />\r\n <Input\r\n label={labels.lastName || 'Last name'}\r\n placeholder={labels.lastName || 'Last name'}\r\n required\r\n disabled={attendee.sameAsPurchaser}\r\n bind:value={attendee.lastName}\r\n errorText={!attendee.sameAsPurchaser\r\n ? (errors[`attendee_${i}_lastName`] ?? '')\r\n : ''}\r\n color={!attendee.sameAsPurchaser &&\r\n errors[`attendee_${i}_lastName`]\r\n ? 'red'\r\n : 'base'}\r\n />\r\n </div>\r\n <Input\r\n label={labels.email || 'Email'}\r\n type=\"email\"\r\n placeholder={labels.attendeeEmailPlaceholder ||\r\n 'attendee@example.com'}\r\n required\r\n disabled={attendee.sameAsPurchaser}\r\n bind:value={attendee.email}\r\n errorText={!attendee.sameAsPurchaser\r\n ? (errors[`attendee_${i}_email`] ?? '')\r\n : ''}\r\n color={!attendee.sameAsPurchaser && errors[`attendee_${i}_email`]\r\n ? 'red'\r\n : 'base'}\r\n />\r\n </div>\r\n </div>\r\n {/each}\r\n </section>\r\n {/if}\r\n\r\n <!-- Payment section -->\r\n <section class=\"space-y-4\">\r\n {#if isFreeOrder}\r\n <div class=\"free-order-notice border-default bg-surface-secondary\">\r\n <Text size=\"sm\" color=\"secondary\" class=\"font-medium block\">\r\n {labels.noPaymentRequired || 'No payment required'}\r\n </Text>\r\n <Text size=\"xs\" color=\"muted\" class=\"block mt-1\">\r\n {labels.freeEventMessage ||\r\n 'This is a free event. Complete the form above to reserve your spot.'}\r\n </Text>\r\n </div>\r\n {:else if stripe && paymentIntent}\r\n <!-- Production: Real Stripe PaymentElement -->\r\n <Heading level={2} size=\"lg\" weight=\"semibold\">Payment</Heading>\r\n {#if browser}\r\n <div bind:this={paymentMountDiv}></div>\r\n {#if !stripeMounted}\r\n <p class=\"text-sm text-color-muted py-2\">\r\n {labels.loadingPaymentForm || 'Loading secure payment form...'}\r\n </p>\r\n {/if}\r\n {:else}\r\n <p class=\"text-sm text-color-muted py-2\">\r\n {labels.loadingPaymentForm || 'Loading secure payment form...'}\r\n </p>\r\n {/if}\r\n {#if paymentError}\r\n <p class=\"text-sm text-accent-danger mt-2\">{paymentError}</p>\r\n {/if}\r\n {:else}\r\n <!-- Showcase: Mock card inputs -->\r\n <Heading level={2} size=\"lg\" weight=\"semibold\">Payment</Heading>\r\n\r\n <Input\r\n label={labels.cardNumber || 'Card number'}\r\n placeholder={labels.cardPlaceholder || '4242 4242 4242 4242'}\r\n type=\"creditCardNumber\"\r\n required\r\n bind:value={cardNumber}\r\n errorText={errors.cardNumber ?? ''}\r\n color={errors.cardNumber ? 'red' : 'base'}\r\n />\r\n\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <Input\r\n label={labels.expiryDate || 'Expiry date'}\r\n placeholder={labels.expiryPlaceholder || 'MM / YY'}\r\n required\r\n bind:value={cardExpiry}\r\n errorText={errors.cardExpiry ?? ''}\r\n color={errors.cardExpiry ? 'red' : 'base'}\r\n />\r\n <Input\r\n label={labels.cvc || 'CVC'}\r\n placeholder={labels.cvcPlaceholder || '123'}\r\n required\r\n maxlength={4}\r\n bind:value={cardCvc}\r\n errorText={errors.cardCvc ?? ''}\r\n color={errors.cardCvc ? 'red' : 'base'}\r\n />\r\n </div>\r\n {/if}\r\n </section>\r\n\r\n <!-- Terms -->\r\n <section class=\"space-y-2\">\r\n <Checkbox bind:checked={agreeTerms}>\r\n {labels.agreeToTerms || 'I agree to the terms and conditions'}\r\n </Checkbox>\r\n {#if errors.agreeTerms}\r\n <div class=\"flex items-center gap-1.5\">\r\n <Warning size={16} class=\"text-accent-danger shrink-0\" />\r\n <Text size=\"xs\" class=\"text-accent-danger\">{errors.agreeTerms}</Text>\r\n </div>\r\n {/if}\r\n </section>\r\n\r\n <!-- Mobile submit is handled by CheckoutMobileFooter -->\r\n</div>\r\n\r\n<style>\r\n .timer-header {\r\n display: flex;\r\n align-items: center;\r\n gap: 0.75rem;\r\n padding: 0.75rem 1rem;\r\n margin-left: -1rem;\r\n margin-right: -1rem;\r\n border-bottom-width: 1px;\r\n border-bottom-style: solid;\r\n border-radius: 0.5rem 0.5rem 0 0;\r\n }\r\n\r\n .attendee-card {\r\n padding: 1rem;\r\n border-radius: 0.5rem;\r\n border-width: 1px;\r\n border-style: solid;\r\n }\r\n\r\n .free-order-notice {\r\n padding: 1rem;\r\n border-radius: 0.5rem;\r\n border-width: 1px;\r\n border-style: solid;\r\n }\r\n</style>\r\n","<script lang=\"ts\">\r\n\timport type { USD } from '@getmicdrop/svelte-components';\r\nimport { Calendar } from 'carbon-icons-svelte';\r\n\timport { Button, Card, Text, formatCurrency } from '@getmicdrop/svelte-components';\r\n\timport type { EventData, OrderTotals } from '$lib/premium-ticket-experience/types';\r\n\timport { formatBrowseDate, formatEventTime } from '$lib/premium-ticket-experience/defaults';\r\n\timport OrderSummary from './OrderSummary.svelte';\r\n\r\n\tinterface Props {\r\n\t\tevent: EventData;\r\n\t\torderTotals: OrderTotals;\r\n\t\tisFreeOrder: boolean;\r\n\t\tonPlaceOrder: () => void;\r\n\t\tprocessing: boolean;\r\n\t\t\tlabels?: Record<string, string>;\r\n\t}\r\n\r\n\tlet { event, orderTotals, isFreeOrder, onPlaceOrder, processing, labels = {}, }: Props = $props();\r\n</script>\r\n\r\n<!--\r\n\tCap the sidebar card to the viewport so the Place Order button never\r\n\tfalls below the fold when many ticket types + fees + taxes + gift-card\r\n\tlines stack up. Body scrolls, button stays pinned at the bottom.\r\n-->\r\n<Card border padding={false} class=\"flex flex-col max-h-[calc(100vh-3rem)] rounded-xl shadow-lg overflow-hidden bg-surface-secondary\">\r\n\t<div class=\"p-5 flex-1 overflow-y-auto min-h-0 space-y-4\">\r\n\t\t<!-- Event info -->\r\n\t\t<div class=\"flex gap-3\">\r\n\t\t\t<div class=\"shrink-0 w-20 h-14 rounded-lg overflow-hidden bg-surface-tertiary\">\r\n\t\t\t\t<img\r\n\t\t\t\t\tsrc={event.imageUrl}\r\n\t\t\t\t\talt={event.title}\r\n\t\t\t\t\tclass=\"w-full h-full object-contain\"\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"flex-1 min-w-0\">\r\n\t\t\t\t<Text size=\"sm\" class=\"font-semibold block leading-tight line-clamp-2\">\r\n\t\t\t\t\t{event.title}\r\n\t\t\t\t</Text>\r\n\t\t\t\t<div class=\"flex items-center gap-1.5 mt-1\">\r\n\t\t\t\t\t<Calendar size={16} class=\"shrink-0 icon-muted\" />\r\n\t\t\t\t\t<Text size=\"xs\" color=\"muted\">\r\n\t\t\t\t\t\t{formatBrowseDate(event.startDateTime, event.timezone)}\r\n\t\t\t\t\t\t{#if event.displayStartTime !== false}\r\n\t\t\t\t\t\t\t&middot; {formatEventTime(event.startDateTime, event.timezone)}\r\n\t\t\t\t\t\t{/if}\r\n\t\t\t\t\t</Text>\r\n\t\t\t\t</div>\r\n\t\t\t\t<Text size=\"xs\" color=\"muted\" class=\"block mt-0.5\">\r\n\t\t\t\t\t{event.venue.name}\r\n\t\t\t\t</Text>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\r\n\t\t<!-- Divider -->\r\n\t\t<div class=\"divider\"></div>\r\n\r\n\t\t<!-- Order summary -->\r\n\t\t<OrderSummary {orderTotals}\r\n\t\t\t\t{labels} />\r\n\t</div>\r\n\r\n\t<!-- Pinned action footer: Place Order always visible -->\r\n\t<div class=\"p-5 pt-3 shrink-0 border-t border-default\">\r\n\t\t<Button\r\n\t\t\tvariant=\"default\"\r\n\t\t\tsize=\"lg\"\r\n\t\t\tclass=\"w-full\"\r\n\t\t\tdisabled={processing}\r\n\t\t\tloading={processing}\r\n\t\t\tonclick={onPlaceOrder}\r\n\t\t>\r\n\t\t\t{#if processing}\r\n\t\t\t\t{labels.placingOrder || 'Placing order...'}\r\n\t\t\t{:else if isFreeOrder}\r\n\t\t\t\t{labels.completeOrder || 'Complete order'} &middot; {labels.free || 'Free'}\r\n\t\t\t{:else}\r\n\t\t\t\t{labels.placeOrder || 'Place order'} &middot; {formatCurrency(orderTotals.total as USD /* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */)}\r\n\t\t\t{/if}\r\n\t\t</Button>\r\n\t</div>\r\n</Card>\r\n\r\n","<script lang=\"ts\">\r\n\timport type { USD } from '@getmicdrop/svelte-components';\r\nimport { Button, Text, formatCurrency } from '@getmicdrop/svelte-components';\r\n\timport type { OrderTotals } from '$lib/premium-ticket-experience/types';\r\n\r\n\tinterface Props {\r\n\t\torderTotals: OrderTotals;\r\n\t\tisFreeOrder: boolean;\r\n\t\tonPlaceOrder: () => void;\r\n\t\tprocessing: boolean;\r\n\t\t\tlabels?: Record<string, string>;\r\n\t}\r\n\r\n\tlet { orderTotals, isFreeOrder, onPlaceOrder, processing, labels = {}, }: Props = $props();\r\n\r\n\tlet totalTicketCount = $derived(\r\n\t\torderTotals.lines.reduce((sum, l) => sum + l.quantity, 0)\r\n\t);\r\n</script>\r\n\r\n<div\r\n\tclass=\"fixed bottom-0 left-0 right-0 z-40 md:hidden bg-surface-primary border-t border-default shadow-lg\"\r\n\tstyle=\"padding-bottom: env(safe-area-inset-bottom, 0);\"\r\n>\r\n\t<div class=\"flex items-center justify-between gap-3 px-4 py-3\">\r\n\t\t<!-- Left: total info -->\r\n\t\t<div class=\"flex-1 min-w-0\">\r\n\t\t\t<Text size=\"sm\" class=\"font-semibold tabular-nums block\">\r\n\t\t\t\t{#if isFreeOrder}\r\n\t\t\t\t\t{totalTicketCount} {totalTicketCount === 1 ? (labels.ticket || 'ticket') : (labels.tickets || 'tickets')} &middot; Free\r\n\t\t\t\t{:else}\r\n\t\t\t\t\t{formatCurrency(orderTotals.total as USD /* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */)}\r\n\t\t\t\t{/if}\r\n\t\t\t</Text>\r\n\t\t</div>\r\n\r\n\t\t<!-- Right: Place order button -->\r\n\t\t<Button\r\n\t\t\tvariant=\"default\"\r\n\t\t\tsize=\"lg\"\r\n\t\t\tdisabled={processing}\r\n\t\t\tloading={processing}\r\n\t\t\tonclick={onPlaceOrder}\r\n\t\t\tclass=\"shrink-0 min-w-36\"\r\n\t\t>\r\n\t\t\t{#if processing}\r\n\t\t\t\t{labels.placingOrder || 'Placing order...'}\r\n\t\t\t{:else if isFreeOrder}\r\n\t\t\t\t{labels.completeOrder || 'Complete order'}\r\n\t\t\t{:else}\r\n\t\t\t\t{labels.placeOrder || 'Place order'}\r\n\t\t\t{/if}\r\n\t\t</Button>\r\n\t</div>\r\n</div>\r\n\r\n","<script module>\r\n import {\r\n type USD,\r\n createLogger,\r\n formatCurrency,\r\n } from '@getmicdrop/svelte-components';\r\n const logger = createLogger('CheckoutMain');\r\n</script>\r\n\r\n<script lang=\"ts\">\r\n import { Warning, Time } from 'carbon-icons-svelte';\r\n import { AppError, Button, Heading, Modal, Text } from '@getmicdrop/svelte-components';\r\n import { toast } from '@getmicdrop/svelte-components/toast';\r\n import { roundCurrency } from '$lib/utils/currency.js';\r\n import type {\r\n EventData,\r\n OrderTotals,\r\n OrderLine,\r\n CheckoutConfig,\r\n CheckoutFormData,\r\n } from '$lib/premium-ticket-experience/types';\r\n import {\r\n mockEvent,\r\n mockFreeEvent,\r\n mockDonationEvent,\r\n mockRegistrationEvent,\r\n } from '$lib/premium-ticket-experience/mock-data';\r\n import { calculateTax } from '$lib/premium-ticket-experience/defaults';\r\n import { getSessionStatus } from '$lib/api/orders';\r\n\r\n import CheckoutForm from './CheckoutForm.svelte';\r\n import CheckoutSidebar from './CheckoutSidebar.svelte';\r\n import CheckoutMobileFooter from './CheckoutMobileFooter.svelte';\r\n import OrderSummary from './OrderSummary.svelte';\r\n import { mergeLabels } from '$lib/premium-ticket-experience/i18n/labels.js';\r\n\r\n // mergedLabels initialized after props destructuring below\r\n\r\n // --- DataToggle types ---\r\n type CheckoutVariant =\r\n | 'default'\r\n | 'free'\r\n | 'donation'\r\n | 'registration'\r\n | 'timer_warning'\r\n | 'expired'\r\n | 'promo';\r\n let dataVariant = $state<CheckoutVariant>('default');\r\n\r\n const toggleOptions: {\r\n value: CheckoutVariant;\r\n label: string;\r\n color: string;\r\n }[] = [\r\n { value: 'default', label: 'Standard', color: 'bg-accent-success' },\r\n { value: 'free', label: 'Free', color: 'bg-sky-500' },\r\n { value: 'donation', label: 'Donation', color: 'bg-accent-danger' },\r\n { value: 'registration', label: 'Registration', color: 'bg-brand-primary' },\r\n {\r\n value: 'timer_warning',\r\n label: 'Timer warning',\r\n color: 'bg-status-warning-bg0',\r\n },\r\n { value: 'expired', label: 'Expired', color: 'bg-accent-danger' },\r\n { value: 'promo', label: 'Promo discount', color: 'bg-accent-success' },\r\n ];\r\n\r\n // --- Props (dual-mode: showcase vs production) ---\r\n interface Props {\r\n /** Pre-built checkout config for production mode. Absence = showcase. */\r\n config?: CheckoutConfig;\r\n /** Production order submission handler. Receives form data for the wrapper to submit. */\r\n onPlaceOrder?: (formData: CheckoutFormData) => Promise<void>;\r\n /** Production back navigation handler. */\r\n onBack?: () => void;\r\n /** Production retry handler for expired sessions. */\r\n onRetryExpired?: () => void;\r\n /** Production session extension handler. Returns extension result with newExpiryTime and remainingExtensions. */\r\n onExtendSession?: () => Promise<{\r\n newExpiryTime?: string;\r\n remainingExtensions?: number;\r\n } | null | void>;\r\n /** Stripe instance passed through to CheckoutForm */\r\n stripe?: any;\r\n /** Stripe client secret passed through to CheckoutForm */\r\n paymentIntent?: string;\r\n /** Bindable Stripe elements for wrapper to access */\r\n elements?: any;\r\n /** Payment error message to display */\r\n paymentError?: string;\r\n labels?: Record<string, string>;\r\n }\r\n\r\n let {\r\n config: configProp = undefined,\r\n onPlaceOrder: onPlaceOrderProp = undefined,\r\n onBack: onBackProp = undefined,\r\n onRetryExpired: onRetryExpiredProp = undefined,\r\n onExtendSession: onExtendSessionProp = undefined,\r\n stripe = undefined,\r\n paymentIntent = undefined,\r\n elements = $bindable(undefined),\r\n paymentError = '',\r\n labels = {},\r\n }: Props = $props();\r\n\r\n const mergedLabels = $derived(mergeLabels(labels));\r\n let isShowcaseMode = $derived(!configProp);\r\n\r\n // --- Mock order configurations per variant ---\r\n function buildConfig(variant: CheckoutVariant): CheckoutConfig {\r\n switch (variant) {\r\n case 'free':\r\n return {\r\n event: mockFreeEvent,\r\n lines: [\r\n {\r\n ticketId: 201,\r\n ticketName: 'Free Entry',\r\n quantity: 2,\r\n unitPrice: 0,\r\n fee: 0,\r\n subtotal: 0,\r\n },\r\n ],\r\n timerStart: 900,\r\n promoApplied: false,\r\n promoDiscount: 0,\r\n forceExpired: false,\r\n };\r\n\r\n case 'donation':\r\n return {\r\n event: mockDonationEvent,\r\n lines: [\r\n {\r\n ticketId: 401,\r\n ticketName: 'Donation',\r\n quantity: 1,\r\n unitPrice: 25,\r\n fee: 0,\r\n subtotal: 25,\r\n },\r\n {\r\n ticketId: 402,\r\n ticketName: 'Standard Admission',\r\n quantity: 1,\r\n unitPrice: 30,\r\n fee: 3,\r\n subtotal: 30,\r\n },\r\n ],\r\n timerStart: 900,\r\n promoApplied: false,\r\n promoDiscount: 0,\r\n forceExpired: false,\r\n };\r\n\r\n case 'registration':\r\n return {\r\n event: mockRegistrationEvent,\r\n lines: [\r\n {\r\n ticketId: 301,\r\n ticketName: 'Workshop Seat',\r\n quantity: 1,\r\n unitPrice: 75,\r\n fee: 7.5,\r\n subtotal: 75,\r\n },\r\n ],\r\n timerStart: 900,\r\n promoApplied: false,\r\n promoDiscount: 0,\r\n forceExpired: false,\r\n };\r\n\r\n case 'timer_warning':\r\n return {\r\n event: mockEvent,\r\n lines: [\r\n {\r\n ticketId: 101,\r\n ticketName: 'General Admission',\r\n quantity: 2,\r\n unitPrice: 25,\r\n fee: 2.5,\r\n subtotal: 50,\r\n },\r\n {\r\n ticketId: 102,\r\n ticketName: 'VIP Front Row',\r\n quantity: 1,\r\n unitPrice: 55,\r\n fee: 5.5,\r\n subtotal: 55,\r\n },\r\n ],\r\n timerStart: 33, // Just over 30s — warning modal triggers at 30s\r\n promoApplied: false,\r\n promoDiscount: 0,\r\n forceExpired: false,\r\n };\r\n\r\n case 'expired':\r\n return {\r\n event: mockEvent,\r\n lines: [\r\n {\r\n ticketId: 101,\r\n ticketName: 'General Admission',\r\n quantity: 2,\r\n unitPrice: 25,\r\n fee: 2.5,\r\n subtotal: 50,\r\n },\r\n {\r\n ticketId: 102,\r\n ticketName: 'VIP Front Row',\r\n quantity: 1,\r\n unitPrice: 55,\r\n fee: 5.5,\r\n subtotal: 55,\r\n },\r\n ],\r\n timerStart: 0,\r\n promoApplied: false,\r\n promoDiscount: 0,\r\n forceExpired: true,\r\n };\r\n\r\n case 'promo':\r\n return {\r\n event: mockEvent,\r\n lines: [\r\n {\r\n ticketId: 101,\r\n ticketName: 'General Admission',\r\n quantity: 2,\r\n unitPrice: 25,\r\n fee: 2.5,\r\n subtotal: 50,\r\n },\r\n {\r\n ticketId: 102,\r\n ticketName: 'VIP Front Row',\r\n quantity: 1,\r\n unitPrice: 55,\r\n fee: 5.5,\r\n subtotal: 55,\r\n },\r\n ],\r\n timerStart: 900,\r\n promoApplied: true,\r\n promoDiscount: 10,\r\n forceExpired: false,\r\n };\r\n\r\n default:\r\n // Standard checkout\r\n return {\r\n event: mockEvent,\r\n lines: [\r\n {\r\n ticketId: 101,\r\n ticketName: 'General Admission',\r\n quantity: 2,\r\n unitPrice: 25,\r\n fee: 2.5,\r\n subtotal: 50,\r\n },\r\n {\r\n ticketId: 102,\r\n ticketName: 'VIP Front Row',\r\n quantity: 1,\r\n unitPrice: 55,\r\n fee: 5.5,\r\n subtotal: 55,\r\n },\r\n ],\r\n timerStart: 900,\r\n promoApplied: false,\r\n promoDiscount: 0,\r\n forceExpired: false,\r\n };\r\n }\r\n }\r\n\r\n // --- State ---\r\n let config: CheckoutConfig = $derived(\r\n isShowcaseMode ? buildConfig(dataVariant) : configProp!\r\n );\r\n // Deadline-based timer model.\r\n //\r\n // We track an absolute deadline timestamp (ms since epoch) and compute\r\n // the displayed seconds from `deadlineMs - Date.now()` on each tick.\r\n // This is immune to backgrounded-tab throttling: when the browser\r\n // suspends our setInterval, the displayed value falls behind, but the\r\n // very next tick (or the visibilitychange handler) recomputes from\r\n // wall-clock time and the display jumps to truth. Previously we\r\n // decremented `timerSeconds -= 1`, which drifted arbitrarily far from\r\n // reality whenever the tab was backgrounded (Chrome throttles 1Hz\r\n // intervals to ~1/min after a few minutes, then pauses them entirely).\r\n //\r\n // `timerSeconds` remains an explicit state var (rather than `$derived`)\r\n // because legacy code paths still write to it (legacy demo modes); the\r\n // canonical writer is now the deadline-driven tick effect below.\r\n let deadlineMs = $state<number | null>(null);\r\n let timerSeconds = $state(900);\r\n let isExpired = $state(false);\r\n let processing = $state(false);\r\n let submitRequested = $state(0);\r\n\r\n // Cart expiration warning/expired modal states\r\n let showWarningModal = $state(false);\r\n let showExpiredModal = $state(false);\r\n let warningShown = $state(false);\r\n let isExtendingSession = $state(false);\r\n let remainingExtensions = $state(3);\r\n let canExtend = $state(true);\r\n\r\n const WARNING_THRESHOLD = 30; // Show warning modal at 30 seconds remaining\r\n\r\n // Formatted timer display for the modal\r\n let timerDisplay = $derived(\r\n (() => {\r\n const m = Math.floor(timerSeconds / 60);\r\n const s = timerSeconds % 60;\r\n return `${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`;\r\n })()\r\n );\r\n\r\n // Order totals — the server's payment-intent response is the source\r\n // of truth (it's what Stripe will actually charge). Fall back to a\r\n // local estimate only when the server hasn't responded yet (showcase\r\n // mode, or while the initial /payment-intent is in flight) so the\r\n // skeleton has something to render.\r\n let orderTotals: OrderTotals = $derived(\r\n (() => {\r\n const lines = config.lines;\r\n if (config.serverTotals) {\r\n return {\r\n lines,\r\n subtotal: config.serverTotals.subtotal,\r\n fees: config.serverTotals.fees,\r\n taxes: config.serverTotals.taxes,\r\n total: config.serverTotals.total,\r\n promoDiscount: config.serverTotals.promoDiscount,\r\n giftCardAmount: config.serverTotals.giftCardAmount,\r\n };\r\n }\r\n const subtotal = roundCurrency(\r\n lines.reduce((sum, l) => sum + l.subtotal, 0)\r\n );\r\n const fees = roundCurrency(\r\n lines.reduce((sum, l) => sum + l.fee * l.quantity, 0)\r\n );\r\n const promoDiscount = config.promoApplied ? config.promoDiscount : 0;\r\n const adjustedSubtotal = roundCurrency(\r\n Math.max(0, subtotal - promoDiscount)\r\n );\r\n const taxes = calculateTax(\r\n adjustedSubtotal + fees,\r\n config.event.venue.taxPercentage\r\n );\r\n return {\r\n lines,\r\n subtotal,\r\n fees,\r\n taxes,\r\n total: roundCurrency(adjustedSubtotal + fees + taxes),\r\n promoDiscount,\r\n giftCardAmount: 0,\r\n };\r\n })()\r\n );\r\n\r\n // Disable Place-order until the server has confirmed the totals.\r\n // Showing \"Place order · $55\" while the actual Stripe charge will be\r\n // $63.55 is worse than briefly disabling the button. Free orders\r\n // never call the payment-intent endpoint, so they're exempt.\r\n let totalsLocked = $derived(!!config.serverTotals);\r\n\r\n let isFreeOrder = $derived(\r\n orderTotals.total === 0 && orderTotals.subtotal === 0\r\n );\r\n let isRegistration = $derived(config.event.isRegistrationEvent);\r\n\r\n // Set timer ONCE on initial mount — not on every config change.\r\n // Config changes frequently (Stripe loads, quantities update, etc.)\r\n // and must not reset the timer.\r\n let timerInitialized = false;\r\n $effect(() => {\r\n const c = config;\r\n if (!timerInitialized) {\r\n timerInitialized = true;\r\n // Convert the incoming \"seconds from now\" into an absolute deadline.\r\n // From this point on, deadlineMs is the source of truth.\r\n deadlineMs = Date.now() + c.timerStart * 1000;\r\n timerSeconds = c.timerStart;\r\n isExpired = c.forceExpired;\r\n }\r\n // These are safe to reset on config change (UI state, not timer)\r\n processing = false;\r\n submitRequested = 0;\r\n });\r\n\r\n function getCartIdFromCookie(): string | null {\r\n if (typeof document === 'undefined') return null;\r\n return document.cookie.match(/checkout-cartid=([^;]+)/)?.[1] ?? null;\r\n }\r\n\r\n function recomputeFromDeadline(): number {\r\n if (deadlineMs == null) return timerSeconds;\r\n return Math.max(0, Math.floor((deadlineMs - Date.now()) / 1000));\r\n }\r\n\r\n /**\r\n * Re-sync the deadline from the orders-service. Called on tab focus —\r\n * a backgrounded tab might have missed an extension granted in another\r\n * tab, or the server may have already expired the cart while we slept.\r\n *\r\n * Silent on any error: the existing deadlineMs continues to drive the\r\n * display, which is no worse than the pre-resync state.\r\n */\r\n async function resyncDeadlineFromServer(): Promise<void> {\r\n const cartId = getCartIdFromCookie();\r\n if (!cartId) return;\r\n try {\r\n const status = await getSessionStatus(cartId);\r\n if (status.notFound) {\r\n // Server has already released the reservation. Surface the\r\n // expired modal so the user isn't staring at a phantom timer.\r\n deadlineMs = Date.now();\r\n timerSeconds = 0;\r\n isExpired = true;\r\n showWarningModal = false;\r\n showExpiredModal = true;\r\n return;\r\n }\r\n if (status.expiresAt) {\r\n deadlineMs = new Date(status.expiresAt).getTime();\r\n timerSeconds = recomputeFromDeadline();\r\n }\r\n } catch {\r\n /* network error — keep current deadlineMs */\r\n }\r\n }\r\n\r\n // Timer countdown with warning and expired modal triggers.\r\n //\r\n // The interval ticks at 1 Hz, but its job is to *recompute* timerSeconds\r\n // from deadlineMs, not to decrement a counter. Backgrounded tabs throttle\r\n // this interval — that's fine; when the tab regains focus the\r\n // visibilitychange handler runs the recompute immediately and the display\r\n // jumps to truth.\r\n $effect(() => {\r\n if (isExpired || timerSeconds <= 0) {\r\n if (timerSeconds <= 0 && !isExpired) {\r\n isExpired = true;\r\n showWarningModal = false;\r\n showExpiredModal = true;\r\n }\r\n return;\r\n }\r\n\r\n const tick = () => {\r\n const next = recomputeFromDeadline();\r\n timerSeconds = next;\r\n\r\n // Persist deadline to localStorage every 10 displayed seconds.\r\n // (Storing the deadline directly — not a recomputed end-time —\r\n // keeps reads consistent across tabs.)\r\n if (\r\n next % 10 === 0 &&\r\n deadlineMs != null &&\r\n typeof localStorage !== 'undefined'\r\n ) {\r\n try {\r\n const cartId = getCartIdFromCookie();\r\n if (cartId) {\r\n localStorage.setItem(\r\n `checkout-expiry-${cartId}`,\r\n String(deadlineMs)\r\n );\r\n }\r\n } catch {\r\n /* ignore */\r\n }\r\n }\r\n\r\n // Show warning modal at 30 seconds remaining (only once per session).\r\n // We compare with <= because a backgrounded tab may have skipped over\r\n // the exact === WARNING_THRESHOLD boundary while throttled.\r\n if (next <= WARNING_THRESHOLD && next > 0 && !warningShown) {\r\n showWarningModal = true;\r\n warningShown = true;\r\n }\r\n\r\n if (next <= 0) {\r\n isExpired = true;\r\n showWarningModal = false;\r\n showExpiredModal = true;\r\n clearInterval(interval);\r\n }\r\n };\r\n\r\n const interval = setInterval(tick, 1000);\r\n\r\n // Recompute immediately whenever the tab becomes visible — a\r\n // throttled/paused interval may have left the display many minutes\r\n // behind reality. Also kick a server resync to catch the case where\r\n // the reservation already expired (or was extended in another tab).\r\n const onVisible = () => {\r\n if (\r\n typeof document !== 'undefined' &&\r\n document.visibilityState === 'visible'\r\n ) {\r\n tick();\r\n void resyncDeadlineFromServer();\r\n }\r\n };\r\n if (typeof document !== 'undefined') {\r\n document.addEventListener('visibilitychange', onVisible);\r\n }\r\n if (typeof window !== 'undefined') {\r\n window.addEventListener('pageshow', onVisible);\r\n }\r\n\r\n // Initial server resync — catches the case where the user landed on\r\n // checkout with a stale cookie whose cart has already been released.\r\n void resyncDeadlineFromServer();\r\n\r\n return () => {\r\n clearInterval(interval);\r\n if (typeof document !== 'undefined') {\r\n document.removeEventListener('visibilitychange', onVisible);\r\n }\r\n if (typeof window !== 'undefined') {\r\n window.removeEventListener('pageshow', onVisible);\r\n }\r\n };\r\n });\r\n\r\n // --- Handlers ---\r\n function handleBack() {\r\n if (onBackProp) {\r\n onBackProp();\r\n } else {\r\n toast.info('Back button pressed — would navigate to ticket selection');\r\n }\r\n }\r\n\r\n /** Called from sidebar/mobile footer — signals the form to validate + submit */\r\n function requestPlaceOrder() {\r\n submitRequested += 1;\r\n }\r\n\r\n /** Called by CheckoutForm after successful validation */\r\n function handlePlaceOrder(formData: CheckoutFormData) {\r\n if (processing) return;\r\n processing = true;\r\n\r\n if (onPlaceOrderProp) {\r\n // Production mode: delegate to wrapper with form data\r\n onPlaceOrderProp(formData)\r\n .catch(() => {\r\n // Error handling is done by the wrapper; just reset processing\r\n })\r\n .finally(() => {\r\n processing = false;\r\n });\r\n return;\r\n }\r\n\r\n // Showcase mode: existing mock delay\r\n setTimeout(() => {\r\n processing = false;\r\n const count = orderTotals.lines.reduce((s, l) => s + l.quantity, 0);\r\n toast.success(\r\n `Order placed! ${count} ticket(s) for ${formatCurrency(orderTotals.total as USD /* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */)}`\r\n );\r\n }, 1500);\r\n }\r\n\r\n function handleRetryExpired() {\r\n showExpiredModal = false;\r\n if (onRetryExpiredProp) {\r\n onRetryExpiredProp();\r\n } else {\r\n toast.info('Would navigate back to ticket selection to start over');\r\n }\r\n }\r\n\r\n /** Extend the checkout session via the parent wrapper's onExtendSession callback */\r\n async function handleExtendSession() {\r\n if (!canExtend || isExtendingSession) return;\r\n isExtendingSession = true;\r\n\r\n try {\r\n if (onExtendSessionProp) {\r\n const result = await onExtendSessionProp();\r\n // The parent wrapper (Checkout.svelte) returns `null` when the\r\n // extend-session API call fails — e.g. when the reservation\r\n // has already expired server-side past its grace window, or\r\n // the user has used all 3 extensions. Treat null/undefined as\r\n // an unambiguous failure: don't reset the timer to +15min\r\n // locally (that would falsely show the user they still have a\r\n // valid cart when the server has already released the tickets).\r\n if (result == null) {\r\n throw new AppError('Extension request returned no result', 'lib/premium-ticket-experience/variants/v3-airbnb-split/CheckoutMain/handleExtendSession');\r\n }\r\n if (typeof result === 'object') {\r\n if (result.newExpiryTime) {\r\n // Server gave us an absolute new expiry — use it directly.\r\n deadlineMs = new Date(result.newExpiryTime).getTime();\r\n } else {\r\n // Fallback: add 15 minutes from now\r\n deadlineMs = Date.now() + 15 * 60 * 1000;\r\n }\r\n timerSeconds = recomputeFromDeadline();\r\n if (result.remainingExtensions !== undefined) {\r\n remainingExtensions = result.remainingExtensions;\r\n canExtend = remainingExtensions > 0;\r\n }\r\n } else {\r\n // Truthy non-object: legacy callers that just return `true`\r\n // on success. Treat as a simple 15-minute extension.\r\n deadlineMs = Date.now() + 15 * 60 * 1000;\r\n timerSeconds = recomputeFromDeadline();\r\n }\r\n } else {\r\n // Showcase mode: just add 15 minutes\r\n deadlineMs = Date.now() + 15 * 60 * 1000;\r\n timerSeconds = recomputeFromDeadline();\r\n }\r\n\r\n isExpired = false;\r\n warningShown = false;\r\n showWarningModal = false;\r\n showExpiredModal = false;\r\n } catch (err) {\r\n logger.error('Failed to extend session:', err);\r\n // Extension failed — close the warning but keep the expired\r\n // modal open so the user is offered \"Select tickets again\".\r\n // Disable further extend attempts on this dead cart.\r\n showWarningModal = false;\r\n canExtend = false;\r\n if (timerSeconds <= 0) {\r\n isExpired = true;\r\n showExpiredModal = true;\r\n }\r\n } finally {\r\n isExtendingSession = false;\r\n }\r\n }\r\n\r\n /** Dismiss warning modal without extending (user will hurry) */\r\n function dismissWarning() {\r\n showWarningModal = false;\r\n }\r\n\r\n function handleVariantChange(v: string) {\r\n dataVariant = v as CheckoutVariant;\r\n }\r\n</script>\r\n\r\n<div class=\"w-full min-h-screen bg-surface-primary text-color-primary\">\r\n <!-- Dev: mock data toggle (showcase mode only) -->\r\n {#if isShowcaseMode}\r\n <div class=\"toggle-bar bg-surface-primary border-default\">\r\n <span class=\"toggle-label text-color-muted\">Checkout</span>\r\n {#each toggleOptions as option}\r\n {@const isActive = dataVariant === option.value}\r\n <button\r\n type=\"button\"\r\n class=\"toggle-btn {isActive\r\n ? 'active bg-surface-secondary text-color-primary font-medium'\r\n : 'text-color-tertiary hover:bg-surface-secondary hover:text-color-secondary'}\"\r\n onclick={() => handleVariantChange(option.value)}\r\n >\r\n <span class=\"w-1.5 h-1.5 rounded-full {option.color} shrink-0\"></span>\r\n {option.label}\r\n </button>\r\n {/each}\r\n </div>\r\n {/if}\r\n\r\n <div class=\"max-w-6xl mx-auto px-4 py-6 md:px-6 md:py-8\">\r\n <!-- Single CheckoutForm shared between desktop and mobile layouts.\r\n\t\t Previously there were two instances (one hidden md:grid, one md:hidden)\r\n\t\t which caused duplicate Stripe elements and broken form submission. -->\r\n <div class=\"max-w-6xl\">\r\n <!-- Desktop: two-column grid; Mobile: single column -->\r\n <!-- @tokens-px-escape: grid-template-columns uses a custom 360px sidebar width that has no space-token equivalent; arbitrary Tailwind JIT class unavailable in VC bundle -->\r\n <div\r\n class=\"md:grid gap-8 items-start\"\r\n style=\"grid-template-columns: 1fr 360px;\"\r\n >\r\n <!-- LEFT COLUMN (or full width on mobile): Checkout form -->\r\n <div class=\"pb-24 md:pb-0\">\r\n <CheckoutForm\r\n event={config.event}\r\n {orderTotals}\r\n {timerSeconds}\r\n {isExpired}\r\n {isRegistration}\r\n {isFreeOrder}\r\n promoApplied={config.promoApplied}\r\n promoDiscount={config.promoDiscount}\r\n onBack={handleBack}\r\n onPlaceOrder={handlePlaceOrder}\r\n {processing}\r\n {submitRequested}\r\n {stripe}\r\n {paymentIntent}\r\n bind:elements\r\n {paymentError}\r\n labels={mergedLabels}\r\n />\r\n\r\n <!-- Inline order summary for mobile (below form) -->\r\n <section\r\n class=\"md:hidden mobile-order-summary border-default bg-surface-secondary mt-6\"\r\n >\r\n <Heading level={3} size=\"sm\" weight=\"semibold\" class=\"mb-3\">\r\n {mergedLabels.orderSummary || 'Order summary'}\r\n </Heading>\r\n <OrderSummary {orderTotals} />\r\n </section>\r\n </div>\r\n\r\n <!-- RIGHT COLUMN: Sticky order summary sidebar (desktop only) -->\r\n <div class=\"hidden md:block sticky top-6\">\r\n <CheckoutSidebar\r\n event={config.event}\r\n {orderTotals}\r\n {isFreeOrder}\r\n onPlaceOrder={requestPlaceOrder}\r\n processing={processing || (!isFreeOrder && !totalsLocked)}\r\n labels={mergedLabels}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Mobile: Fixed bottom bar -->\r\n <div class=\"md:hidden\">\r\n <CheckoutMobileFooter\r\n {orderTotals}\r\n {isFreeOrder}\r\n onPlaceOrder={requestPlaceOrder}\r\n processing={processing || (!isFreeOrder && !totalsLocked)}\r\n labels={mergedLabels}\r\n />\r\n </div>\r\n </div>\r\n\r\n <!-- Session Warning Modal (30 seconds remaining).\r\n Wrapped in `{#if}` (instead of relying on `bind:open` alone) so\r\n the Modal fully mounts/unmounts each time showWarningModal\r\n transitions. Surfaced by a wall-clock test where, after the\r\n user clicked \"Continue checkout\" on a first warning, the Modal\r\n component's internal open-state never reset cleanly — on the\r\n NEXT 30s threshold the timer text in DOM updated but the modal\r\n stayed visually hidden, so the user lost the cart with no\r\n chance to re-extend. Forcing remount with #if sidesteps that. -->\r\n {#if showWarningModal}\r\n <Modal\r\n open={true}\r\n oncancel={() => (showWarningModal = false)}\r\n size=\"sm\"\r\n role=\"alertdialog\"\r\n aria-labelledby=\"warning-modal-title\"\r\n aria-describedby=\"warning-modal-description\"\r\n >\r\n {#snippet body()}\r\n <div class=\"timer-modal\" id=\"warning-modal-description\">\r\n <div class=\"timer-modal-icon warning\">\r\n <Warning size={32} />\r\n </div>\r\n <h3 id=\"warning-modal-title\" class=\"timer-modal-title\">\r\n {mergedLabels.sessionExpiringSoon || 'Session expiring soon'}\r\n </h3>\r\n <p class=\"timer-modal-text\">\r\n {(\r\n mergedLabels.sessionExpiringSoonMessage ||\r\n 'Your checkout session will expire in {time}. Your selected tickets will be released back to inventory.'\r\n ).replace('{time}', timerDisplay)}\r\n </p>\r\n {#if canExtend && remainingExtensions > 0}\r\n <p class=\"timer-modal-hint\">\r\n {(\r\n mergedLabels.extensionsRemaining ||\r\n '{count} extension{plural} remaining'\r\n )\r\n .replace('{count}', String(remainingExtensions))\r\n .replace('{plural}', remainingExtensions === 1 ? '' : 's')}\r\n </p>\r\n {/if}\r\n </div>\r\n {/snippet}\r\n {#snippet footer()}\r\n <div class=\"timer-modal-actions\">\r\n {#if canExtend}\r\n <Button\r\n variant=\"default\"\r\n size=\"lg\"\r\n class=\"w-full\"\r\n onclick={handleExtendSession}\r\n disabled={isExtendingSession}\r\n loading={isExtendingSession}\r\n >\r\n {isExtendingSession\r\n ? mergedLabels.extendingSession || 'Extending...'\r\n : mergedLabels.continueCheckout || 'Continue checkout'}\r\n </Button>\r\n {:else}\r\n <Button\r\n variant=\"default\"\r\n size=\"lg\"\r\n class=\"w-full\"\r\n onclick={dismissWarning}\r\n >\r\n {mergedLabels.okIllHurry || \"OK, I'll hurry\"}\r\n </Button>\r\n <p class=\"timer-modal-hint\">\r\n {mergedLabels.maxExtensionsReached ||\r\n 'Maximum extensions reached'}\r\n </p>\r\n {/if}\r\n </div>\r\n {/snippet}\r\n </Modal>\r\n {/if}\r\n\r\n <!-- Session Expired Modal (\"Want to keep your tickets?\").\r\n Same `{#if}` wrap as the warning modal — forces a fresh\r\n Modal mount each time so reopening after a previous extend\r\n cycle actually re-displays the dialog. -->\r\n {#if showExpiredModal}\r\n <Modal\r\n open={true}\r\n oncancel={() => (showExpiredModal = false)}\r\n size=\"sm\"\r\n role=\"alertdialog\"\r\n aria-labelledby=\"expired-modal-title\"\r\n aria-describedby=\"expired-modal-description\"\r\n >\r\n {#snippet body()}\r\n <div class=\"timer-modal\" id=\"expired-modal-description\">\r\n <div class=\"timer-modal-icon expired\">\r\n <Time size={32} />\r\n </div>\r\n <h3 id=\"expired-modal-title\" class=\"timer-modal-title\">\r\n {canExtend\r\n ? mergedLabels.wantToKeepTickets || 'Want to keep your tickets?'\r\n : mergedLabels.sessionExpired || 'Session expired'}\r\n </h3>\r\n <p class=\"timer-modal-text\">\r\n {canExtend\r\n ? mergedLabels.sessionExpiredMessage ||\r\n 'Your checkout session has expired and your selected tickets have been released.'\r\n : mergedLabels.reservationTimedOut ||\r\n 'Your reservation has timed out. Please select your tickets again to continue.'}\r\n </p>\r\n </div>\r\n {/snippet}\r\n {#snippet footer()}\r\n <div class=\"timer-modal-actions\">\r\n {#if canExtend}\r\n <Button\r\n variant=\"default\"\r\n size=\"lg\"\r\n class=\"w-full\"\r\n onclick={handleExtendSession}\r\n disabled={isExtendingSession}\r\n loading={isExtendingSession}\r\n >\r\n {isExtendingSession\r\n ? mergedLabels.extendingSession || 'Extending...'\r\n : mergedLabels.keepMyTickets || 'Keep my tickets'}\r\n </Button>\r\n <Button\r\n variant=\"alternative\"\r\n size=\"lg\"\r\n class=\"w-full\"\r\n onclick={handleRetryExpired}\r\n >\r\n {mergedLabels.selectTicketsAgain || 'Select tickets again'}\r\n </Button>\r\n {:else}\r\n <Button\r\n variant=\"default\"\r\n size=\"lg\"\r\n class=\"w-full\"\r\n onclick={handleRetryExpired}\r\n >\r\n {mergedLabels.selectTicketsAgain || 'Select tickets again'}\r\n </Button>\r\n {/if}\r\n </div>\r\n {/snippet}\r\n </Modal>\r\n {/if}\r\n</div>\r\n\r\n<style>\r\n /* DataToggle inline (matches DataToggle.svelte pattern) */\r\n .toggle-bar {\r\n position: sticky;\r\n top: 0;\r\n z-index: var(--z-dropdown);\r\n display: flex;\r\n align-items: center;\r\n gap: 0.25rem;\r\n padding: 0.5rem 0.75rem;\r\n overflow-x: auto;\r\n border-bottom-width: 1px;\r\n border-bottom-style: solid;\r\n }\r\n\r\n .toggle-label {\r\n padding-left: 0.375rem;\r\n padding-right: 0.375rem;\r\n flex-shrink: 0;\r\n text-transform: uppercase;\r\n letter-spacing: 0.05em;\r\n font-size: 0.625rem;\r\n }\r\n\r\n .toggle-btn {\r\n display: flex;\r\n align-items: center;\r\n gap: 0.375rem;\r\n padding: 0.25rem 0.5rem;\r\n border-radius: 0.375rem;\r\n font-size: 0.75rem;\r\n line-height: 1rem;\r\n white-space: nowrap;\r\n transition-property: all;\r\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\r\n transition-duration: 150ms;\r\n }\r\n\r\n /* Mobile order summary */\r\n .mobile-order-summary {\r\n padding: 1rem;\r\n border-radius: 0.5rem;\r\n border-width: 1px;\r\n border-style: solid;\r\n }\r\n\r\n /* Timer modals */\r\n .timer-modal {\r\n text-align: center;\r\n padding: 0.5rem 0;\r\n }\r\n\r\n .timer-modal-icon {\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 3.5rem;\r\n height: 3.5rem;\r\n border-radius: 9999px;\r\n margin: 0 auto 1rem;\r\n }\r\n\r\n .timer-modal-icon.warning {\r\n background-color: hsl(var(--accent-warning) / 8%);\r\n color: hsl(var(--accent-warning));\r\n }\r\n\r\n .timer-modal-icon.expired {\r\n background-color: hsl(var(--accent-danger) / 5%);\r\n color: hsl(var(--accent-danger));\r\n }\r\n\r\n .timer-modal-title {\r\n font-size: 1.125rem;\r\n font-weight: 600;\r\n margin-bottom: 0.5rem;\r\n }\r\n\r\n .timer-modal-text {\r\n font-size: 0.875rem;\r\n line-height: 1.4;\r\n color: hsl(var(--text-tertiary)); /* gray-500 */\r\n }\r\n\r\n .timer-modal-hint {\r\n font-size: 0.75rem;\r\n color: hsl(var(--text-head)); /* gray-400 */\r\n margin-top: 0.5rem;\r\n }\r\n\r\n .timer-modal-actions {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 0.5rem;\r\n }\r\n /* The Button component's class=\"w-full\" is a Tailwind utility that\r\n isn't always emitted in the venue-calendar bundle (no scanner\r\n pass over node_modules), so force full width at the layout\r\n level. Applies to both <button> and the anchor variant. */\r\n .timer-modal-actions :global(button),\r\n .timer-modal-actions :global(a) {\r\n width: 100%;\r\n }\r\n</style>\r\n"],"names":["browser","detectDarkMode","containerSelector","saved","selector","containers","container","getStripeTheme","isDark","useStripeTheme","options","watchChanges","fallback","current","$","observer","updateTheme","onMount","root","onDestroy","stripe","paymentIntent","elements","paymentError","labels","$$props","stripeTheme","paymentMountDiv","paymentElement","stripeMounted","mountStripePayment","firstName","lastName","email","keepUpdated","agreeTerms","cardNumber","cardExpiry","cardCvc","attendees","submitted","errors","e","i","att","hasErrors","isTimerUrgent","totalTickets","sum","l","_","lastSubmitRequest","handleSubmit","handleSameAsPurchaser","index","checked","a","div","div_1","Button","node","ChevronLeft","CheckoutTimer","node_1","section","Heading","node_2","div_2","$3","Input","node_3","$$value","node_4","node_5","Checkbox","node_6","section_1","root_4","node_8","node_9","attendee","div_3","root_6","div_4","Text","node_10","node_11","div_5","div_6","node_12","node_13","node_14","$$render","consequent","section_2","node_7","div_7","root_9","node_16","node_17","node_18","div_8","fragment_9","p","root_15","consequent_2","p_1","root_16","consequent_3","alternate","p_2","root_17","consequent_4","node_22","node_23","div_9","node_24","node_25","consequent_1","consequent_5","alternate_1","section_3","node_26","div_10","root_21","Warning","node_29","text_13","consequent_6","Card","$$anchor","fragment_1","img","Calendar","formatEventTime","formatBrowseDate","text_3","OrderSummary","$0","text_6","formatCurrency","totalTicketCount","text_1","logger","createLogger","dataVariant","toggleOptions","configProp","onPlaceOrderProp","onBackProp","onRetryExpiredProp","onExtendSessionProp","mergedLabels","mergeLabels","isShowcaseMode","buildConfig","variant","mockFreeEvent","mockDonationEvent","mockRegistrationEvent","mockEvent","config","deadlineMs","timerSeconds","isExpired","processing","submitRequested","showWarningModal","showExpiredModal","warningShown","isExtendingSession","remainingExtensions","canExtend","WARNING_THRESHOLD","timerDisplay","m","s","orderTotals","lines","subtotal","roundCurrency","fees","promoDiscount","adjustedSubtotal","taxes","calculateTax","totalsLocked","isFreeOrder","isRegistration","timerInitialized","c","getCartIdFromCookie","recomputeFromDeadline","resyncDeadlineFromServer","cartId","status","getSessionStatus","tick","next","interval","onVisible","handleBack","toast","requestPlaceOrder","handlePlaceOrder","formData","count","handleRetryExpired","handleExtendSession","result","AppError","err","dismissWarning","handleVariantChange","v","root_1","option","isActive","button","root_2","span","text","CheckoutForm","CheckoutSidebar","CheckoutMobileFooter","Modal","root_5","h3","root_7","div_11","root_13","div_12","Time","h3_1","p_3","div_13","root_14","node_15"],"mappings":";;;;;;;;;;;AACoB,MAACA,KAAU,OAAO,SAAW;SC6BjCC,GAAeC,GAAmB;aACnC,SA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AAAA;;;;QAM/B,MAAI,CAAAtC,MAAA;cACXmG,IAAGC,GAAA,GACDC,YADFF,CAAG,eACDE,CAAG;AACD,UAAAC,cAAW,GAAE,CAAA,WADfD,CAAG;AAGH,cAAAE,cAHAF,GAAG,CAAA,eAGHE,GAAE,EAAA;kBAAFA,CAAE;AAKF,cAAAC,cALAD,GAAE,CAAA,eAKFC,GAAC,EAAA;kBAADA,CAAC,WATHL,CAAG;gCAKCzD,CAAS,UACNpB,CAAY,EAAC,qBAAqB,qCAClCA,CAAY,EAAC,kBAAkB,iBAAiB,uBAGnDoB,CAAS,UACNpB,CAAY,EAAC,yBACb,0FACAA,CAAY,EAAC,uBACb,+EAA+E;AAAA,0BAdtF6E,CAAG;AAAA;QAkBI,QAAM,CAAAnG,MAAA;cACbyG,IAAGC,GAAA,eAAHD,CAAG;;;;AAEC,cAAAhL,GAAMkL,GAAA;AAAA;;;yBAII7B;AAAA;+BACCtC,CAAkB;AAAA;;+BACnBA,CAAkB;AAAA;;;;+DAE1BA,CAAkB,UACflB,CAAY,EAAC,oBAAoB,uBACjCA,CAAY,EAAC,iBAAiB,iBAAiB,CAAA;;;;;AAEpD,cAAA7F,GAAMuC,GAAA;AAAA;;;yBAII6G;AAAA;;;+DAERvD,CAAY,EAAC,sBAAsB,sBAAsB,CAAA;;;;;AAG3D,cAAA7F,GAAMuE,GAAA;AAAA;;;yBAII6E;AAAA;;;8DAERvD,CAAY,EAAC,sBAAsB,sBAAsB,CAAA;;;;;;oBA5BzDoB,CAAS,IAAAhF,EAAAoB,CAAA,IAAApB,EAAA4B,GAAA,EAAA;AAAA;;kBADfmH,CAAG,eAAHA,CAAG;AAAA;;;;;YA7BLnE,CAAgB,KAAA5E,EAAA2B,EAAA;AAAA;;UA7KtB9D,EAAG,eAAHA,EAAG;AAFI;;;;;;","x_google_ignoreList":[1]}
@@ -1,6 +1,6 @@
1
1
  import "svelte/internal/disclose-version";
2
2
  import * as t from "svelte/internal/client";
3
- import { T as p } from "./VenueCalendar-c5GDxqM9.js";
3
+ import { T as p } from "./VenueCalendar-ByT4N7rW.js";
4
4
  import { T as u } from "./Text-CXR2fhx6.js";
5
5
  import "svelte/internal/flags/legacy";
6
6
  import "svelte/transition";
@@ -31,4 +31,4 @@ function b(n, e) {
31
31
  export {
32
32
  b as C
33
33
  };
34
- //# sourceMappingURL=CheckoutTimer-DE8MT4_A.js.map
34
+ //# sourceMappingURL=CheckoutTimer-BKt80FcV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutTimer-DE8MT4_A.js","sources":["../src/lib/premium-ticket-experience/variants/v3-airbnb-split/CheckoutTimer.svelte"],"sourcesContent":["<script lang=\"ts\">\r\n\timport { Time } from 'carbon-icons-svelte';\r\n\timport { Text } from '@getmicdrop/svelte-components';\r\n\r\n\tinterface Props {\r\n\t\tseconds: number;\r\n\t\tisUrgent: boolean;\r\n\t\t\tlabels?: Record<string, string>;\r\n\t}\r\n\r\n\tlet { seconds, isUrgent, labels = {}, }: Props = $props();\r\n\r\n\tlet display = $derived((() => {\r\n\t\tconst m = Math.floor(seconds / 60);\r\n\t\tconst s = seconds % 60;\r\n\t\treturn `${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`;\r\n\t})());\r\n\r\n\tlet label = $derived(isUrgent ? 'Complete soon' : 'Reservation held');\r\n</script>\r\n\r\n<div class=\"timer-display text-color-secondary\" class:urgent={isUrgent}>\r\n\t<Time size={16} class=\"shrink-0\" />\r\n\t<Text size=\"sm\" class=\"font-medium tabular-nums\">\r\n\t\t{label} &middot; {display}\r\n\t</Text>\r\n</div>\r\n\r\n<style>\r\n\t.timer-display {\r\n\t\tdisplay: inline-flex;\r\n\t\talign-items: center;\r\n\t\tgap: 0.5rem;\r\n\t}\r\n\r\n\t.timer-display.urgent {\r\n\t\tcolor: hsl(var(--accent-warning)); /* orange-500 */\r\n\t}\r\n</style>\r\n"],"names":["$","$$props","display","m","s","label","div","root","Time","Text","node_1","text","classes"],"mappings":";;;;;;;;iBAAA;iBAUgCA,EAAA,KAAAC,GAAA,UAAA,IAAA,OAAA,CAAA,EAAA;AAE3B,MAAAC,2BAA0B;AACvB,UAAAC,IAAI,KAAK,kBAAgB,EAAE,GAC3BC,gBAAc;AACV,WAAA,GAAAD,EAAE,SAAQ,EAAG,SAAS,GAAG,GAAG,CAAA,IAAKC,EAAE,SAAQ,EAAG,SAAS,GAAG,GAAG,CAAA;AAAA,EACxE,IAAC,GAEGC,IAAKL,EAAA,QAAA,MAAAC,EAAA,WAAuB,kBAAkB,kBAAkB;MAGpEK,IAAGC,EAAA;;kBAAHD,CAAG;AACF,EAAAE,aAAW,IAAE,OAAA,YAAA;;AACb,EAAAC,EAAIC,GAAA;AAAA;;;;;AACH,MAAAV,EAAA,gBAAA,MAAAA,EAAA,SAAAW,GAAA,GAAAX,EAAA,IAAAK,CAAK,mBAAYH,CAAO,KAAA,EAAA,EAAA,CAAA;;;cAH1BI,CAAG,2CAAHA,GAAG,GAAA,qDAAA,MAAAM,GAAA,EAAA,QAAAX,EAAA,SAAA,CAAA,CAAA,eAAHK,CAAG;AAFI;"}
1
+ {"version":3,"file":"CheckoutTimer-BKt80FcV.js","sources":["../src/lib/premium-ticket-experience/variants/v3-airbnb-split/CheckoutTimer.svelte"],"sourcesContent":["<script lang=\"ts\">\r\n\timport { Time } from 'carbon-icons-svelte';\r\n\timport { Text } from '@getmicdrop/svelte-components';\r\n\r\n\tinterface Props {\r\n\t\tseconds: number;\r\n\t\tisUrgent: boolean;\r\n\t\t\tlabels?: Record<string, string>;\r\n\t}\r\n\r\n\tlet { seconds, isUrgent, labels = {}, }: Props = $props();\r\n\r\n\tlet display = $derived((() => {\r\n\t\tconst m = Math.floor(seconds / 60);\r\n\t\tconst s = seconds % 60;\r\n\t\treturn `${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`;\r\n\t})());\r\n\r\n\tlet label = $derived(isUrgent ? 'Complete soon' : 'Reservation held');\r\n</script>\r\n\r\n<div class=\"timer-display text-color-secondary\" class:urgent={isUrgent}>\r\n\t<Time size={16} class=\"shrink-0\" />\r\n\t<Text size=\"sm\" class=\"font-medium tabular-nums\">\r\n\t\t{label} &middot; {display}\r\n\t</Text>\r\n</div>\r\n\r\n<style>\r\n\t.timer-display {\r\n\t\tdisplay: inline-flex;\r\n\t\talign-items: center;\r\n\t\tgap: 0.5rem;\r\n\t}\r\n\r\n\t.timer-display.urgent {\r\n\t\tcolor: hsl(var(--accent-warning)); /* orange-500 */\r\n\t}\r\n</style>\r\n"],"names":["$","$$props","display","m","s","label","div","root","Time","Text","node_1","text","classes"],"mappings":";;;;;;;;iBAAA;iBAUgCA,EAAA,KAAAC,GAAA,UAAA,IAAA,OAAA,CAAA,EAAA;AAE3B,MAAAC,2BAA0B;AACvB,UAAAC,IAAI,KAAK,kBAAgB,EAAE,GAC3BC,gBAAc;AACV,WAAA,GAAAD,EAAE,SAAQ,EAAG,SAAS,GAAG,GAAG,CAAA,IAAKC,EAAE,SAAQ,EAAG,SAAS,GAAG,GAAG,CAAA;AAAA,EACxE,IAAC,GAEGC,IAAKL,EAAA,QAAA,MAAAC,EAAA,WAAuB,kBAAkB,kBAAkB;MAGpEK,IAAGC,EAAA;;kBAAHD,CAAG;AACF,EAAAE,aAAW,IAAE,OAAA,YAAA;;AACb,EAAAC,EAAIC,GAAA;AAAA;;;;;AACH,MAAAV,EAAA,gBAAA,MAAAA,EAAA,SAAAW,GAAA,GAAAX,EAAA,IAAAK,CAAK,mBAAYH,CAAO,KAAA,EAAA,EAAA,CAAA;;;cAH1BI,CAAG,2CAAHA,GAAG,GAAA,qDAAA,MAAAM,GAAA,EAAA,QAAAX,EAAA,SAAA,CAAA,CAAA,eAAHK,CAAG;AAFI;"}
@@ -2,19 +2,19 @@ import "svelte/internal/disclose-version";
2
2
  import * as e from "svelte/internal/client";
3
3
  import { onMount as Q, onDestroy as W } from "svelte";
4
4
  import { g as Y } from "./__SKIP_NAVIGATION__-CJ96TTPE.js";
5
- import { h as B, as as H, at as J } from "./VenueCalendar-c5GDxqM9.js";
5
+ import { h as B, as as H, at as J } from "./VenueCalendar-ByT4N7rW.js";
6
6
  import "svelte/internal/flags/legacy";
7
7
  import "svelte/transition";
8
8
  import "svelte/easing";
9
- import { A as K } from "./AirbnbSplitMain-CDM_Jj-4.js";
10
- import { b as X } from "./transform-D7RXKMkr.js";
9
+ import { A as K } from "./AirbnbSplitMain-oIv0QO5G.js";
10
+ import { b as X } from "./transform-L7FxlbrT.js";
11
11
  var Z = e.from_html('<div class="flex items-center justify-center py-12 text-center loading-container svelte-q4dz4y"><p> </p></div>'), $ = e.from_html('<div class="flex flex-col items-center justify-center min-h-[50vh] text-center"><div class="password-card rounded-lg p-8 max-w-sm w-full svelte-q4dz4y"><h2 class="password-title text-xl font-bold mb-2 svelte-q4dz4y"> </h2> <p class="password-description text-sm mb-6 svelte-q4dz4y"> </p> <form class="flex flex-col gap-3"><!> <button type="submit" class="password-submit px-4 py-2 rounded-lg text-sm font-semibold svelte-q4dz4y"> </button></form></div></div>'), ee = e.from_html('<div class="flex flex-col items-center justify-center min-h-[50vh] text-center"><p class="error-text svelte-q4dz4y"> </p></div>');
12
12
  function de(E, s) {
13
13
  e.push(s, !0);
14
14
  const D = B("CollectionView");
15
15
  let f = e.state(!1), u = e.state(null);
16
16
  typeof window < "u" && new URLSearchParams(window.location.search).get("legacy") === "1" && e.set(f, !0), e.user_effect(() => {
17
- e.get(f) && !e.get(u) && (D.warn("[VC] DEPRECATED: ?legacy=1 fallback for CollectionView retires on 2026-08-13. See docs/LEGACY_RETIREMENT.md."), import("./CollectionView.legacy-BqNKpXKj.js").then((t) => {
17
+ e.get(f) && !e.get(u) && (D.warn("[VC] DEPRECATED: ?legacy=1 fallback for CollectionView retires on 2026-08-13. See docs/LEGACY_RETIREMENT.md."), import("./CollectionView.legacy-CwBblIfH.js").then((t) => {
18
18
  e.set(u, t.default, !0);
19
19
  }).catch(() => {
20
20
  e.set(f, !1);
@@ -144,4 +144,4 @@ function de(E, s) {
144
144
  export {
145
145
  de as default
146
146
  };
147
- //# sourceMappingURL=CollectionView-B67Gg3E0.js.map
147
+ //# sourceMappingURL=CollectionView-D4btOQm1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionView-B67Gg3E0.js","sources":["../src/components/Views/CollectionView.svelte"],"sourcesContent":["<script lang=\"ts\">\r\n\timport { onMount, onDestroy } from 'svelte';\r\n\timport { goto } from '$app/navigation';\r\n\timport { createLogger, PasswordInput } from '@getmicdrop/svelte-components';\r\n\timport AirbnbSplitMain from '$lib/premium-ticket-experience/variants/v3-airbnb-split/AirbnbSplitMain.svelte';\r\n\timport { transformCollectionData } from '$lib/premium-ticket-experience/transform';\r\n\timport { fetchPublicCollection } from '$lib/api/events';\r\n\timport type { PublicCollectionData } from '$lib/api/types';\r\n\r\n\tconst logger = createLogger('CollectionView');\r\n\r\n\t// --- Legacy fallback ---\r\n\t// RETIREMENT: 2026-08-13 — see docs/LEGACY_RETIREMENT.md.\r\n\tlet useLegacy = $state(false);\r\n\tlet LegacyComponent: any = $state(null);\r\n\r\n\tif (typeof window !== 'undefined') {\r\n\t\tconst params = new URLSearchParams(window.location.search);\r\n\t\tif (params.get('legacy') === '1') {\r\n\t\t\tuseLegacy = true;\r\n\t\t}\r\n\t}\r\n\r\n\t$effect(() => {\r\n\t\tif (useLegacy && !LegacyComponent) {\r\n\t\t\tlogger.warn(\r\n\t\t\t\t'[VC] DEPRECATED: ?legacy=1 fallback for CollectionView retires on 2026-08-13. See docs/LEGACY_RETIREMENT.md.'\r\n\t\t\t);\r\n\t\t\timport('./CollectionView.legacy.svelte').then((m) => {\r\n\t\t\t\tLegacyComponent = m.default;\r\n\t\t\t}).catch(() => {\r\n\t\t\t\tuseLegacy = false;\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\r\n\t// --- Props (matches old CollectionView external interface) ---\r\n\tinterface Props {\r\n\t\tcollectionId: string | number;\r\n\t\torganizationId?: string;\r\n\t\tonNavigateToEvent?: (id: number, slug: string) => void;\r\n\t\tpassword?: string;\r\n\t\tdisplayMode?: string;\r\n\t\tshowViewSwitcher?: boolean;\r\n\t\tlabels?: Record<string, string>;\r\n\t}\r\n\r\n\tlet {\r\n\t\tcollectionId,\r\n\t\torganizationId = '',\r\n\t\tonNavigateToEvent = undefined,\r\n\t\tpassword = undefined,\r\n\t\tdisplayMode = 'gallery',\r\n\t\tshowViewSwitcher = true,\r\n\t\tlabels = {},\r\n\t}: Props = $props();\r\n\r\n\t// --- State ---\r\n\tlet collection = $state<PublicCollectionData | null>(null);\r\n\tlet isLoading = $state(true);\r\n\tlet error = $state<string | null>(null);\r\n\tlet isMounted = $state(false);\r\n\tlet passwordRequired = $state(false);\r\n\tlet passwordInput = $state('');\r\n\tlet passwordError = $state(false);\r\n\r\n\t// --- Derived ---\r\n\tlet eventData = $derived(collection ? transformCollectionData(collection) : null);\r\n\r\n\t// --- Load collection data ---\r\n\tasync function loadCollection(pwd?: string): Promise<void> {\r\n\t\tif (!isMounted) return;\r\n\t\tif (!collectionId) {\r\n\t\t\terror = labels.noCollectionIdProvided || 'No collection ID provided';\r\n\t\t\tisLoading = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tisLoading = true;\r\n\t\terror = null;\r\n\t\tpasswordError = false;\r\n\r\n\t\ttry {\r\n\t\t\tconst data = await fetchPublicCollection(collectionId, pwd);\r\n\t\t\tif (!isMounted) return;\r\n\r\n\t\t\tif (data) {\r\n\t\t\t\tif ((data as any).passwordRequired || (data as any).error?.code === 'PASSWORD_REQUIRED') {\r\n\t\t\t\t\tpasswordRequired = true;\r\n\t\t\t\t\tisLoading = false;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tcollection = data;\r\n\t\t\t\tpasswordRequired = false;\r\n\t\t\t} else {\r\n\t\t\t\tif (pwd) {\r\n\t\t\t\t\tpasswordRequired = true;\r\n\t\t\t\t\tpasswordError = true;\r\n\t\t\t\t\tisLoading = false;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\terror = labels.failedToLoadCollection || 'Failed to load collection';\r\n\t\t\t}\r\n\t\t} catch (err: any) {\r\n\t\t\tif (isMounted) {\r\n\t\t\t\tconst msg = err.message || '';\r\n\t\t\t\tif (msg.includes('401') || msg.includes('403') || msg.includes('password')) {\r\n\t\t\t\t\tpasswordRequired = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terror = msg || labels.failedToLoadCollection || 'Failed to load collection';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tif (isMounted) {\r\n\t\t\t\tisLoading = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction handlePasswordSubmit(e: Event): void {\r\n\t\te.preventDefault();\r\n\t\tif (!passwordInput.trim()) return;\r\n\t\tloadCollection(passwordInput);\r\n\t}\r\n\r\n\tfunction handleCollectionEventClick(galleryEvent: { id?: number | string; slug: string }): void {\r\n\t\tif (onNavigateToEvent && galleryEvent.id) {\r\n\t\t\tonNavigateToEvent(Number(galleryEvent.id), galleryEvent.slug);\r\n\t\t} else {\r\n\t\t\tgoto(`/${galleryEvent.id}/${galleryEvent.slug}`);\r\n\t\t}\r\n\t}\r\n\r\n\t// --- Lifecycle ---\r\n\tonMount(() => {\r\n\t\tisMounted = true;\r\n\t\tloadCollection(password);\r\n\t});\r\n\r\n\tonDestroy(() => {\r\n\t\tisMounted = false;\r\n\t});\r\n</script>\r\n\r\n{#if useLegacy && LegacyComponent}\r\n\t<svelte:component this={LegacyComponent}\r\n\t\t{collectionId}\r\n\t\t{organizationId}\r\n\t\t{onNavigateToEvent}\r\n\t\t{password}\r\n\t\t{displayMode}\r\n\t\t{showViewSwitcher}\r\n\t\t{labels}\r\n\t/>\r\n{:else if isLoading}\r\n\t<div class=\"flex items-center justify-center py-12 text-center loading-container\">\r\n\t\t<p>{labels.loadingCollection || 'Loading collection...'}</p>\r\n\t</div>\r\n{:else if passwordRequired}\r\n\t<div class=\"flex flex-col items-center justify-center min-h-[50vh] text-center\">\r\n\t\t<div class=\"password-card rounded-lg p-8 max-w-sm w-full\">\r\n\t\t\t<h2 class=\"password-title text-xl font-bold mb-2\">{labels.collectionPrivateTitle || 'This collection is private'}</h2>\r\n\t\t\t<p class=\"password-description text-sm mb-6\">{labels.collectionPrivateDescription || 'Please enter the password to view this collection.'}</p>\r\n\t\t\t<form onsubmit={handlePasswordSubmit} class=\"flex flex-col gap-3\">\r\n\t\t\t\t<PasswordInput\r\n\t\t\t\t\tbind:value={passwordInput}\r\n\t\t\t\t\tplaceholder={labels.enterPassword || \"Enter password\"}\r\n\t\t\t\t\terror={passwordError ? (labels.incorrectPassword || 'Incorrect password. Please try again.') : ''}\r\n\t\t\t\t/>\r\n\t\t\t\t<button type=\"submit\" class=\"password-submit px-4 py-2 rounded-lg text-sm font-semibold\">{labels.viewCollection || 'View Collection'}</button>\r\n\t\t\t</form>\r\n\t\t</div>\r\n\t</div>\r\n{:else if error}\r\n\t<div class=\"flex flex-col items-center justify-center min-h-[50vh] text-center\">\r\n\t\t<p class=\"error-text\">{labels.errorPrefix || 'Error:'} {error}</p>\r\n\t</div>\r\n{:else if eventData}\r\n\t<AirbnbSplitMain\r\n\t\tevent={eventData}\r\n\t\tonCollectionEventClick={handleCollectionEventClick}\r\n\t/>\r\n{/if}\r\n\r\n<style>\r\n\t.loading-container {\r\n\t\tcolor: hsl(var(--text-secondary, 215 16% 47%));\r\n\t}\r\n\r\n\t.error-text {\r\n\t\tcolor: hsl(var(--status-sold-out, 0 72% 51%));\r\n\t}\r\n\r\n\t.password-card {\r\n\t\tbackground: hsl(var(--surface-primary, 0 0% 100%));\r\n\t\tbox-shadow: 0 2px 10px color-mix(in srgb, black 10%, transparent);\r\n\t}\r\n\r\n\t.password-title {\r\n\t\tcolor: hsl(var(--text-primary, 0 0% 10%));\r\n\t}\r\n\r\n\t.password-description {\r\n\t\tcolor: hsl(var(--text-secondary, 0 0% 45%));\r\n\t}\r\n\r\n\t.password-submit {\r\n\t\tbackground: hsl(var(--brand-primary, 220 90% 56%));\r\n\t\tcolor: hsl(var(--text-on-primary, 0 0% 100%));\r\n\t}\r\n\r\n\t.password-submit:hover {\r\n\t\tfilter: brightness(0.95);\r\n\t}\r\n</style>\r\n"],"names":["logger","createLogger","useLegacy","$","LegacyComponent","m","organizationId","onNavigateToEvent","password","displayMode","showViewSwitcher","labels","$$props","collection","isLoading","error","isMounted","passwordRequired","passwordInput","passwordError","eventData","transformCollectionData","loadCollection","pwd","data","fetchPublicCollection","err","msg","handlePasswordSubmit","e","handleCollectionEventClick","galleryEvent","goto","onMount","onDestroy","$$anchor","$$component","div","root_2","p","div_1","root_3","div_2","h2","p_1","form","PasswordInput","node_2","$$value","button","div_3","root_4","p_2","text_4","AirbnbSplitMain","$$render","consequent","consequent_2","consequent_3","consequent_4"],"mappings":";;;;;;;;;;;kBAAA;;QASOA,IAASC,EAAa,gBAAgB;MAIxCC,IAAYC,EAAA,MAAO,EAAK,GACxBC,IAAuBD,EAAA,MAAO,IAAI;SAE3B,SAAW,WACF,gBAAgB,OAAO,SAAS,MAAM,EAC9C,IAAI,QAAQ,MAAM,OAC5BA,EAAA,IAAAD,GAAY,EAAI,GAIlBC,EAAA,kBAAc;UACTD,CAAS,KAAA,CAAAC,EAAA,IAAKC,CAAe,MAChCJ,EAAO,KACN,8GAA8G,GAExG,OAAA,qCAAgC,EAAE,KAAI,CAAEK,MAAM;YACpDD,GAAkBC,EAAE,SAAO,EAAA;AAAA,IAC5B,CAAC,EAAE,MAAK,MAAO;AACd,MAAAF,EAAA,IAAAD,GAAY,EAAK;AAAA,IAClB,CAAC;AAAA,EAEH,CAAC;AAeA,MAAAI,mCAAiB,EAAE,GACnBC,sCAAoB,MAAS,GAC7BC,6BAAW,MAAS,GACpBC,gCAAc,SAAS,GACvBC,qCAAmB,EAAI,GACvBC,IAAMR,EAAA,KAAAS,GAAA,UAAA,IAAA,OAAA,CAAA,EAAA,GAIHC,IAAaV,EAAA,MAAo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,GAAC,CAAA,eACDC,CAAI;;gCAGUlC,EAAM,EAAC,iBAAiB,gBAAgB,6BAC9CQ,CAAa,IAAIR,EAAM,EAAC,qBAAqB,0CAA2C,EAAE;AAHjG,QAAAmC,EAAaC,GAAA;AAAA;;;;;;cACb,QAAU;yBAAE7B,CAAa;AAAA;cAAzB,MAAU8B,GAAA;kBAAE9B,GAAa8B,GAAA,EAAA;AAAA;;;UAIzBC,IAAM9C,EAAA,QAAA4C,GAAA,CAAA,eAANE,GAAM,EAAA;cAANA,CAAM,WANPJ,CAAI,WAHLH,CAAG,WADJF,CAAG;sBAEiD7B,EAAM,EAAC,0BAA0B,4BAA4B,iBAClEA,EAAM,EAAC,gCAAgC,oDAAoD,iBAO9CA,EAAM,EAAC,kBAAkB,iBAAiB;AAAA,UANpIR,EAAA,MAAA,UAAA0C,GAAejB,CAAoB,eAJrCY,CAAG;AAAA;UAeHU,IAAGC,GAAA,GACFC,YADDF,CAAG,eACFE,CAAC;cAADA,CAAC,WADFF,CAAG,GACoB/C,EAAA,gBAAA,MAAAA,EAAA,SAAAkD,GAAA,IAAA1C,IAAO,eAAe,yBAAWI,CAAK,KAAA,EAAA,EAAA,CAAA,eAD7DmC,CAAG;AAAA;AAIH,MAAAI,EAAenB,GAAA;AAAA;uBACRf,CAAS;AAAA;gCACQU;AAAA;;;YApCrB5B,CAAS,KAAAC,EAAA,IAAIC,CAAe,IAAAmD,EAAAC,CAAA,IAAArD,EAAA,IAUvBW,CAAS,oBAITG,CAAgB,IAAAsC,EAAAE,GAAA,CAAA,IAAAtD,EAAA,IAehBY,CAAK,IAAAwC,EAAAG,GAAA,CAAA,IAAAvD,EAAA,IAILiB,CAAS,KAAAmC,EAAAI,GAAA,CAAA;AAAA;;;AAnCX;"}
1
+ {"version":3,"file":"CollectionView-D4btOQm1.js","sources":["../src/components/Views/CollectionView.svelte"],"sourcesContent":["<script lang=\"ts\">\r\n\timport { onMount, onDestroy } from 'svelte';\r\n\timport { goto } from '$app/navigation';\r\n\timport { createLogger, PasswordInput } from '@getmicdrop/svelte-components';\r\n\timport AirbnbSplitMain from '$lib/premium-ticket-experience/variants/v3-airbnb-split/AirbnbSplitMain.svelte';\r\n\timport { transformCollectionData } from '$lib/premium-ticket-experience/transform';\r\n\timport { fetchPublicCollection } from '$lib/api/events';\r\n\timport type { PublicCollectionData } from '$lib/api/types';\r\n\r\n\tconst logger = createLogger('CollectionView');\r\n\r\n\t// --- Legacy fallback ---\r\n\t// RETIREMENT: 2026-08-13 — see docs/LEGACY_RETIREMENT.md.\r\n\tlet useLegacy = $state(false);\r\n\tlet LegacyComponent: any = $state(null);\r\n\r\n\tif (typeof window !== 'undefined') {\r\n\t\tconst params = new URLSearchParams(window.location.search);\r\n\t\tif (params.get('legacy') === '1') {\r\n\t\t\tuseLegacy = true;\r\n\t\t}\r\n\t}\r\n\r\n\t$effect(() => {\r\n\t\tif (useLegacy && !LegacyComponent) {\r\n\t\t\tlogger.warn(\r\n\t\t\t\t'[VC] DEPRECATED: ?legacy=1 fallback for CollectionView retires on 2026-08-13. See docs/LEGACY_RETIREMENT.md.'\r\n\t\t\t);\r\n\t\t\timport('./CollectionView.legacy.svelte').then((m) => {\r\n\t\t\t\tLegacyComponent = m.default;\r\n\t\t\t}).catch(() => {\r\n\t\t\t\tuseLegacy = false;\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\r\n\t// --- Props (matches old CollectionView external interface) ---\r\n\tinterface Props {\r\n\t\tcollectionId: string | number;\r\n\t\torganizationId?: string;\r\n\t\tonNavigateToEvent?: (id: number, slug: string) => void;\r\n\t\tpassword?: string;\r\n\t\tdisplayMode?: string;\r\n\t\tshowViewSwitcher?: boolean;\r\n\t\tlabels?: Record<string, string>;\r\n\t}\r\n\r\n\tlet {\r\n\t\tcollectionId,\r\n\t\torganizationId = '',\r\n\t\tonNavigateToEvent = undefined,\r\n\t\tpassword = undefined,\r\n\t\tdisplayMode = 'gallery',\r\n\t\tshowViewSwitcher = true,\r\n\t\tlabels = {},\r\n\t}: Props = $props();\r\n\r\n\t// --- State ---\r\n\tlet collection = $state<PublicCollectionData | null>(null);\r\n\tlet isLoading = $state(true);\r\n\tlet error = $state<string | null>(null);\r\n\tlet isMounted = $state(false);\r\n\tlet passwordRequired = $state(false);\r\n\tlet passwordInput = $state('');\r\n\tlet passwordError = $state(false);\r\n\r\n\t// --- Derived ---\r\n\tlet eventData = $derived(collection ? transformCollectionData(collection) : null);\r\n\r\n\t// --- Load collection data ---\r\n\tasync function loadCollection(pwd?: string): Promise<void> {\r\n\t\tif (!isMounted) return;\r\n\t\tif (!collectionId) {\r\n\t\t\terror = labels.noCollectionIdProvided || 'No collection ID provided';\r\n\t\t\tisLoading = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tisLoading = true;\r\n\t\terror = null;\r\n\t\tpasswordError = false;\r\n\r\n\t\ttry {\r\n\t\t\tconst data = await fetchPublicCollection(collectionId, pwd);\r\n\t\t\tif (!isMounted) return;\r\n\r\n\t\t\tif (data) {\r\n\t\t\t\tif ((data as any).passwordRequired || (data as any).error?.code === 'PASSWORD_REQUIRED') {\r\n\t\t\t\t\tpasswordRequired = true;\r\n\t\t\t\t\tisLoading = false;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tcollection = data;\r\n\t\t\t\tpasswordRequired = false;\r\n\t\t\t} else {\r\n\t\t\t\tif (pwd) {\r\n\t\t\t\t\tpasswordRequired = true;\r\n\t\t\t\t\tpasswordError = true;\r\n\t\t\t\t\tisLoading = false;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\terror = labels.failedToLoadCollection || 'Failed to load collection';\r\n\t\t\t}\r\n\t\t} catch (err: any) {\r\n\t\t\tif (isMounted) {\r\n\t\t\t\tconst msg = err.message || '';\r\n\t\t\t\tif (msg.includes('401') || msg.includes('403') || msg.includes('password')) {\r\n\t\t\t\t\tpasswordRequired = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terror = msg || labels.failedToLoadCollection || 'Failed to load collection';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tif (isMounted) {\r\n\t\t\t\tisLoading = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction handlePasswordSubmit(e: Event): void {\r\n\t\te.preventDefault();\r\n\t\tif (!passwordInput.trim()) return;\r\n\t\tloadCollection(passwordInput);\r\n\t}\r\n\r\n\tfunction handleCollectionEventClick(galleryEvent: { id?: number | string; slug: string }): void {\r\n\t\tif (onNavigateToEvent && galleryEvent.id) {\r\n\t\t\tonNavigateToEvent(Number(galleryEvent.id), galleryEvent.slug);\r\n\t\t} else {\r\n\t\t\tgoto(`/${galleryEvent.id}/${galleryEvent.slug}`);\r\n\t\t}\r\n\t}\r\n\r\n\t// --- Lifecycle ---\r\n\tonMount(() => {\r\n\t\tisMounted = true;\r\n\t\tloadCollection(password);\r\n\t});\r\n\r\n\tonDestroy(() => {\r\n\t\tisMounted = false;\r\n\t});\r\n</script>\r\n\r\n{#if useLegacy && LegacyComponent}\r\n\t<svelte:component this={LegacyComponent}\r\n\t\t{collectionId}\r\n\t\t{organizationId}\r\n\t\t{onNavigateToEvent}\r\n\t\t{password}\r\n\t\t{displayMode}\r\n\t\t{showViewSwitcher}\r\n\t\t{labels}\r\n\t/>\r\n{:else if isLoading}\r\n\t<div class=\"flex items-center justify-center py-12 text-center loading-container\">\r\n\t\t<p>{labels.loadingCollection || 'Loading collection...'}</p>\r\n\t</div>\r\n{:else if passwordRequired}\r\n\t<div class=\"flex flex-col items-center justify-center min-h-[50vh] text-center\">\r\n\t\t<div class=\"password-card rounded-lg p-8 max-w-sm w-full\">\r\n\t\t\t<h2 class=\"password-title text-xl font-bold mb-2\">{labels.collectionPrivateTitle || 'This collection is private'}</h2>\r\n\t\t\t<p class=\"password-description text-sm mb-6\">{labels.collectionPrivateDescription || 'Please enter the password to view this collection.'}</p>\r\n\t\t\t<form onsubmit={handlePasswordSubmit} class=\"flex flex-col gap-3\">\r\n\t\t\t\t<PasswordInput\r\n\t\t\t\t\tbind:value={passwordInput}\r\n\t\t\t\t\tplaceholder={labels.enterPassword || \"Enter password\"}\r\n\t\t\t\t\terror={passwordError ? (labels.incorrectPassword || 'Incorrect password. Please try again.') : ''}\r\n\t\t\t\t/>\r\n\t\t\t\t<button type=\"submit\" class=\"password-submit px-4 py-2 rounded-lg text-sm font-semibold\">{labels.viewCollection || 'View Collection'}</button>\r\n\t\t\t</form>\r\n\t\t</div>\r\n\t</div>\r\n{:else if error}\r\n\t<div class=\"flex flex-col items-center justify-center min-h-[50vh] text-center\">\r\n\t\t<p class=\"error-text\">{labels.errorPrefix || 'Error:'} {error}</p>\r\n\t</div>\r\n{:else if eventData}\r\n\t<AirbnbSplitMain\r\n\t\tevent={eventData}\r\n\t\tonCollectionEventClick={handleCollectionEventClick}\r\n\t/>\r\n{/if}\r\n\r\n<style>\r\n\t.loading-container {\r\n\t\tcolor: hsl(var(--text-secondary, 215 16% 47%));\r\n\t}\r\n\r\n\t.error-text {\r\n\t\tcolor: hsl(var(--status-sold-out, 0 72% 51%));\r\n\t}\r\n\r\n\t.password-card {\r\n\t\tbackground: hsl(var(--surface-primary, 0 0% 100%));\r\n\t\tbox-shadow: 0 2px 10px color-mix(in srgb, black 10%, transparent);\r\n\t}\r\n\r\n\t.password-title {\r\n\t\tcolor: hsl(var(--text-primary, 0 0% 10%));\r\n\t}\r\n\r\n\t.password-description {\r\n\t\tcolor: hsl(var(--text-secondary, 0 0% 45%));\r\n\t}\r\n\r\n\t.password-submit {\r\n\t\tbackground: hsl(var(--brand-primary, 220 90% 56%));\r\n\t\tcolor: hsl(var(--text-on-primary, 0 0% 100%));\r\n\t}\r\n\r\n\t.password-submit:hover {\r\n\t\tfilter: brightness(0.95);\r\n\t}\r\n</style>\r\n"],"names":["logger","createLogger","useLegacy","$","LegacyComponent","m","organizationId","onNavigateToEvent","password","displayMode","showViewSwitcher","labels","$$props","collection","isLoading","error","isMounted","passwordRequired","passwordInput","passwordError","eventData","transformCollectionData","loadCollection","pwd","data","fetchPublicCollection","err","msg","handlePasswordSubmit","e","handleCollectionEventClick","galleryEvent","goto","onMount","onDestroy","$$anchor","$$component","div","root_2","p","div_1","root_3","div_2","h2","p_1","form","PasswordInput","node_2","$$value","button","div_3","root_4","p_2","text_4","AirbnbSplitMain","$$render","consequent","consequent_2","consequent_3","consequent_4"],"mappings":";;;;;;;;;;;kBAAA;;QASOA,IAASC,EAAa,gBAAgB;MAIxCC,IAAYC,EAAA,MAAO,EAAK,GACxBC,IAAuBD,EAAA,MAAO,IAAI;SAE3B,SAAW,WACF,gBAAgB,OAAO,SAAS,MAAM,EAC9C,IAAI,QAAQ,MAAM,OAC5BA,EAAA,IAAAD,GAAY,EAAI,GAIlBC,EAAA,kBAAc;UACTD,CAAS,KAAA,CAAAC,EAAA,IAAKC,CAAe,MAChCJ,EAAO,KACN,8GAA8G,GAExG,OAAA,qCAAgC,EAAE,KAAI,CAAEK,MAAM;YACpDD,GAAkBC,EAAE,SAAO,EAAA;AAAA,IAC5B,CAAC,EAAE,MAAK,MAAO;AACd,MAAAF,EAAA,IAAAD,GAAY,EAAK;AAAA,IAClB,CAAC;AAAA,EAEH,CAAC;AAeA,MAAAI,mCAAiB,EAAE,GACnBC,sCAAoB,MAAS,GAC7BC,6BAAW,MAAS,GACpBC,gCAAc,SAAS,GACvBC,qCAAmB,EAAI,GACvBC,IAAMR,EAAA,KAAAS,GAAA,UAAA,IAAA,OAAA,CAAA,EAAA,GAIHC,IAAaV,EAAA,MAAoC,IAAI,GACrDW,IAAYX,EAAA,MAAO,EAAI,GACvBY,IAAQZ,EAAA,MAAsB,IAAI,GAClCa,IAAYb,EAAA,MAAO,EAAK,GACxBc,IAAmBd,EAAA,MAAO,EAAK,GAC/Be,IAAgBf,EAAA,MAAO,EAAE,GACzBgB,IAAgBhB,EAAA,MAAO,EAAK,GAG5BiB,0BAAqBP,CAAU,IAAGQ,EAAuBlB,EAAA,IAACU,C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