@getmicdrop/venue-calendar 4.0.107 → 4.0.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/CartView-C3N5pw89.js +2381 -0
  2. package/dist/CartView-C3N5pw89.js.map +1 -0
  3. package/dist/{Checkout-Db6v9jHf.js → Checkout-CMEf_qnp.js} +604 -620
  4. package/dist/Checkout-CMEf_qnp.js.map +1 -0
  5. package/dist/{Checkout-JvsT5PvE.js → Checkout-Chki2df_.js} +130 -130
  6. package/dist/Checkout-Chki2df_.js.map +1 -0
  7. package/dist/{CheckoutTimer-3Hp1OSA3.js → CheckoutTimer-BAaY_60w.js} +5 -5
  8. package/dist/{CheckoutTimer-3Hp1OSA3.js.map → CheckoutTimer-BAaY_60w.js.map} +1 -1
  9. package/dist/{ClockIcon-CaqjP14C.js → ClockIcon-Dbbj_qur.js} +2 -2
  10. package/dist/{ClockIcon-CaqjP14C.js.map → ClockIcon-Dbbj_qur.js.map} +1 -1
  11. package/dist/{CollectionView-DXJfvNlt.js → CollectionView-RM30YPOJ.js} +41 -41
  12. package/dist/CollectionView-RM30YPOJ.js.map +1 -0
  13. package/dist/{Event-BJRx05iL.js → Event-kdxMa6OT.js} +1683 -1603
  14. package/dist/{Event-BJRx05iL.js.map → Event-kdxMa6OT.js.map} +1 -1
  15. package/dist/EventPage-BRBByBHe.js +1001 -0
  16. package/dist/EventPage-BRBByBHe.js.map +1 -0
  17. package/dist/{Heading-BbCHtFCM.js → Heading-CSDFD80h.js} +5 -5
  18. package/dist/{Heading-BbCHtFCM.js.map → Heading-CSDFD80h.js.map} +1 -1
  19. package/dist/{ScarcityBadge-iHyVN-k7.js → ScarcityBadge-B0ca48su.js} +12 -12
  20. package/dist/{ScarcityBadge-iHyVN-k7.js.map → ScarcityBadge-B0ca48su.js.map} +1 -1
  21. package/dist/{SeriesPage-b9aAGbcb.js → SeriesPage-CczfbUKO.js} +5 -5
  22. package/dist/{SeriesPage-b9aAGbcb.js.map → SeriesPage-CczfbUKO.js.map} +1 -1
  23. package/dist/{Spinner-DC99jWmt.js → Spinner--TOwvv9A.js} +2 -2
  24. package/dist/{Spinner-DC99jWmt.js.map → Spinner--TOwvv9A.js.map} +1 -1
  25. package/dist/{Success-H4fQrbfA.js → Success-DIWUGUPs.js} +136 -153
  26. package/dist/Success-DIWUGUPs.js.map +1 -0
  27. package/dist/{Text-CKmfSVMa.js → Text-WLl_ELy9.js} +7 -7
  28. package/dist/{Text-CKmfSVMa.js.map → Text-WLl_ELy9.js.map} +1 -1
  29. package/dist/{VenueCalendar-DmxiEy6q.js → VenueCalendar-CU5N9klc.js} +3366 -3319
  30. package/dist/VenueCalendar-CU5N9klc.js.map +1 -0
  31. package/dist/{ViewTicketsEmbed-BKrQgPf8.js → ViewTicketsEmbed-BOukxQIF.js} +6 -6
  32. package/dist/ViewTicketsEmbed-BOukxQIF.js.map +1 -0
  33. package/dist/api/api/events.d.ts +28 -12
  34. package/dist/api/api/index.d.ts +1 -1
  35. package/dist/api/api/route-manifest.d.ts +179 -0
  36. package/dist/api/api.cjs +1 -1
  37. package/dist/api/api.cjs.map +1 -1
  38. package/dist/api/api.mjs +316 -316
  39. package/dist/api/api.mjs.map +1 -1
  40. package/dist/{labels-DgU1irgj.js → labels-DXGieQXs.js} +86 -89
  41. package/dist/labels-DXGieQXs.js.map +1 -0
  42. package/dist/{modalManager.svelte-Ddxmimtn.js → modalManager.svelte-Dbd1xgTQ.js} +2 -2
  43. package/dist/{modalManager.svelte-Ddxmimtn.js.map → modalManager.svelte-Dbd1xgTQ.js.map} +1 -1
  44. package/dist/promo-oWi_MKmY.js +29 -0
  45. package/dist/promo-oWi_MKmY.js.map +1 -0
  46. package/dist/seo/helpers.d.ts +11 -0
  47. package/dist/seo/seo.cjs +1 -1
  48. package/dist/seo/seo.cjs.map +1 -1
  49. package/dist/seo/seo.mjs +170 -179
  50. package/dist/seo/seo.mjs.map +1 -1
  51. package/dist/{data-toggle-store.svelte-BEm-nTSr.js → showcase-state-options-DJJdjxvZ.js} +72 -45
  52. package/dist/showcase-state-options-DJJdjxvZ.js.map +1 -0
  53. package/dist/{transform-BOx8W51w.js → transform-Bgqwj9i-.js} +42 -42
  54. package/dist/transform-Bgqwj9i-.js.map +1 -0
  55. package/dist/venue-calendar.css +1 -1
  56. package/dist/venue-calendar.es.js +4 -4
  57. package/dist/venue-calendar.iife.js +50 -50
  58. package/dist/venue-calendar.iife.js.map +1 -1
  59. package/dist/venue-calendar.umd.js +44 -44
  60. package/dist/venue-calendar.umd.js.map +1 -1
  61. package/package.json +199 -187
  62. package/dist/CartView-DC_stfl4.js +0 -2348
  63. package/dist/CartView-DC_stfl4.js.map +0 -1
  64. package/dist/Checkout-Db6v9jHf.js.map +0 -1
  65. package/dist/Checkout-JvsT5PvE.js.map +0 -1
  66. package/dist/CollectionView-DXJfvNlt.js.map +0 -1
  67. package/dist/EventPage-E0tOQVFN.js +0 -940
  68. package/dist/EventPage-E0tOQVFN.js.map +0 -1
  69. package/dist/Success-H4fQrbfA.js.map +0 -1
  70. package/dist/VenueCalendar-DmxiEy6q.js.map +0 -1
  71. package/dist/ViewTicketsEmbed-BKrQgPf8.js.map +0 -1
  72. package/dist/data-toggle-store.svelte-BEm-nTSr.js.map +0 -1
  73. package/dist/labels-DgU1irgj.js.map +0 -1
  74. package/dist/promo-WWbp2OWI.js +0 -12
  75. package/dist/promo-WWbp2OWI.js.map +0 -1
  76. package/dist/transform-BOx8W51w.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"modalManager.svelte-Ddxmimtn.js","sources":["../node_modules/@getmicdrop/svelte-components/dist/primitives/Modal/ModalHeader.svelte","../node_modules/@getmicdrop/svelte-components/dist/utils/modalManager.svelte.js"],"sourcesContent":["<script lang=\"ts\">\r\n import type { Snippet } from 'svelte';\r\n import { getModalContext } from './context.js';\r\n import { cn } from '../../utils/classNames.js';\r\n\r\n interface Props {\r\n class?: string;\r\n children?: Snippet;\r\n }\r\n\r\n let { class: className, children }: Props = $props();\r\n\r\n // Validates this component is inside ModalRoot\r\n getModalContext();\r\n</script>\r\n\r\n<div class={cn('shrink-0 px-6 pt-6 pb-3', className)}>\r\n {#if children}{@render children()}{/if}\r\n</div>\r\n","/**\n * behavior-modal-orchestration canonical (R-MODAL-1/3).\n *\n * Two rune primitives for modal open-state — pick by modal count:\n *\n * - `createModalState<T>()` — ONE modal. Replaces the dominant\n * `let showFooModal = $state(false)` + `let fooData = $state(null)` pair.\n * Use: `modal.isOpen`, `modal.data`, `modal.open(data?)`, `modal.close()`.\n *\n * - `createModalManager<Id>()` — a page with 3+ modals. Replaces N booleans\n * with one registry: `m.open(id, payload?)`, `m.close(id)`, `m.isOpen(id)`,\n * `m.payload(id)`, `m.active`, `m.closeAll()`. Coordinates exclusive-open\n * (opening one closes the others) and focus-return (focus goes back to the\n * element that was active before the first modal opened) in one place,\n * instead of the implicit-by-convention mutual exclusion seen across the\n * 4-modal accounts page and the 3-modal checkout hand-off chains.\n *\n * `createModalState` is lifted verbatim from micdrop-frontend's storeUtils\n * (zero consumers there); `createModalManager` is new — no modal coordinator\n * existed in any of the four repos.\n *\n * ## Binding to `ModalRoot` (`bind()`)\n * Both factories expose a `bind(...)` helper returning the props to spread onto a\n * `ModalRoot`, wiring its open-state to the manager:\n *\n * <ModalRoot {...modals.bind('edit')}>…</ModalRoot> // multi\n * <ModalRoot {...editModal.bind()}>…</ModalRoot> // single\n *\n * `bind()` returns a `{ get open, set open, oncancel }` object. The `open`\n * **getter** keeps `ModalRoot` reading the manager's live open-state (so opening\n * the modal anywhere re-renders it); `oncancel` closes the modal through the\n * manager. `ModalRoot`'s only self-close path (`resetModal`) always fires\n * `oncancel` before flipping its own local `open`, so escape / backdrop dismissal\n * routes back through the manager and the two never desync.\n *\n * This deliberately avoids the foot-gun it replaces: you can't write\n * `bind:open={modals.isOpen('edit')}` (a method call isn't an assignable lvalue),\n * and feeding `bind:open` a `$derived` is the read-only binding runtime bug. The\n * getter + `oncancel` spread sidesteps both — no per-page `$state` boolean, no\n * accidental derived binding. The `set open` setter completes the\n * getter/setter pair so the object also reads/writes cleanly when assigned to\n * programmatically. Scroll-lock + focus-trap stay in `ModalRoot`; the manager\n * owns only open-state, payload, exclusivity, and focus-return.\n */\n/**\n * Reactive open/close state for a single modal, with optional context data.\n *\n * @example\n * const editModal = createModalState<User>();\n * editModal.open(user); // editModal.isOpen === true, editModal.data === user\n * editModal.close(); // isOpen === false, data === null\n *\n * // Compose with ModalRoot by spreading the bind() props:\n * // <ModalRoot {...editModal.bind()}>…</ModalRoot>\n */\nexport function createModalState() {\n let isOpen = $state(false);\n let data = $state(null);\n return {\n get isOpen() {\n return isOpen;\n },\n get data() {\n return data;\n },\n open(newData) {\n data = newData ?? null;\n isOpen = true;\n },\n close() {\n isOpen = false;\n data = null;\n },\n toggle(newData) {\n if (isOpen) {\n isOpen = false;\n data = null;\n }\n else {\n data = newData ?? null;\n isOpen = true;\n }\n },\n bind() {\n return {\n get open() {\n return isOpen;\n },\n set open(value) {\n // Binding-driven open carries no data (data stays null); use the\n // explicit open(data) call when a payload is needed.\n if (value)\n isOpen = true;\n else {\n isOpen = false;\n data = null;\n }\n },\n oncancel() {\n isOpen = false;\n data = null;\n },\n };\n },\n };\n}\n/**\n * Coordinate a set of named modals on one page. See module docs for when to\n * reach for this over `createModalState`.\n *\n * @example\n * const modals = createModalManager<'create' | 'edit' | 'delete'>();\n * modals.open('edit', user);\n * modals.isOpen('edit'); // true\n * modals.payload<User>('edit');\n * modals.open('delete'); // 'edit' auto-closes (exclusive)\n * modals.closeAll(); // focus returns to the original trigger\n *\n * // Compose with ModalRoot by spreading the bind() props:\n * // <ModalRoot {...modals.bind('edit')}>…</ModalRoot>\n */\nexport function createModalManager(options = {}) {\n const exclusive = options.exclusive ?? true;\n const restoreFocus = options.restoreFocus ?? true;\n const modals = $state({});\n let returnFocusEl = null;\n function anyOpen() {\n return Object.values(modals).some((m) => m.open);\n }\n function isOpen(id) {\n return modals[id]?.open ?? false;\n }\n /** Remember the active element when transitioning from \"none open\" → \"open\". */\n function captureReturnFocus() {\n if (!restoreFocus || typeof document === 'undefined')\n return;\n if (!anyOpen()) {\n const el = document.activeElement;\n returnFocusEl = el instanceof HTMLElement ? el : null;\n }\n }\n /** Return focus to the captured trigger once everything is closed. */\n function restoreReturnFocus() {\n if (!restoreFocus)\n return;\n if (!anyOpen() && returnFocusEl) {\n returnFocusEl.focus();\n returnFocusEl = null;\n }\n }\n function open(id, payload) {\n captureReturnFocus();\n if (exclusive) {\n for (const key of Object.keys(modals)) {\n if (key !== id) {\n modals[key].open = false;\n modals[key].payload = null;\n }\n }\n }\n modals[id] = { open: true, payload: payload ?? null };\n }\n function close(id) {\n const entry = modals[id];\n if (entry) {\n entry.open = false;\n entry.payload = null;\n }\n restoreReturnFocus();\n }\n function toggle(id, payload) {\n if (isOpen(id))\n close(id);\n else\n open(id, payload);\n }\n function closeAll() {\n for (const key of Object.keys(modals)) {\n modals[key].open = false;\n modals[key].payload = null;\n }\n restoreReturnFocus();\n }\n return {\n isOpen,\n payload(id) {\n return modals[id]?.payload ?? null;\n },\n get active() {\n return Object.keys(modals).filter((key) => modals[key].open);\n },\n open,\n close,\n toggle,\n closeAll,\n bind(id) {\n return {\n get open() {\n return isOpen(id);\n },\n set open(value) {\n // Binding-driven open carries no payload; use open(id, payload) for that.\n if (value)\n open(id);\n else\n close(id);\n },\n oncancel() {\n close(id);\n },\n };\n },\n };\n}\n"],"names":["getModalContext","div","root","$0","$","cn","$$props","createModalState","isOpen","data","newData","value"],"mappings":";;;;iBAAA;iBAaEA,EAAe;MAGhBC,IAAGC,EAAA,eAAHD,CAAG;;;;;;;;;;UAAHA,CAAG,wCAAHA,GAAG,GAAAE,CAAA,GAAA,CAAA,MAAAC,EAAA,KAAQC,EAAG,2BAAyBC,EAAA,KAAA,CAAA,CAAA,CAAA,eAAvCL,CAAG;AAFI;ACyCD,SAASM,IAAmB;AAC/B,MAAIC,IAASJ,EAAA,MAAO,EAAK,GACrBK,IAAOL,EAAA,MAAO,IAAI;AACtB,SAAM;AAAA,IACF,IAAI,SAAS;AACT,mBAAOI,CAAM;AAAA,IACjB;AAAA,IACA,IAAI,OAAO;AACP,mBAAOC,CAAI;AAAA,IACf;AAAA,IACA,KAAKC,GAAS;YACVD,GAAOC,KAAW,MAAI,EAAA,GACtBN,EAAA,IAAAI,GAAS,EAAI;AAAA,IACjB;AAAA,IACA,QAAQ;AACJ,MAAAJ,EAAA,IAAAI,GAAS,EAAK,GACdJ,EAAA,IAAAK,GAAO,IAAI;AAAA,IACf;AAAA,IACA,OAAOC,GAAS;AACZ,MAAEN,EAAA,IAAEI,CAAM,KACNJ,EAAA,IAAAI,GAAS,EAAK,GACdJ,EAAA,IAAAK,GAAO,IAAI,YAGXA,GAAOC,KAAW,MAAI,EAAA,GACtBN,EAAA,IAAAI,GAAS,EAAI;AAAA,IAErB;AAAA,IACA,OAAO;AACH,aAAM;AAAA,QACF,IAAI,OAAO;AACP,uBAAOA,CAAM;AAAA,QACjB;AAAA,QACA,IAAI,KAAKG,GAAO;AAGZ,UAAIA,IAAKP,EAAA,IACLI,GAAS,EAAI,KAEbJ,EAAA,IAAAI,GAAS,EAAK,GACdJ,EAAA,IAAAK,GAAO,IAAI;AAAA,QAEnB;AAAA,QACA,WAAW;AACP,UAAAL,EAAA,IAAAI,GAAS,EAAK,GACdJ,EAAA,IAAAK,GAAO,IAAI;AAAA,QACf;AAAA;IAER;AAAA;AAER;","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"modalManager.svelte-Dbd1xgTQ.js","sources":["../node_modules/@getmicdrop/svelte-components/dist/primitives/Modal/ModalHeader.svelte","../node_modules/@getmicdrop/svelte-components/dist/utils/modalManager.svelte.js"],"sourcesContent":["<script lang=\"ts\">\r\n import type { Snippet } from 'svelte';\r\n import { getModalContext } from './context.js';\r\n import { cn } from '../../utils/classNames.js';\r\n\r\n interface Props {\r\n class?: string;\r\n children?: Snippet;\r\n }\r\n\r\n let { class: className, children }: Props = $props();\r\n\r\n // Validates this component is inside ModalRoot\r\n getModalContext();\r\n</script>\r\n\r\n<div class={cn('shrink-0 px-6 pt-6 pb-3', className)}>\r\n {#if children}{@render children()}{/if}\r\n</div>\r\n","/**\n * behavior-modal-orchestration canonical (R-MODAL-1/3).\n *\n * Two rune primitives for modal open-state — pick by modal count:\n *\n * - `createModalState<T>()` — ONE modal. Replaces the dominant\n * `let showFooModal = $state(false)` + `let fooData = $state(null)` pair.\n * Use: `modal.isOpen`, `modal.data`, `modal.open(data?)`, `modal.close()`.\n *\n * - `createModalManager<Id>()` — a page with 3+ modals. Replaces N booleans\n * with one registry: `m.open(id, payload?)`, `m.close(id)`, `m.isOpen(id)`,\n * `m.payload(id)`, `m.active`, `m.closeAll()`. Coordinates exclusive-open\n * (opening one closes the others) and focus-return (focus goes back to the\n * element that was active before the first modal opened) in one place,\n * instead of the implicit-by-convention mutual exclusion seen across the\n * 4-modal accounts page and the 3-modal checkout hand-off chains.\n *\n * `createModalState` is lifted verbatim from micdrop-frontend's storeUtils\n * (zero consumers there); `createModalManager` is new — no modal coordinator\n * existed in any of the four repos.\n *\n * ## Binding to `ModalRoot` (`bind()`)\n * Both factories expose a `bind(...)` helper returning the props to spread onto a\n * `ModalRoot`, wiring its open-state to the manager:\n *\n * <ModalRoot {...modals.bind('edit')}>…</ModalRoot> // multi\n * <ModalRoot {...editModal.bind()}>…</ModalRoot> // single\n *\n * `bind()` returns a `{ get open, set open, oncancel }` object. The `open`\n * **getter** keeps `ModalRoot` reading the manager's live open-state (so opening\n * the modal anywhere re-renders it); `oncancel` closes the modal through the\n * manager. `ModalRoot`'s only self-close path (`resetModal`) always fires\n * `oncancel` before flipping its own local `open`, so escape / backdrop dismissal\n * routes back through the manager and the two never desync.\n *\n * This deliberately avoids the foot-gun it replaces: you can't write\n * `bind:open={modals.isOpen('edit')}` (a method call isn't an assignable lvalue),\n * and feeding `bind:open` a `$derived` is the read-only binding runtime bug. The\n * getter + `oncancel` spread sidesteps both — no per-page `$state` boolean, no\n * accidental derived binding. The `set open` setter completes the\n * getter/setter pair so the object also reads/writes cleanly when assigned to\n * programmatically. Scroll-lock + focus-trap stay in `ModalRoot`; the manager\n * owns only open-state, payload, exclusivity, and focus-return.\n */\n/**\n * Reactive open/close state for a single modal, with optional context data.\n *\n * @example\n * const editModal = createModalState<User>();\n * editModal.open(user); // editModal.isOpen === true, editModal.data === user\n * editModal.close(); // isOpen === false, data === null\n *\n * // Compose with ModalRoot by spreading the bind() props:\n * // <ModalRoot {...editModal.bind()}>…</ModalRoot>\n */\nexport function createModalState() {\n let isOpen = $state(false);\n let data = $state(null);\n return {\n get isOpen() {\n return isOpen;\n },\n get data() {\n return data;\n },\n open(newData) {\n data = newData ?? null;\n isOpen = true;\n },\n close() {\n isOpen = false;\n data = null;\n },\n toggle(newData) {\n if (isOpen) {\n isOpen = false;\n data = null;\n }\n else {\n data = newData ?? null;\n isOpen = true;\n }\n },\n bind() {\n return {\n get open() {\n return isOpen;\n },\n set open(value) {\n // Binding-driven open carries no data (data stays null); use the\n // explicit open(data) call when a payload is needed.\n if (value)\n isOpen = true;\n else {\n isOpen = false;\n data = null;\n }\n },\n oncancel() {\n isOpen = false;\n data = null;\n },\n };\n },\n };\n}\n/**\n * Coordinate a set of named modals on one page. See module docs for when to\n * reach for this over `createModalState`.\n *\n * @example\n * const modals = createModalManager<'create' | 'edit' | 'delete'>();\n * modals.open('edit', user);\n * modals.isOpen('edit'); // true\n * modals.payload<User>('edit');\n * modals.open('delete'); // 'edit' auto-closes (exclusive)\n * modals.closeAll(); // focus returns to the original trigger\n *\n * // Compose with ModalRoot by spreading the bind() props:\n * // <ModalRoot {...modals.bind('edit')}>…</ModalRoot>\n */\nexport function createModalManager(options = {}) {\n const exclusive = options.exclusive ?? true;\n const restoreFocus = options.restoreFocus ?? true;\n const modals = $state({});\n let returnFocusEl = null;\n function anyOpen() {\n return Object.values(modals).some((m) => m.open);\n }\n function isOpen(id) {\n return modals[id]?.open ?? false;\n }\n /** Remember the active element when transitioning from \"none open\" → \"open\". */\n function captureReturnFocus() {\n if (!restoreFocus || typeof document === 'undefined')\n return;\n if (!anyOpen()) {\n const el = document.activeElement;\n returnFocusEl = el instanceof HTMLElement ? el : null;\n }\n }\n /** Return focus to the captured trigger once everything is closed. */\n function restoreReturnFocus() {\n if (!restoreFocus)\n return;\n if (!anyOpen() && returnFocusEl) {\n returnFocusEl.focus();\n returnFocusEl = null;\n }\n }\n function open(id, payload) {\n captureReturnFocus();\n if (exclusive) {\n for (const key of Object.keys(modals)) {\n if (key !== id) {\n modals[key].open = false;\n modals[key].payload = null;\n }\n }\n }\n modals[id] = { open: true, payload: payload ?? null };\n }\n function close(id) {\n const entry = modals[id];\n if (entry) {\n entry.open = false;\n entry.payload = null;\n }\n restoreReturnFocus();\n }\n function toggle(id, payload) {\n if (isOpen(id))\n close(id);\n else\n open(id, payload);\n }\n function closeAll() {\n for (const key of Object.keys(modals)) {\n modals[key].open = false;\n modals[key].payload = null;\n }\n restoreReturnFocus();\n }\n return {\n isOpen,\n payload(id) {\n return modals[id]?.payload ?? null;\n },\n get active() {\n return Object.keys(modals).filter((key) => modals[key].open);\n },\n open,\n close,\n toggle,\n closeAll,\n bind(id) {\n return {\n get open() {\n return isOpen(id);\n },\n set open(value) {\n // Binding-driven open carries no payload; use open(id, payload) for that.\n if (value)\n open(id);\n else\n close(id);\n },\n oncancel() {\n close(id);\n },\n };\n },\n };\n}\n"],"names":["getModalContext","div","root","$0","$","cn","$$props","createModalState","isOpen","data","newData","value"],"mappings":";;;;iBAAA;iBAaEA,EAAe;MAGhBC,IAAGC,EAAA,eAAHD,CAAG;;;;;;;;;;UAAHA,CAAG,wCAAHA,GAAG,GAAAE,CAAA,GAAA,CAAA,MAAAC,EAAA,KAAQC,EAAG,2BAAyBC,EAAA,KAAA,CAAA,CAAA,CAAA,eAAvCL,CAAG;AAFI;ACyCD,SAASM,IAAmB;AAC/B,MAAIC,IAASJ,EAAA,MAAO,EAAK,GACrBK,IAAOL,EAAA,MAAO,IAAI;AACtB,SAAM;AAAA,IACF,IAAI,SAAS;AACT,mBAAOI,CAAM;AAAA,IACjB;AAAA,IACA,IAAI,OAAO;AACP,mBAAOC,CAAI;AAAA,IACf;AAAA,IACA,KAAKC,GAAS;YACVD,GAAOC,KAAW,MAAI,EAAA,GACtBN,EAAA,IAAAI,GAAS,EAAI;AAAA,IACjB;AAAA,IACA,QAAQ;AACJ,MAAAJ,EAAA,IAAAI,GAAS,EAAK,GACdJ,EAAA,IAAAK,GAAO,IAAI;AAAA,IACf;AAAA,IACA,OAAOC,GAAS;AACZ,MAAEN,EAAA,IAAEI,CAAM,KACNJ,EAAA,IAAAI,GAAS,EAAK,GACdJ,EAAA,IAAAK,GAAO,IAAI,YAGXA,GAAOC,KAAW,MAAI,EAAA,GACtBN,EAAA,IAAAI,GAAS,EAAI;AAAA,IAErB;AAAA,IACA,OAAO;AACH,aAAM;AAAA,QACF,IAAI,OAAO;AACP,uBAAOA,CAAM;AAAA,QACjB;AAAA,QACA,IAAI,KAAKG,GAAO;AAGZ,UAAIA,IAAKP,EAAA,IACLI,GAAS,EAAI,KAEbJ,EAAA,IAAAI,GAAS,EAAK,GACdJ,EAAA,IAAAK,GAAO,IAAI;AAAA,QAEnB;AAAA,QACA,WAAW;AACP,UAAAL,EAAA,IAAAI,GAAS,EAAK,GACdJ,EAAA,IAAAK,GAAO,IAAI;AAAA,QACf;AAAA;IAER;AAAA;AAER;","x_google_ignoreList":[0,1]}
@@ -0,0 +1,29 @@
1
+ import { ay as c, az as f, aA as m, aB as u } from "./VenueCalendar-CU5N9klc.js";
2
+ function l(r) {
3
+ return r === "percentage" || r === "%";
4
+ }
5
+ function t(r, e, s) {
6
+ if (!(e > 0) || !(r > 0)) return 0;
7
+ const n = l(s) ? r * e / 100 : e, a = Math.max(0, Math.min(r, n));
8
+ return Math.round(a * 100) / 100;
9
+ }
10
+ function C(r, e, s, n) {
11
+ if (!(s > 0)) return 0;
12
+ if (!l(n))
13
+ return t(e, s, n);
14
+ const a = r.filter(({ quantity: o }) => o > 0).map(
15
+ ({ unitPrice: o, quantity: i }) => c(
16
+ f(
17
+ t(o, s, n)
18
+ ),
19
+ i
20
+ )
21
+ );
22
+ return m(u(a));
23
+ }
24
+ export {
25
+ C as a,
26
+ l as i,
27
+ t as r
28
+ };
29
+ //# sourceMappingURL=promo-oWi_MKmY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promo-oWi_MKmY.js","sources":["../src/lib/utils/promo.ts"],"sourcesContent":["// Canonical promo-discount resolver.\r\n//\r\n// The promo apply endpoint returns a discount as { amount, discountType } where\r\n// a percentage promo's `amount` is the raw percent (e.g. 10 for \"10%\"). The\r\n// order-summary display path stores that raw number in the per-event\r\n// `checkout-promo-discount-${eventID}` cookie and subtracts it from the\r\n// subtotal as if it were dollars — so a \"10%\" promo renders as a flat \"$10 off\"\r\n// regardless of cart size. PromocodeInput cannot fix this at write-time: it has no subtotal\r\n// (it can even auto-apply before any ticket is chosen). The correct dollar\r\n// value is subtotal-dependent, so it must be resolved wherever the subtotal is\r\n// known, using the stored discount type.\r\n//\r\n// Single source of truth for that resolution. Two discountType vocabularies\r\n// exist in the codebase — the API/cookie form ('percentage' | 'fixed') and the\r\n// per-ticket/pcf form ('%' | '$') — so both are accepted.\r\n\r\nimport {\r\n dollarsToCents,\r\n mulCents,\r\n sumCents,\r\n centsToDollars,\r\n} from '@getmicdrop/svelte-components';\r\n\r\n// The meaningful discount-type values. The resolver accepts any string (the\r\n// value comes from a cookie / promo-change event, i.e. an untyped `string`) and\r\n// treats anything that isn't a percentage marker as a fixed dollar amount.\r\nexport type PromoDiscountType =\r\n | 'percentage'\r\n | 'fixed'\r\n | '%'\r\n | '$'\r\n | ''\r\n | null\r\n | undefined;\r\n\r\ntype PromoDiscountTypeInput = PromoDiscountType | string;\r\n\r\n/**\r\n * Is this promo a percentage promo?\r\n *\r\n * Callers need this to know WHERE a promo may be shown, not just how to size\r\n * it. A percentage promo is *per-ticket*: 20% off each unit summed over the\r\n * cart is exactly 20% off the subtotal, so a ticket row can show it and still\r\n * agree with the order summary. A fixed promo is *order-level*: \"$5 off\" is\r\n * taken once against the subtotal, so a row that shows \"$5 off\" on every unit\r\n * promises `amount × (qty − 1)` more than the order will give.\r\n *\r\n * Anything that isn't a percentage marker is treated as a fixed dollar amount\r\n * (the value arrives from a cookie / promo-change event, i.e. an untyped\r\n * `string`).\r\n */\r\nexport function isPercentageDiscount(\r\n discountType: PromoDiscountTypeInput\r\n): boolean {\r\n return discountType === 'percentage' || discountType === '%';\r\n}\r\n\r\n/**\r\n * Resolve a promo discount to a dollar amount against the current subtotal.\r\n *\r\n * @param subtotal - order subtotal in dollars.\r\n * @param rawAmount - the discount value from the promo response: a percent for\r\n * a percentage promo, a dollar amount for a fixed promo.\r\n * @param discountType - 'percentage'/'%' or 'fixed'/'$' (or empty → fixed).\r\n * @returns the discount in dollars, clamped to [0, subtotal].\r\n */\r\nexport function resolvePromoDiscountDollars(\r\n subtotal: number,\r\n rawAmount: number,\r\n discountType: PromoDiscountTypeInput\r\n): number {\r\n if (!(rawAmount > 0) || !(subtotal > 0)) return 0;\r\n\r\n const dollars = isPercentageDiscount(discountType)\r\n ? (subtotal * rawAmount) / 100\r\n : rawAmount;\r\n\r\n const clamped = Math.max(0, Math.min(subtotal, dollars));\r\n // Round to cents so the deduction matches the currency-formatted display.\r\n return Math.round(clamped * 100) / 100;\r\n}\r\n\r\n/** One cart line: a ticket's unit price (dollars) and how many are in the cart. */\r\nexport interface PromoDiscountLine {\r\n unitPrice: number;\r\n quantity: number;\r\n}\r\n\r\n/**\r\n * Resolve a promo discount for the WHOLE ORDER, rounding the SAME way the\r\n * ticket rows do — so the row and the order summary can never disagree by a\r\n * cent.\r\n *\r\n * A percentage promo shows on every ticket ROW. A row renders a unit price\r\n * rounded to cents, so the discount a buyer reads off the rows is\r\n * `Σ quantity × round(unitPrice × pct)`. If the summary instead rounds\r\n * `pct × subtotal` ONCE, the two round independently and can land up to a cent\r\n * apart per line — the buyer sees two different numbers for the same discount.\r\n * So the summary sums the per-unit rounded discounts: one rounding decision\r\n * (per unit), shared by both surfaces. Each per-unit discount comes from the\r\n * same canonical {@link resolvePromoDiscountDollars} the row calls, so there is\r\n * no second copy of the math.\r\n *\r\n * A fixed promo is order-level and never shown on a row, so it resolves once\r\n * against the subtotal, exactly as before.\r\n *\r\n * @param lines - the cart's ticket lines (unit price × quantity).\r\n * @param subtotal - order subtotal in dollars (used for a fixed, order-level promo).\r\n * @param rawAmount - a percent for a percentage promo, dollars for a fixed one.\r\n * @param discountType - 'percentage'/'%' or 'fixed'/'$' (or empty → fixed).\r\n * @returns the order discount in dollars.\r\n */\r\nexport function resolveOrderPromoDiscountDollars(\r\n lines: readonly PromoDiscountLine[],\r\n subtotal: number,\r\n rawAmount: number,\r\n discountType: PromoDiscountTypeInput\r\n): number {\r\n if (!(rawAmount > 0)) return 0;\r\n\r\n // A fixed promo is order-level and never rendered on a row, so it resolves\r\n // once against the subtotal — unchanged from the single-line resolver.\r\n if (!isPercentageDiscount(discountType)) {\r\n return resolvePromoDiscountDollars(subtotal, rawAmount, discountType);\r\n }\r\n\r\n // Percentage promo: round per unit exactly as the row does, then sum. The\r\n // canonical Cents algebra keeps the sum exact — 0.01 + 0.01 in floats is\r\n // 0.020000000000000004, and this feeds a currency display.\r\n const lineCents = lines\r\n .filter(({ quantity }) => quantity > 0)\r\n .map(({ unitPrice, quantity }) =>\r\n mulCents(\r\n dollarsToCents(\r\n resolvePromoDiscountDollars(unitPrice, rawAmount, discountType)\r\n ),\r\n quantity\r\n )\r\n );\r\n return centsToDollars(sumCents(lineCents));\r\n}\r\n"],"names":["isPercentageDiscount","discountType","resolvePromoDiscountDollars","subtotal","rawAmount","dollars","clamped","resolveOrderPromoDiscountDollars","lines","lineCents","quantity","unitPrice","mulCents","dollarsToCents","centsToDollars","sumCents"],"mappings":";AAmDO,SAASA,EACdC,GACS;AACT,SAAOA,MAAiB,gBAAgBA,MAAiB;AAC3D;AAWO,SAASC,EACdC,GACAC,GACAH,GACQ;AACR,MAAI,EAAEG,IAAY,MAAM,EAAED,IAAW,GAAI,QAAO;AAEhD,QAAME,IAAUL,EAAqBC,CAAY,IAC5CE,IAAWC,IAAa,MACzBA,GAEEE,IAAU,KAAK,IAAI,GAAG,KAAK,IAAIH,GAAUE,CAAO,CAAC;AAEvD,SAAO,KAAK,MAAMC,IAAU,GAAG,IAAI;AACrC;AAgCO,SAASC,EACdC,GACAL,GACAC,GACAH,GACQ;AACR,MAAI,EAAEG,IAAY,GAAI,QAAO;AAI7B,MAAI,CAACJ,EAAqBC,CAAY;AACpC,WAAOC,EAA4BC,GAAUC,GAAWH,CAAY;AAMtE,QAAMQ,IAAYD,EACf,OAAO,CAAC,EAAE,UAAAE,QAAeA,IAAW,CAAC,EACrC;AAAA,IAAI,CAAC,EAAE,WAAAC,GAAW,UAAAD,EAAA,MACjBE;AAAA,MACEC;AAAA,QACEX,EAA4BS,GAAWP,GAAWH,CAAY;AAAA,MAAA;AAAA,MAEhES;AAAA,IAAA;AAAA,EACF;AAEJ,SAAOI,EAAeC,EAASN,CAAS,CAAC;AAC3C;"}
@@ -63,6 +63,17 @@ export declare function getEventStatus(rawStatus: string | null | undefined): st
63
63
  * Extracted from EventStructuredData.svelte lines 137-157.
64
64
  */
65
65
  export declare function getTicketAvailability(ticket: EventTicketInput): string;
66
+ /**
67
+ * Build a schema.org price-range offer from a low/high price and availability.
68
+ *
69
+ * The shared primitive behind every JSON-LD offer block: emit an AggregateOffer
70
+ * when the range spans two prices, or a single Offer when low === high. Any
71
+ * caller-specific fields (a buy `url`, a `validFrom` sales-start) ride along in
72
+ * `extra`, spread verbatim after the core fields so each caller reproduces its
73
+ * exact prior shape — the event builder passes url/validFrom, the series builder
74
+ * passes nothing.
75
+ */
76
+ export declare function buildPriceRangeOffer(lowPrice: number, highPrice: number, availability: string, extra?: Record<string, unknown>): Record<string, unknown>;
66
77
  /**
67
78
  * Build offers from available tickets.
68
79
  *
package/dist/seo/seo.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function E(){return"America/Los_Angeles"}const Z=/<\/(?:p|div|h[1-6]|li|ul|ol|blockquote|tr)>/gi,q=/<br\s*\/?>/gi,j=/<[^>]*>/g,J={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&apos;":"'","&nbsp;":" "};function z(i){return i.replace(/&#x([0-9a-f]+);/gi,(t,e)=>P(parseInt(e,16))).replace(/&#(\d+);/g,(t,e)=>P(Number(e))).replace(/&[a-z0-9]+;/gi,t=>J[t.toLowerCase()]??t)}function P(i){return Number.isFinite(i)&&i>0&&i<=1114111?String.fromCodePoint(i):""}function y(i,t){if(!i)return"";let e=String(i).replace(q," ").replace(Z," ").replace(j,"");if(e=z(e).replace(/\s+/g," ").trim(),t&&t>0&&e.length>t){const n=e.slice(0,t),s=n.lastIndexOf(" ");e=(s>40?n.slice(0,s):n).trimEnd()+"…"}return e}function B(i){return i.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function v(i,t){if(!i)return null;const e=new Date(i);if(isNaN(e.getTime()))return null;const n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZoneName:"shortOffset"};let s;try{s=new Intl.DateTimeFormat("en-US",{...n,timeZone:t})}catch{s=new Intl.DateTimeFormat("en-US",{...n,timeZone:E()})}const a=s.formatToParts(e),r=m=>a.find(b=>b.type===m)?.value||"",l=r("year"),c=r("month"),o=r("day"),d=r("hour"),u=r("minute"),h=r("second"),g=r("timeZoneName");let p="+00:00";if(g){const m=g.match(/GMT([+-])(\d+)(?::(\d+))?/);if(m){const b=m[1],M=m[2].padStart(2,"0"),w=m[3]||"00";p=`${b}${M}:${w}`}}return`${l}-${c}-${o}T${d}:${u}:${h}${p}`}function L(i){if(!i)return null;const t=i.split(",").map(s=>s.trim());if(t.length<2)return{"@type":"PostalAddress",streetAddress:i,addressCountry:"US"};const n=t[t.length-1].match(/^([A-Z]{2})\s+(\d{5}(?:-\d{4})?)$/);return n&&t.length>=3?{"@type":"PostalAddress",streetAddress:t.slice(0,-2).join(", "),addressLocality:t[t.length-2],addressRegion:n[1],postalCode:n[2],addressCountry:"US"}:{"@type":"PostalAddress",streetAddress:t[0],addressLocality:t.slice(1).join(", "),addressCountry:"US"}}function T(i,t){if(i&&(i.city||i.state||i.postalCode)){const e={"@type":"PostalAddress"};return i.address&&(e.streetAddress=i.address),i.city&&(e.addressLocality=i.city),i.state&&(e.addressRegion=i.state),i.postalCode&&(e.postalCode=i.postalCode),e.addressCountry=i.country||"US",e}return L(i&&i.address||t||null)}function N(i){if(!i)return"https://schema.org/EventScheduled";const t=i.toLowerCase();return t==="cancelled"||t==="canceled"?"https://schema.org/EventCancelled":t==="postponed"?"https://schema.org/EventPostponed":t==="rescheduled"?"https://schema.org/EventRescheduled":"https://schema.org/EventScheduled"}function S(i){if((i.remainingCapacity??i.quantityRemaining??i.quantity)===0||i.soldOut)return"https://schema.org/SoldOut";const e=new Date,n=i.salesBegin||i.salesStart||i.saleBegin||i.onSaleStart,s=i.salesEnd||i.saleEnd||i.onSaleEnd;return n&&new Date(n)>e?"https://schema.org/PreOrder":s&&new Date(s)<e?"https://schema.org/SoldOut":"https://schema.org/InStock"}function O(i,t){if(!i||i.length===0)return null;const e=i.filter(l=>{const c=l.visibility??0,o=c===0||c===1,d=l.salesChannel!==2;return o&&d});if(e.length===0)return null;const n=e.map(l=>parseFloat(String(l.price??0))).filter(l=>!isNaN(l));if(n.length===0)return null;const s=Math.min(...n),a=Math.max(...n);if(s!==a)return{"@type":"AggregateOffer",lowPrice:s,highPrice:a,priceCurrency:"USD",availability:S(e[0]),url:t||void 0,validFrom:e[0]?.salesBegin||e[0]?.salesStart||void 0};const r=e[0];return{"@type":"Offer",price:s,priceCurrency:"USD",availability:S(r),url:t||void 0,validFrom:r?.salesBegin||r?.salesStart||void 0}}function D(i){if(!i||i.length===0)return null;const t=i.filter(e=>{const n=e.acceptedState===2,s=!e.shouldBeHidden,a=e.RosterPerformer?.User?.performerProfile,r=a?.firstName||a?.lastName||a?.displayName;return n&&s&&r});return t.length===0?null:t.map(e=>{const n=e.RosterPerformer?.User?.performerProfile;return{"@type":"PerformingGroup",name:n?.displayName||[n?.firstName,n?.lastName].filter(Boolean).join(" ")}})}function C(i){const{event:t,venue:e,venueTimeZone:n=E(),eventUrl:s,organizer:a}=i;if(!t)return null;const r=v(t.startDateTime,n);if(!t.name||!r||!e?.name)return null;const l=T(e,e?.googleLocationNameCache),c={"@type":"Place",name:e.name};l&&(c.address=l);const o={"@context":"https://schema.org","@type":"Event",name:t.name,startDate:r,eventStatus:N(t.status),eventAttendanceMode:"https://schema.org/OfflineEventAttendanceMode",location:c},d=v(t.endDateTime,n);d&&(o.endDate=d);const u=y(t.description)||t.eventSummary;u&&(o.description=u);const h=t.image||t.coverImage||t.ShowImage;h&&(o.image=[h]);const g=O(t.availableTickets,s);g&&(o.offers=g);const p=D(t.performers);if(p&&p.length>0&&(o.performer=p),a?.name){const m={"@type":"Organization",name:a.name};a.url&&(m.url=a.url),o.organizer=m}return s&&(o.url=s),o}function I(i){switch(i){case"available":return"https://schema.org/InStock";case"sold_out":return"https://schema.org/SoldOut";case"coming_soon":return"https://schema.org/PreOrder";case"ended":return"https://schema.org/SoldOut";default:return"https://schema.org/InStock"}}function F(i,t){if(!i||i.length===0)return null;const e=i.filter(r=>r.status!=="sold_out"&&r.status!=="ended");if(e.length===0){const r=i.map(o=>o.price).filter(o=>!isNaN(o));if(r.length===0)return null;const l=Math.min(...r),c=Math.max(...r);return l!==c?{"@type":"AggregateOffer",lowPrice:l,highPrice:c,priceCurrency:"USD",availability:"https://schema.org/SoldOut"}:{"@type":"Offer",price:l,priceCurrency:"USD",availability:"https://schema.org/SoldOut"}}const n=e.map(r=>r.price).filter(r=>!isNaN(r));if(n.length===0)return null;const s=Math.min(...n),a=Math.max(...n);return s!==a?{"@type":"AggregateOffer",lowPrice:s,highPrice:a,priceCurrency:"USD",availability:I(e[0].status)}:{"@type":"Offer",price:s,priceCurrency:"USD",availability:I(e[0].status)}}function U(i){const{series:t,baseEventUrl:e}=i;if(!t.title||!t.occurrences||t.occurrences.length===0||!t.venue?.name)return null;const n=T(t.venue,t.venue.googleLocationNameCache),s={"@type":"Place",name:t.venue.name};n&&(s.address=n);const a={"@context":"https://schema.org","@type":"EventSeries",name:t.title,location:s},r=y(t.description)||t.eventSummary;r&&(a.description=r),t.image&&(a.image=[t.image]);const l=t.performers?.filter(o=>o.displayName);l&&l.length>0&&(a.performer=l.map(o=>({"@type":"PerformingGroup",name:o.displayName})));const c=[];for(const o of t.occurrences){const d=v(o.startDateTime,t.timeZone);if(!d)continue;const u={"@type":"Event",name:o.title,startDate:d,eventStatus:N(o.status),location:s};e&&(u["@id"]=`${e}/${o.id}-${o.slug}`);const h=v(o.endDateTime,t.timeZone);h&&(u.endDate=h);const g=F(o.tickets,o.status);g&&(u.offers=g),c.push(u)}return c.length===0?null:(a.subEvent=c,a)}function $(i){const{collection:t,baseEventUrl:e}=i;if(!t.collectionTitle||!t.events||t.events.length===0)return null;const n=[];for(const r of t.events){if(!r.title)continue;const l={"@type":"ListItem",position:n.length+1,name:r.title};e&&(l.url=r.slug?`${e}/${r.id}-${r.slug}`:`${e}/${r.id}`),n.push(l)}if(n.length===0)return null;const s={"@context":"https://schema.org","@type":"CollectionPage",name:t.collectionTitle},a=y(t.description)||t.summary;return a&&(s.description=a),t.coverImage&&(s.image=[t.coverImage]),s.mainEntity={"@type":"ItemList",numberOfItems:n.length,itemListElement:n},s}const x=70;function R(i){return i.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,x).replace(/-+$/g,"")}function _(i){return i?R(i):""}const f=class f{constructor(t){this._state="idle",this._originals=null,this._originalsSaved=!1,this._events=[],!(typeof document>"u")&&(f._activeInstance&&f._activeInstance!==this&&f._activeInstance.destroy(),this._venueName=t.venueName,this._venueAddress=t.venueAddress,this._venueTimeZone=t.venueTimeZone||E(),this._baseUrl=t.baseUrl||window.location.origin+window.location.pathname,this._saveOriginals(),f._activeInstance=this)}_saveOriginals(){if(this._originalsSaved)return;const t=document.querySelector('link[rel="canonical"]'),e=document.querySelector('meta[property="og:title"]'),n=document.querySelector('meta[property="og:description"]'),s=document.querySelector('meta[property="og:image"]'),a=document.querySelector('meta[property="og:url"]'),r=document.querySelector('meta[property="og:type"]'),l=document.querySelector('meta[name="description"]');this._originals={title:document.title,canonicalHref:t?.getAttribute("href")??null,ogTitle:e?.getAttribute("content")??null,ogDescription:n?.getAttribute("content")??null,ogImage:s?.getAttribute("content")??null,ogUrl:a?.getAttribute("content")??null,ogType:r?.getAttribute("content")??null,metaDescription:l?.getAttribute("content")??null},this._originalsSaved=!0}_injectJsonLd(t){if(typeof document>"u")return;document.querySelectorAll('script[data-micdrop="jsonld"]').forEach(n=>n.remove());const e=document.createElement("script");e.setAttribute("type","application/ld+json"),e.setAttribute("data-micdrop","jsonld"),e.textContent=JSON.stringify(t),document.head.appendChild(e)}_setMeta(t,e){if(!(typeof document>"u"))if(t.startsWith("og:")){let n=document.querySelector(`meta[property="${t}"]`);n?n.setAttribute("content",e):(n=document.createElement("meta"),n.setAttribute("property",t),n.setAttribute("content",e),n.setAttribute("data-micdrop","og"),document.head.appendChild(n))}else{let n=document.querySelector(`meta[name="${t}"]`);n?n.setAttribute("content",e):(n=document.createElement("meta"),n.setAttribute("name",t),n.setAttribute("content",e),n.setAttribute("data-micdrop","meta"),document.head.appendChild(n))}}_setCanonical(t){if(typeof document>"u")return;let e=document.querySelector('link[rel="canonical"]');e?e.setAttribute("href",t):(e=document.createElement("link"),e.setAttribute("rel","canonical"),e.setAttribute("href",t),e.setAttribute("data-micdrop","canonical"),document.head.appendChild(e))}_removeAllInjected(){typeof document>"u"||document.querySelectorAll("[data-micdrop]").forEach(t=>t.remove())}_restoreOriginals(){if(!(typeof document>"u"||!this._originals)){if(document.title=this._originals.title,this._originals.canonicalHref!==null){const t=document.querySelector('link[rel="canonical"]');t&&t.setAttribute("href",this._originals.canonicalHref)}this._restoreMetaProperty("og:title",this._originals.ogTitle),this._restoreMetaProperty("og:description",this._originals.ogDescription),this._restoreMetaProperty("og:image",this._originals.ogImage),this._restoreMetaProperty("og:url",this._originals.ogUrl),this._restoreMetaProperty("og:type",this._originals.ogType),this._restoreMetaName("description",this._originals.metaDescription),this._originalsSaved=!1}}_restoreMetaProperty(t,e){const n=document.querySelector(`meta[property="${t}"]`);e!==null&&n?n.setAttribute("content",e):e===null&&n?.hasAttribute("data-micdrop")&&n.remove()}_restoreMetaName(t,e){const n=document.querySelector(`meta[name="${t}"]`);e!==null&&n?n.setAttribute("content",e):e===null&&n?.hasAttribute("data-micdrop")&&n.remove()}_buildItemList(t){return{"@context":"https://schema.org","@type":"ItemList",itemListElement:t.map((e,n)=>{const s=e.slug||_(e.name);return{"@type":"ListItem",position:n+1,url:`${this._baseUrl}?e=${e.id}-${s}`}})}}_buildEntityUrl(t,e,n){const s=t==="event"?"e":t==="series"?"s":"c";return`${this._baseUrl}?${s}=${e}-${n}`}onEventsLoaded(t,e){if(typeof document>"u"||this._state==="destroyed")return;if(e){this._venueName=e.name||this._venueName,this._venueAddress=e.address||e.googleLocationNameCache||this._venueAddress;const s=e.timeZone||e.timezone;s&&(this._venueTimeZone=s)}this._events=t;const n=this._buildItemList(t);this._injectJsonLd(n),this._state="listing"}onEntitySelected(t,e,n){if(typeof document>"u"||this._state==="destroyed")return;if(this._saveOriginals(),n){this._venueName=n.name||this._venueName,this._venueAddress=n.address||n.googleLocationNameCache||this._venueAddress;const u=n.timeZone||n.timezone;u&&(this._venueTimeZone=u)}let s=null,a="",r="",l="",c="",o="";if(t==="event"){const u=e.slug||_(e.name||"");o=this._buildEntityUrl("event",e.id||e.eventID||"",u),s=C({event:e,venue:{name:this._venueName,googleLocationNameCache:this._venueAddress},venueTimeZone:this._venueTimeZone,eventUrl:o}),a=e.name||"",r=e.description||"",l=e.eventSummary||"",c=e.image||e.coverImage||e.ShowImage||""}else if(t==="series"){const u=e.slug||_(e.title||"");o=this._buildEntityUrl("series",e.id||"",u),s=U({series:{...e,venue:{name:this._venueName,googleLocationNameCache:this._venueAddress},timeZone:this._venueTimeZone},baseEventUrl:o}),a=e.title||"",r=e.description||"",l=e.eventSummary||"",c=e.image||""}else if(t==="collection"){const u=e.slug||_(e.collectionTitle||"");o=this._buildEntityUrl("collection",e.id||"",u),s=$({collection:e,baseEventUrl:o,defaultTimeZone:this._venueTimeZone}),a=e.collectionTitle||"",r=e.description||"",l=e.summary||"",c=e.coverImage||""}s&&this._injectJsonLd(s),o&&this._setCanonical(o),a&&this._setMeta("og:title",a);const d=y(r,160)||y(l,160);d?this._setMeta("og:description",d):this._restoreMetaProperty("og:description",this._originals?.ogDescription??null),c&&this._setMeta("og:image",c),o&&this._setMeta("og:url",o),this._setMeta("og:type","website"),this._setMeta("twitter:card","summary_large_image"),d?this._setMeta("description",d):this._restoreMetaName("description",this._originals?.metaDescription??null),a&&(document.title=`${a} | ${this._venueName}`),this._state="entity"}onBackToListing(){if(!(typeof document>"u")&&this._state!=="destroyed"){if(this._restoreOriginals(),this._removeAllInjected(),this._events.length>0){const t=this._buildItemList(this._events);this._injectJsonLd(t)}this._saveOriginals(),this._state="listing"}}destroy(){typeof document>"u"||this._state!=="destroyed"&&(this._removeAllInjected(),this._restoreOriginals(),f._activeInstance===this&&(f._activeInstance=null),this._state="destroyed")}};f._activeInstance=null;let A=f;exports.HostSeoController=A;exports.buildCollectionJsonLd=$;exports.buildEventJsonLd=C;exports.buildOffers=O;exports.buildPerformers=D;exports.buildPostalAddress=T;exports.buildSeriesJsonLd=U;exports.escapeJsonLdForScript=B;exports.formatDateTimeWithOffset=v;exports.getEventStatus=N;exports.getTicketAvailability=S;exports.parseAddressToPostal=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function E(){return"America/Los_Angeles"}const w=/<\/(?:p|div|h[1-6]|li|ul|ol|blockquote|tr)>/gi,q=/<br\s*\/?>/gi,j=/<[^>]*>/g,J={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&apos;":"'","&nbsp;":" "};function z(i){return i.replace(/&#x([0-9a-f]+);/gi,(t,e)=>I(parseInt(e,16))).replace(/&#(\d+);/g,(t,e)=>I(Number(e))).replace(/&[a-z0-9]+;/gi,t=>J[t.toLowerCase()]??t)}function I(i){return Number.isFinite(i)&&i>0&&i<=1114111?String.fromCodePoint(i):""}function y(i,t){if(!i)return"";let e=String(i).replace(q," ").replace(w," ").replace(j,"");if(e=z(e).replace(/\s+/g," ").trim(),t&&t>0&&e.length>t){const n=e.slice(0,t),s=n.lastIndexOf(" ");e=(s>40?n.slice(0,s):n).trimEnd()+"…"}return e}function B(){return new Date}function F(i){return i.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function _(i,t){if(!i)return null;const e=new Date(i);if(isNaN(e.getTime()))return null;const n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZoneName:"shortOffset"};let s;try{s=new Intl.DateTimeFormat("en-US",{...n,timeZone:t})}catch{s=new Intl.DateTimeFormat("en-US",{...n,timeZone:E()})}const o=s.formatToParts(e),l=m=>o.find(b=>b.type===m)?.value||"",a=l("year"),u=l("month"),r=l("day"),d=l("hour"),c=l("minute"),h=l("second"),g=l("timeZoneName");let p="+00:00";if(g){const m=g.match(/GMT([+-])(\d+)(?::(\d+))?/);if(m){const b=m[1],U=m[2].padStart(2,"0"),Z=m[3]||"00";p=`${b}${U}:${Z}`}}return`${a}-${u}-${r}T${d}:${c}:${h}${p}`}function L(i){if(!i)return null;const t=i.split(",").map(s=>s.trim());if(t.length<2)return{"@type":"PostalAddress",streetAddress:i,addressCountry:"US"};const n=t[t.length-1].match(/^([A-Z]{2})\s+(\d{5}(?:-\d{4})?)$/);return n&&t.length>=3?{"@type":"PostalAddress",streetAddress:t.slice(0,-2).join(", "),addressLocality:t[t.length-2],addressRegion:n[1],postalCode:n[2],addressCountry:"US"}:{"@type":"PostalAddress",streetAddress:t[0],addressLocality:t.slice(1).join(", "),addressCountry:"US"}}function N(i,t){if(i&&(i.city||i.state||i.postalCode)){const e={"@type":"PostalAddress"};return i.address&&(e.streetAddress=i.address),i.city&&(e.addressLocality=i.city),i.state&&(e.addressRegion=i.state),i.postalCode&&(e.postalCode=i.postalCode),e.addressCountry=i.country||"US",e}return L(i&&i.address||t||null)}function T(i){if(!i)return"https://schema.org/EventScheduled";const t=i.toLowerCase();return t==="cancelled"||t==="canceled"?"https://schema.org/EventCancelled":t==="postponed"?"https://schema.org/EventPostponed":t==="rescheduled"?"https://schema.org/EventRescheduled":"https://schema.org/EventScheduled"}function O(i){if((i.remainingCapacity??i.quantityRemaining??i.quantity)===0||i.soldOut)return"https://schema.org/SoldOut";const e=B(),n=i.salesBegin||i.salesStart||i.saleBegin||i.onSaleStart,s=i.salesEnd||i.saleEnd||i.onSaleEnd;return n&&new Date(n)>e?"https://schema.org/PreOrder":s&&new Date(s)<e?"https://schema.org/SoldOut":"https://schema.org/InStock"}function S(i,t,e,n={}){return i!==t?{"@type":"AggregateOffer",lowPrice:i,highPrice:t,priceCurrency:"USD",availability:e,...n}:{"@type":"Offer",price:i,priceCurrency:"USD",availability:e,...n}}function P(i,t){if(!i||i.length===0)return null;const e=i.filter(a=>{const u=a.visibility??0,r=u===0||u===1,d=a.salesChannel!==2;return r&&d});if(e.length===0)return null;const n=e.map(a=>parseFloat(String(a.price??0))).filter(a=>!isNaN(a));if(n.length===0)return null;const s=Math.min(...n),o=Math.max(...n),l=e[0];return S(s,o,O(l),{url:t||void 0,validFrom:l?.salesBegin||l?.salesStart||void 0})}function D(i){if(!i||i.length===0)return null;const t=i.filter(e=>{const n=e.acceptedState===2,s=!e.shouldBeHidden,o=e.RosterPerformer?.User?.performerProfile,l=o?.firstName||o?.lastName||o?.displayName;return n&&s&&l});return t.length===0?null:t.map(e=>{const n=e.RosterPerformer?.User?.performerProfile;return{"@type":"PerformingGroup",name:n?.displayName||[n?.firstName,n?.lastName].filter(Boolean).join(" ")}})}function $(i){const{event:t,venue:e,venueTimeZone:n=E(),eventUrl:s,organizer:o}=i;if(!t)return null;const l=_(t.startDateTime,n);if(!t.name||!l||!e?.name)return null;const a=N(e,e?.googleLocationNameCache),u={"@type":"Place",name:e.name};a&&(u.address=a);const r={"@context":"https://schema.org","@type":"Event",name:t.name,startDate:l,eventStatus:T(t.status),eventAttendanceMode:"https://schema.org/OfflineEventAttendanceMode",location:u},d=_(t.endDateTime,n);d&&(r.endDate=d);const c=y(t.description)||t.eventSummary;c&&(r.description=c);const h=t.image||t.coverImage||t.ShowImage;h&&(r.image=[h]);const g=P(t.availableTickets,s);g&&(r.offers=g);const p=D(t.performers);if(p&&p.length>0&&(r.performer=p),o?.name){const m={"@type":"Organization",name:o.name};o.url&&(m.url=o.url),r.organizer=m}return s&&(r.url=s),r}function x(i){switch(i){case"available":return"https://schema.org/InStock";case"sold_out":return"https://schema.org/SoldOut";case"coming_soon":return"https://schema.org/PreOrder";case"ended":return"https://schema.org/SoldOut";default:return"https://schema.org/InStock"}}function R(i,t){if(!i||i.length===0)return null;const e=i.filter(s=>s.status!=="sold_out"&&s.status!=="ended");if(e.length===0){const s=i.map(o=>o.price).filter(o=>!isNaN(o));return s.length===0?null:S(Math.min(...s),Math.max(...s),"https://schema.org/SoldOut")}const n=e.map(s=>s.price).filter(s=>!isNaN(s));return n.length===0?null:S(Math.min(...n),Math.max(...n),x(e[0].status))}function C(i){const{series:t,baseEventUrl:e}=i;if(!t.title||!t.occurrences||t.occurrences.length===0||!t.venue?.name)return null;const n=N(t.venue,t.venue.googleLocationNameCache),s={"@type":"Place",name:t.venue.name};n&&(s.address=n);const o={"@context":"https://schema.org","@type":"EventSeries",name:t.title,location:s},l=y(t.description)||t.eventSummary;l&&(o.description=l),t.image&&(o.image=[t.image]);const a=t.performers?.filter(r=>r.displayName);a&&a.length>0&&(o.performer=a.map(r=>({"@type":"PerformingGroup",name:r.displayName})));const u=[];for(const r of t.occurrences){const d=_(r.startDateTime,t.timeZone);if(!d)continue;const c={"@type":"Event",name:r.title,startDate:d,eventStatus:T(r.status),location:s};e&&(c["@id"]=`${e}/${r.id}-${r.slug}`);const h=_(r.endDateTime,t.timeZone);h&&(c.endDate=h);const g=R(r.tickets,r.status);g&&(c.offers=g),u.push(c)}return u.length===0?null:(o.subEvent=u,o)}function M(i){const{collection:t,baseEventUrl:e}=i;if(!t.collectionTitle||!t.events||t.events.length===0)return null;const n=[];for(const l of t.events){if(!l.title)continue;const a={"@type":"ListItem",position:n.length+1,name:l.title};e&&(a.url=l.slug?`${e}/${l.id}-${l.slug}`:`${e}/${l.id}`),n.push(a)}if(n.length===0)return null;const s={"@context":"https://schema.org","@type":"CollectionPage",name:t.collectionTitle},o=y(t.description)||t.summary;return o&&(s.description=o),t.coverImage&&(s.image=[t.coverImage]),s.mainEntity={"@type":"ItemList",numberOfItems:n.length,itemListElement:n},s}const G=70;function H(i){return i.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,G).replace(/-+$/g,"")}function v(i){return i?H(i):""}const f=class f{constructor(t){this._state="idle",this._originals=null,this._originalsSaved=!1,this._events=[],!(typeof document>"u")&&(f._activeInstance&&f._activeInstance!==this&&f._activeInstance.destroy(),this._venueName=t.venueName,this._venueAddress=t.venueAddress,this._venueTimeZone=t.venueTimeZone||E(),this._baseUrl=t.baseUrl||window.location.origin+window.location.pathname,this._saveOriginals(),f._activeInstance=this)}_saveOriginals(){if(this._originalsSaved)return;const t=document.querySelector('link[rel="canonical"]'),e=document.querySelector('meta[property="og:title"]'),n=document.querySelector('meta[property="og:description"]'),s=document.querySelector('meta[property="og:image"]'),o=document.querySelector('meta[property="og:url"]'),l=document.querySelector('meta[property="og:type"]'),a=document.querySelector('meta[name="description"]');this._originals={title:document.title,canonicalHref:t?.getAttribute("href")??null,ogTitle:e?.getAttribute("content")??null,ogDescription:n?.getAttribute("content")??null,ogImage:s?.getAttribute("content")??null,ogUrl:o?.getAttribute("content")??null,ogType:l?.getAttribute("content")??null,metaDescription:a?.getAttribute("content")??null},this._originalsSaved=!0}_injectJsonLd(t){if(typeof document>"u")return;document.querySelectorAll('script[data-micdrop="jsonld"]').forEach(n=>n.remove());const e=document.createElement("script");e.setAttribute("type","application/ld+json"),e.setAttribute("data-micdrop","jsonld"),e.textContent=JSON.stringify(t),document.head.appendChild(e)}_setMeta(t,e){if(!(typeof document>"u"))if(t.startsWith("og:")){let n=document.querySelector(`meta[property="${t}"]`);n?n.setAttribute("content",e):(n=document.createElement("meta"),n.setAttribute("property",t),n.setAttribute("content",e),n.setAttribute("data-micdrop","og"),document.head.appendChild(n))}else{let n=document.querySelector(`meta[name="${t}"]`);n?n.setAttribute("content",e):(n=document.createElement("meta"),n.setAttribute("name",t),n.setAttribute("content",e),n.setAttribute("data-micdrop","meta"),document.head.appendChild(n))}}_setCanonical(t){if(typeof document>"u")return;let e=document.querySelector('link[rel="canonical"]');e?e.setAttribute("href",t):(e=document.createElement("link"),e.setAttribute("rel","canonical"),e.setAttribute("href",t),e.setAttribute("data-micdrop","canonical"),document.head.appendChild(e))}_removeAllInjected(){typeof document>"u"||document.querySelectorAll("[data-micdrop]").forEach(t=>t.remove())}_restoreOriginals(){if(!(typeof document>"u"||!this._originals)){if(document.title=this._originals.title,this._originals.canonicalHref!==null){const t=document.querySelector('link[rel="canonical"]');t&&t.setAttribute("href",this._originals.canonicalHref)}this._restoreMetaProperty("og:title",this._originals.ogTitle),this._restoreMetaProperty("og:description",this._originals.ogDescription),this._restoreMetaProperty("og:image",this._originals.ogImage),this._restoreMetaProperty("og:url",this._originals.ogUrl),this._restoreMetaProperty("og:type",this._originals.ogType),this._restoreMetaName("description",this._originals.metaDescription),this._originalsSaved=!1}}_restoreMetaProperty(t,e){const n=document.querySelector(`meta[property="${t}"]`);e!==null&&n?n.setAttribute("content",e):e===null&&n?.hasAttribute("data-micdrop")&&n.remove()}_restoreMetaName(t,e){const n=document.querySelector(`meta[name="${t}"]`);e!==null&&n?n.setAttribute("content",e):e===null&&n?.hasAttribute("data-micdrop")&&n.remove()}_buildItemList(t){return{"@context":"https://schema.org","@type":"ItemList",itemListElement:t.map((e,n)=>{const s=e.slug||v(e.name);return{"@type":"ListItem",position:n+1,url:`${this._baseUrl}?e=${e.id}-${s}`}})}}_buildEntityUrl(t,e,n){const s=t==="event"?"e":t==="series"?"s":"c";return`${this._baseUrl}?${s}=${e}-${n}`}onEventsLoaded(t,e){if(typeof document>"u"||this._state==="destroyed")return;if(e){this._venueName=e.name||this._venueName,this._venueAddress=e.address||e.googleLocationNameCache||this._venueAddress;const s=e.timeZone||e.timezone;s&&(this._venueTimeZone=s)}this._events=t;const n=this._buildItemList(t);this._injectJsonLd(n),this._state="listing"}onEntitySelected(t,e,n){if(typeof document>"u"||this._state==="destroyed")return;if(this._saveOriginals(),n){this._venueName=n.name||this._venueName,this._venueAddress=n.address||n.googleLocationNameCache||this._venueAddress;const c=n.timeZone||n.timezone;c&&(this._venueTimeZone=c)}let s=null,o="",l="",a="",u="",r="";if(t==="event"){const c=e.slug||v(e.name||"");r=this._buildEntityUrl("event",e.id||e.eventID||"",c),s=$({event:e,venue:{name:this._venueName,googleLocationNameCache:this._venueAddress},venueTimeZone:this._venueTimeZone,eventUrl:r}),o=e.name||"",l=e.description||"",a=e.eventSummary||"",u=e.image||e.coverImage||e.ShowImage||""}else if(t==="series"){const c=e.slug||v(e.title||"");r=this._buildEntityUrl("series",e.id||"",c),s=C({series:{...e,venue:{name:this._venueName,googleLocationNameCache:this._venueAddress},timeZone:this._venueTimeZone},baseEventUrl:r}),o=e.title||"",l=e.description||"",a=e.eventSummary||"",u=e.image||""}else if(t==="collection"){const c=e.slug||v(e.collectionTitle||"");r=this._buildEntityUrl("collection",e.id||"",c),s=M({collection:e,baseEventUrl:r,defaultTimeZone:this._venueTimeZone}),o=e.collectionTitle||"",l=e.description||"",a=e.summary||"",u=e.coverImage||""}s&&this._injectJsonLd(s),r&&this._setCanonical(r),o&&this._setMeta("og:title",o);const d=y(l,160)||y(a,160);d?this._setMeta("og:description",d):this._restoreMetaProperty("og:description",this._originals?.ogDescription??null),u&&this._setMeta("og:image",u),r&&this._setMeta("og:url",r),this._setMeta("og:type","website"),this._setMeta("twitter:card","summary_large_image"),d?this._setMeta("description",d):this._restoreMetaName("description",this._originals?.metaDescription??null),o&&(document.title=`${o} | ${this._venueName}`),this._state="entity"}onBackToListing(){if(!(typeof document>"u")&&this._state!=="destroyed"){if(this._restoreOriginals(),this._removeAllInjected(),this._events.length>0){const t=this._buildItemList(this._events);this._injectJsonLd(t)}this._saveOriginals(),this._state="listing"}}destroy(){typeof document>"u"||this._state!=="destroyed"&&(this._removeAllInjected(),this._restoreOriginals(),f._activeInstance===this&&(f._activeInstance=null),this._state="destroyed")}};f._activeInstance=null;let A=f;exports.HostSeoController=A;exports.buildCollectionJsonLd=M;exports.buildEventJsonLd=$;exports.buildOffers=P;exports.buildPerformers=D;exports.buildPostalAddress=N;exports.buildSeriesJsonLd=C;exports.escapeJsonLdForScript=F;exports.formatDateTimeWithOffset=_;exports.getEventStatus=T;exports.getTicketAvailability=O;exports.parseAddressToPostal=L;
2
2
  //# sourceMappingURL=seo.cjs.map