@getmicdrop/venue-calendar 4.0.163 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CartView-BkRTBDXZ.js → CartView-DYabQwHC.js} +9 -9
- package/dist/CartView-DYabQwHC.js.map +1 -0
- package/dist/{Checkout-C8kEhq77.js → Checkout-C9SOzGlj.js} +9 -9
- package/dist/Checkout-C9SOzGlj.js.map +1 -0
- package/dist/{Checkout-rSZjE7ZX.js → Checkout-DIVV0L0F.js} +7 -7
- package/dist/Checkout-DIVV0L0F.js.map +1 -0
- package/dist/{CheckoutTimer-CCoBtfvN.js → CheckoutTimer-B_SlgvFU.js} +5 -5
- package/dist/CheckoutTimer-B_SlgvFU.js.map +1 -0
- package/dist/{ClockIcon-TC9h_DgF.js → ClockIcon-PHXURS1M.js} +2 -2
- package/dist/ClockIcon-PHXURS1M.js.map +1 -0
- package/dist/{CollectionView-8095UIbe.js → CollectionView-BCA1R0PJ.js} +5 -5
- package/dist/CollectionView-BCA1R0PJ.js.map +1 -0
- package/dist/{Event-D5qSa4qP.js → Event-BErjd7aD.js} +183 -175
- package/dist/Event-BErjd7aD.js.map +1 -0
- package/dist/{EventPage-B0i9SYgi.js → EventPage-DV-MVPHg.js} +8 -8
- package/dist/EventPage-DV-MVPHg.js.map +1 -0
- package/dist/{Heading-BFbWZKav.js → Heading-Ci8L45Wr.js} +2 -2
- package/dist/Heading-Ci8L45Wr.js.map +1 -0
- package/dist/{ScarcityBadge-B1jjs4xL.js → ScarcityBadge-Cdwyg52F.js} +2 -2
- package/dist/ScarcityBadge-Cdwyg52F.js.map +1 -0
- package/dist/{SeriesPage-Q9vQLIEZ.js → SeriesPage-BoA70wuP.js} +5 -5
- package/dist/{SeriesPage-Q9vQLIEZ.js.map → SeriesPage-BoA70wuP.js.map} +1 -1
- package/dist/{Spinner-tiRQ2I2B.js → Spinner-jozFw0lx.js} +2 -2
- package/dist/Spinner-jozFw0lx.js.map +1 -0
- package/dist/{Success-CsIw4bxU.js → Success-HolOJLu3.js} +9 -9
- package/dist/Success-HolOJLu3.js.map +1 -0
- package/dist/{Text-KbMXo7g6.js → Text-BjAFX0Oh.js} +2 -2
- package/dist/Text-BjAFX0Oh.js.map +1 -0
- package/dist/{VenueCalendar-Czx0Kn4d.js → VenueCalendar-BDW-jkLN.js} +16 -15
- package/dist/VenueCalendar-BDW-jkLN.js.map +1 -0
- package/dist/{ViewTicketsEmbed-Bew7UA7B.js → ViewTicketsEmbed-DBkDPXp1.js} +5 -5
- package/dist/ViewTicketsEmbed-DBkDPXp1.js.map +1 -0
- package/dist/api/api/route-manifest.d.ts +35 -8
- package/dist/api/api.cjs.map +1 -1
- package/dist/api/api.mjs.map +1 -1
- package/dist/{es-Czctk5do.js → es-CltuJW7p.js} +2 -1
- package/dist/es-CltuJW7p.js.map +1 -0
- package/dist/{index-HngV5Tmp.js → index-EHtVTS-p.js} +3 -3
- package/dist/index-EHtVTS-p.js.map +1 -0
- package/dist/{modalManager.svelte-JZXVYH3m.js → modalManager.svelte-DmLABgNg.js} +2 -2
- package/dist/modalManager.svelte-DmLABgNg.js.map +1 -0
- package/dist/{promo-dsT5Iw68.js → promo-C9oFaeEp.js} +2 -2
- package/dist/{promo-dsT5Iw68.js.map → promo-C9oFaeEp.js.map} +1 -1
- package/dist/{serverTotals-D5dQ_beP.js → serverTotals-CJHVQkJo.js} +2 -2
- package/dist/{serverTotals-D5dQ_beP.js.map → serverTotals-CJHVQkJo.js.map} +1 -1
- package/dist/{shareCopyFeedback.svelte-CvE7h_Wn.js → shareCopyFeedback.svelte-BvXv8plI.js} +2 -2
- package/dist/shareCopyFeedback.svelte-BvXv8plI.js.map +1 -0
- package/dist/{showcase-state-options-DmmK-lzB.js → showcase-state-options-BZiy68Tm.js} +2 -2
- package/dist/{showcase-state-options-DmmK-lzB.js.map → showcase-state-options-BZiy68Tm.js.map} +1 -1
- package/dist/{transform-CpUt4pIr.js → transform-BH-qIBIv.js} +2 -2
- package/dist/transform-BH-qIBIv.js.map +1 -0
- package/dist/{utm-CfowKK2u.js → utm-B6GLtZhc.js} +2 -2
- package/dist/{utm-CfowKK2u.js.map → utm-B6GLtZhc.js.map} +1 -1
- package/dist/venue-calendar.css +1 -1
- package/dist/venue-calendar.es.js +2 -2
- package/dist/venue-calendar.iife.js +6 -6
- package/dist/venue-calendar.iife.js.map +1 -1
- package/dist/venue-calendar.umd.js +5 -5
- package/dist/venue-calendar.umd.js.map +1 -1
- package/package.json +2 -2
- package/dist/CartView-BkRTBDXZ.js.map +0 -1
- package/dist/Checkout-C8kEhq77.js.map +0 -1
- package/dist/Checkout-rSZjE7ZX.js.map +0 -1
- package/dist/CheckoutTimer-CCoBtfvN.js.map +0 -1
- package/dist/ClockIcon-TC9h_DgF.js.map +0 -1
- package/dist/CollectionView-8095UIbe.js.map +0 -1
- package/dist/Event-D5qSa4qP.js.map +0 -1
- package/dist/EventPage-B0i9SYgi.js.map +0 -1
- package/dist/Heading-BFbWZKav.js.map +0 -1
- package/dist/ScarcityBadge-B1jjs4xL.js.map +0 -1
- package/dist/Spinner-tiRQ2I2B.js.map +0 -1
- package/dist/Success-CsIw4bxU.js.map +0 -1
- package/dist/Text-KbMXo7g6.js.map +0 -1
- package/dist/VenueCalendar-Czx0Kn4d.js.map +0 -1
- package/dist/ViewTicketsEmbed-Bew7UA7B.js.map +0 -1
- package/dist/es-Czctk5do.js.map +0 -1
- package/dist/index-HngV5Tmp.js.map +0 -1
- package/dist/modalManager.svelte-JZXVYH3m.js.map +0 -1
- package/dist/shareCopyFeedback.svelte-CvE7h_Wn.js.map +0 -1
- package/dist/transform-CpUt4pIr.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkout-rSZjE7ZX.js","sources":["../node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/CalendarOutline.svelte","../node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/phosphor/CheckIcon.svelte","../node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/phosphor/CloseIcon.svelte","../node_modules/@stripe/stripe-js/dist/index.mjs","../src/lib/utils/stripe-errors.ts","../src/components/Events/Checkout/GiftCardInput.svelte","../src/components/Modals/EventUnavailableModal.svelte","../src/components/Views/Checkout.svelte"],"sourcesContent":["<script lang=\"ts\">\r\n interface Props {\r\n size?: string;\r\n color?: string;\r\n class?: string;\r\n }\r\n let { size = \"24\", color = \"currentColor\", class: className = \"\" }: Props = $props();\r\n</script>\r\n\r\n<svg\r\n class={className}\r\n aria-hidden=\"true\"\r\n width={size}\r\n height={size}\r\n fill=\"none\"\r\n stroke={color}\r\n stroke-width=\"2\"\r\n viewBox=\"0 0 24 24\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n>\r\n <path\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n d=\"M8 2.25v3M16 2.25v3M3.75 9.75h16.5M5.25 4.5h13.5a1.5 1.5 0 011.5 1.5v13.5a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5V6a1.5 1.5 0 011.5-1.5z\"\r\n />\r\n</svg>\r\n","<script lang=\"ts\">\r\n /**\r\n * Check — Phosphor icon (canonical Micdrop icon family).\r\n * Outline by default; pass `weight=\"fill\"` for solid, or let a stateful parent\r\n * (NavItem / Tabs / BottomNav / status badge) drive it via icon-weight context.\r\n */\r\n import { useIconWeight, type IconWeight } from './iconWeight.js';\r\n\r\n interface Props {\r\n /** Pixel size (width + height). */\r\n size?: string;\r\n /** Icon color; defaults to `currentColor` (inherits text color). */\r\n color?: string;\r\n /** Extra classes. */\r\n class?: string;\r\n /** `regular` (outline) or `fill` (solid). Overrides ambient state weight. */\r\n weight?: IconWeight;\r\n }\r\n\r\n let { size = '24', color = 'currentColor', class: className = '', weight }: Props = $props();\r\n\r\n const ctx = useIconWeight();\r\n let resolved: IconWeight = $derived(weight ?? ctx?.weight ?? 'regular');\r\n</script>\r\n\r\n<svg\r\n class={className}\r\n aria-hidden=\"true\"\r\n width={size}\r\n height={size}\r\n viewBox=\"0 0 256 256\"\r\n fill=\"currentColor\"\r\n style:color={color === 'currentColor' ? undefined : color}\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n>\r\n {#if resolved === 'fill'}<path d=\"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z\"/>{:else}<polyline points=\"40 144 96 200 224 72\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/>{/if}\r\n</svg>\r\n","<script lang=\"ts\">\r\n /**\r\n * Close — Phosphor icon (canonical Micdrop icon family).\r\n * Outline by default; pass `weight=\"fill\"` for solid, or let a stateful parent\r\n * (NavItem / Tabs / BottomNav / status badge) drive it via icon-weight context.\r\n */\r\n import { useIconWeight, type IconWeight } from './iconWeight.js';\r\n\r\n interface Props {\r\n /** Pixel size (width + height). */\r\n size?: string;\r\n /** Icon color; defaults to `currentColor` (inherits text color). */\r\n color?: string;\r\n /** Extra classes. */\r\n class?: string;\r\n /** `regular` (outline) or `fill` (solid). Overrides ambient state weight. */\r\n weight?: IconWeight;\r\n }\r\n\r\n let { size = '24', color = 'currentColor', class: className = '', weight }: Props = $props();\r\n\r\n const ctx = useIconWeight();\r\n let resolved: IconWeight = $derived(weight ?? ctx?.weight ?? 'regular');\r\n</script>\r\n\r\n<svg\r\n class={className}\r\n aria-hidden=\"true\"\r\n width={size}\r\n height={size}\r\n viewBox=\"0 0 256 256\"\r\n fill=\"currentColor\"\r\n style:color={color === 'currentColor' ? undefined : color}\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n>\r\n {#if resolved === 'fill'}<path d=\"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z\"/>{:else}<line x1=\"200\" y1=\"56\" x2=\"56\" y2=\"200\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/><line x1=\"200\" y1=\"200\" x2=\"56\" y2=\"56\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/>{/if}\r\n</svg>\r\n","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nvar RELEASE_TRAIN = 'clover';\n\nvar runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion(version) {\n return version === 3 ? 'v3' : version;\n};\n\nvar ORIGIN = 'https://js.stripe.com';\nvar STRIPE_JS_URL = \"\".concat(ORIGIN, \"/\").concat(RELEASE_TRAIN, \"/stripe.js\");\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar STRIPE_JS_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/(v3|[a-z]+)\\/stripe\\.js(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\n\nvar isStripeJSURL = function isStripeJSURL(url) {\n return V3_URL_REGEX.test(url) || STRIPE_JS_URL_REGEX.test(url);\n};\n\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(ORIGIN, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!isStripeJSURL(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(STRIPE_JS_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"8.8.0\",\n startTime: startTime\n });\n};\n\nvar stripePromise$1 = null;\nvar onErrorListener = null;\nvar onLoadListener = null;\n\nvar onError = function onError(reject) {\n return function (cause) {\n reject(new Error('Failed to load Stripe.js', {\n cause: cause\n }));\n };\n};\n\nvar onLoad = function onLoad(resolve, reject) {\n return function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n };\n};\n\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise$1 !== null) {\n return stripePromise$1;\n }\n\n stripePromise$1 = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n } else if (script && onLoadListener !== null && onErrorListener !== null) {\n var _script$parentNode;\n\n // remove event listeners\n script.removeEventListener('load', onLoadListener);\n script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error,\n // reload script to trigger 'load' event\n\n (_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);\n script = injectScript(params);\n }\n\n onLoadListener = onLoad(resolve, reject);\n onErrorListener = onError(reject);\n script.addEventListener('load', onLoadListener);\n script.addEventListener('error', onErrorListener);\n } catch (error) {\n reject(error);\n return;\n }\n }); // Resets stripePromise on error\n\n return stripePromise$1[\"catch\"](function (error) {\n stripePromise$1 = null;\n return Promise.reject(error);\n });\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var pk = args[0];\n\n if (typeof pk !== 'string') {\n throw new Error(\"Expected publishable key to be of type string, got type \".concat(_typeof(pk), \" instead.\"));\n }\n\n var isTestKey = pk.match(/^pk_test/); // @ts-expect-error this is not publicly typed\n\n var version = runtimeVersionToUrlVersion(maybeStripe.version);\n var expectedVersion = RELEASE_TRAIN;\n\n if (isTestKey && version !== expectedVersion) {\n console.warn(\"Stripe.js@\".concat(version, \" was loaded on the page, but @stripe/stripe-js@\").concat(\"8.8.0\", \" expected Stripe.js@\").concat(expectedVersion, \". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning\"));\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\nvar stripePromise;\nvar loadCalled = false;\n\nvar getStripePromise = function getStripePromise() {\n if (stripePromise) {\n return stripePromise;\n }\n\n stripePromise = loadScript(null)[\"catch\"](function (error) {\n // clear cache on error\n stripePromise = null;\n return Promise.reject(error);\n });\n return stripePromise;\n}; // Execute our own script injection after a tick to give users time to do their\n// own script injection.\n\n\nPromise.resolve().then(function () {\n return getStripePromise();\n})[\"catch\"](function (error) {\n if (!loadCalled) {\n console.warn(error);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadCalled = true;\n var startTime = Date.now(); // if previous attempts are unsuccessful, will re-load script\n\n return getStripePromise().then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nexport { loadStripe };\n","// Stripe error code to user-friendly message mapping.\r\n// Extracted from Views/Checkout.svelte for reuse across checkout implementations.\r\n\r\nexport interface PaymentErrorDetails {\r\n\ttype: string; // 'card_declined', 'network', 'validation', 'general', 'rate_limit'\r\n\ttitle: string;\r\n\tmessage: string;\r\n\tsuggestion: string;\r\n\tretryable: boolean;\r\n}\r\n\r\n/**\r\n * Maps a Stripe error object to user-friendly error details.\r\n * Handles card_declined (insufficient_funds, lost_card, stolen_card, expired_card),\r\n * api_connection_error/network, rate_limit, incorrect_number/invalid_cvc/invalid_expiry,\r\n * and a default fallback.\r\n */\r\nexport function getPaymentErrorDetails(error: any): PaymentErrorDetails {\r\n\tconst errorCode = error?.code || error?.decline_code || '';\r\n\tconst errorType = error?.type || '';\r\n\tconst errorMessage = error?.message || '';\r\n\r\n\t// Card declined errors\r\n\tif (errorCode === 'card_declined' || errorType === 'card_error') {\r\n\t\tconst declineCode = error?.decline_code || '';\r\n\r\n\t\tif (declineCode === 'insufficient_funds') {\r\n\t\t\treturn {\r\n\t\t\t\ttype: 'card_declined',\r\n\t\t\t\ttitle: 'Insufficient funds',\r\n\t\t\t\tmessage: 'Your card has insufficient funds to complete this purchase.',\r\n\t\t\t\tsuggestion: 'Please try a different payment method or contact your bank.',\r\n\t\t\t\tretryable: true,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tif (declineCode === 'lost_card' || declineCode === 'stolen_card') {\r\n\t\t\treturn {\r\n\t\t\t\ttype: 'card_declined',\r\n\t\t\t\ttitle: 'Card cannot be used',\r\n\t\t\t\tmessage: 'This card cannot be used for this transaction.',\r\n\t\t\t\tsuggestion: 'Please use a different payment method.',\r\n\t\t\t\tretryable: true,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tif (declineCode === 'expired_card') {\r\n\t\t\treturn {\r\n\t\t\t\ttype: 'card_declined',\r\n\t\t\t\ttitle: 'Card expired',\r\n\t\t\t\tmessage: 'Your card has expired.',\r\n\t\t\t\tsuggestion: 'Please use a different card or update your card details.',\r\n\t\t\t\tretryable: true,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\ttype: 'card_declined',\r\n\t\t\ttitle: 'Card declined',\r\n\t\t\tmessage: 'Your card was declined by your bank.',\r\n\t\t\tsuggestion: 'Please try a different card or contact your bank for more information.',\r\n\t\t\tretryable: true,\r\n\t\t};\r\n\t}\r\n\r\n\t// Network/connection errors\r\n\tif (\r\n\t\terrorType === 'api_connection_error' ||\r\n\t\terrorMessage.includes('network') ||\r\n\t\terrorMessage.includes('connection')\r\n\t) {\r\n\t\treturn {\r\n\t\t\ttype: 'network',\r\n\t\t\ttitle: 'Connection error',\r\n\t\t\tmessage: \"We couldn't connect to the payment server.\",\r\n\t\t\tsuggestion: 'Please check your internet connection and try again.',\r\n\t\t\tretryable: true,\r\n\t\t};\r\n\t}\r\n\r\n\t// Rate limiting\r\n\tif (errorCode === 'rate_limit') {\r\n\t\treturn {\r\n\t\t\ttype: 'rate_limit',\r\n\t\t\ttitle: 'Too many attempts',\r\n\t\t\tmessage: 'Too many payment attempts. Please wait a moment.',\r\n\t\t\tsuggestion: 'Wait 30 seconds before trying again.',\r\n\t\t\tretryable: true,\r\n\t\t};\r\n\t}\r\n\r\n\t// Invalid card details\r\n\tif (errorCode === 'incorrect_number' || errorCode === 'invalid_number') {\r\n\t\treturn {\r\n\t\t\ttype: 'validation',\r\n\t\t\ttitle: 'Invalid card number',\r\n\t\t\tmessage: 'The card number you entered is invalid.',\r\n\t\t\tsuggestion: 'Please check your card number and try again.',\r\n\t\t\tretryable: true,\r\n\t\t};\r\n\t}\r\n\r\n\tif (errorCode === 'incorrect_cvc' || errorCode === 'invalid_cvc') {\r\n\t\treturn {\r\n\t\t\ttype: 'validation',\r\n\t\t\ttitle: 'Invalid security code',\r\n\t\t\tmessage: 'The security code (CVC) is incorrect.',\r\n\t\t\tsuggestion: 'Please check the 3-digit code on the back of your card.',\r\n\t\t\tretryable: true,\r\n\t\t};\r\n\t}\r\n\r\n\tif (errorCode === 'invalid_expiry_month' || errorCode === 'invalid_expiry_year') {\r\n\t\treturn {\r\n\t\t\ttype: 'validation',\r\n\t\t\ttitle: 'Invalid expiration date',\r\n\t\t\tmessage: 'The expiration date is invalid.',\r\n\t\t\tsuggestion: \"Please check your card's expiration date.\",\r\n\t\t\tretryable: true,\r\n\t\t};\r\n\t}\r\n\r\n\t// Default error\r\n\treturn {\r\n\t\ttype: 'general',\r\n\t\ttitle: 'Payment failed',\r\n\t\tmessage: errorMessage || 'Something went wrong with your payment.',\r\n\t\tsuggestion: 'Please try again or use a different payment method.',\r\n\t\tretryable: true,\r\n\t};\r\n}\r\n","<!-- button-exception: ONE control remains raw — the \"Have a gift card?\" disclosure row. It is a LEFT-ALIGNED full-width row (icon, label, trailing +/- indicator pushed to the far edge); SC Button hardcodes `isLeftAligned = false`, so every variant centres its content and cannot express this row. The remove-X and Apply controls are now SC Button. -->\r\n<script module>\r\n import { defaultLabels } from '$lib/i18n/defaultLabels.js';\r\n import { createLogger } from '@getmicdrop/svelte-components';\r\n const logger = createLogger('GiftCardInput');\r\n</script>\r\n\r\n<script>\r\n import {\r\n TagIcon,\r\n CloseIcon,\r\n CheckIcon,\r\n WarningTriIcon,\r\n } from '@getmicdrop/svelte-components/primitives/Icons/phosphor/index.js';\r\n import {\r\n Button,\r\n DURATION,\r\n formatCurrency,\r\n safeSlide,\r\n typography,\r\n textWeight,\r\n } from '@getmicdrop/svelte-components';\r\n import { applyGiftCard, removeGiftCard } from '$lib/api';\r\n\r\n let {\r\n cartId,\r\n onApplied = () => {},\r\n onRemoved = () => {},\r\n disabled = false,\r\n labels = defaultLabels,\r\n } = $props();\r\n\r\n let code = $state('');\r\n let loading = $state(false);\r\n let error = $state('');\r\n // Stacked applied cards: { code, giftCardAmount } (giftCardAmount in dollars).\r\n let appliedCards = $state([]);\r\n let showInput = $state(false);\r\n // Order total (dollars) inferred from the latest apply response, so the residual\r\n // can be recomputed locally after a single-card removal.\r\n let orderTotal = $state(0);\r\n\r\n let totalApplied = $derived(\r\n appliedCards.reduce((s, c) => s + (c.giftCardAmount || 0), 0)\r\n );\r\n let residual = $derived(Math.max(0, orderTotal - totalApplied));\r\n let fullyCovered = $derived(appliedCards.length > 0 && residual <= 0);\r\n\r\n // Emit the aggregate cart gift-card state to the parent (re-prices the order /\r\n // re-inits the PaymentIntent for the residual). Emits onRemoved when empty.\r\n function emitAggregate() {\r\n if (appliedCards.length === 0) {\r\n onRemoved();\r\n return;\r\n }\r\n onApplied({\r\n code: appliedCards.map(c => c.code).join(', '),\r\n giftCardAmount: totalApplied,\r\n stripeAmount: residual,\r\n requiresStripe: residual > 0,\r\n paymentType: residual > 0 ? 'split' : 'gift_card_only',\r\n orderTotal,\r\n });\r\n }\r\n\r\n async function handleApply() {\r\n const entered = code.trim().toUpperCase();\r\n if (!entered || loading || !cartId) return;\r\n if (appliedCards.some(c => c.code === entered)) {\r\n error =\r\n labels.giftCardAlreadyApplied || 'That gift card is already applied';\r\n return;\r\n }\r\n\r\n loading = true;\r\n error = '';\r\n\r\n try {\r\n const result = await applyGiftCard(cartId, entered);\r\n\r\n if (result.valid) {\r\n appliedCards = [\r\n ...appliedCards,\r\n {\r\n code: result.giftCardCode || entered,\r\n giftCardAmount: result.giftCardAmount || 0,\r\n },\r\n ];\r\n // orderTotal = (new) sum applied + the aggregate residual the backend\r\n // reported for the whole cart.\r\n orderTotal = totalApplied + (result.stripeAmount || 0);\r\n code = '';\r\n showInput = false;\r\n emitAggregate();\r\n } else {\r\n error =\r\n result.error ||\r\n labels.invalidGiftCardCode ||\r\n 'Invalid gift card code';\r\n }\r\n } catch (err) {\r\n logger.error('Error applying gift card:', err);\r\n error =\r\n labels.failedToApplyGiftCard ||\r\n 'Failed to apply gift card. Please try again';\r\n }\r\n\r\n loading = false;\r\n }\r\n\r\n async function handleRemove(cardCode) {\r\n if (loading || !cartId) return;\r\n\r\n loading = true;\r\n error = '';\r\n\r\n try {\r\n const result = await removeGiftCard(cartId, cardCode);\r\n\r\n if (result.success !== false && !result.error) {\r\n appliedCards = appliedCards.filter(c => c.code !== cardCode);\r\n emitAggregate();\r\n } else {\r\n error =\r\n result.error ||\r\n labels.failedToRemoveGiftCard ||\r\n 'Failed to remove gift card. Please try again';\r\n }\r\n } catch (err) {\r\n logger.error('Error removing gift card:', err);\r\n error =\r\n labels.failedToRemoveGiftCard ||\r\n 'Failed to remove gift card. Please try again';\r\n }\r\n\r\n loading = false;\r\n }\r\n\r\n function handleKeydown(e) {\r\n if (e.key === 'Enter' && !loading) {\r\n handleApply();\r\n }\r\n }\r\n\r\n function toggleInput() {\r\n showInput = !showInput;\r\n if (!showInput) {\r\n code = '';\r\n error = '';\r\n }\r\n }\r\n</script>\r\n\r\n<div class=\"mb-4\">\r\n <!-- Applied gift cards (stackable): one removable row each -->\r\n {#each appliedCards as card (card.code)}\r\n <div\r\n class=\"applied-card mb-2\"\r\n transition:safeSlide={{ duration: DURATION.fast }}\r\n >\r\n <div class=\"flex items-center gap-3\">\r\n <div class=\"applied-icon\">\r\n <CheckIcon size=\"16\" />\r\n </div>\r\n <div class=\"flex flex-col flex-1\">\r\n <span class=\"type-caption text-status-success-text\"\r\n >{labels.giftCardApplied || 'Gift card applied'}</span\r\n >\r\n <span class=\"type-body font-mono text-text-primary\">{card.code}</span>\r\n </div>\r\n <span class=\"type-label text-accent-success\"\r\n >-{formatCurrency(card.giftCardAmount)}</span\r\n >\r\n <Button\r\n variant=\"icon\"\r\n size=\"icon-sm\"\r\n class=\"rounded-full hover:bg-status-error-bg hover:text-accent-danger\"\r\n onclick={() => handleRemove(card.code)}\r\n {loading}\r\n {disabled}\r\n aria-label={labels.removeGiftCard || 'Remove gift card'}\r\n >\r\n <CloseIcon size=\"16\" />\r\n </Button>\r\n </div>\r\n </div>\r\n {/each}\r\n\r\n <!-- Aggregate summary -->\r\n {#if appliedCards.length > 0}\r\n <div class=\"applied-card mb-3\">\r\n <div class=\"flex justify-between items-center type-body\">\r\n <span class=\"text-text-secondary\"\r\n >{labels.appliedToOrder || 'Applied to order'}</span\r\n >\r\n <span class=\"type-label text-accent-success\"\r\n >-{formatCurrency(totalApplied)}</span\r\n >\r\n </div>\r\n {#if fullyCovered}\r\n <div\r\n class=\"full-coverage-badge {typography.caption} {textWeight.emphasis}\"\r\n >\r\n <CheckIcon size=\"16\" />\r\n <span\r\n >{labels.fullyCoveredByGiftCard ||\r\n 'Fully covered by gift card'}</span\r\n >\r\n </div>\r\n {:else}\r\n <div class=\"flex justify-between items-center type-body mt-1.5\">\r\n <span class=\"text-text-secondary\"\r\n >{labels.remainingToPay || 'Remaining to pay'}</span\r\n >\r\n <span class=\"type-label text-text-primary\"\r\n >{formatCurrency(residual)}</span\r\n >\r\n </div>\r\n {/if}\r\n </div>\r\n {/if}\r\n\r\n <!-- Add a gift card (stack multiple) -->\r\n <button\r\n type=\"button\"\r\n class=\"gift-card-toggle {typography.label}\"\r\n onclick={toggleInput}\r\n {disabled}\r\n aria-expanded={showInput}\r\n >\r\n <TagIcon size=\"20\" class=\"gift-icon\" />\r\n <span\r\n >{appliedCards.length > 0\r\n ? labels.addAnotherGiftCard || 'Add another gift card'\r\n : labels.haveAGiftCard || 'Have a gift card?'}</span\r\n >\r\n <span class=\"toggle-indicator\">{showInput ? '-' : '+'}</span>\r\n </button>\r\n\r\n {#if showInput}\r\n <div\r\n class=\"input-section\"\r\n transition:safeSlide={{ duration: DURATION.fast }}\r\n >\r\n <div class=\"flex gap-2\">\r\n <input\r\n type=\"text\"\r\n name=\"giftCardCode\"\r\n aria-label={labels.enterGiftCardCode || 'Enter gift card code'}\r\n bind:value={code}\r\n onkeydown={handleKeydown}\r\n placeholder={labels.enterGiftCardCode || 'Enter gift card code'}\r\n disabled={loading || disabled}\r\n class=\"gift-input {typography.body}\"\r\n class:has-error={!!error}\r\n autocomplete=\"off\"\r\n autocapitalize=\"characters\"\r\n />\r\n <Button\r\n variant=\"default\"\r\n size=\"sm\"\r\n class=\"min-w-16 shrink-0\"\r\n onclick={handleApply}\r\n {loading}\r\n disabled={!code.trim() || disabled}\r\n >\r\n {labels.apply || 'Apply'}\r\n </Button>\r\n </div>\r\n {#if error}\r\n <div\r\n class=\"flex items-center gap-1.5 mt-2 type-body text-accent-danger\"\r\n transition:safeSlide={{ duration: DURATION.micro }}\r\n >\r\n <WarningTriIcon size=\"16\" />\r\n <span>{error}</span>\r\n </div>\r\n {/if}\r\n </div>\r\n {/if}\r\n</div>\r\n\r\n<style>\r\n /* Role: type-label (markup) owns size/weight/leading; box + color stay scoped. */\r\n .gift-card-toggle {\r\n display: flex;\r\n align-items: center;\r\n gap: 0.5rem;\r\n width: 100%;\r\n padding: 0.75rem 1rem;\r\n background-color: hsl(var(--bg-secondary));\r\n border-radius: 0.5rem;\r\n border: 1px solid hsl(var(--border));\r\n color: hsl(var(--text-secondary));\r\n cursor: pointer;\r\n transition-property: background-color, color;\r\n transition-duration: var(--motion-micro);\r\n }\r\n\r\n .gift-card-toggle:hover:not(:disabled) {\r\n background-color: hsl(var(--bg-tertiary));\r\n }\r\n\r\n :global([data-theme='dark']) .gift-card-toggle:hover:not(:disabled) {\r\n background-color: hsl(var(--muted));\r\n }\r\n\r\n .gift-card-toggle:disabled {\r\n opacity: 0.5;\r\n cursor: not-allowed;\r\n }\r\n\r\n .gift-card-toggle :global(.gift-icon) {\r\n color: hsl(var(--text-tertiary));\r\n }\r\n\r\n :global([data-theme='dark']) .gift-card-toggle :global(.gift-icon) {\r\n color: hsl(var(--text-head));\r\n }\r\n\r\n .toggle-indicator {\r\n margin-left: auto;\r\n color: hsl(var(--text-head));\r\n /* stylelint-disable-next-line micdrop/no-raw-text-values -- decorative +/- expand glyph, not text content; no role carries the 18px light (300) affordance, and snapping to a role would thicken it */\r\n font-size: 1.125rem;\r\n /* stylelint-disable-next-line micdrop/no-raw-text-values -- see above: weight 300 has no role in the SC type scale */\r\n font-weight: 300;\r\n }\r\n\r\n .input-section {\r\n margin-top: 0.75rem;\r\n padding: 1rem;\r\n background-color: hsl(var(--bg-secondary));\r\n border-radius: 0.5rem;\r\n border: 1px solid hsl(var(--border));\r\n }\r\n\r\n /* Role: type-body (markup) owns size/weight/leading; box + color stay scoped. */\r\n .gift-input {\r\n width: 100%;\r\n padding: 0.5rem 0.75rem;\r\n border-radius: 0.5rem;\r\n border: 1px solid hsl(var(--stroke-primary));\r\n background-color: hsl(var(--bg-primary));\r\n color: hsl(var(--text-primary));\r\n flex: 1;\r\n text-transform: uppercase;\r\n transition-property: border-color;\r\n transition-duration: var(--motion-micro);\r\n }\r\n\r\n .gift-input::placeholder {\r\n color: hsl(var(--text-head));\r\n }\r\n\r\n :global([data-theme='dark']) .gift-input::placeholder {\r\n color: hsl(var(--text-tertiary));\r\n }\r\n\r\n .gift-input:focus {\r\n outline: none;\r\n box-shadow: 0 0 0 2px hsl(var(--brand-primary));\r\n border-color: transparent;\r\n }\r\n\r\n .gift-input.has-error {\r\n border-color: hsl(var(--accent-danger));\r\n }\r\n\r\n .gift-input:disabled {\r\n opacity: 0.5;\r\n cursor: not-allowed;\r\n }\r\n\r\n /* Applied card styles */\r\n .applied-card {\r\n padding: 1rem;\r\n background-color: hsl(var(--accent-success) / 8%);\r\n border-radius: 0.5rem;\r\n border: 1px solid hsl(var(--accent-success) / 30%);\r\n }\r\n\r\n .applied-icon {\r\n width: 2rem;\r\n height: 2rem;\r\n border-radius: 9999px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n background-color: hsl(var(--accent-success) / 15%);\r\n color: hsl(var(--accent-success));\r\n }\r\n\r\n /* Role: type-caption + textWeight.emphasis (markup, 12px/500) owns text; box + color stay scoped. */\r\n .full-coverage-badge {\r\n display: flex;\r\n align-items: center;\r\n gap: 0.375rem;\r\n margin-top: 0.5rem;\r\n padding: 0.375rem 0.625rem;\r\n border-radius: 0.375rem;\r\n background-color: hsl(var(--accent-success) / 15%);\r\n color: hsl(var(--accent-success));\r\n }\r\n</style>\r\n","<!--\r\n Fail-closed FLOOR for the public checkout. When a buyer tries to finalize a\r\n purchase for an event that has been canceled or postponed mid-purchase, the\r\n backend gate refuses to capture the charge and returns\r\n `{ success: false, eventCanceled: true }` or `{ ... eventPostponed: true }`\r\n on validatePaymentIntent. Checkout.svelte catches that rejection and raises\r\n THIS modal instead of the inline payment-error text — the buyer needs an\r\n interruptive, charge-aware response, not a line of red text under the form.\r\n\r\n The copy is intentionally calm and factual: the headline fact is \"you weren't\r\n charged.\" Structure mirrors NetworkErrorModal (the existing interruptive\r\n error-modal precedent in this repo): ModalRoot size=\"sm\", centered icon +\r\n title + body, footer with a single full-width Button.\r\n\r\n Both variants (canceled / postponed) offer a SINGLE action: \"Back to events\".\r\n There is no notify/waitlist backend wired for the mid-purchase case, so a\r\n \"Notify me\" button would do nothing — a dead button is worse than no button.\r\n\r\n role=\"alertdialog\": this is an interruptive prompt that demands a response and\r\n must not be dismissible by a stray backdrop click (R-MODAL-04 / R-A11Y-06).\r\n\r\n class=\"micdrop\" on ModalRoot: the Modal primitive PORTALS its dialog to\r\n document.body, which lands OUTSIDE the widget's `.micdrop` style scope. That\r\n scope is where the widget gets both `font-family: Inter` (app.css) and\r\n `box-sizing: border-box` (app.css `.micdrop *`). Without it the portaled\r\n dialog fell back to the UA serif AND content-box sizing (so `w-full` + button\r\n padding overflowed the panel). Tagging the portaled root with `micdrop`\r\n re-enters that scope for the whole subtree, fixing font + overflow at once.\r\n-->\r\n<script>\r\n import { defaultLabels } from '$lib/i18n/defaultLabels.js';\r\n import {\r\n ModalRoot,\r\n ModalOverlay,\r\n ModalPanel,\r\n ModalBody,\r\n ModalFooter,\r\n Button,\r\n CloseCircleOutline,\r\n CalendarOutline,\r\n typography,\r\n } from '@getmicdrop/svelte-components';\r\n\r\n /**\r\n * @typedef {Object} Props\r\n * @property {boolean} [open]\r\n * @property {'canceled' | 'postponed'} reason - which fail-closed variant to show\r\n * @property {() => void} [onBackToEvents] - return to the calendar / event list\r\n * @property {Record<string, string>} [labels]\r\n */\r\n /** @type {Props} */\r\n let {\r\n open = $bindable(false),\r\n reason,\r\n onBackToEvents = () => {},\r\n labels = defaultLabels,\r\n } = $props();\r\n\r\n let isCanceled = $derived(reason === 'canceled');\r\n\r\n let resolvedTitle = $derived(\r\n isCanceled\r\n ? labels.eventCanceledTitle || 'Event cancelled'\r\n : labels.eventPostponedTitle || 'Event postponed'\r\n );\r\n let resolvedBody = $derived(\r\n isCanceled\r\n ? labels.eventCanceledBody ||\r\n \"This event was cancelled — you weren't charged\"\r\n : labels.eventPostponedBody ||\r\n \"Sales are paused while this show is rescheduled — you weren't charged\"\r\n );\r\n let resolvedBackToEvents = $derived(labels.backToEvents || 'Back to events');\r\n</script>\r\n\r\n<ModalRoot bind:open size=\"sm\" role=\"alertdialog\" class=\"micdrop\">\r\n <ModalOverlay />\r\n <ModalPanel>\r\n <ModalBody>\r\n <div class=\"flex flex-col items-center text-center pt-6 px-4 pb-4\">\r\n <div\r\n class=\"w-16 h-16 rounded-full flex items-center justify-center mb-4 {isCanceled\r\n ? 'bg-accent-danger/10 text-accent-danger'\r\n : 'bg-accent-warning/10 text-accent-warning'}\"\r\n aria-hidden=\"true\"\r\n >\r\n {#if isCanceled}\r\n <CloseCircleOutline size=\"32\" />\r\n {:else}\r\n <CalendarOutline size=\"32\" />\r\n {/if}\r\n </div>\r\n <h3 id=\"event-unavailable-title\" class=\"mb-2 {typography.heading}\">\r\n {resolvedTitle}\r\n </h3>\r\n <p\r\n id=\"event-unavailable-body\"\r\n class=\"type-body tone-secondary max-w-72\"\r\n >\r\n {resolvedBody}\r\n </p>\r\n </div>\r\n </ModalBody>\r\n <ModalFooter>\r\n <Button\r\n size=\"full\"\r\n variant=\"default\"\r\n onclick={onBackToEvents}\r\n aria-label={resolvedBackToEvents}\r\n >\r\n {resolvedBackToEvents}\r\n </Button>\r\n </ModalFooter>\r\n </ModalPanel>\r\n</ModalRoot>\r\n","<!--\r\n @currency-escape: cents/100 in this file is fee-math arithmetic, not\r\n display. `serviceFeeCents / 100` produces a dollar-magnitude `number`\r\n used in the running fee total + `Math.min(fee, maxServiceFeeCents / 100)`\r\n cap calculation. Real math, not formatter bypass. Per Atlas\r\n utility-currency convergence record.\r\n\r\n @form-handling-escape: `processing` is a Stripe payment-confirmation\r\n reentrancy guard (`if (processing) return; processing = true` around\r\n confirmPayment), NOT form-submission/validation state. createFormStore\r\n cannot express a payment-intent confirmation flow, and forcing it here\r\n would risk double-charge regressions for zero user-visible benefit.\r\n Same call as PP#193. Per Atlas behavior-form-handling convergence record.\r\n-->\r\n<script module>\r\n import { defaultLabels } from '$lib/i18n/defaultLabels.js';\r\n import { createLogger } from '@getmicdrop/svelte-components';\r\n import { toInstant } from '@getmicdrop/svelte-components/datetime';\r\n const logger = createLogger('Checkout');\r\n</script>\r\n\r\n<script>\r\n import {\r\n roundCurrency,\r\n getCookie,\r\n COOKIE_NAMES,\r\n } from '@getmicdrop/svelte-components';\r\n import { getDefaultTimezone } from '@getmicdrop/svelte-components/utils/timezones';\r\n import { onMount } from 'svelte';\r\n import { loadStripe } from '@stripe/stripe-js';\r\n import {\r\n loadCheckoutStateFromCookies,\r\n getVenueDetails,\r\n } from '$lib/utils/utils.js';\r\n // Canonical promo-discount resolver — the single source that turns a promo's\r\n // RAW stored value (a percent for a percentage promo, dollars for a fixed one)\r\n // into the dollar deduction shown against the current subtotal. Imported from\r\n // the dedicated module (not the utils barrel) so the display math is the same\r\n // one CartView uses. See the percent-as-dollars note where checkoutConfig is built.\r\n import { resolvePromoDiscountDollars } from '$lib/utils/promo';\r\n // DETAIL-mode view shaper under an unambiguous alias — `$lib/api` exports\r\n // a DIFFERENT `transformEvent` (the canonical domain parseEvent); the name\r\n // collision previously made this import ambiguous to readers.\r\n import { transformEvent as transformEventDetail } from '$lib/utils/event-transform.js';\r\n import {\r\n createPaymentIntent,\r\n completeGiftCardPayment,\r\n extendCheckoutSession,\r\n getSessionStatus,\r\n applyPromoCode,\r\n // validatePaymentIntent MUST come from the same orders-v2 service as\r\n // createPaymentIntent. Previously it was imported from utils.js (the legacy\r\n // /api/v2/public/orders/{id}/validate-payment endpoint), so after a\r\n // successful charge the cart created via the orders-v2 PI could fail to\r\n // finalize / report \"validation failed\" — money taken, order not confirmed.\r\n validatePaymentIntent,\r\n } from '$lib/api';\r\n import { getPaymentErrorDetails } from '$lib/utils/stripe-errors';\r\n import { trackCheckoutStarted } from '$lib/tracking';\r\n import CheckoutMain from '$lib/public-calendar-flow/Checkout.svelte';\r\n import {\r\n buildServerTotalsFromPaymentIntent,\r\n foldGiftCardIntoServerTotals,\r\n } from '$lib/public-calendar-flow/serverTotals';\r\n import { finitePriceOrNull } from '$lib/public-calendar-flow/transform';\r\n import GiftCardInput from '../Events/Checkout/GiftCardInput.svelte';\r\n import EventUnavailableModal from '../Modals/EventUnavailableModal.svelte';\r\n\r\n let {\r\n data,\r\n availableTickets: _availableTickets = [],\r\n value: _value = '',\r\n venueId = '',\r\n organizationId = '',\r\n onNavigateToSuccess,\r\n // Optional back handler. Defaults to history.back() for the full-page\r\n // get-micdrop.com checkout route; the in-widget embed passes a callback\r\n // that returns to the in-place show detail (there is no history entry to\r\n // pop in that context).\r\n onNavigateBack = undefined,\r\n initialError = undefined,\r\n // Saved-widget id, threaded from CalendarContainer onto the checkout_started\r\n // funnel beacon (per-widget attribution).\r\n widgetId = null,\r\n labels = defaultLabels,\r\n // BCP-47 locale, threaded from CalendarContainer's resolved locale so the\r\n // checkout translates in step with the calendar (vc#693).\r\n locale = undefined,\r\n } = $props();\r\n\r\n // --- Derive event from data prop ---\r\n let id = $derived((data || {}).id);\r\n let _orgSlug = $derived((data || {}).orgSlug);\r\n let slug = $derived((data || {}).slug);\r\n let rawEvent = $derived((data || {}).event);\r\n let event = $derived(\r\n rawEvent\r\n ? transformEventDetail(rawEvent)\r\n : data && (data.id || id)\r\n ? {\r\n id: data.id || id,\r\n eventID: data.id || id,\r\n venueID: data.venueID ?? data.venueId ?? null,\r\n venueId: data.venueId ?? data.venueID ?? null,\r\n eventTicketingType: 0,\r\n ticketType: 0,\r\n availableTickets: [],\r\n }\r\n : null\r\n );\r\n\r\n // --- Core state ---\r\n let cartId = $state('');\r\n let quantities = $state({});\r\n let donationAmounts = $state({});\r\n let tickets = $state([]);\r\n let promocode = $state('');\r\n let promoDiscountAmount = $state(0);\r\n let processing = $state(false);\r\n // Read out of CheckoutMain, which owns the clock behind the ended-event\r\n // derivation. Drives the sibling gift-card input's visibility (vc#645).\r\n let eventEnded = $state(false);\r\n // True while a gift-card PI re-init is in flight (the Stripe PaymentIntent is\r\n // being re-created at the reduced residual after a split gift card is applied,\r\n // or restored to the full amount after one is removed). Place-order is blocked\r\n // while it's true so a click can't confirm a charge against the stale PI.\r\n let reinitializingPayment = $state(false);\r\n\r\n // Stripe state\r\n let stripe = $state(null);\r\n let paymentIntent = $state('');\r\n let elements = $state(undefined);\r\n\r\n // Error state\r\n let paymentErrorMessage = $state('');\r\n // Buyer-facing warning when the promo code fails to persist onto the cart\r\n // during a PI (re-)init. Kept separate from paymentErrorMessage so a promo\r\n // apply failure never wipes a live payment error, and a later successful\r\n // re-init can clear it on its own (slice p1-vc-applypromocode-failure-silent).\r\n let promoApplyError = $state('');\r\n let showError = $state(false);\r\n let errorMessage = $state('');\r\n\r\n // Fail-closed FLOOR: when the finalize call is rejected because the event was\r\n // canceled or postponed mid-purchase, the backend gate did NOT capture the\r\n // charge. We raise an interruptive, charge-aware modal instead of the inline\r\n // payment-error text — the buyer must be told plainly they weren't charged.\r\n // `eventUnavailableReason` is 'canceled' | 'postponed' | null.\r\n let eventUnavailableReason = $state(null);\r\n let showEventUnavailable = $derived(eventUnavailableReason !== null);\r\n\r\n // Gift card state\r\n let giftCardApplied = $state(null);\r\n\r\n // CheckoutConfig for CheckoutMain\r\n let checkoutConfig = $state(null);\r\n\r\n // Captured from /payment-intent response — the server's totals are\r\n // the source of truth for what Stripe charges. Set inside\r\n // initializeStripePayment (which runs before checkoutConfig is\r\n // built) and applied at checkoutConfig assembly time.\r\n let serverTotalsFromPaymentIntent = null;\r\n\r\n // True when a PAID order's payment-intent response carried no charged amount,\r\n // so buildServerTotalsFromPaymentIntent refused (null). The Place-order button\r\n // stays locked; this drives a plain \"price unavailable\" line under it so the\r\n // buyer isn't left with a silent dead button (mf#2383 / vc#619).\r\n let serverTotalsUnavailable = $state(false);\r\n\r\n // The order's paid total + currency for the Purchase pixel + MICDROP_CHECKOUT_COMPLETE\r\n // postMessage (MISSION-TRUTH C6). Threaded onto every success payload →\r\n // CalendarContainer → Success. value is null (fires without an amount) when\r\n // the server totals never arrived; currency defaults to USD.\r\n function orderValueForPixel() {\r\n return {\r\n value: serverTotalsFromPaymentIntent?.total ?? null,\r\n currency: serverTotalsFromPaymentIntent?.currency || 'USD',\r\n };\r\n }\r\n\r\n // --- Initialize on mount ---\r\n onMount(async () => {\r\n cartId = getCookie(COOKIE_NAMES.CHECKOUT_CARTID);\r\n\r\n if (!cartId) {\r\n showError = true;\r\n errorMessage =\r\n labels.noCheckoutSession ||\r\n 'No checkout session found. Please select tickets first';\r\n return;\r\n }\r\n\r\n // Funnel: the checkout UI is open with a live cart → checkout_started\r\n // moment (never deduped). Fire-and-forget with this instance's widgetId.\r\n trackCheckoutStarted(\r\n event?.eventID || event?.id || id,\r\n widgetId,\r\n venueId || event?.venueID || event?.venueId || null\r\n );\r\n\r\n // Load checkout state from cookies/localStorage\r\n const eventKey = event?.eventID || event?.id || id;\r\n try {\r\n const checkoutState = loadCheckoutStateFromCookies(eventKey);\r\n quantities = checkoutState.quantities || {};\r\n donationAmounts = checkoutState.donationAmounts || {};\r\n promocode = checkoutState.promocode || '';\r\n promoDiscountAmount = checkoutState.promoDiscountAmount || 0;\r\n tickets = checkoutState.tickets || [];\r\n } catch (err) {\r\n logger.error('Error loading checkout state:', err);\r\n quantities = {};\r\n tickets = [];\r\n }\r\n\r\n if (tickets.length > 0 && event) {\r\n event.availableTickets = tickets;\r\n _availableTickets = tickets;\r\n }\r\n\r\n // Fetch venue details for fee calculations\r\n let venueServiceCharge = {\r\n serviceFeeCents: 0,\r\n serviceFeePercentage: 0,\r\n serviceFeeChargeType: 'both',\r\n maxServiceFeeCents: 0,\r\n taxPercentage: 0,\r\n };\r\n\r\n try {\r\n const venueData = /** @type {any} */ (\r\n await getVenueDetails(event?.venueID || event?.venueId || venueId)\r\n );\r\n venueServiceCharge = {\r\n // Legit-zero venue fee config (mf#2234's ruled-separate class): a venue\r\n // with no flat service fee / cap is a real 0. Null-check keeps the 0\r\n // default without a `?? 0` money-field flag.\r\n serviceFeeCents: Number(\r\n venueData?.serviceFeeCents == null ? 0 : venueData.serviceFeeCents\r\n ),\r\n serviceFeePercentage: Number(venueData?.serviceFeePercentage ?? 0),\r\n serviceFeeChargeType: String(venueData?.serviceFeeChargeType ?? 'both'),\r\n maxServiceFeeCents: Number(\r\n venueData?.maxServiceFeeCents == null\r\n ? 0\r\n : venueData.maxServiceFeeCents\r\n ),\r\n taxPercentage: Number(venueData?.taxPercentage ?? 0),\r\n };\r\n } catch (err) {\r\n logger.error('Error fetching venue data:', err);\r\n }\r\n\r\n // Build OrderLine[] from quantities + tickets + venue fees\r\n const lines = buildOrderLines(quantities, tickets, venueServiceCharge);\r\n\r\n // Initialize the payment intent for any cart that has line items.\r\n //\r\n // For PAID carts this creates a Stripe PaymentIntent up front so the\r\n // card form has a PI to mount against on the common pay-by-card path.\r\n // Gift-card application happens AFTER mount; if the user later applies a\r\n // gift card that covers the whole amount, handleGiftCardApplied clears\r\n // the elements. The unused PaymentIntent is benign on Stripe's side\r\n // (auto-expires).\r\n //\r\n // For genuinely FREE carts ($0 total, no donation) we STILL call the\r\n // payment-intent endpoint: the backend's CreatePaymentIntentFromCart\r\n // finalizes a $0 order in-band (generates tickets, marks the cart\r\n // completed, sends the confirmation email, sets payment_status\r\n // \"succeeded\") and returns { requires_stripe: false, payment_type:\r\n // 'free', order_uuid }. initializeStripePayment then sets the\r\n // `paymentIntent = 'free'` sentinel, which handlePlaceOrder reads to\r\n // skip Stripe and navigate straight to the Confirmation page. Skipping\r\n // this call is what dead-ended free orders at \"Payment form is not\r\n // ready\" (checkout-free-order-deadend).\r\n // Donation (\"pay what you want\") carts have unitPrice-0 lines but a real\r\n // amount in donationAmounts, so they are paid carts and take the Stripe\r\n // path via the same call below.\r\n if (Object.keys(quantities).length > 0) {\r\n await initializeStripePayment();\r\n }\r\n\r\n // Resolve timer from: 1) server session, 2) localStorage, 3) default 15 min\r\n let timerStart = 15 * 60;\r\n if (cartId) {\r\n // Always check localStorage first (set by tickets page timer)\r\n const storedExpiry =\r\n typeof localStorage !== 'undefined'\r\n ? localStorage.getItem(`checkout-expiry-${cartId}`) // @storage-escape: checkout-timer state (intentional raw localStorage)\r\n : null;\r\n if (storedExpiry) {\r\n const remaining = Math.max(\r\n 0,\r\n Math.floor((parseInt(storedExpiry, 10) - Date.now()) / 1000)\r\n );\r\n if (remaining > 0) timerStart = remaining;\r\n }\r\n\r\n // Then try server (overrides localStorage if available)\r\n try {\r\n const status = await getSessionStatus(cartId);\r\n if (!status.error && status.expiresAt) {\r\n // Cart-hold countdown vs the buyer's own wall clock, tz-independent.\r\n // A garbage expiresAt throws here and is swallowed by the catch —\r\n // timerStart keeps the localStorage value.\r\n const expiryMs = toInstant(status.expiresAt).getTime();\r\n const remaining = Math.max(\r\n 0,\r\n Math.floor((expiryMs - Date.now()) / 1000)\r\n );\r\n timerStart = remaining;\r\n localStorage.setItem(\r\n // @storage-escape: checkout-timer state (intentional raw localStorage)\r\n `checkout-expiry-${cartId}`,\r\n String(expiryMs) // persist hold-expiry epoch (ms) — wall-clock timer\r\n );\r\n }\r\n // If status.error (404), timerStart keeps the localStorage value\r\n } catch {\r\n // Network error — timerStart keeps the localStorage value\r\n }\r\n }\r\n\r\n // Resolve the promo discount to DOLLARS for the pre-server-totals estimate.\r\n // `promoDiscountAmount` is the RAW promo value from the cookie/localStorage —\r\n // a percent for a percentage promo, dollars for a fixed one. Handing it to\r\n // CheckoutMain straight rendered a \"10%\" code as a flat \"$10 off\" on the\r\n // checkout step (percent-as-dollars), so cart and checkout disagreed. Resolve\r\n // it against the cart subtotal using the stored discount type, exactly like\r\n // CartView does. The type lives in its own per-event cookie (checkoutState\r\n // only carries the amount); a missing type falls back to fixed, matching the\r\n // resolver's contract. Once the server's payment-intent totals land they take\r\n // over (config.serverTotals is authoritative); this only governs the window\r\n // before they arrive.\r\n // Cast the dynamic per-event key: SC's getCookie is typed to the branded\r\n // COOKIE_NAMES union, but this promo cookie is a per-event key with no\r\n // canonical builder yet (same TEMPORARY-LOCAL state PromocodeInput documents\r\n // — `converge-promo-cookie-onto-sc-canonical` owns minting the builder).\r\n const promoDiscountType =\r\n getCookie(\r\n /** @type {any} */ (`checkout-promo-discount-type-${eventKey}`)\r\n ) || '';\r\n const promoSubtotal = roundCurrency(\r\n // A missing-price line contributes 0 to the promo base; the order is\r\n // unpriced and hard-blocks anyway (mf#2383 / vc#619).\r\n lines.reduce((sum, l) => sum + (l.subtotal == null ? 0 : l.subtotal), 0)\r\n );\r\n const resolvedPromoDiscount = resolvePromoDiscountDollars(\r\n promoSubtotal,\r\n promoDiscountAmount,\r\n promoDiscountType\r\n );\r\n\r\n // Build CheckoutConfig for CheckoutMain. If initializeStripePayment\r\n // already captured server totals (paid carts), include them so the\r\n // first render uses authoritative numbers.\r\n checkoutConfig = {\r\n event: buildEventData(event, venueServiceCharge),\r\n lines,\r\n timerStart,\r\n promoApplied: !!promocode,\r\n promoDiscount: resolvedPromoDiscount,\r\n forceExpired: false,\r\n ...(serverTotalsFromPaymentIntent\r\n ? { serverTotals: serverTotalsFromPaymentIntent }\r\n : {}),\r\n };\r\n\r\n // Apply initial error if provided (for showcase/preview)\r\n if (initialError) {\r\n const details = getPaymentErrorDetails(\r\n typeof initialError === 'object'\r\n ? initialError\r\n : {\r\n code: 'card_declined',\r\n message:\r\n 'Your card was declined. Please try a different payment method.',\r\n }\r\n );\r\n paymentErrorMessage = details.message;\r\n }\r\n });\r\n\r\n // --- Stripe initialization (uses API-provided key, NO hardcoded key) ---\r\n // Monotonic id for payment-intent re-inits. initializeStripePayment runs on\r\n // mount AND on every gift-card apply/remove, each awaiting a fresh\r\n // createPaymentIntent before it binds `paymentIntent`/`serverTotals`. Two\r\n // re-inits can overlap (apply then remove); a slower EARLIER run resolving\r\n // last would otherwise clobber the latest intent, so Stripe Elements confirms\r\n // the card against a PI for the wrong amount. We stamp each run and, on\r\n // resolve, bail unless it is still the latest — a superseded run writes nothing.\r\n let latestPaymentInit = 0;\r\n\r\n async function initializeStripePayment() {\r\n const runId = ++latestPaymentInit;\r\n if (!cartId) {\r\n logger.error('Missing cartId!');\r\n return;\r\n }\r\n\r\n const filteredQuantities = Object.fromEntries(\r\n Object.entries(quantities).filter(([_, val]) => val > 0)\r\n );\r\n\r\n try {\r\n // Convert donationAmounts to numeric keys/values for the API\r\n const numericDonationAmounts = Object.fromEntries(\r\n Object.entries(donationAmounts)\r\n .filter(([, v]) => parseFloat(String(v)) > 0)\r\n .map(([k, v]) => [parseInt(k, 10), parseFloat(String(v))])\r\n );\r\n // Persist the promo code onto the cart BEFORE creating the PaymentIntent.\r\n // The PI is built from the cart's DiscountAmount, which is only set by the\r\n // apply-promo endpoint — validation on the event-detail step is display-only.\r\n // Without this, the buyer saw a discount but was charged full price.\r\n if (promocode) {\r\n const promoResult = await applyPromoCode(cartId, promocode);\r\n // A newer re-init superseded us while applying — bail before touching\r\n // shared UI state so a stale failure can't paint over the latest run\r\n // (same batch-A guard the PI response below uses).\r\n if (runId !== latestPaymentInit) return;\r\n if (!promoResult.success) {\r\n // Surface the failure to the buyer. The discount did NOT land on the\r\n // cart, so the PaymentIntent below is built at full price — logging\r\n // alone left the buyer believing the promo applied while they were\r\n // charged full (slice p1-vc-applypromocode-failure-silent).\r\n logger.error(\r\n 'Failed to apply promo code to cart:',\r\n promoResult.error\r\n );\r\n promoApplyError = (\r\n labels.promoCodeNotApplied ||\r\n \"We couldn't apply promo code {code}. It isn't included in this total — go back to re-enter it, or continue at the full price\"\r\n ).replace('{code}', promocode);\r\n } else {\r\n // The latest apply landed the discount — clear any warning a prior\r\n // failed apply left up.\r\n promoApplyError = '';\r\n }\r\n }\r\n\r\n const paymentData = await createPaymentIntent(\r\n cartId,\r\n filteredQuantities,\r\n Object.keys(numericDonationAmounts).length > 0\r\n ? numericDonationAmounts\r\n : undefined\r\n );\r\n\r\n // A newer re-init superseded us — discard this stale response before it\r\n // repaints the totals or the payment intent (wrong-amount charge).\r\n if (runId !== latestPaymentInit) return;\r\n\r\n if (!paymentData) {\r\n paymentErrorMessage =\r\n labels.failedToCreatePaymentIntent ||\r\n 'Failed to create payment intent. Please try again';\r\n return;\r\n }\r\n\r\n // Reset each init; set below on the paid path if the server refuses totals.\r\n serverTotalsUnavailable = false;\r\n\r\n // Capture the server's authoritative totals — from here on, OrderSummary /\r\n // Place-order render from these numbers, not from a local subtotal ×\r\n // tax-rate guess, so the displayed total always matches what Stripe will\r\n // charge. Shared with the hosted route checkout via the one canonical\r\n // buildServerTotalsFromPaymentIntent (Total = charged residual, currency\r\n // upper-cased for the pixel — see that helper for the money notes).\r\n serverTotalsFromPaymentIntent =\r\n buildServerTotalsFromPaymentIntent(paymentData);\r\n // If checkoutConfig was already built (e.g. a later re-init for\r\n // promo/gift-card flows), apply immediately. Otherwise the\r\n // assembly step below picks it up.\r\n if (checkoutConfig) {\r\n checkoutConfig = {\r\n ...checkoutConfig,\r\n serverTotals: serverTotalsFromPaymentIntent,\r\n };\r\n }\r\n\r\n // §8.2 Free-order branch — server returned payment_type=free /\r\n // requires_stripe=false. Order has already been finalized in-band; do\r\n // NOT mount Stripe Element. Set a sentinel paymentIntent so downstream\r\n // place-order code knows to skip Stripe confirm and just navigate to\r\n // the success page using the order_uuid the server returned. (These\r\n // fields aren't on PaymentIntentResponse, hence the loose cast.)\r\n const paymentDataAny = /** @type {any} */ (paymentData);\r\n if (\r\n paymentDataAny.requires_stripe === false ||\r\n paymentDataAny.payment_type === 'free'\r\n ) {\r\n paymentIntent = 'free';\r\n return;\r\n }\r\n\r\n // Paid order: if the server sent no charged amount the totals were refused\r\n // (null) — surface the \"price unavailable\" line under the locked button.\r\n serverTotalsUnavailable = serverTotalsFromPaymentIntent === null;\r\n\r\n // Use the Stripe publishable key from the API response -- NEVER hardcoded\r\n const stripeKey = paymentData.stripe_publishable_key;\r\n if (!stripeKey) {\r\n logger.error('No Stripe publishable key in payment intent response');\r\n paymentErrorMessage =\r\n labels.paymentConfigError ||\r\n 'Payment configuration error. Please try again';\r\n return;\r\n }\r\n\r\n const loadedStripe = await loadStripe(stripeKey);\r\n\r\n // loadStripe is another await point — re-check before binding Elements.\r\n if (runId !== latestPaymentInit) return;\r\n stripe = loadedStripe;\r\n\r\n if (paymentData.client_secret) {\r\n paymentIntent = paymentData.client_secret;\r\n } else {\r\n paymentErrorMessage =\r\n labels.failedToInitPayment ||\r\n 'Failed to initialize payment. Please try again';\r\n }\r\n } catch (err) {\r\n logger.error('Failed to initialize Stripe payment:', err);\r\n // A superseded run failing must not paint an error over the latest run's\r\n // successfully-bound intent.\r\n if (runId !== latestPaymentInit) return;\r\n paymentErrorMessage =\r\n err.message ||\r\n labels.failedToInitPayment ||\r\n 'Failed to initialize payment. Please try again';\r\n }\r\n }\r\n\r\n // --- Build EventData shape for CheckoutMain ---\r\n function buildEventData(evt, venueCharge) {\r\n if (!evt) return null;\r\n return {\r\n id: evt.id || evt.eventID,\r\n title: evt.name || evt.title || '',\r\n slug: evt.slug || slug || '',\r\n description: evt.description || '',\r\n date: evt.date || '',\r\n startDateTime: evt.startDateTime || '',\r\n endDateTime: evt.endDateTime || '',\r\n doorsOpenTime: evt.doorsOpenTime || '',\r\n timezone: evt.timeZone || evt.timezone || getDefaultTimezone(),\r\n imageUrl: evt.imageUrl || evt.image || '',\r\n venue: {\r\n id: evt.venueID || evt.venueId || 0,\r\n name: evt.venueName || '',\r\n address: evt.venueAddress || '',\r\n timezone: evt.timeZone || evt.timezone || getDefaultTimezone(),\r\n serviceFeePercentage: venueCharge.serviceFeePercentage,\r\n serviceFeeCents: venueCharge.serviceFeeCents,\r\n taxPercentage: venueCharge.taxPercentage,\r\n serviceFeeChargeType: venueCharge.serviceFeeChargeType,\r\n maxServiceFeeCents: venueCharge.maxServiceFeeCents,\r\n },\r\n performers: evt.performers || [],\r\n tickets: (evt.availableTickets || []).map(t => ({\r\n id: t.ID || t.id,\r\n name: t.name || '',\r\n description: t.description || '',\r\n // ticket.price is DOLLARS here, same source buildOrderLines and CartView\r\n // read (CartView: Math.round(ticket.price * 100)). No /100 — that made\r\n // event.tickets[].price 100x too small for any consumer that reads it.\r\n // A missing OR malformed wire price stays null → renders an em-dash and\r\n // hard-blocks, never a coerced $0/\"Free\" or a NaN (mf#2383 / vc#619).\r\n price: finitePriceOrNull(t.price),\r\n fee: 0,\r\n quantityAvailable: t.quantityAvailable || 0,\r\n quantityTotal: t.quantityTotal || 0,\r\n minPerOrder: t.minPerOrder || 1,\r\n maxPerOrder: t.maxPerOrder || 10,\r\n status: 'on_sale',\r\n isDonation: t.type === 2,\r\n isHidden: false,\r\n })),\r\n faqs: evt.faqs || [],\r\n status: 'on_sale',\r\n isPasswordProtected: false,\r\n isRegistrationEvent: evt.eventTicketingType === 1 || evt.ticketType === 1,\r\n totalTicketsRemaining: 100,\r\n totalTicketsCapacity: 100,\r\n };\r\n }\r\n\r\n // --- Build OrderLine[] from cookie data + venue fees ---\r\n function buildOrderLines(qtys, ticketList, venueCharge) {\r\n const lines = [];\r\n for (const [ticketId, quantity] of Object.entries(qtys)) {\r\n if (quantity <= 0) continue;\r\n const ticket = ticketList.find(\r\n t => String(t.ID) === ticketId || String(t.id) === ticketId\r\n );\r\n if (!ticket) continue;\r\n\r\n const isDonation = ticket.type === 2;\r\n const rawPrice = ticket.price; // dollars; null = missing wire price\r\n // Missing OR malformed non-donation price → a null line (em-dash) that\r\n // makes the order unpriced, never a coerced $0/\"Free\" or a NaN that throws\r\n // in toUSD (mf#2383 / vc#619).\r\n if (!isDonation && (rawPrice == null || !Number.isFinite(rawPrice))) {\r\n lines.push({\r\n ticketId: parseInt(ticketId),\r\n ticketName: ticket.name || '',\r\n quantity,\r\n unitPrice: null,\r\n fee: 0,\r\n subtotal: null,\r\n isDonation: false,\r\n });\r\n continue;\r\n }\r\n const unitPrice = rawPrice == null ? 0 : rawPrice;\r\n const fee = calculateTicketFee(unitPrice, venueCharge);\r\n\r\n lines.push({\r\n ticketId: parseInt(ticketId),\r\n ticketName: ticket.name || '',\r\n quantity,\r\n unitPrice,\r\n fee,\r\n subtotal: roundCurrency(unitPrice * quantity),\r\n isDonation,\r\n });\r\n }\r\n return lines;\r\n }\r\n\r\n // --- Calculate fee per ticket based on venue charge settings ---\r\n function calculateTicketFee(unitPrice, venueCharge) {\r\n if (unitPrice === 0) return 0;\r\n\r\n const {\r\n serviceFeePercentage = 0,\r\n serviceFeeCents = 0,\r\n serviceFeeChargeType = 'both',\r\n maxServiceFeeCents = 0,\r\n } = venueCharge;\r\n\r\n let fee = 0;\r\n if (\r\n serviceFeeChargeType === 'percentage' ||\r\n serviceFeeChargeType === 'both'\r\n ) {\r\n fee += unitPrice * (serviceFeePercentage / 100);\r\n }\r\n // Canonical charge type is 'fixed' (normalizeChargeType maps legacy\r\n // 'flat'/'cents' -> 'fixed'); accept all so a 'fixed'-configured venue's\r\n // flat fee isn't silently dropped from the estimate.\r\n if (\r\n serviceFeeChargeType === 'fixed' ||\r\n serviceFeeChargeType === 'flat' ||\r\n serviceFeeChargeType === 'cents' ||\r\n serviceFeeChargeType === 'both'\r\n ) {\r\n fee += serviceFeeCents / 100;\r\n }\r\n\r\n if (maxServiceFeeCents > 0) {\r\n fee = Math.min(fee, maxServiceFeeCents / 100);\r\n }\r\n\r\n return roundCurrency(fee);\r\n }\r\n\r\n // --- Compute whether order is free (for hiding gift card section) ---\r\n // A donation (\"pay what you want\") cart has unitPrice-0 lines but a real\r\n // amount in donationAmounts, so it is NOT free — otherwise the payment UI is\r\n // hidden and the donation can't be paid.\r\n let hasDonations = $derived(\r\n Object.values(donationAmounts).some(v => (Number(v) || 0) > 0)\r\n );\r\n let isFreeOrder = $derived(\r\n !hasDonations &&\r\n (checkoutConfig\r\n ? checkoutConfig.lines.every(l => l.unitPrice === 0)\r\n : true)\r\n );\r\n\r\n // --- Place order handler: 3-step Stripe flow ---\r\n async function handlePlaceOrder(formData) {\r\n if (processing) return;\r\n processing = true;\r\n paymentErrorMessage = '';\r\n\r\n try {\r\n // Gift-card PI re-init in flight: the Stripe PaymentIntent is being\r\n // rebuilt at the reduced residual. Refuse rather than confirm against a\r\n // stale full-amount PI (overcharge). Recoverable — the buyer retries once\r\n // the residual PI has mounted.\r\n if (reinitializingPayment) {\r\n paymentErrorMessage =\r\n labels.paymentReinitializing ||\r\n 'Updating your total. Please wait a moment and try again';\r\n return;\r\n }\r\n\r\n // Gift-card-only purchase: skip Stripe entirely\r\n if (giftCardApplied && !giftCardApplied.requiresStripe) {\r\n await executeGiftCardOnlyPurchase(formData);\r\n return;\r\n }\r\n\r\n // Free ($0) order: skip Stripe entirely. The backend's payment-intent\r\n // endpoint finalizes a $0 order in-band (issues tickets, completes the\r\n // cart, sends the confirmation email) and returns requires_stripe:false\r\n // / payment_type:'free'; initializeStripePayment records that as the\r\n // `paymentIntent === 'free'` sentinel. If the sentinel isn't set yet\r\n // (init skipped or raced), executeFreeOrder calls the endpoint itself so\r\n // the order is finalized before we navigate.\r\n if (isFreeOrder) {\r\n await executeFreeOrder(formData);\r\n return;\r\n }\r\n\r\n // Step 1: Validate card via Stripe elements\r\n if (!elements) {\r\n paymentErrorMessage =\r\n labels.paymentFormNotReady ||\r\n 'Payment form is not ready. Please wait a moment and try again';\r\n processing = false;\r\n return;\r\n }\r\n\r\n if (!stripe) {\r\n paymentErrorMessage =\r\n labels.paymentSystemNotInitialized ||\r\n 'Payment system is not initialized. Please refresh the page';\r\n processing = false;\r\n return;\r\n }\r\n\r\n const { error: submitError } = await elements.submit();\r\n if (submitError) {\r\n const details = getPaymentErrorDetails(submitError);\r\n paymentErrorMessage = details.message;\r\n processing = false;\r\n return;\r\n }\r\n\r\n // Step 2: Confirm payment with Stripe\r\n const result = await stripe.confirmPayment({\r\n elements,\r\n redirect: 'if_required',\r\n });\r\n\r\n if (result.error) {\r\n const details = getPaymentErrorDetails(result.error);\r\n paymentErrorMessage = details.message;\r\n processing = false;\r\n return;\r\n }\r\n\r\n // Step 3: Validate payment on backend\r\n const paymentPayload = {\r\n id: cartId,\r\n paymentIntentId: result.paymentIntent.id,\r\n tickets: quantities,\r\n firstName: formData.firstName,\r\n lastName: formData.lastName,\r\n email: formData.email,\r\n paymentMethod: 'credit-card',\r\n mailingList: formData.keepMeUpdated,\r\n saleType: 'online',\r\n };\r\n\r\n const response = await validatePaymentIntent(cartId, paymentPayload);\r\n\r\n // FAIL-CLOSED FLOOR: the backend gate refuses to capture the charge when\r\n // the event was canceled or postponed between cart-creation and finalize,\r\n // returning `{ success: false, eventCanceled: true }` or\r\n // `{ ... eventPostponed: true }`. Treat either as \"buyer was NOT charged\":\r\n // stop the success navigation and raise the charge-aware modal instead of\r\n // the inline payment-error text. Checked BEFORE the success branch so a\r\n // rejected finalize can never slip through to onNavigateToSuccess.\r\n if (response?.eventCanceled || response?.eventPostponed) {\r\n eventUnavailableReason = response.eventCanceled\r\n ? 'canceled'\r\n : 'postponed';\r\n // No charge implies no order: clear any inline error so the modal is\r\n // the single source of truth, and leave the cart untouched (a postponed\r\n // show may resume — we don't destroy the buyer's selection here).\r\n paymentErrorMessage = '';\r\n return;\r\n }\r\n\r\n if (response?.status === 'Payment succeeded') {\r\n const successData = {\r\n orderId: cartId,\r\n eventId: event?.id || event?.eventID || null,\r\n event: event || null,\r\n venueId: venueId || event?.venueId || null,\r\n organizationId: organizationId || event?.organizationId || null,\r\n ...orderValueForPixel(),\r\n };\r\n\r\n if (onNavigateToSuccess) {\r\n onNavigateToSuccess(successData);\r\n }\r\n } else if (\r\n response?.status === 'Payment amount does not match the total price'\r\n ) {\r\n paymentErrorMessage =\r\n labels.paymentAmountMismatch ||\r\n 'Payment amount mismatch. Please refresh and try again';\r\n } else {\r\n paymentErrorMessage =\r\n labels.paymentValidationFailed ||\r\n 'Payment validation failed. Please try again';\r\n }\r\n } catch (err) {\r\n logger.error('Payment execution error:', err);\r\n const details = getPaymentErrorDetails(err);\r\n paymentErrorMessage = details.message;\r\n } finally {\r\n processing = false;\r\n }\r\n }\r\n\r\n // --- Gift card only purchase ---\r\n async function executeGiftCardOnlyPurchase(formData) {\r\n try {\r\n const result = await completeGiftCardPayment(cartId, {\r\n firstName: formData.firstName,\r\n lastName: formData.lastName,\r\n email: formData.email,\r\n phoneNumber: null,\r\n mailingList: formData.keepMeUpdated,\r\n });\r\n\r\n if (result?.success) {\r\n const successData = {\r\n orderId: result.orderId || cartId,\r\n eventId: event?.id || event?.eventID || null,\r\n event: event || null,\r\n venueId: venueId || event?.venueId || null,\r\n organizationId: organizationId || event?.organizationId || null,\r\n paymentType: 'gift_card_only',\r\n ...orderValueForPixel(),\r\n };\r\n\r\n if (onNavigateToSuccess) {\r\n onNavigateToSuccess(successData);\r\n }\r\n } else {\r\n paymentErrorMessage =\r\n result?.error ||\r\n labels.failedToCompleteOrder ||\r\n 'Failed to complete order. Please try again';\r\n }\r\n } catch (err) {\r\n logger.error('Gift card payment error:', err);\r\n const details = getPaymentErrorDetails(err);\r\n paymentErrorMessage = details.message;\r\n } finally {\r\n processing = false;\r\n }\r\n }\r\n\r\n // --- Free ($0) order: complete without Stripe ---\r\n // The orders-service finalizes a $0 order in-band when the payment-intent\r\n // endpoint is called: it issues tickets, marks the cart completed and sets\r\n // payment_status \"succeeded\" (CreatePaymentIntentFromCart, stripeAmount==0\r\n // branch). initializeStripePayment records that result as paymentIntent ===\r\n // 'free'. If init was skipped or hasn't completed yet we call it now so the\r\n // order is finalized server-side before navigating to the Confirmation page.\r\n // NOTE: the public payment-intent endpoint does not accept customer details,\r\n // so name/email are not persisted on a purely-free order today — see the\r\n // checkout-free-order-deadend finding for the backend follow-up.\r\n async function executeFreeOrder(_formData) {\r\n try {\r\n if (paymentIntent !== 'free') {\r\n await initializeStripePayment();\r\n }\r\n\r\n if (paymentIntent !== 'free') {\r\n // Backend did not treat the order as free (e.g. it now carries a\r\n // chargeable amount). Surface a recoverable error rather than a\r\n // silent dead-end.\r\n paymentErrorMessage =\r\n labels.failedToCompleteOrder ||\r\n 'Failed to complete order. Please try again';\r\n return;\r\n }\r\n\r\n const successData = {\r\n orderId: cartId,\r\n eventId: event?.id || event?.eventID || null,\r\n event: event || null,\r\n venueId: venueId || event?.venueId || null,\r\n organizationId: organizationId || event?.organizationId || null,\r\n paymentType: 'free',\r\n ...orderValueForPixel(),\r\n };\r\n\r\n if (onNavigateToSuccess) {\r\n onNavigateToSuccess(successData);\r\n }\r\n } catch (err) {\r\n logger.error('Free order completion error:', err);\r\n const details = getPaymentErrorDetails(err);\r\n paymentErrorMessage = details.message;\r\n } finally {\r\n processing = false;\r\n }\r\n }\r\n\r\n // --- Gift card handlers ---\r\n async function handleGiftCardApplied(appliedCard) {\r\n giftCardApplied = appliedCard;\r\n\r\n // Fold the gift card into the authoritative totals so the OrderSummary\r\n // line items AND the \"Place order · $X\" button show the final amount due\r\n // — not the pre-gift-card total. The gift-card panel still shows the full\r\n // breakdown (applied / remaining). serverTotalsFromPaymentIntent stays the\r\n // pristine pre-gift-card snapshot so removal can restore it.\r\n if (checkoutConfig && serverTotalsFromPaymentIntent) {\r\n checkoutConfig = {\r\n ...checkoutConfig,\r\n serverTotals: foldGiftCardIntoServerTotals(\r\n serverTotalsFromPaymentIntent,\r\n appliedCard\r\n ),\r\n };\r\n }\r\n\r\n if (!appliedCard.requiresStripe) {\r\n // Gift card covers full amount -- clear Stripe. Supersede any in-flight\r\n // re-init so a pending response can't repaint a card form after the order\r\n // is fully covered.\r\n latestPaymentInit++;\r\n elements = undefined;\r\n stripe = null;\r\n paymentIntent = '';\r\n } else if (cartId && Object.keys(quantities).length > 0) {\r\n // Split payment: the gift card is now persisted on the cart, so re-create\r\n // the PaymentIntent for the REDUCED remaining amount (CreatePaymentIntentFromCart\r\n // subtracts the cart's gift card). Without this the buyer's card is confirmed\r\n // against the original full-amount PI and is overcharged (full card charge +\r\n // gift-card redemption). Mirrors handleGiftCardRemoved's re-init. Guarded so\r\n // Place-order can't confirm against the stale full-amount PI mid-re-init.\r\n reinitializingPayment = true;\r\n try {\r\n await initializeStripePayment();\r\n } finally {\r\n reinitializingPayment = false;\r\n }\r\n }\r\n }\r\n\r\n async function handleGiftCardRemoved() {\r\n giftCardApplied = null;\r\n // Restore the pristine pre-gift-card totals immediately so the headline\r\n // total / Place-order button revert without waiting on the async re-init.\r\n if (checkoutConfig && serverTotalsFromPaymentIntent) {\r\n checkoutConfig = {\r\n ...checkoutConfig,\r\n serverTotals: serverTotalsFromPaymentIntent,\r\n };\r\n }\r\n // Re-initialize Stripe payment at the full amount. Guarded so Place-order\r\n // can't confirm against the just-torn-down reduced PI mid-re-init.\r\n if (cartId && Object.keys(quantities).length > 0) {\r\n reinitializingPayment = true;\r\n try {\r\n await initializeStripePayment();\r\n } finally {\r\n reinitializingPayment = false;\r\n }\r\n }\r\n }\r\n\r\n // --- Navigation handlers ---\r\n function handleBack() {\r\n if (onNavigateBack) onNavigateBack();\r\n else window.history.back();\r\n }\r\n\r\n function handleRetryExpired() {\r\n if (onNavigateBack) onNavigateBack();\r\n else window.history.back();\r\n }\r\n\r\n // --- Fail-closed (canceled/postponed) modal handlers ---\r\n // \"Back to events\" returns the buyer to the calendar / event list, reusing\r\n // the existing back navigation (embed callback or history.back()).\r\n function handleEventUnavailableBack() {\r\n eventUnavailableReason = null;\r\n handleBack();\r\n }\r\n\r\n async function handleExtendSession() {\r\n if (!cartId) return null;\r\n\r\n try {\r\n const result = await extendCheckoutSession(cartId);\r\n if (result.success) {\r\n return {\r\n newExpiryTime: result.newExpiryTime,\r\n remainingExtensions: result.remainingExtensions,\r\n };\r\n } else {\r\n logger.error('Failed to extend session:', result.error);\r\n return null;\r\n }\r\n } catch (err) {\r\n logger.error('Error extending checkout session:', err);\r\n return null;\r\n }\r\n }\r\n</script>\r\n\r\n{#if checkoutConfig}\r\n <CheckoutMain\r\n config={checkoutConfig}\r\n onPlaceOrder={handlePlaceOrder}\r\n onBack={handleBack}\r\n onRetryExpired={handleRetryExpired}\r\n onExtendSession={handleExtendSession}\r\n {stripe}\r\n {paymentIntent}\r\n bind:elements\r\n bind:eventEnded\r\n {serverTotalsUnavailable}\r\n paymentError={paymentErrorMessage || promoApplyError}\r\n {labels}\r\n {locale}\r\n />\r\n\r\n <!-- The gift-card input is a SIBLING of CheckoutMain, so it survives that\r\n component's ended-event short-circuit on its own. Suppress it from the\r\n same answer (vc#645) — an event that has ended must not still be\r\n offering a way to pay for it. -->\r\n {#if !isFreeOrder && !eventEnded}\r\n <div class=\"max-w-6xl mx-auto px-4 md:px-6 -mt-4 mb-8\">\r\n <GiftCardInput\r\n {cartId}\r\n onApplied={handleGiftCardApplied}\r\n onRemoved={handleGiftCardRemoved}\r\n disabled={processing || reinitializingPayment}\r\n {labels}\r\n />\r\n </div>\r\n {/if}\r\n{:else if showError}\r\n <div class=\"p-8 text-center\">\r\n <p class=\"text-accent-danger\">{errorMessage}</p>\r\n </div>\r\n{:else}\r\n <div class=\"p-8 text-center\">\r\n <p class=\"tone-muted\">\r\n {labels.loadingSecurePaymentForm || 'Loading secure payment form...'}\r\n </p>\r\n </div>\r\n{/if}\r\n\r\n<!--\r\n Fail-closed FLOOR: raised when validatePaymentIntent reports the event was\r\n canceled/postponed mid-purchase (no charge captured). Rendered outside the\r\n page branches so it overlays whatever checkout state is showing.\r\n-->\r\n{#if showEventUnavailable}\r\n <EventUnavailableModal\r\n open\r\n reason={eventUnavailableReason}\r\n onBackToEvents={handleEventUnavailableBack}\r\n {labels}\r\n />\r\n{/if}\r\n"],"names":["size","$","$$props","color","className","svg","root","ctx","useIconWeight","resolved","root_2","path","polyline","root_1","$$render","consequent","alternate","styles","_typeof","obj","RELEASE_TRAIN","runtimeVersionToUrlVersion","version","ORIGIN","STRIPE_JS_URL","V3_URL_REGEX","STRIPE_JS_URL_REGEX","isStripeJSURL","url","findScript","scripts","i","script","injectScript","params","queryString","headOrBody","registerWrapper","stripe","startTime","stripePromise$1","onErrorListener","onLoadListener","onError","reject","cause","onLoad","resolve","loadScript","_script$parentNode","error","initStripe","maybeStripe","args","pk","isTestKey","expectedVersion","stripePromise","loadCalled","getStripePromise","loadStripe","_len","_key","getPaymentErrorDetails","errorCode","errorType","errorMessage","declineCode","logger","createLogger","onApplied","onRemoved","disabled","labels","defaultLabels","code","loading","appliedCards","showInput","orderTotal","totalApplied","s","c","residual","fullyCovered","emitAggregate","handleApply","entered","result","applyGiftCard","err","handleRemove","cardCode","removeGiftCard","handleKeydown","e","toggleInput","div","root_6","node","card","div_1","div_2","div_3","CheckIcon","node_1","div_4","span","span_1","span_2","Button","node_2","CloseIcon","$$anchor","text_1","formatCurrency","safeSlide","DURATION","div_5","root_3","div_6","span_3","span_4","div_7","node_5","span_5","typography","textWeight","div_8","span_6","span_7","consequent_1","button","node_3","TagIcon","node_6","span_8","span_9","div_9","root_5","div_10","input","node_8","div_11","root_4","WarningTriIcon","node_10","span_10","consequent_2","classes","$$value","consequent_3","open","onBackToEvents","isCanceled","resolvedTitle","resolvedBody","resolvedBackToEvents","ModalRoot","ModalOverlay","ModalPanel","ModalBody","CloseCircleOutline","CalendarOutline","h3","p","ModalFooter","node_4","_availableTickets","venueId","organizationId","onNavigateBack","initialError","widgetId","locale","id","slug","rawEvent","event","transformEventDetail","cartId","quantities","donationAmounts","tickets","promocode","promoDiscountAmount","processing","eventEnded","reinitializingPayment","paymentIntent","elements","paymentErrorMessage","promoApplyError","showError","eventUnavailableReason","showEventUnavailable","giftCardApplied","checkoutConfig","serverTotalsFromPaymentIntent","serverTotalsUnavailable","orderValueForPixel","onMount","getCookie","COOKIE_NAMES","trackCheckoutStarted","eventKey","checkoutState","loadCheckoutStateFromCookies","venueServiceCharge","venueData","getVenueDetails","lines","buildOrderLines","initializeStripePayment","timerStart","storedExpiry","remaining","status","getSessionStatus","expiryMs","toInstant","promoDiscountType","promoSubtotal","roundCurrency","sum","l","resolvedPromoDiscount","resolvePromoDiscountDollars","buildEventData","details","latestPaymentInit","runId","filteredQuantities","_","val","numericDonationAmounts","v","k","promoResult","applyPromoCode","paymentData","createPaymentIntent","buildServerTotalsFromPaymentIntent","paymentDataAny","stripeKey","loadedStripe","evt","venueCharge","getDefaultTimezone","t","finitePriceOrNull","qtys","ticketList","ticketId","quantity","ticket","isDonation","rawPrice","unitPrice","fee","calculateTicketFee","serviceFeePercentage","serviceFeeCents","serviceFeeChargeType","maxServiceFeeCents","hasDonations","isFreeOrder","handlePlaceOrder","formData","executeGiftCardOnlyPurchase","executeFreeOrder","submitError","paymentPayload","response","validatePaymentIntent","successData","completeGiftCardPayment","_formData","handleGiftCardApplied","appliedCard","foldGiftCardIntoServerTotals","handleGiftCardRemoved","handleBack","handleRetryExpired","handleEventUnavailableBack","handleExtendSession","extendCheckoutSession","$0","CheckoutMain","GiftCardInput","p_1","EventUnavailableModal"],"mappings":";;;;;;;;;;kBAAA;AAME,MAAMA,IAAIC,EAAA,KAAAC,GAAA,QAAA,GAAG,IAAI,GAAEC,0BAAQ,cAAc,GAASC,0BAAY,EAAE;MAGjEC,IAAGC,GAAA;;AAAH,IAAAL,EAAA,UAAAI,aACQD,EAAS,CAAA,CAAA,GADjBH,EAAA,cAAAI,YAGQL,EAAI,CAAA,GAHZC,EAAA,cAAAI,aAISL,EAAI,CAAA,GAJbC,EAAA,cAAAI,aAMSF,EAAK,CAAA;AAAA,kBANdE,CAAG;AAFI;;kBCPR;;AAmBE,MAAML,IAAIC,EAA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;cAYdrD,IAAG3F,GAAA,eAAH2F,CAAG;;AAKU,gBAAA8L,IAAA9R,EAAA,QAAA,MAAAA,EAAA,IAAAyL,CAAU,WAAIE,CAAqB,CAAA;AAJ9C,YAAAqG,GAAa5J,GAAA;AAAA;6BACX+C,CAAM;AAAA;yBACIkG;AAAA,yBACAG;AAAA;;;;uBAEVhN,EAAM;AAAA;;;kBANVwB,CAAG,eAAHA,CAAG;AAAA;;AADA,UAAA,CAAAhG,EAAA,IAAAyQ,CAAW,YAAK/E,CAAU,KAAA7K,EAAAC,CAAA;AAAA;;;;UAY/BsF,IAAG3F,GAAA,GACD2J,YADFhE,CAAG,eACDgE,GAAC,EAAA;cAADA,CAAC,WADHhE,CAAG,+CAC6BnC,EAAY,CAAA,CAAA,eAD5CmC,CAAG;AAAA;UAIHC,IAAGiB,GAAA,GACD2K,YADF5L,CAAG,eACD4L,GAAC,EAAA;cAADA,CAAC,WADH5L,CAAG,yCAEC7B,EAAM,EAAC,4BAA4B,gCAAgC,CAAA,eAFvE6B,CAAG;AAAA;;AArCD,MAAArG,EAAA,IAAAoM,CAAc,kBAgCTJ,CAAS,IAAAnL,EAAAsI,IAAA,CAAA,IAAAtI,EAAAE,IAAA,EAAA;AAAA;;;;;AAkBhB,MAAAmR,GAAqBlL,GAAA;AAAA;;uBAEZiF,CAAsB;AAAA;wBACd0F;AAAA;iBACfnN,EAAM;AAAA;;;;YALN0H,EAAoB,KAAArL,EAAAyI,EAAA;AAAA;;;AAnDjB;","x_google_ignoreList":[0,1,2,3]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutTimer-CCoBtfvN.js","sources":["../node_modules/@getmicdrop/svelte-components/dist/primitives/Modal/Modal.svelte","../src/lib/utils/event-ended.ts","../src/lib/public-calendar-flow/CheckoutTimer.svelte"],"sourcesContent":["<script lang=\"ts\">\r\n /**\r\n * Legacy Modal API — backward-compatible wrapper around ModalRoot + ModalOverlay + ModalPanel.\r\n * Accepts the old flat API: bind:open, header/body/footer snippets, size, persistent, oncancel.\r\n * New code should use ModalRoot + ModalOverlay + ModalPanel directly.\r\n */\r\n import type { Snippet } from 'svelte';\r\n import ModalRoot from './ModalRoot.svelte';\r\n import ModalOverlay from './ModalOverlay.svelte';\r\n import ModalPanel from './ModalPanel.svelte';\r\n import ModalHeader from './ModalHeader.svelte';\r\n import ModalBody from './ModalBody.svelte';\r\n import ModalFooter from './ModalFooter.svelte';\r\n\r\n interface Props {\r\n open?: boolean;\r\n size?: 'sm' | 'md' | 'lg' | 'xl';\r\n persistent?: boolean;\r\n haptic?: boolean;\r\n oncancel?: () => void;\r\n header?: Snippet;\r\n body?: Snippet;\r\n footer?: Snippet;\r\n children?: Snippet;\r\n class?: string;\r\n 'aria-labelledby'?: string;\r\n /**\r\n * Layout variant. `'sheet'` (default) = bottom-sheet on mobile, centered\r\n * on md+. `'dialog'` = centered on all viewports. See ModalRoot for details.\r\n */\r\n variant?: 'sheet' | 'dialog';\r\n }\r\n\r\n let {\r\n open = $bindable(false),\r\n size = 'md',\r\n persistent = false,\r\n haptic = true,\r\n oncancel,\r\n header,\r\n body,\r\n footer,\r\n children,\r\n class: className,\r\n 'aria-labelledby': ariaLabelledby,\r\n variant = 'sheet',\r\n }: Props = $props();\r\n</script>\r\n\r\n<ModalRoot bind:open {size} {persistent} {haptic} {oncancel} {variant} class={className} aria-labelledby={ariaLabelledby}>\r\n <ModalOverlay />\r\n <ModalPanel>\r\n {#if header}<ModalHeader>{@render header()}</ModalHeader>{/if}\r\n {#if body}<ModalBody>{@render body()}</ModalBody>{/if}\r\n {#if children}<ModalBody>{@render children()}</ModalBody>{/if}\r\n {#if footer}<ModalFooter>{@render footer()}</ModalFooter>{/if}\r\n </ModalPanel>\r\n</ModalRoot>\r\n","import {\r\n browserNow,\r\n compareInstants,\r\n toInstantOrNull,\r\n} from '@getmicdrop/svelte-components/datetime';\r\n\r\n/**\r\n * The minimum an event has to carry to be judged ended. Both fields are\r\n * optional here so callers can pass a partially-loaded event without casting —\r\n * an event with neither timestamp is simply never \"ended\".\r\n */\r\nexport interface EndableEvent {\r\n startDateTime?: string | null;\r\n endDateTime?: string | null;\r\n}\r\n\r\n/**\r\n * Has this event's end time already passed?\r\n *\r\n * Extracted verbatim from CartView's `isEventEnded` derivation so the cart and\r\n * the checkout answer this question the same way — same source field\r\n * (`endDateTime` falling back to `startDateTime`), same absolute-instant\r\n * comparison against the buyer's own clock, tz-independent.\r\n *\r\n * `now` is a parameter so a ticking caller (checkout, where the event can end\r\n * while the buyer is mid-flow) can re-derive against a clock it owns. It\r\n * defaults to `browserNow()` for callers that only need the mount-time answer.\r\n */\r\nexport function isEventEnded(\r\n event: EndableEvent | null | undefined,\r\n now: Date = browserNow()\r\n): boolean {\r\n if (!event) return false;\r\n // Absolute instant vs the buyer's clock, tz-independent\r\n const eventEnd = toInstantOrNull(event.endDateTime || event.startDateTime);\r\n return eventEnd ? compareInstants(eventEnd, now) < 0 : false;\r\n}\r\n","<script lang=\"ts\">\r\n import { defaultLabels } from '$lib/public-calendar-flow/i18n/labels.js';\r\n import { ClockIcon } from '@getmicdrop/svelte-components/primitives/Icons/phosphor/index.js';\r\n import { Text } from '@getmicdrop/svelte-components';\r\n\r\n interface Props {\r\n seconds: number;\r\n isUrgent: boolean;\r\n labels?: Record<string, string>;\r\n }\r\n\r\n let { seconds, isUrgent, labels = defaultLabels }: Props = $props();\r\n\r\n let display = $derived(\r\n (() => {\r\n const m = Math.floor(seconds / 60);\r\n const s = seconds % 60;\r\n return `${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`;\r\n })()\r\n );\r\n\r\n // vc#706: these were bare string literals with no catalogue entry, so they\r\n // were unreachable by every locale mechanism while on screen for the entire\r\n // checkout session. Keyed now; the `||` keeps English when no labels arrive.\r\n let label = $derived(\r\n isUrgent\r\n ? labels.completeSoon || 'Complete soon'\r\n : labels.reservationHeld || 'Reservation held'\r\n );\r\n</script>\r\n\r\n<div class=\"timer-display text-color-secondary\" class:urgent={isUrgent}>\r\n <ClockIcon size=\"16\" class=\"shrink-0\" />\r\n <Text size=\"sm\" weight=\"medium\" class=\"tabular-nums\">\r\n {label} · {display}\r\n </Text>\r\n</div>\r\n\r\n<style>\r\n .timer-display {\r\n display: inline-flex;\r\n align-items: center;\r\n gap: 0.5rem;\r\n }\r\n\r\n .timer-display.urgent {\r\n color: hsl(var(--accent-warning)); /* orange-500 */\r\n }\r\n</style>\r\n"],"names":["open","$","$$props","size","persistent","haptic","variant","ModalRoot","$$anchor","$$value","ModalOverlay","node","ModalPanel","node_1","ModalHeader","ModalBody","ModalFooter","isEventEnded","event","now","browserNow","eventEnd","toInstantOrNull","compareInstants","labels","defaultLabels","display","m","s","label","div","root","ClockIcon","Text","text","classes"],"mappings":";;;;;;;;iBAAA;;AAiCE,MACEA,IAAIC,EAAA,KAAAC,GAAA,QAAA,IAAa,EAAK,GACtBC,yBAAO,IAAI,GACXC,+BAAa,EAAK,GAClBC,2BAAS,EAAI,GAQbC,4BAAU,OAAO;AAIpB,EAAAC,EAASC,GAAA;AAAA;aAAYL,EAAI;AAAA;;aAAGC,EAAU;AAAA;;aAAGC,EAAM;AAAA;;;;;aAAcC,EAAO;AAAA;;;;;;;QAA1D,OAAS;;;QAAT,KAASG,GAAA;;;;;AACjB,MAAAC,EAAYC,GAAA,EAAA;;AACZ,MAAAC,EAAUC,GAAA;AAAA;;;;AACI,cAAAC,EAAWN,GAAA;AAAA;;;;;;;;;;;;;;AACb,cAAAO,EAASP,GAAA;AAAA;;;;;;;;;;;;;;AACL,cAAAO,EAASP,GAAA;AAAA;;;;;;;;;;;;;;AACX,cAAAQ,EAAWR,GAAA;AAAA;;;;;;;;;;;;;;;;;;AARpB;ACnBD,SAASS,EACdC,GACAC,IAAYC,KACH;AACT,MAAI,CAACF,EAAO,QAAO;AAEnB,QAAMG,IAAWC,EAAgBJ,EAAM,eAAeA,EAAM,aAAa;AACzE,SAAOG,IAAWE,EAAgBF,GAAUF,CAAG,IAAI,IAAI;AACzD;;iBCpCA;;AAWE,MAAyBK,IAAMvB,EAAA,KAAAC,GAAA,UAAA,GAAGuB,CAAa,GAE3CC,2BACK;AACL,UAAMC,IAAI,KAAK,kBAAgB,EAAE,GAC3BC,gBAAc;AACpB,cAAUD,EAAE,SAAQ,EAAG,SAAS,GAAG,GAAG,CAAA,IAAKC,EAAE,SAAQ,EAAG,SAAS,GAAG,GAAG,CAAA;AAAA,EACzE,IAAC,GAMCC,IAAK5B,EAAA,QAAA,MAAAC,EAAA,WAEHsB,EAAM,EAAC,gBAAgB,kBACvBA,EAAM,EAAC,mBAAmB,kBAAkB;MAInDM,IAAGC,EAAA;;kBAAHD,CAAG;AACD,EAAAE,EAASrB,GAAA,EAAA,MAAA,MAAA,OAAA,YAAA;;AACT,EAAAsB,EAAIpB,GAAA;AAAA;;;;;;AACF,MAAAZ,EAAA,gBAAA,MAAAA,EAAA,SAAAiC,GAAA,GAAAjC,EAAA,IAAA4B,CAAK,mBAAYH,CAAO,KAAA,EAAA,EAAA,CAAA;;;cAH5BI,CAAG,2CAAHA,GAAG,GAAA,oDAAA,MAAAK,GAAA,EAAA,QAAAjC,EAAA,SAAA,CAAA,CAAA,eAAH4B,CAAG;AAFI;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClockIcon-TC9h_DgF.js","sources":["../node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/phosphor/ClockIcon.svelte"],"sourcesContent":["<script lang=\"ts\">\r\n /**\r\n * Clock — Phosphor icon (canonical Micdrop icon family).\r\n * Outline by default; pass `weight=\"fill\"` for solid, or let a stateful parent\r\n * (NavItem / Tabs / BottomNav / status badge) drive it via icon-weight context.\r\n */\r\n import { useIconWeight, type IconWeight } from './iconWeight.js';\r\n\r\n interface Props {\r\n /** Pixel size (width + height). */\r\n size?: string;\r\n /** Icon color; defaults to `currentColor` (inherits text color). */\r\n color?: string;\r\n /** Extra classes. */\r\n class?: string;\r\n /** `regular` (outline) or `fill` (solid). Overrides ambient state weight. */\r\n weight?: IconWeight;\r\n }\r\n\r\n let { size = '24', color = 'currentColor', class: className = '', weight }: Props = $props();\r\n\r\n const ctx = useIconWeight();\r\n let resolved: IconWeight = $derived(weight ?? ctx?.weight ?? 'regular');\r\n</script>\r\n\r\n<svg\r\n class={className}\r\n aria-hidden=\"true\"\r\n width={size}\r\n height={size}\r\n viewBox=\"0 0 256 256\"\r\n fill=\"currentColor\"\r\n style:color={color === 'currentColor' ? undefined : color}\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n>\r\n {#if resolved === 'fill'}<path d=\"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z\"/>{:else}<circle cx=\"128\" cy=\"128\" r=\"96\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/><polyline points=\"128 72 128 128 184 128\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/>{/if}\r\n</svg>\r\n"],"names":["size","$","$$props","color","className","ctx","useIconWeight","resolved","svg","root_2","path","root","$$render","consequent","alternate","styles"],"mappings":";;;;iBAAA;;AAmBE,MAAMA,IAAIC,EAAA,KAAAC,GAAA,QAAA,GAAG,IAAI,GAAEC,0BAAQ,cAAc,GAASC,0BAAY,EAAE;AAEhE,QAAMC,IAAMC,EAAa;AACzB,MAAIC,IAAoBN,EAAA,QAAA,MAAAC,EAAA,UAAsBG,GAAK,UAAU,SAAS;MAGvEG,IAAGC,EAAA;;kBAAHD,CAAG;;;UAUwBE,IAAIC,EAAA;kBAAJD,CAAI;AAAA;;;;;AAAzB,MAAAT,EAAA,IAAAM,CAAQ,MAAK,SAAMK,EAAAC,CAAA,IAAAD,EAAAE,GAAA,EAAA;AAAA;;UAVzBN,CAAG;AAAH,IAAAP,EAAA,UAAAO,aACQJ,EAAS,CAAA,CAAA,GADjBH,EAAA,cAAAO,YAGQR,EAAI,CAAA,GAHZC,EAAA,cAAAO,aAISR,EAAI,CAAA,GAJbe,IAAAd,EAAA,UAAAO,mBAOcL,EAAK,MAAK,iBAAiB,SAAYA,EAAK,EAAA,CAAA;AAAA,kBAP1DK,CAAG;AAFI;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionView-8095UIbe.js","sources":["../node_modules/@getmicdrop/svelte-components/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte","../node_modules/@getmicdrop/svelte-components/dist/recipes/inputs/PasswordInput.svelte","../src/components/Views/CollectionView.svelte"],"sourcesContent":["<script lang=\"ts\">\r\n import { mergeLabels, type SCLabels } from '../../../utils/labels.js';\r\n import type { Snippet } from 'svelte';\r\n import type { Options } from 'check-password-strength';\r\n import { DURATION, safeSlide, EASING } from \"../../../utils/transitions.js\";\r\n import { lazyOnce } from \"../../../utils/lazyOnce.js\";\r\n import { untrack } from \"svelte\";\r\n\r\n const defaultLabels = {\r\n tooWeak: 'Too weak',\r\n weak: 'Weak',\r\n good: 'Good',\r\n strong: 'Strong',\r\n };\r\n\r\n interface Props {\r\n password?: string;\r\n strengthText?: string;\r\n score?: number;\r\n textColor?: string;\r\n children?: Snippet;\r\n labels?: SCLabels<typeof defaultLabels>;\r\n }\r\n\r\n let {\r\n password = \"\",\r\n strengthText = $bindable(\"\"),\r\n score = $bindable(-1),\r\n textColor = $bindable(\"\"),\r\n children,\r\n labels: userLabels = {},\r\n }: Props = $props();\r\n\r\n let labels = $derived(mergeLabels(defaultLabels, userLabels));\r\n\r\n let debouncedPassword = $state(\"\");\r\n // Use a plain variable for timer to avoid reactive dependency\r\n let timer: ReturnType<typeof setTimeout> | undefined;\r\n\r\n // Lazily load the (~10 KB) strength library only once a password exists.\r\n // Until it resolves, `strengthFn` is null and the indicator shows its\r\n // neutral (no-result) state — the debounce window absorbs the load latency.\r\n //\r\n // lazyOnce memoizes the import on success but RESETS on rejection: a\r\n // transient chunk-load failure must not be cached, or the indicator would\r\n // stay bricked until a page reload. On failure the next keystroke retries.\r\n // Explicit type ARGUMENT (not annotation) on purpose: with `$state(null)` TS\r\n // infers T = null, so control-flow analysis proves the variable is `null` at\r\n // the $derived read below and collapses the truthy branch to `never`\r\n // (\"This expression is not callable\"). The type argument keeps the union.\r\n let strengthFn = $state<typeof import('check-password-strength').passwordStrength | null>(null);\r\n const loadStrengthModule = lazyOnce(() => import('check-password-strength'));\r\n function ensureStrengthFn() {\r\n void loadStrengthModule()\r\n .then((m) => {\r\n strengthFn = m.passwordStrength;\r\n })\r\n .catch(() => {\r\n // Swallow — strengthFn stays null (neutral state) and lazyOnce\r\n // has already dropped its memo, so a later keystroke retries.\r\n });\r\n }\r\n\r\n // Kick off the load on the first keystroke, before the debounce fires.\r\n // Retries naturally on subsequent keystrokes after a transient failure\r\n // because lazyOnce does not cache the rejection.\r\n $effect(() => {\r\n if (password && !strengthFn) ensureStrengthFn();\r\n });\r\n\r\n // Typed as the library's own `Options<string>` so the strength call needs no\r\n // cast: the tuple's first entry satisfies `FirstOption` (minDiversity/minLength 0)\r\n // and the rest satisfy `Option`, checked contextually against this annotation.\r\n let customOptions: Options<string> = $derived([\r\n {\r\n id: 0,\r\n value: labels.tooWeak,\r\n minDiversity: 0,\r\n minLength: 0,\r\n },\r\n {\r\n id: 1,\r\n value: labels.weak,\r\n minDiversity: 1,\r\n minLength: 6,\r\n },\r\n {\r\n id: 2,\r\n value: labels.good,\r\n minDiversity: 2,\r\n minLength: 8,\r\n },\r\n {\r\n id: 3,\r\n value: labels.strong,\r\n minDiversity: 3,\r\n minLength: 10,\r\n },\r\n ]);\r\n\r\n // Debounce password updates - timer is not reactive to avoid dependency cycle\r\n $effect(() => {\r\n clearTimeout(timer);\r\n if (password.length === 0) {\r\n debouncedPassword = \"\";\r\n } else {\r\n timer = setTimeout(() => {\r\n debouncedPassword = password;\r\n }, 400); // 400ms delay as requested\r\n }\r\n return () => clearTimeout(timer);\r\n });\r\n\r\n let strength = $derived(debouncedPassword && strengthFn\r\n ? strengthFn(debouncedPassword, customOptions)\r\n : null);\r\n\r\n // Derive score based on password length and strength\r\n let computedScore = $derived(debouncedPassword.length > 12 ? 3 : (strength?.id ?? -1));\r\n\r\n // Sync computed values to bindable props using effects with untrack\r\n $effect(() => {\r\n const newScore = computedScore;\r\n if (untrack(() => score) !== newScore) {\r\n score = newScore;\r\n }\r\n });\r\n\r\n // Derive text and color from computedScore (not from bindable score)\r\n let computedStrengthText = $derived(\r\n computedScore === 0 ? labels.tooWeak :\r\n computedScore === 1 ? labels.weak :\r\n computedScore === 2 ? labels.good :\r\n computedScore === 3 ? labels.strong : \"\"\r\n );\r\n\r\n // No color until a real strength result exists. computedScore is -1 while\r\n // the lazily-loaded strength library is still in flight (and during the\r\n // debounce window), so emitting danger here would flash a red \"Password\r\n // strength\" line with empty text in consumers (e.g. PasswordInput).\r\n let computedTextColor = $derived(\r\n computedScore < 0 ? \"\" :\r\n computedScore <= 1 ? \"text-accent-danger\" : \"text-accent-success\"\r\n );\r\n\r\n $effect(() => {\r\n const newText = computedStrengthText;\r\n if (untrack(() => strengthText) !== newText) {\r\n strengthText = newText;\r\n }\r\n });\r\n\r\n let strengthColor = $derived(computedScore <= 1 ? \"bg-accent-danger\" : \"bg-accent-success\");\r\n\r\n $effect(() => {\r\n const newColor = computedTextColor;\r\n if (untrack(() => textColor) !== newColor) {\r\n textColor = newColor;\r\n }\r\n });\r\n\r\n // Calculate how many bars to fill (1-3)\r\n let filledBars = $derived(computedScore === 0 ? 1 : computedScore === 1 ? 2 : computedScore >= 2 ? 3 : 0);\r\n</script>\r\n\r\n{#if debouncedPassword.length > 0}\r\n <div\r\n transition:safeSlide={{ duration: DURATION.elaborate, easing: EASING.out }}\r\n class=\"pt-2 space-y-2\"\r\n >\r\n <!-- 3 segment bars -->\r\n <div class=\"flex gap-1.5\">\r\n {#each [0, 1, 2] as barIndex (barIndex)}\r\n <div\r\n class=\"h-1 flex-1 rounded-full transition-colors duration-normal {barIndex <\r\n filledBars\r\n ? strengthColor\r\n : 'bg-bg-tertiary'}\"\r\n ></div>\r\n {/each}\r\n </div>\r\n {@render children?.()}\r\n </div>\r\n{/if}\r\n","<script lang=\"ts\">\r\n import { mergeLabels, type SCLabels } from '../../utils/labels.js';\r\n /**\r\n * PasswordInput - Password field with show/hide toggle and strength indicator\r\n *\r\n * Combines Input (password type) with PasswordStrengthIndicator for\r\n * a complete password entry experience.\r\n *\r\n * @example\r\n * <PasswordInput\r\n * label=\"New Password\"\r\n * bind:value={password}\r\n * showStrength\r\n * error={$errors.password}\r\n * required\r\n * />\r\n *\r\n * @example Consumer-owned validation (e.g. Zod): opt out of the built-in\r\n * `required` constraint so the consuming form is the single source of truth.\r\n * <PasswordInput\r\n * label=\"Password\"\r\n * bind:value={password}\r\n * required\r\n * disableBuiltInValidation\r\n * error={$errors.password}\r\n * />\r\n */\r\n import Input from '../../primitives/Input/Input.svelte';\r\n import PasswordStrengthIndicator from './PasswordStrengthIndicator/PasswordStrengthIndicator.svelte';\r\n\r\n const defaultLabels = {\r\n passwordStrength: 'Password strength:',\r\n };\r\n\r\n interface Props {\r\n /** Password value */\r\n value?: string;\r\n /** Label text */\r\n label?: string;\r\n /** Placeholder text */\r\n placeholder?: string;\r\n /** Input name attribute */\r\n name?: string;\r\n /** Input id attribute */\r\n id?: string;\r\n /** Whether the field is required */\r\n required?: boolean;\r\n /**\r\n * Opt out of the component's built-in `required` validation so the\r\n * consumer owns validation entirely (e.g. a Zod schema on the form).\r\n * When `true`, the `required` constraint is NOT forwarded to the\r\n * underlying field (no `aria-required`, no required asterisk). The\r\n * visual error/hint still render via `error`/`hint`. Defaults to\r\n * `false`, preserving the existing built-in behavior exactly.\r\n */\r\n disableBuiltInValidation?: boolean;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Error message to display */\r\n error?: string;\r\n /** Hint text shown below input */\r\n hint?: string;\r\n /** Show password strength indicator */\r\n showStrength?: boolean;\r\n /** Size variant */\r\n size?: 'sm' | 'md' | 'lg';\r\n /** Minimum password length */\r\n minlength?: number | null;\r\n /** Maximum password length */\r\n maxlength?: number | null;\r\n /** Autocomplete attribute */\r\n autocomplete?: string;\r\n /** Whether to show the password toggle button */\r\n showPasswordToggle?: boolean;\r\n /** Additional class for the wrapper div */\r\n class?: string;\r\n // Optional callbacks (matching Input component signatures)\r\n // eslint-disable-next-line no-unused-vars -- intentionally retained (prop/slot/forward-compat or Svelte-5 reactive binding eslint cannot see)\r\n oninput?: (value: string) => void;\r\n onblur?: () => void;\r\n onfocus?: () => void;\r\n /** Override user-visible strings */\r\n labels?: SCLabels<typeof defaultLabels>;\r\n }\r\n\r\n let {\r\n value = $bindable(''),\r\n label = '',\r\n placeholder = '',\r\n name = '',\r\n id = '',\r\n required = false,\r\n disableBuiltInValidation = false,\r\n disabled = false,\r\n error = '',\r\n hint = '',\r\n showStrength = false,\r\n size = 'md',\r\n minlength = null,\r\n maxlength = null,\r\n autocomplete = 'new-password',\r\n showPasswordToggle = true,\r\n class: className = '',\r\n oninput,\r\n onblur,\r\n onfocus,\r\n labels: userLabels = {},\r\n }: Props = $props();\r\n\r\n let labels = $derived(mergeLabels(defaultLabels, userLabels));\r\n\r\n // When the consumer opts out of built-in validation, do NOT forward the\r\n // `required` constraint to the underlying field — the consuming form owns\r\n // validation entirely. Default (false) forwards `required` as-is, exactly\r\n // preserving existing behavior.\r\n let effectiveRequired = $derived(disableBuiltInValidation ? false : required);\r\n\r\n // Password strength tracking\r\n let strengthScore = $state(-1);\r\n let strengthText = $state('');\r\n let strengthColor = $state('');\r\n</script>\r\n\r\n<div class={className}>\r\n <Input\r\n type=\"password\"\r\n {id}\r\n {name}\r\n {placeholder}\r\n {label}\r\n required={effectiveRequired}\r\n {disabled}\r\n {size}\r\n {minlength}\r\n {maxlength}\r\n {autocomplete}\r\n {showPasswordToggle}\r\n errorText={error}\r\n hintText={hint}\r\n bind:value\r\n oninputchange={oninput}\r\n {onblur}\r\n {onfocus}\r\n />\r\n\r\n {#if showStrength && value}\r\n <PasswordStrengthIndicator\r\n password={value}\r\n bind:score={strengthScore}\r\n bind:strengthText\r\n bind:textColor={strengthColor}\r\n >\r\n <p class=\"type-caption {strengthColor}\">\r\n {labels.passwordStrength} {strengthText}\r\n </p>\r\n </PasswordStrengthIndicator>\r\n {/if}\r\n</div>\r\n","<!-- @route-escape: widget-intentional. -->\r\n<script lang=\"ts\">\r\n import { defaultLabels } from '$lib/i18n/defaultLabels.js';\r\n import { onMount, onDestroy } from 'svelte';\r\n import { goto } from '$app/navigation';\r\n import { resolve } from '$app/paths';\r\n import EventExperience from '$lib/public-calendar-flow/Event.svelte';\r\n import { transformCollectionData } from '$lib/public-calendar-flow/transform';\r\n import { fetchPublicCollection } from '$lib/api/events';\r\n import type { PublicCollectionData } from '$lib/api/types';\r\n import {\r\n Button,\r\n createLogger,\r\n PasswordInput,\r\n } from '@getmicdrop/svelte-components';\r\n\r\n const _logger = createLogger('CollectionView');\r\n\r\n // --- Props (matches old CollectionView external interface) ---\r\n interface Props {\r\n collectionId: string | number;\r\n organizationId?: string;\r\n onNavigateToEvent?: (_id: number, _slug: string) => void;\r\n password?: string;\r\n displayMode?: string;\r\n showViewSwitcher?: boolean;\r\n labels?: Record<string, string>;\r\n /** BCP-47 locale tag (e.g. 'es', 'es-MX'). Undefined → browser locale → en. */\r\n locale?: string;\r\n }\r\n\r\n let {\r\n collectionId,\r\n organizationId: _organizationId = '',\r\n onNavigateToEvent = undefined,\r\n password = undefined,\r\n displayMode: _displayMode = 'gallery',\r\n showViewSwitcher: _showViewSwitcher = true,\r\n labels = defaultLabels,\r\n locale = undefined,\r\n }: Props = $props();\r\n\r\n // --- State ---\r\n let collection = $state<PublicCollectionData | null>(null);\r\n let isLoading = $state(true);\r\n let error = $state<string | null>(null);\r\n let isMounted = $state(false);\r\n let passwordRequired = $state(false);\r\n let passwordInput = $state('');\r\n let passwordError = $state(false);\r\n\r\n // --- Derived ---\r\n let eventData = $derived(\r\n collection ? transformCollectionData(collection) : null\r\n );\r\n\r\n // Monotonic id for collection loads. loadCollection runs on mount AND on each\r\n // password submit; a slower EARLIER request resolving last would otherwise\r\n // clobber the latest attempt (isMounted only covers unmount, not overlap).\r\n let latestLoad = 0;\r\n\r\n // R-STORAGE-02 namespaced key (`micdrop:<feature>:<detail>`) — mirrors\r\n // EventPage's `micdrop:authedEvents:list` so the two public password gates\r\n // behave the same way: an unlock is sticky for the tab session instead of\r\n // re-prompting on every refresh.\r\n //\r\n // Events can store the id alone because their flag only suppresses a modal.\r\n // The public collection payload is served ONLY for a matching `?password=`\r\n // query (auth `isCollectionPasswordSatisfied` — there is no unlock cookie),\r\n // so the entry has to carry the password in order to replay it. The server\r\n // stays the authority: a stored password that no longer matches comes back\r\n // as `passwordRequired` and we re-prompt, so the flag can never reveal gated\r\n // content on its own. The value is a shared per-collection gate password,\r\n // not a visitor credential, and dies with the tab.\r\n const AUTHED_COLLECTIONS_STORAGE_KEY = 'micdrop:authedCollections:list';\r\n\r\n interface AuthedCollection {\r\n id: string;\r\n password: string;\r\n }\r\n\r\n function readAuthedCollections(): AuthedCollection[] {\r\n if (typeof window === 'undefined') return [];\r\n try {\r\n const parsed = JSON.parse(\r\n sessionStorage.getItem(AUTHED_COLLECTIONS_STORAGE_KEY) || '[]'\r\n ); // @storage-escape: authedCollections session-auth state (intentional raw sessionStorage)\r\n // A foreign/corrupt value under our key must degrade to \"locked\" rather\r\n // than throw and take the whole collection load down with it.\r\n return Array.isArray(parsed) ? parsed : [];\r\n } catch {\r\n return [];\r\n }\r\n }\r\n\r\n function getAuthedCollectionPassword(\r\n colId: string | number\r\n ): string | undefined {\r\n const entry = readAuthedCollections().find((c) => c?.id === String(colId));\r\n return entry?.password || undefined;\r\n }\r\n\r\n function setAuthedCollectionPassword(\r\n colId: string | number,\r\n pwd?: string\r\n ): void {\r\n if (typeof window === 'undefined' || !pwd) return;\r\n // Rewrite rather than push-if-absent so a rotated password replaces the\r\n // stale entry for this collection instead of being shadowed by it.\r\n const authedCollections = readAuthedCollections().filter(\r\n (c) => c?.id !== String(colId)\r\n );\r\n authedCollections.push({ id: String(colId), password: pwd });\r\n sessionStorage.setItem(\r\n AUTHED_COLLECTIONS_STORAGE_KEY,\r\n JSON.stringify(authedCollections)\r\n ); // @storage-escape: authedCollections session-auth state (intentional raw sessionStorage)\r\n }\r\n\r\n function clearAuthedCollection(colId: string | number): void {\r\n if (typeof window === 'undefined') return;\r\n const remaining = readAuthedCollections().filter(\r\n (c) => c?.id !== String(colId)\r\n );\r\n sessionStorage.setItem(\r\n AUTHED_COLLECTIONS_STORAGE_KEY,\r\n JSON.stringify(remaining)\r\n ); // @storage-escape: authedCollections session-auth state (intentional raw sessionStorage)\r\n }\r\n\r\n // --- Load collection data ---\r\n // `fromSession` marks a password replayed from sessionStorage rather than\r\n // typed just now — it must be dropped (not blamed on the visitor) if the\r\n // server no longer accepts it.\r\n async function loadCollection(\r\n pwd?: string,\r\n fromSession = false\r\n ): Promise<void> {\r\n if (!isMounted) return;\r\n const loadId = ++latestLoad;\r\n if (!collectionId) {\r\n error = labels.noCollectionIdProvided || 'No collection ID provided';\r\n isLoading = false;\r\n return;\r\n }\r\n\r\n isLoading = true;\r\n error = null;\r\n passwordError = false;\r\n\r\n try {\r\n const data = await fetchPublicCollection(collectionId, pwd);\r\n // A newer load superseded us — discard this stale response.\r\n if (!isMounted || loadId !== latestLoad) return;\r\n\r\n if (data) {\r\n if (data.passwordRequired || data.error?.code === 'PASSWORD_REQUIRED') {\r\n passwordRequired = true;\r\n if (fromSession) clearAuthedCollection(collectionId);\r\n isLoading = false;\r\n return;\r\n }\r\n collection = data;\r\n passwordRequired = false;\r\n // Remember the accepted password for this tab so a refresh re-opens the\r\n // collection instead of re-prompting. No-op when the collection isn't\r\n // protected (pwd undefined).\r\n setAuthedCollectionPassword(collectionId, pwd);\r\n } else {\r\n if (pwd) {\r\n passwordRequired = true;\r\n if (fromSession) {\r\n clearAuthedCollection(collectionId);\r\n } else {\r\n passwordError = true;\r\n }\r\n isLoading = false;\r\n return;\r\n }\r\n error = labels.failedToLoadCollection || 'Failed to load collection';\r\n }\r\n } catch (err: any) {\r\n // A superseded load failing must not overwrite the latest load's state\r\n // (e.g. a slow wrong-password 401 re-locking an already-loaded collection).\r\n if (isMounted && loadId === latestLoad) {\r\n const msg = err.message || '';\r\n if (\r\n msg.includes('401') ||\r\n msg.includes('403') ||\r\n msg.includes('password')\r\n ) {\r\n passwordRequired = true;\r\n if (fromSession) clearAuthedCollection(collectionId);\r\n } else {\r\n error =\r\n msg || labels.failedToLoadCollection || 'Failed to load collection';\r\n }\r\n }\r\n } finally {\r\n // Only the latest load may clear the spinner — a stale load settling\r\n // first must not reveal content while the newest load is still pending.\r\n if (isMounted && loadId === latestLoad) {\r\n isLoading = false;\r\n }\r\n }\r\n }\r\n\r\n function handlePasswordSubmit(e: Event): void {\r\n e.preventDefault();\r\n if (!passwordInput.trim()) return;\r\n loadCollection(passwordInput);\r\n }\r\n\r\n function handleCollectionEventClick(galleryEvent: {\r\n id?: number | string;\r\n slug: string;\r\n }): void {\r\n if (onNavigateToEvent && galleryEvent.id) {\r\n onNavigateToEvent(Number(galleryEvent.id), galleryEvent.slug);\r\n } else {\r\n // @url-builder-escape: widget-internal route; SC's url-builders cover /a admin paths, not embedded calendar navigation.\r\n goto(\r\n resolve('/[id]/[slug]', {\r\n id: String(galleryEvent.id),\r\n slug: String(galleryEvent.slug),\r\n })\r\n );\r\n }\r\n }\r\n\r\n // --- Lifecycle ---\r\n onMount(() => {\r\n isMounted = true;\r\n // An explicit prop password wins (the embed host supplied it); otherwise\r\n // replay this tab's stored unlock. The stored entry is keyed to the\r\n // collection id alone, so unlocking a collection still does NOT authenticate\r\n // the events inside it — the per-event gate runs on its own on the event page.\r\n const sessionPwd = password\r\n ? undefined\r\n : getAuthedCollectionPassword(collectionId);\r\n loadCollection(password ?? sessionPwd, Boolean(sessionPwd));\r\n });\r\n\r\n onDestroy(() => {\r\n isMounted = false;\r\n });\r\n</script>\r\n\r\n<!-- @pageloader-escape: 4-state gate (loading / private-password-card / error /\r\n content) — PageLoader models only loading/error/children, so it can't own the\r\n password-required branch that sits as a sibling here. -->\r\n{#if isLoading}\r\n <div\r\n class=\"flex items-center justify-center py-12 text-center loading-container\"\r\n >\r\n <p>{labels.loadingCollection || 'Loading collection...'}</p>\r\n </div>\r\n{:else if passwordRequired}\r\n <div\r\n class=\"flex flex-col items-center justify-center min-h-[50vh] text-center\"\r\n >\r\n <div class=\"password-card rounded-lg p-8 max-w-sm w-full\">\r\n <h2 class=\"password-title type-heading mb-2\">\r\n {labels.collectionPrivateTitle || 'This collection is private'}\r\n </h2>\r\n <p class=\"password-description type-body mb-6\">\r\n {labels.collectionPrivateDescription ||\r\n 'Please enter the password to view this collection'}\r\n </p>\r\n <form onsubmit={handlePasswordSubmit} class=\"flex flex-col gap-3\">\r\n <PasswordInput\r\n bind:value={passwordInput}\r\n placeholder={labels.enterPassword || 'Enter password'}\r\n error={passwordError\r\n ? labels.incorrectPassword || 'Incorrect password. Please try again'\r\n : ''}\r\n />\r\n <Button variant=\"default\" type=\"submit\">\r\n {labels.viewCollection || 'View collection'}\r\n </Button>\r\n </form>\r\n </div>\r\n </div>\r\n{:else if error}\r\n <div\r\n class=\"flex flex-col items-center justify-center min-h-[50vh] text-center\"\r\n >\r\n <p class=\"error-text\">{labels.errorPrefix || 'Error:'} {error}</p>\r\n </div>\r\n{:else if eventData}\r\n <EventExperience\r\n event={eventData}\r\n onCollectionEventClick={handleCollectionEventClick}\r\n {labels}\r\n {locale}\r\n />\r\n{/if}\r\n\r\n<style>\r\n .loading-container {\r\n color: hsl(var(--text-secondary, 215 16% 47%));\r\n }\r\n\r\n .error-text {\r\n color: hsl(var(--status-sold-out, 0 72% 51%));\r\n }\r\n\r\n .password-card {\r\n background: hsl(var(--surface-primary, 0 0% 100%));\r\n box-shadow: 0 2px 10px color-mix(in srgb, black 10%, transparent);\r\n }\r\n\r\n .password-title {\r\n color: hsl(var(--text-primary, 0 0% 10%));\r\n }\r\n\r\n .password-description {\r\n color: hsl(var(--text-secondary, 0 0% 45%));\r\n }\r\n</style>\r\n"],"names":["defaultLabels","password","$","$$props","strengthText","score","textColor","userLabels","labels","mergeLabels","debouncedPassword","timer","strengthFn","loadStrengthModule","lazyOnce","ensureStrengthFn","m","customOptions","strength","computedScore","newScore","untrack","computedStrengthText","computedTextColor","newText","strengthColor","newColor","filledBars","div","root_1","div_1","barIndex","$$anchor","div_2","root","safeSlide","DURATION","EASING","$$render","consequent","value","label","placeholder","name","id","required","disableBuiltInValidation","disabled","error","hint","showStrength","size","minlength","maxlength","autocomplete","showPasswordToggle","className","effectiveRequired","strengthScore","Input","node","$$value","PasswordStrengthIndicator","p","createLogger","onNavigateToEvent","locale","collection","isLoading","isMounted","passwordRequired","passwordInput","passwordError","eventData","transformCollectionData","latestLoad","AUTHED_COLLECTIONS_STORAGE_KEY","readAuthedCollections","parsed","getAuthedCollectionPassword","colId","c","setAuthedCollectionPassword","pwd","authedCollections","clearAuthedCollection","remaining","loadCollection","fromSession","loadId","data","fetchPublicCollection","err","msg","handlePasswordSubmit","e","handleCollectionEventClick","galleryEvent","goto","resolve","onMount","sessionPwd","onDestroy","h2","p_1","form","PasswordInput","node_1","Button","node_2","div_3","root_2","p_2","text_4","EventExperience","consequent_1","consequent_3"],"mappings":";;;;;;;;kBAAA;;AAQI,QAAMA,IAAa;AAAA,IACjB,SAAS;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA;AAYV,MACEC,IAAQC,EAAA,KAAAC,GAAA,YAAA,GAAG,EAAE,GACbC,kCAAyB,EAAE,GAC3BC,mCAAoB,GACpBC,+BAAsB,EAAE,GAEhBC,IAAUL,EAAA,KAAAC,GAAA,UAAA,IAAA,OAAA,CAAA,EAAA,GAGhBK,IAAMN,EAAA,QAAA,MA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