@ticketlayer/elements 0.2.0

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 (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +55 -0
  3. package/dist/cjs/index-DfzcrE9-.js +3598 -0
  4. package/dist/cjs/index.cjs.js +16 -0
  5. package/dist/cjs/loader.cjs.js +12 -0
  6. package/dist/cjs/order-summary-ZMkJ5bez.js +116 -0
  7. package/dist/cjs/sdk-connector-ClDF3013.js +108 -0
  8. package/dist/cjs/ticketlayer-elements.cjs.js +24 -0
  9. package/dist/cjs/tl-buy-modal.cjs.entry.js +127 -0
  10. package/dist/cjs/tl-buy-tickets-button.cjs.entry.js +131 -0
  11. package/dist/cjs/tl-buy-tickets-wrapper.cjs.entry.js +58 -0
  12. package/dist/cjs/tl-cart-badge.cjs.entry.js +109 -0
  13. package/dist/cjs/tl-cart-drawer.cjs.entry.js +67 -0
  14. package/dist/cjs/tl-cart.cjs.entry.js +148 -0
  15. package/dist/cjs/tl-checkout-wrapper.cjs.entry.js +57 -0
  16. package/dist/cjs/tl-event-card.cjs.entry.js +140 -0
  17. package/dist/cjs/tl-event-list.cjs.entry.js +80 -0
  18. package/dist/cjs/tl-login.cjs.entry.js +184 -0
  19. package/dist/cjs/tl-my-orders.cjs.entry.js +123 -0
  20. package/dist/cjs/tl-occurrence-selector_2.cjs.entry.js +754 -0
  21. package/dist/cjs/tl-order-confirmation.cjs.entry.js +146 -0
  22. package/dist/cjs/tl-order-tickets_2.cjs.entry.js +3198 -0
  23. package/dist/cjs/tl-promo-code.cjs.entry.js +75 -0
  24. package/dist/cjs/tl-seat-map.cjs.entry.js +147 -0
  25. package/dist/collection/collection-manifest.json +29 -0
  26. package/dist/collection/components/tl-buy-modal/tl-buy-modal.css +264 -0
  27. package/dist/collection/components/tl-buy-modal/tl-buy-modal.js +249 -0
  28. package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.css +120 -0
  29. package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.js +412 -0
  30. package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.css +23 -0
  31. package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.js +192 -0
  32. package/dist/collection/components/tl-cart/tl-cart.css +251 -0
  33. package/dist/collection/components/tl-cart/tl-cart.js +314 -0
  34. package/dist/collection/components/tl-cart-badge/tl-cart-badge.css +138 -0
  35. package/dist/collection/components/tl-cart-badge/tl-cart-badge.js +217 -0
  36. package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.css +98 -0
  37. package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.js +185 -0
  38. package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.css +23 -0
  39. package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.js +148 -0
  40. package/dist/collection/components/tl-event-card/event-card-adapter.js +23 -0
  41. package/dist/collection/components/tl-event-card/tl-event-card.css +175 -0
  42. package/dist/collection/components/tl-event-card/tl-event-card.js +205 -0
  43. package/dist/collection/components/tl-event-list/tl-event-list.css +134 -0
  44. package/dist/collection/components/tl-event-list/tl-event-list.js +171 -0
  45. package/dist/collection/components/tl-login/tl-login.css +133 -0
  46. package/dist/collection/components/tl-login/tl-login.js +309 -0
  47. package/dist/collection/components/tl-my-orders/tl-my-orders.css +204 -0
  48. package/dist/collection/components/tl-my-orders/tl-my-orders.js +221 -0
  49. package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.css +658 -0
  50. package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.js +707 -0
  51. package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.css +176 -0
  52. package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.js +298 -0
  53. package/dist/collection/components/tl-order-tickets/tl-order-tickets.css +30 -0
  54. package/dist/collection/components/tl-order-tickets/tl-order-tickets.js +122 -0
  55. package/dist/collection/components/tl-promo-code/tl-promo-code.css +106 -0
  56. package/dist/collection/components/tl-promo-code/tl-promo-code.js +181 -0
  57. package/dist/collection/components/tl-seat-map/tl-seat-map.css +85 -0
  58. package/dist/collection/components/tl-seat-map/tl-seat-map.js +366 -0
  59. package/dist/collection/components/tl-ticket/tl-ticket.css +90 -0
  60. package/dist/collection/components/tl-ticket/tl-ticket.js +129 -0
  61. package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.css +205 -0
  62. package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.js +332 -0
  63. package/dist/collection/index.js +10 -0
  64. package/dist/collection/utils/order-summary.js +101 -0
  65. package/dist/collection/utils/sdk-connector.js +100 -0
  66. package/dist/collection/utils/testing/mock-sdk.js +95 -0
  67. package/dist/components/index.d.ts +35 -0
  68. package/dist/components/index.js +1 -0
  69. package/dist/components/order-summary.js +1 -0
  70. package/dist/components/sdk-connector.js +1 -0
  71. package/dist/components/tl-buy-modal.d.ts +11 -0
  72. package/dist/components/tl-buy-modal.js +1 -0
  73. package/dist/components/tl-buy-tickets-button.d.ts +11 -0
  74. package/dist/components/tl-buy-tickets-button.js +1 -0
  75. package/dist/components/tl-buy-tickets-wrapper.d.ts +11 -0
  76. package/dist/components/tl-buy-tickets-wrapper.js +1 -0
  77. package/dist/components/tl-buy-tickets-wrapper2.js +1 -0
  78. package/dist/components/tl-cart-badge.d.ts +11 -0
  79. package/dist/components/tl-cart-badge.js +1 -0
  80. package/dist/components/tl-cart-drawer.d.ts +11 -0
  81. package/dist/components/tl-cart-drawer.js +1 -0
  82. package/dist/components/tl-cart.d.ts +11 -0
  83. package/dist/components/tl-cart.js +1 -0
  84. package/dist/components/tl-cart2.js +1 -0
  85. package/dist/components/tl-checkout-wrapper.d.ts +11 -0
  86. package/dist/components/tl-checkout-wrapper.js +1 -0
  87. package/dist/components/tl-checkout-wrapper2.js +1 -0
  88. package/dist/components/tl-event-card.d.ts +11 -0
  89. package/dist/components/tl-event-card.js +1 -0
  90. package/dist/components/tl-event-card2.js +1 -0
  91. package/dist/components/tl-event-list.d.ts +11 -0
  92. package/dist/components/tl-event-list.js +1 -0
  93. package/dist/components/tl-login.d.ts +11 -0
  94. package/dist/components/tl-login.js +1 -0
  95. package/dist/components/tl-login2.js +1 -0
  96. package/dist/components/tl-my-orders.d.ts +11 -0
  97. package/dist/components/tl-my-orders.js +1 -0
  98. package/dist/components/tl-occurrence-selector.d.ts +11 -0
  99. package/dist/components/tl-occurrence-selector.js +1 -0
  100. package/dist/components/tl-occurrence-selector2.js +1 -0
  101. package/dist/components/tl-order-confirmation.d.ts +11 -0
  102. package/dist/components/tl-order-confirmation.js +1 -0
  103. package/dist/components/tl-order-tickets.d.ts +11 -0
  104. package/dist/components/tl-order-tickets.js +1 -0
  105. package/dist/components/tl-order-tickets2.js +1 -0
  106. package/dist/components/tl-promo-code.d.ts +11 -0
  107. package/dist/components/tl-promo-code.js +1 -0
  108. package/dist/components/tl-seat-map.d.ts +11 -0
  109. package/dist/components/tl-seat-map.js +1 -0
  110. package/dist/components/tl-ticket-selector.d.ts +11 -0
  111. package/dist/components/tl-ticket-selector.js +1 -0
  112. package/dist/components/tl-ticket-selector2.js +1 -0
  113. package/dist/components/tl-ticket.d.ts +11 -0
  114. package/dist/components/tl-ticket.js +1 -0
  115. package/dist/components/tl-ticket2.js +1 -0
  116. package/dist/elements.docs.d.ts +454 -0
  117. package/dist/elements.docs.json +3008 -0
  118. package/dist/esm/index-Ba-RZTFI.js +3588 -0
  119. package/dist/esm/index.js +4 -0
  120. package/dist/esm/loader.js +10 -0
  121. package/dist/esm/order-summary-BGekdjN9.js +103 -0
  122. package/dist/esm/sdk-connector-CqhvfyKV.js +102 -0
  123. package/dist/esm/ticketlayer-elements.js +20 -0
  124. package/dist/esm/tl-buy-modal.entry.js +125 -0
  125. package/dist/esm/tl-buy-tickets-button.entry.js +129 -0
  126. package/dist/esm/tl-buy-tickets-wrapper.entry.js +56 -0
  127. package/dist/esm/tl-cart-badge.entry.js +107 -0
  128. package/dist/esm/tl-cart-drawer.entry.js +65 -0
  129. package/dist/esm/tl-cart.entry.js +146 -0
  130. package/dist/esm/tl-checkout-wrapper.entry.js +55 -0
  131. package/dist/esm/tl-event-card.entry.js +138 -0
  132. package/dist/esm/tl-event-list.entry.js +78 -0
  133. package/dist/esm/tl-login.entry.js +182 -0
  134. package/dist/esm/tl-my-orders.entry.js +121 -0
  135. package/dist/esm/tl-occurrence-selector_2.entry.js +751 -0
  136. package/dist/esm/tl-order-confirmation.entry.js +144 -0
  137. package/dist/esm/tl-order-tickets_2.entry.js +3195 -0
  138. package/dist/esm/tl-promo-code.entry.js +73 -0
  139. package/dist/esm/tl-seat-map.entry.js +145 -0
  140. package/dist/index.cjs.js +1 -0
  141. package/dist/index.js +1 -0
  142. package/dist/ticketlayer-elements/index.esm.js +1 -0
  143. package/dist/ticketlayer-elements/p-0291df4c.entry.js +1 -0
  144. package/dist/ticketlayer-elements/p-10f01a1f.entry.js +1 -0
  145. package/dist/ticketlayer-elements/p-11273f8f.entry.js +1 -0
  146. package/dist/ticketlayer-elements/p-340ab4f5.entry.js +1 -0
  147. package/dist/ticketlayer-elements/p-41d22d7c.entry.js +1 -0
  148. package/dist/ticketlayer-elements/p-82752e3b.entry.js +1 -0
  149. package/dist/ticketlayer-elements/p-976770f3.entry.js +1 -0
  150. package/dist/ticketlayer-elements/p-9a903ff6.entry.js +1 -0
  151. package/dist/ticketlayer-elements/p-9c9072c8.entry.js +1 -0
  152. package/dist/ticketlayer-elements/p-9d8163d6.entry.js +1 -0
  153. package/dist/ticketlayer-elements/p-BGekdjN9.js +1 -0
  154. package/dist/ticketlayer-elements/p-Ba-RZTFI.js +2 -0
  155. package/dist/ticketlayer-elements/p-CqhvfyKV.js +1 -0
  156. package/dist/ticketlayer-elements/p-a5c90b68.entry.js +1 -0
  157. package/dist/ticketlayer-elements/p-b6d479ad.entry.js +1 -0
  158. package/dist/ticketlayer-elements/p-dd43f015.entry.js +1 -0
  159. package/dist/ticketlayer-elements/p-eb640760.entry.js +1 -0
  160. package/dist/ticketlayer-elements/p-ee3aa227.entry.js +1 -0
  161. package/dist/ticketlayer-elements/p-fb9444c4.entry.js +1 -0
  162. package/dist/ticketlayer-elements/ticketlayer-elements.css +1 -0
  163. package/dist/ticketlayer-elements/ticketlayer-elements.esm.js +1 -0
  164. package/dist/types/components/tl-buy-modal/tl-buy-modal.d.ts +54 -0
  165. package/dist/types/components/tl-buy-tickets-button/tl-buy-tickets-button.d.ts +61 -0
  166. package/dist/types/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.d.ts +52 -0
  167. package/dist/types/components/tl-cart/tl-cart.d.ts +80 -0
  168. package/dist/types/components/tl-cart-badge/tl-cart-badge.d.ts +36 -0
  169. package/dist/types/components/tl-cart-drawer/tl-cart-drawer.d.ts +35 -0
  170. package/dist/types/components/tl-checkout-wrapper/tl-checkout-wrapper.d.ts +39 -0
  171. package/dist/types/components/tl-event-card/event-card-adapter.d.ts +23 -0
  172. package/dist/types/components/tl-event-card/tl-event-card.d.ts +55 -0
  173. package/dist/types/components/tl-event-list/tl-event-list.d.ts +30 -0
  174. package/dist/types/components/tl-login/tl-login.d.ts +59 -0
  175. package/dist/types/components/tl-my-orders/tl-my-orders.d.ts +39 -0
  176. package/dist/types/components/tl-occurrence-selector/tl-occurrence-selector.d.ts +208 -0
  177. package/dist/types/components/tl-order-confirmation/tl-order-confirmation.d.ts +54 -0
  178. package/dist/types/components/tl-order-tickets/tl-order-tickets.d.ts +21 -0
  179. package/dist/types/components/tl-promo-code/tl-promo-code.d.ts +39 -0
  180. package/dist/types/components/tl-seat-map/tl-seat-map.d.ts +68 -0
  181. package/dist/types/components/tl-ticket/tl-ticket.d.ts +28 -0
  182. package/dist/types/components/tl-ticket-selector/tl-ticket-selector.d.ts +78 -0
  183. package/dist/types/components.d.ts +1629 -0
  184. package/dist/types/index.d.ts +14 -0
  185. package/dist/types/stencil-public-runtime.d.ts +1839 -0
  186. package/dist/types/utils/order-summary.d.ts +67 -0
  187. package/dist/types/utils/sdk-connector.d.ts +113 -0
  188. package/dist/types/utils/testing/mock-sdk.d.ts +36 -0
  189. package/elements.catalogue.json +968 -0
  190. package/loader/cdn.js +1 -0
  191. package/loader/index.cjs.js +1 -0
  192. package/loader/index.d.ts +24 -0
  193. package/loader/index.es2017.js +1 -0
  194. package/loader/index.js +2 -0
  195. package/package.json +101 -0
@@ -0,0 +1,249 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { getSDK, whenSDK } from "../../utils/sdk-connector";
3
+ /**
4
+ * @component tl-buy-modal
5
+ *
6
+ * The in-page buy-tickets funnel: occurrence → ticket selection → added.
7
+ * A NATIVE Elements overlay (no iframe) - it simply composes the existing
8
+ * `tl-occurrence-selector` and `tl-ticket-selector`, which already bind to the
9
+ * SDK and add to the cart. Because it's pure browse/cart (zero PCI surface), it
10
+ * renders in-page identically on HBO and on any third-party embed bound to
11
+ * `window.Ticketlayer`. Only the *checkout* step crosses into an iframe.
12
+ *
13
+ * It is not placed in markup by hosts: the SDK's buy-modal manager mounts it on
14
+ * demand when something emits `ui:event-modal-requested` (e.g. a
15
+ * `tl-buy-tickets-button` or a calendar date click), and removes it on close.
16
+ *
17
+ * @event tlClose - user dismissed the modal (keep browsing)
18
+ * @event tlCheckout - user chose to proceed to checkout (manager hands off to
19
+ * the checkout intent: iframe on embeds, /checkout on HBO)
20
+ * @event tlError - the event couldn't be loaded
21
+ */
22
+ export class TlBuyModal {
23
+ constructor() {
24
+ this.step = 'loading';
25
+ this.eventName = '';
26
+ this.imageUrl = '';
27
+ this.venueLabel = '';
28
+ this.dateSummary = '';
29
+ this.selectedOccurrenceId = null;
30
+ this.occurrenceCount = 0;
31
+ this.occurrenceLabel = '';
32
+ this.error = null;
33
+ this.handleOccurrenceSelect = (e) => {
34
+ const occ = e.detail.occurrence;
35
+ this.selectedOccurrenceId = occ.id;
36
+ this.occurrenceLabel = this.labelFor(occ);
37
+ this.step = 'tickets';
38
+ };
39
+ this.handleAdded = () => {
40
+ this.step = 'done';
41
+ };
42
+ this.backToDates = () => {
43
+ this.selectedOccurrenceId = null;
44
+ this.step = 'occurrence';
45
+ };
46
+ this.close = () => this.tlClose.emit();
47
+ this.goCheckout = () => this.tlCheckout.emit();
48
+ }
49
+ async componentWillLoad() {
50
+ if (!this.eventId) {
51
+ this.fail('No event specified');
52
+ return;
53
+ }
54
+ try {
55
+ await whenSDK();
56
+ const ev = (await getSDK().getEventsManager().get(this.eventId));
57
+ this.eventName = ev?.name ?? 'Tickets';
58
+ this.imageUrl = ev?.imageUrl || ev?.heroImageUrl || '';
59
+ this.venueLabel = [ev?.venueName, ev?.venueCity].filter(Boolean).join(', ');
60
+ const occs = ev?.occurrences ?? [];
61
+ this.occurrenceCount = occs.length;
62
+ this.dateSummary = this.summariseDates(occs);
63
+ // Skip the date step when one was preselected or there's only one date.
64
+ const initial = this.occurrenceId ?? (occs.length === 1 ? occs[0]?.id : null);
65
+ if (initial) {
66
+ this.selectedOccurrenceId = initial;
67
+ this.occurrenceLabel = this.labelFor(occs.find((o) => o.id === initial));
68
+ this.step = 'tickets';
69
+ }
70
+ else {
71
+ this.step = 'occurrence';
72
+ }
73
+ }
74
+ catch (err) {
75
+ this.fail(err instanceof Error ? err.message : 'Could not load this event');
76
+ }
77
+ }
78
+ fail(message) {
79
+ this.error = message;
80
+ this.step = 'error';
81
+ this.tlError.emit({ message });
82
+ }
83
+ /** A compact date line for the header: a single date, or a range across many. */
84
+ summariseDates(occs) {
85
+ const times = occs
86
+ .map((o) => o.startsAt)
87
+ .filter((s) => !!s)
88
+ .sort();
89
+ if (times.length === 0)
90
+ return '';
91
+ const day = (s) => new Date(s).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' });
92
+ if (times.length === 1) {
93
+ return new Date(times[0]).toLocaleDateString('en-GB', {
94
+ weekday: 'short',
95
+ day: 'numeric',
96
+ month: 'short',
97
+ year: 'numeric',
98
+ });
99
+ }
100
+ const first = day(times[0]);
101
+ const last = day(times[times.length - 1]);
102
+ const range = first === last ? first : `${first} – ${last}`;
103
+ return `${range} · ${times.length} dates`;
104
+ }
105
+ labelFor(occ) {
106
+ if (!occ?.startsAt)
107
+ return '';
108
+ return new Date(occ.startsAt).toLocaleString('en-GB', {
109
+ weekday: 'short',
110
+ day: 'numeric',
111
+ month: 'short',
112
+ hour: '2-digit',
113
+ minute: '2-digit',
114
+ });
115
+ }
116
+ stepKicker() {
117
+ switch (this.step) {
118
+ case 'occurrence':
119
+ return 'Choose a date';
120
+ case 'tickets':
121
+ return 'Select tickets';
122
+ case 'done':
123
+ return 'Nice one';
124
+ default:
125
+ return 'Tickets';
126
+ }
127
+ }
128
+ render() {
129
+ return (h(Host, { key: '1245e518c2b5232f4d9dba091cf808cd3867fbef' }, h("div", { key: '4e770fccdd785444f1cc87df4adab5a5dc1bf58a', class: "overlay", onClick: (e) => {
130
+ if (e.target === e.currentTarget)
131
+ this.close();
132
+ } }, h("div", { key: '57b13dac690028aeebd6a601acfba07f00854c40', class: { panel: true, 'panel--wide': this.step === 'occurrence' }, role: "dialog", "aria-modal": "true", "aria-label": this.eventName }, h("header", { key: '881e9cc70a0ca25947f272b9ebcb2e6d4b4268f2', class: "panel-header" }, this.imageUrl && (h("div", { key: '753f7df1b5118dfacbbc6b89b4e5d7ba114f6cdf', class: "event-thumb", style: { backgroundImage: `url(${this.imageUrl})` } })), h("div", { key: '9aaa32d1add90fabd1b0ea0c100f198962f4e6a5', class: "titles" }, h("span", { key: '538032bdf2338206ad763417386852ff97cc472f', class: "kicker" }, this.stepKicker()), h("h2", { key: '71429804179e7fbbea1fa90a2937a065517092f5', class: "event-name" }, this.eventName), this.venueLabel && h("p", { key: 'dd968b397deab890df3a4fbdff33226e82bd9660', class: "event-meta" }, this.venueLabel), this.dateSummary && h("p", { key: 'f40e6049d09b06c9f599e7d14d6fbb43b39b22fd', class: "event-meta" }, this.dateSummary)), h("button", { key: 'dbe0908f8cd8544654b627921f68cc4961802b77', class: "close-btn", "aria-label": "Close", onClick: this.close }, h("svg", { key: '23a750830e6e16d28cbcd5025507d25848aaadf7', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: 'e81b8763a5c781f72c1ca8a2113482948e3ba8cc', d: "M6 6l12 12M18 6L6 18", "stroke-linecap": "round" })))), h("div", { key: 'da71e610f907cf53e78246d2065aaf526d5ceffd', class: "panel-body" }, this.step === 'loading' && (h("div", { key: '28cbb9a98c7b08fa8dcb9d8d5dfbf3bec93fe38d', class: "state-msg" }, h("span", { key: '915c8de87cbdc7da1ccf0622ce6c0f02fccf2cad', class: "spinner" }), " Loading\u2026")), this.step === 'error' && h("div", { key: '5785578bfef6f1ee81d938d91ffd3ded975f8c12', class: "state-msg error" }, this.error), this.step === 'occurrence' && (h("tl-occurrence-selector", { key: 'eeb853eab141c3c103015e82d221a140f6a3a109', eventId: this.eventId, onTlSelect: this.handleOccurrenceSelect })), this.step === 'tickets' && this.selectedOccurrenceId && (h("div", { key: 'f608f592ba651eb431375433eb4ff9393863ade5', class: "tickets-step" }, this.occurrenceCount > 1 && (h("button", { key: '84adfbdbeaceb2cf4238c6ffd09558b4499ca940', class: "back-link", onClick: this.backToDates }, "\u2190 Change date")), this.occurrenceLabel && h("p", { key: '0317e9194049608711e8c622142c3ad2c0a5dc12', class: "occ-label" }, this.occurrenceLabel), h("tl-ticket-selector", { key: '27b1e05d9d92fb8d519375e2b27d4b5ea0a4890a', eventId: this.eventId, occurrenceId: this.selectedOccurrenceId, onTlAddToCart: this.handleAdded }))), this.step === 'done' && (h("div", { key: '0853088206988c66d489f8804df7899821d49e64', class: "done-step" }, h("div", { key: 'c2955b893c4dffaadcdfd27bee96ef2724a131a6', class: "done-mark" }, "\uD83C\uDF9F\uFE0F"), h("p", { key: '370c30dfcbc0c25b4794d984dd261a3a5779a9dc', class: "done-title" }, "Added to your cart"), h("p", { key: 'c462f3c9292740e2fd2c74b173484f80a5dc1a30', class: "done-sub" }, "Held for you while you check out."), h("button", { key: '484991f79572e3213ad6413a1af87599880c3643', class: "primary-btn", onClick: this.goCheckout }, "Go to checkout"), h("button", { key: '5b4ba5a472b794e8f5af0f131dad1c8c11b869f5', class: "ghost-btn", onClick: this.close }, "Keep browsing"))))))));
133
+ }
134
+ static get is() { return "tl-buy-modal"; }
135
+ static get encapsulation() { return "shadow"; }
136
+ static get originalStyleUrls() {
137
+ return {
138
+ "$": ["tl-buy-modal.css"]
139
+ };
140
+ }
141
+ static get styleUrls() {
142
+ return {
143
+ "$": ["tl-buy-modal.css"]
144
+ };
145
+ }
146
+ static get properties() {
147
+ return {
148
+ "eventId": {
149
+ "type": "string",
150
+ "mutable": false,
151
+ "complexType": {
152
+ "original": "string",
153
+ "resolved": "string",
154
+ "references": {}
155
+ },
156
+ "required": true,
157
+ "optional": false,
158
+ "docs": {
159
+ "tags": [],
160
+ "text": "Event to sell tickets for."
161
+ },
162
+ "getter": false,
163
+ "setter": false,
164
+ "reflect": false,
165
+ "attribute": "event-id"
166
+ },
167
+ "occurrenceId": {
168
+ "type": "string",
169
+ "mutable": false,
170
+ "complexType": {
171
+ "original": "string",
172
+ "resolved": "string | undefined",
173
+ "references": {}
174
+ },
175
+ "required": false,
176
+ "optional": true,
177
+ "docs": {
178
+ "tags": [],
179
+ "text": "Optionally open straight to ticket selection for this occurrence."
180
+ },
181
+ "getter": false,
182
+ "setter": false,
183
+ "reflect": false,
184
+ "attribute": "occurrence-id"
185
+ }
186
+ };
187
+ }
188
+ static get states() {
189
+ return {
190
+ "step": {},
191
+ "eventName": {},
192
+ "imageUrl": {},
193
+ "venueLabel": {},
194
+ "dateSummary": {},
195
+ "selectedOccurrenceId": {},
196
+ "occurrenceCount": {},
197
+ "occurrenceLabel": {},
198
+ "error": {}
199
+ };
200
+ }
201
+ static get events() {
202
+ return [{
203
+ "method": "tlClose",
204
+ "name": "tlClose",
205
+ "bubbles": true,
206
+ "cancelable": true,
207
+ "composed": true,
208
+ "docs": {
209
+ "tags": [],
210
+ "text": ""
211
+ },
212
+ "complexType": {
213
+ "original": "void",
214
+ "resolved": "void",
215
+ "references": {}
216
+ }
217
+ }, {
218
+ "method": "tlCheckout",
219
+ "name": "tlCheckout",
220
+ "bubbles": true,
221
+ "cancelable": true,
222
+ "composed": true,
223
+ "docs": {
224
+ "tags": [],
225
+ "text": ""
226
+ },
227
+ "complexType": {
228
+ "original": "void",
229
+ "resolved": "void",
230
+ "references": {}
231
+ }
232
+ }, {
233
+ "method": "tlError",
234
+ "name": "tlError",
235
+ "bubbles": true,
236
+ "cancelable": true,
237
+ "composed": true,
238
+ "docs": {
239
+ "tags": [],
240
+ "text": ""
241
+ },
242
+ "complexType": {
243
+ "original": "{ message: string }",
244
+ "resolved": "{ message: string; }",
245
+ "references": {}
246
+ }
247
+ }];
248
+ }
249
+ }
@@ -0,0 +1,120 @@
1
+ /**
2
+ * TlBuyTicketsButton styles
3
+ */
4
+
5
+ :host {
6
+ display: inline-block;
7
+ font-family: var(--tl-font-family, system-ui, -apple-system, sans-serif);
8
+ }
9
+
10
+ :host(.full-width) {
11
+ display: block;
12
+ width: 100%;
13
+ }
14
+
15
+ :host(.full-width) .buy-button {
16
+ width: 100%;
17
+ }
18
+
19
+ .buy-button {
20
+ display: inline-flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ gap: 0.5rem;
24
+ font-weight: 600;
25
+ border: none;
26
+ cursor: pointer;
27
+ text-decoration: none;
28
+ outline: none;
29
+ transition: all 0.2s ease;
30
+ white-space: nowrap;
31
+ }
32
+
33
+ /* Variants */
34
+ .buy-button.variant-primary {
35
+ background: var(--button-color);
36
+ color: var(--button-foreground);
37
+ }
38
+
39
+ .buy-button.variant-secondary {
40
+ background: color-mix(in srgb, var(--button-color) 15%, transparent);
41
+ color: var(--button-color);
42
+ }
43
+
44
+ .buy-button.variant-outline {
45
+ background: transparent;
46
+ color: var(--button-color);
47
+ border: 2px solid var(--button-color);
48
+ }
49
+
50
+ /* Sizes */
51
+ .buy-button.size-sm {
52
+ padding: 0.5rem 1rem;
53
+ font-size: 0.875rem;
54
+ border-radius: var(--tl-radius-sm, 0.375rem);
55
+ }
56
+
57
+ .buy-button.size-md {
58
+ padding: 0.75rem 1.5rem;
59
+ font-size: 1rem;
60
+ border-radius: var(--tl-radius-md, 0.5rem);
61
+ }
62
+
63
+ .buy-button.size-lg {
64
+ padding: 1rem 2rem;
65
+ font-size: 1.125rem;
66
+ border-radius: var(--tl-radius-lg, 0.625rem);
67
+ min-height: 51px;
68
+ }
69
+
70
+ /* Hover state */
71
+ .buy-button.hovered:not(.disabled) {
72
+ opacity: 0.9;
73
+ transform: translateY(-1px);
74
+ }
75
+
76
+ .buy-button.hovered.variant-primary {
77
+ background: var(--button-hover-color);
78
+ }
79
+
80
+ /* Disabled state */
81
+ .buy-button.disabled {
82
+ opacity: 0.7;
83
+ cursor: not-allowed;
84
+ }
85
+
86
+ /* Icon */
87
+ .icon {
88
+ display: inline-flex;
89
+ align-items: center;
90
+ justify-content: center;
91
+ flex-shrink: 0;
92
+ }
93
+
94
+ .icon svg {
95
+ width: 1em;
96
+ height: 1em;
97
+ }
98
+
99
+ /* Label */
100
+ .label {
101
+ flex-shrink: 0;
102
+ }
103
+
104
+ /* Price */
105
+ .price {
106
+ display: inline-flex;
107
+ align-items: center;
108
+ gap: 0.25rem;
109
+ margin-left: 0.5rem;
110
+ white-space: nowrap;
111
+ opacity: 0.9;
112
+ }
113
+
114
+ .price-prefix {
115
+ opacity: 0.7;
116
+ }
117
+
118
+ .price-value {
119
+ font-weight: 700;
120
+ }