@ticketlayer/elements 0.4.0 → 1.0.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 (161) hide show
  1. package/dist/cjs/{index-I9CoYv3k.js → index-DanPUX0s.js} +1 -1
  2. package/dist/cjs/index.cjs.js +2 -1
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/ticket-selector-BYVL13k_.js +3623 -0
  5. package/dist/cjs/ticketlayer-elements.cjs.js +2 -2
  6. package/dist/cjs/tl-buy-modal.cjs.entry.js +3 -3
  7. package/dist/cjs/tl-buy-tickets-button.cjs.entry.js +89 -74
  8. package/dist/cjs/tl-buy-tickets-wrapper.cjs.entry.js +61 -30
  9. package/dist/cjs/tl-cart-badge.cjs.entry.js +74 -61
  10. package/dist/cjs/tl-cart-drawer.cjs.entry.js +51 -23
  11. package/dist/cjs/tl-cart.cjs.entry.js +71 -103
  12. package/dist/cjs/tl-checkout-wrapper.cjs.entry.js +51 -29
  13. package/dist/cjs/tl-event-card.cjs.entry.js +43 -105
  14. package/dist/cjs/tl-event-list.cjs.entry.js +72 -35
  15. package/dist/cjs/tl-login.cjs.entry.js +74 -141
  16. package/dist/cjs/tl-my-orders.cjs.entry.js +52 -92
  17. package/dist/cjs/tl-occurrence-selector_2.cjs.entry.js +153 -921
  18. package/dist/cjs/tl-order-confirmation.cjs.entry.js +71 -107
  19. package/dist/cjs/tl-order-tickets_2.cjs.entry.js +48 -74
  20. package/dist/cjs/tl-promo-code.cjs.entry.js +50 -47
  21. package/dist/cjs/tl-seat-map.cjs.entry.js +3 -3
  22. package/dist/cjs/web-query-Ce73jB4k.js +16 -0
  23. package/dist/collection/components/tl-buy-modal/tl-buy-modal.js +2 -2
  24. package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.css +37 -0
  25. package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.js +105 -79
  26. package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.js +73 -30
  27. package/dist/collection/components/tl-cart/tl-cart.js +82 -107
  28. package/dist/collection/components/tl-cart-badge/tl-cart-badge.js +62 -62
  29. package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.js +56 -24
  30. package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.js +61 -29
  31. package/dist/collection/components/tl-event-card/event-card-adapter.js +11 -23
  32. package/dist/collection/components/tl-event-card/tl-event-card.js +51 -84
  33. package/dist/collection/components/tl-event-list/tl-event-list.js +82 -38
  34. package/dist/collection/components/tl-login/tl-login.js +83 -147
  35. package/dist/collection/components/tl-my-orders/tl-my-orders.js +58 -96
  36. package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.js +137 -516
  37. package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.js +81 -115
  38. package/dist/collection/components/tl-order-tickets/tl-order-tickets.js +57 -92
  39. package/dist/collection/components/tl-promo-code/tl-promo-code.js +55 -50
  40. package/dist/collection/components/tl-seat-map/tl-seat-map.js +2 -2
  41. package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.js +34 -20
  42. package/dist/collection/utils/order-summary.js +15 -135
  43. package/dist/collection/utils/testing/deep-text.js +29 -0
  44. package/dist/collection/utils/testing/fixtures.js +290 -0
  45. package/dist/collection/utils/testing/mock-sdk.js +13 -2
  46. package/dist/collection/utils/web-query.js +12 -0
  47. package/dist/collection/utils/web-storage.js +22 -0
  48. package/dist/components/ticket-selector.js +1 -0
  49. package/dist/components/tl-buy-modal.js +1 -1
  50. package/dist/components/tl-buy-tickets-button.js +1 -1
  51. package/dist/components/tl-buy-tickets-wrapper2.js +1 -1
  52. package/dist/components/tl-cart-badge.js +1 -1
  53. package/dist/components/tl-cart-drawer.js +1 -1
  54. package/dist/components/tl-cart2.js +1 -1
  55. package/dist/components/tl-checkout-wrapper2.js +1 -1
  56. package/dist/components/tl-event-card2.js +1 -1
  57. package/dist/components/tl-event-list.js +1 -1
  58. package/dist/components/tl-login2.js +1 -1
  59. package/dist/components/tl-my-orders.js +1 -1
  60. package/dist/components/tl-occurrence-selector2.js +1 -1
  61. package/dist/components/tl-order-confirmation.js +1 -1
  62. package/dist/components/tl-order-tickets2.js +1 -1
  63. package/dist/components/tl-promo-code.js +1 -1
  64. package/dist/components/tl-seat-map.js +1 -1
  65. package/dist/components/tl-ticket-selector2.js +1 -1
  66. package/dist/components/web-query.js +1 -0
  67. package/dist/elements.docs.json +34 -34
  68. package/dist/esm/{index-OoYV1faY.js → index-imfxp765.js} +1 -1
  69. package/dist/esm/index.js +2 -1
  70. package/dist/esm/loader.js +3 -3
  71. package/dist/esm/ticket-selector-BwChnHVC.js +3606 -0
  72. package/dist/esm/ticketlayer-elements.js +3 -3
  73. package/dist/esm/tl-buy-modal.entry.js +3 -3
  74. package/dist/esm/tl-buy-tickets-button.entry.js +90 -75
  75. package/dist/esm/tl-buy-tickets-wrapper.entry.js +62 -31
  76. package/dist/esm/tl-cart-badge.entry.js +75 -62
  77. package/dist/esm/tl-cart-drawer.entry.js +52 -24
  78. package/dist/esm/tl-cart.entry.js +72 -104
  79. package/dist/esm/tl-checkout-wrapper.entry.js +52 -30
  80. package/dist/esm/tl-event-card.entry.js +44 -106
  81. package/dist/esm/tl-event-list.entry.js +73 -36
  82. package/dist/esm/tl-login.entry.js +75 -142
  83. package/dist/esm/tl-my-orders.entry.js +53 -93
  84. package/dist/esm/tl-occurrence-selector_2.entry.js +152 -920
  85. package/dist/esm/tl-order-confirmation.entry.js +72 -108
  86. package/dist/esm/tl-order-tickets_2.entry.js +49 -75
  87. package/dist/esm/tl-promo-code.entry.js +51 -48
  88. package/dist/esm/tl-seat-map.entry.js +3 -3
  89. package/dist/esm/web-query-Bdbb2lk5.js +14 -0
  90. package/dist/ticketlayer-elements/index.esm.js +1 -1
  91. package/dist/ticketlayer-elements/p-45923d2c.entry.js +1 -0
  92. package/dist/ticketlayer-elements/p-492adc77.entry.js +1 -0
  93. package/dist/ticketlayer-elements/p-4cfc9e53.entry.js +1 -0
  94. package/dist/ticketlayer-elements/{p-ac264adc.entry.js → p-5135630e.entry.js} +1 -1
  95. package/dist/ticketlayer-elements/p-5bbce3b5.entry.js +1 -0
  96. package/dist/ticketlayer-elements/p-7d547721.entry.js +1 -0
  97. package/dist/ticketlayer-elements/p-7fe7b6ba.entry.js +1 -0
  98. package/dist/ticketlayer-elements/p-8122f0c1.entry.js +1 -0
  99. package/dist/ticketlayer-elements/p-98d40869.entry.js +1 -0
  100. package/dist/ticketlayer-elements/p-Bdbb2lk5.js +1 -0
  101. package/dist/ticketlayer-elements/p-BwChnHVC.js +1 -0
  102. package/dist/ticketlayer-elements/p-abec290a.entry.js +1 -0
  103. package/dist/ticketlayer-elements/p-ac79a3f6.entry.js +1 -0
  104. package/dist/ticketlayer-elements/p-d01f4429.entry.js +1 -0
  105. package/dist/ticketlayer-elements/p-d7ffaf46.entry.js +1 -0
  106. package/dist/ticketlayer-elements/p-e7170f3c.entry.js +1 -0
  107. package/dist/ticketlayer-elements/p-e787e862.entry.js +1 -0
  108. package/dist/ticketlayer-elements/p-f1ff931f.entry.js +1 -0
  109. package/dist/ticketlayer-elements/p-imfxp765.js +3 -0
  110. package/dist/ticketlayer-elements/ticketlayer-elements.css +1 -1
  111. package/dist/ticketlayer-elements/ticketlayer-elements.esm.js +1 -1
  112. package/dist/types/components/tl-buy-tickets-button/tl-buy-tickets-button.d.ts +40 -8
  113. package/dist/types/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.d.ts +20 -1
  114. package/dist/types/components/tl-cart/tl-cart.d.ts +40 -42
  115. package/dist/types/components/tl-cart-badge/tl-cart-badge.d.ts +22 -7
  116. package/dist/types/components/tl-cart-drawer/tl-cart-drawer.d.ts +28 -5
  117. package/dist/types/components/tl-checkout-wrapper/tl-checkout-wrapper.d.ts +18 -1
  118. package/dist/types/components/tl-event-card/event-card-adapter.d.ts +9 -20
  119. package/dist/types/components/tl-event-card/tl-event-card.d.ts +25 -28
  120. package/dist/types/components/tl-event-list/tl-event-list.d.ts +46 -6
  121. package/dist/types/components/tl-login/tl-login.d.ts +68 -22
  122. package/dist/types/components/tl-my-orders/tl-my-orders.d.ts +30 -12
  123. package/dist/types/components/tl-occurrence-selector/tl-occurrence-selector.d.ts +73 -161
  124. package/dist/types/components/tl-order-confirmation/tl-order-confirmation.d.ts +48 -15
  125. package/dist/types/components/tl-order-tickets/tl-order-tickets.d.ts +29 -31
  126. package/dist/types/components/tl-promo-code/tl-promo-code.d.ts +28 -10
  127. package/dist/types/components/tl-ticket/tl-ticket.d.ts +2 -11
  128. package/dist/types/components/tl-ticket-selector/tl-ticket-selector.d.ts +22 -4
  129. package/dist/types/components.d.ts +270 -62
  130. package/dist/types/utils/order-summary.d.ts +14 -97
  131. package/dist/types/utils/testing/deep-text.d.ts +13 -0
  132. package/dist/types/utils/testing/fixtures.d.ts +225 -0
  133. package/dist/types/utils/testing/mock-sdk.d.ts +14 -1
  134. package/dist/types/utils/web-query.d.ts +18 -0
  135. package/dist/types/utils/web-storage.d.ts +16 -0
  136. package/elements.catalogue.json +602 -50
  137. package/package.json +8 -6
  138. package/dist/cjs/money-BtmM2gt-.js +0 -118
  139. package/dist/cjs/order-summary-X3TlZxc2.js +0 -150
  140. package/dist/components/money.js +0 -1
  141. package/dist/components/order-summary.js +0 -1
  142. package/dist/esm/money-4ig0-WB6.js +0 -112
  143. package/dist/esm/order-summary-DiDtvfZM.js +0 -136
  144. package/dist/ticketlayer-elements/p-0814420f.entry.js +0 -1
  145. package/dist/ticketlayer-elements/p-0acabc26.entry.js +0 -1
  146. package/dist/ticketlayer-elements/p-109a3feb.entry.js +0 -1
  147. package/dist/ticketlayer-elements/p-1a4ba71c.entry.js +0 -1
  148. package/dist/ticketlayer-elements/p-318965c1.entry.js +0 -1
  149. package/dist/ticketlayer-elements/p-347c7fd1.entry.js +0 -1
  150. package/dist/ticketlayer-elements/p-3649c26d.entry.js +0 -1
  151. package/dist/ticketlayer-elements/p-40260cc9.entry.js +0 -1
  152. package/dist/ticketlayer-elements/p-4ig0-WB6.js +0 -1
  153. package/dist/ticketlayer-elements/p-55fd2f9f.entry.js +0 -1
  154. package/dist/ticketlayer-elements/p-62ee659b.entry.js +0 -1
  155. package/dist/ticketlayer-elements/p-7d4ecc2b.entry.js +0 -1
  156. package/dist/ticketlayer-elements/p-7f0abf95.entry.js +0 -1
  157. package/dist/ticketlayer-elements/p-BXpVGW51.js +0 -1
  158. package/dist/ticketlayer-elements/p-OoYV1faY.js +0 -3
  159. package/dist/ticketlayer-elements/p-a3c1b26c.entry.js +0 -1
  160. package/dist/ticketlayer-elements/p-aeb4c6fb.entry.js +0 -1
  161. package/dist/ticketlayer-elements/p-ba62541f.entry.js +0 -1
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-I9CoYv3k.js');
3
+ var index = require('./index-DanPUX0s.js');
4
4
  var sdkConnector = require('./sdk-connector-ClDF3013.js');
5
- var orderSummary = require('./order-summary-X3TlZxc2.js');
6
- require('./money-BtmM2gt-.js');
5
+ var webQuery = require('./web-query-Ce73jB4k.js');
6
+ var ticketSelector = require('./ticket-selector-BYVL13k_.js');
7
7
 
8
8
  const tlOrderConfirmationCss = () => `:host{display:block;font-family:var(--tl-font-family);color:var(--tl-foreground)}.confirmation{text-align:center}.check{width:4rem;height:4rem;margin:0 auto var(--tl-spacing-4);display:flex;align-items:center;justify-content:center;border-radius:9999px;background:var(--tl-success);color:var(--tl-success-foreground)}.check svg{width:2rem;height:2rem}.title{margin:0 0 var(--tl-spacing-2);font-size:1.875rem;font-weight:700;line-height:1.2}.lead{margin:0 0 var(--tl-spacing-6);color:var(--tl-muted-foreground)}.error{margin:0 0 var(--tl-spacing-6);font-size:0.875rem;color:var(--tl-error)}.summary{text-align:left;padding:var(--tl-spacing-6);margin-bottom:var(--tl-spacing-6);background:var(--tl-muted);border:1px solid var(--tl-border);border-radius:var(--tl-radius-lg)}.rows{display:grid;gap:var(--tl-spacing-2);margin:0 0 var(--tl-spacing-4);padding:0 0 var(--tl-spacing-4);border-bottom:1px solid var(--tl-border)}.row{display:flex;justify-content:space-between;gap:var(--tl-spacing-4);font-size:0.875rem}.row dt{color:var(--tl-muted-foreground)}.row dd{margin:0;text-align:right;overflow-wrap:anywhere}.reference{font-family:var(--tl-font-family-mono);font-weight:600}.lines{list-style:none;margin:0;padding:0;display:grid;gap:var(--tl-spacing-2)}.line{display:flex;justify-content:space-between;gap:var(--tl-spacing-4);font-size:0.875rem}.totals{margin-top:var(--tl-spacing-3);padding-top:var(--tl-spacing-3);border-top:1px solid var(--tl-border);display:grid;gap:var(--tl-spacing-1);font-size:0.875rem}.total-row{display:flex;justify-content:space-between;color:var(--tl-muted-foreground)}.total-row.discount{color:var(--tl-success)}.total-row.total{margin-top:var(--tl-spacing-1);font-size:1rem;font-weight:600;color:var(--tl-foreground)}.tickets{text-align:left}.subtitle{margin:0 0 var(--tl-spacing-4);font-size:1.125rem;font-weight:600}.hint{margin:var(--tl-spacing-3) 0 0;font-size:0.75rem;color:var(--tl-muted-foreground)}.skeleton-line,.skeleton-block{background:var(--tl-secondary);border-radius:var(--tl-radius-md);animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;margin:0 auto var(--tl-spacing-3)}.skeleton-line{height:1rem}.skeleton-line.short{width:40%;height:1.75rem}.skeleton-line.long{width:70%}.skeleton-block{height:8rem}@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.5}}`;
9
9
 
@@ -16,131 +16,95 @@ const TlOrderConfirmation = class {
16
16
  this.showTickets = true;
17
17
  /** Columns for the ticket grid. */
18
18
  this.columns = 2;
19
- this.order = null;
20
- this.resolvedOrderId = null;
21
- this.loading = false;
22
- this.error = null;
23
- this.paymentFailed = false;
24
- this.occurrence = null;
25
- this.signedInCustomer = null;
26
- }
27
- watchOrderId(next) {
28
- this.resolvedOrderId = next || this.orderIdFromUrl();
29
- this.load();
19
+ this.element = ticketSelector.createElement(ticketSelector.orderConfirmationCore, {
20
+ client: () => sdkConnector.getSDK(),
21
+ clientReady: () => sdkConnector.whenSDK(),
22
+ query: webQuery.webQuery,
23
+ emit: (event, detail) => this.forward(event, detail),
24
+ });
25
+ /** The core's whole view. Assigning it is what makes Stencil re-render. */
26
+ this.view = this.element.view;
30
27
  }
31
- async componentWillLoad() {
32
- const params = this.urlParams();
33
- // Stripe returns with ?redirect_status=; anything but succeeded is not paid.
34
- const redirect = params?.get('redirect_status');
35
- this.paymentFailed = !!redirect && redirect !== 'succeeded';
36
- this.resolvedOrderId = this.orderId || this.orderIdFromUrl();
37
- if (this.resolvedOrderId && !this.paymentFailed) {
38
- await this.load();
39
- }
28
+ /**
29
+ * A new order id is a new subject, and the core resolves it again the way
30
+ * the mount did - the prop first, the link second. Not a remount: the
31
+ * `checkout:completed` subscription belongs to the element rather than to
32
+ * the order it is showing.
33
+ */
34
+ watchOrderId() {
35
+ this.syncProps();
36
+ this.element.actions.orderIdChanged();
40
37
  }
41
- componentDidLoad() {
42
- // A page that mounts before checkout: pick the order up when the SDK completes it.
43
- this.unsubscribe = sdkConnector.onSDKEvent('checkout:completed', (payload) => {
44
- const order = payload;
45
- if (!order?.id)
46
- return;
47
- this.paymentFailed = false;
48
- this.order = order;
49
- this.resolvedOrderId = order.id;
50
- this.tlOrderLoaded.emit({ order });
51
- // Re-read for tickets, which are issued after the order is created.
52
- this.load();
38
+ syncProps() {
39
+ this.element.setProps({
40
+ orderId: this.orderId,
41
+ customerEmail: this.customerEmail,
42
+ showTickets: this.showTickets,
43
+ columns: this.columns,
53
44
  });
54
45
  }
46
+ connectedCallback() {
47
+ this.syncProps();
48
+ this.unsubscribe ?? (this.unsubscribe = this.element.subscribe((view) => {
49
+ this.view = view;
50
+ }));
51
+ this.view = this.element.view;
52
+ this.teardown = this.element.mount();
53
+ }
54
+ /**
55
+ * Off screen: run the mount's teardown, which drops the
56
+ * `checkout:completed` subscription. Not `destroy()`: Stencil calls this for
57
+ * a DOM move as well as a removal, and a destroyed core never mounts again.
58
+ */
55
59
  disconnectedCallback() {
60
+ this.teardown?.();
61
+ this.teardown = undefined;
56
62
  this.unsubscribe?.();
63
+ this.unsubscribe = undefined;
57
64
  }
58
- urlParams() {
59
- if (typeof window === 'undefined' || !window.location?.search)
60
- return null;
61
- return new URLSearchParams(window.location.search);
62
- }
63
- orderIdFromUrl() {
64
- return this.urlParams()?.get('orderId') || null;
65
- }
66
- async load() {
67
- const id = this.resolvedOrderId;
68
- if (!id)
69
- return;
70
- try {
71
- this.loading = !this.order;
72
- this.error = null;
73
- const sdk = await sdkConnector.whenSDK();
74
- const orders = sdk.getOrdersManager?.();
75
- if (!orders)
76
- throw new Error('Orders are not available');
77
- const order = (await orders.get(id));
78
- if (!order)
79
- throw new Error('Order not found');
80
- this.order = order;
81
- this.signedInCustomer = sdk.getAuthManager?.()?.customer ?? null;
82
- this.tlOrderLoaded.emit({ order });
83
- this.resolveEvent(sdk, order);
84
- }
85
- catch (err) {
86
- console.error('[tl-order-confirmation] Failed to load order:', err);
87
- this.error = orderSummary.errorMessage(err, 'Failed to load your order');
88
- this.tlError.emit({ message: this.error });
89
- }
90
- finally {
91
- this.loading = false;
92
- }
93
- }
94
- // The order view has no event name or date; look them up from the first
95
- // ticket's occurrence. Non-blocking and best effort.
96
- async resolveEvent(sdk, order) {
97
- const occurrenceId = order.tickets?.find((t) => t.eventOccurrenceId)?.eventOccurrenceId;
98
- if (!occurrenceId)
99
- return;
100
- try {
101
- const resolved = await orderSummary.resolveOccurrence(sdk, occurrenceId);
102
- if (resolved && this.order?.id === order.id)
103
- this.occurrence = resolved;
104
- }
105
- catch {
106
- // Leave the event line at what the order gives us.
107
- }
65
+ forward(event, detail) {
66
+ if (event === 'tlOrderLoaded')
67
+ this.tlOrderLoaded.emit(detail);
68
+ else if (event === 'tlError')
69
+ this.tlError.emit(detail);
108
70
  }
109
- renderRows(order) {
110
- const email = this.customerEmail || orderSummary.orderCustomerEmail(order, this.signedInCustomer);
111
- const eventName = this.occurrence?.eventName || orderSummary.orderEventName(order);
112
- const startsAt = this.occurrence?.startsAt;
113
- return (index.h("dl", { class: "rows" }, index.h("div", { class: "row" }, index.h("dt", null, "Order reference"), index.h("dd", { class: "reference" }, order.orderNumber)), email && (index.h("div", { class: "row" }, index.h("dt", null, "Email"), index.h("dd", null, email))), eventName && (index.h("div", { class: "row" }, index.h("dt", null, "Event"), index.h("dd", null, eventName))), startsAt && (index.h("div", { class: "row" }, index.h("dt", null, "Date"), index.h("dd", null, orderSummary.formatDateTime(startsAt))))));
71
+ renderRows() {
72
+ return (index.h("dl", { class: "rows" }, this.view.derived.rows.map((row) => (index.h("div", { class: "row", key: row.label }, index.h("dt", null, row.label), index.h("dd", { class: row.reference ? 'reference' : undefined }, row.value))))));
114
73
  }
115
- // Money comes from orderTotals: the booking fee is its own row named after
116
- // the channel's fee profile, the subtotal is the ticket lines alone (the
117
- // order's own `subtotal` folds the fee line into it) and the total is the
118
- // order's figure, so what is shown is what was charged.
119
- renderTotals(order) {
120
- const totals = orderSummary.orderTotals(order);
121
- const c = totals.currency;
122
- return (index.h("div", { class: "totals" }, index.h("div", { class: "total-row" }, index.h("span", null, "Subtotal"), index.h("span", null, orderSummary.formatPrice(totals.subtotal, c))), totals.showFee && (index.h("div", { class: "total-row fee" }, index.h("span", null, totals.feeLabel), index.h("span", null, orderSummary.formatPrice(totals.fees, c)))), totals.tax > 0 && (index.h("div", { class: "total-row" }, index.h("span", null, "Tax"), index.h("span", null, orderSummary.formatPrice(totals.tax, c)))), totals.discount > 0 && (index.h("div", { class: "total-row discount" }, index.h("span", null, "Discount"), index.h("span", null, "-", orderSummary.formatPrice(totals.discount, c)))), index.h("div", { class: "total-row total" }, index.h("span", null, "Total"), index.h("span", null, orderSummary.formatPrice(totals.total, c)))));
74
+ // Money comes from the core's orderTotals: the booking fee is its own row
75
+ // named after the channel's fee profile, the subtotal is the ticket lines
76
+ // alone (the order's own `subtotal` folds the fee line into it) and the
77
+ // total is the order's figure, so what is shown is what was charged.
78
+ renderTotals() {
79
+ const { strings, derived } = this.view;
80
+ return (index.h("div", { class: "totals" }, index.h("div", { class: "total-row" }, index.h("span", null, strings.subtotalRow), index.h("span", null, derived.subtotalLabel)), derived.totals.showFee && (index.h("div", { class: "total-row fee" }, index.h("span", null, derived.totals.feeLabel), index.h("span", null, derived.feeAmountLabel))), derived.showTaxRow && (index.h("div", { class: "total-row" }, index.h("span", null, strings.taxRow), index.h("span", null, derived.taxLabel))), derived.showDiscountRow && (index.h("div", { class: "total-row discount" }, index.h("span", null, strings.discountRow), index.h("span", null, "-", derived.discountLabel))), index.h("div", { class: "total-row total" }, index.h("span", null, strings.totalRow), index.h("span", null, derived.totalLabel))));
123
81
  }
124
82
  render() {
125
- if (this.paymentFailed) {
126
- return (index.h("div", { class: "confirmation" }, index.h("h1", { class: "title" }, "Payment not completed"), index.h("p", { class: "lead" }, "Your payment wasn't completed. Your cart is still saved, so you can try again.")));
83
+ const { status, state, strings, derived } = this.view;
84
+ if (status === 'payment-failed') {
85
+ return (index.h("div", { class: "confirmation" }, index.h("h1", { class: "title" }, strings.paymentFailedTitle), index.h("p", { class: "lead" }, strings.paymentFailedLead)));
127
86
  }
128
87
  // Nothing to show yet: no order in props, URL or from checkout.
129
- if (!this.resolvedOrderId && !this.order) {
88
+ if (status === 'idle') {
130
89
  return null;
131
90
  }
132
- if (this.loading) {
91
+ if (status === 'loading') {
133
92
  return (index.h("div", { class: "confirmation" }, index.h("div", { class: "skeleton-line short" }), index.h("div", { class: "skeleton-line long" }), index.h("div", { class: "skeleton-block" })));
134
93
  }
135
- const order = this.order;
136
- const orderId = order?.id || this.resolvedOrderId;
137
- return (index.h("div", { class: "confirmation" }, index.h("div", { class: "check", "aria-hidden": "true" }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M5 13l4 4L19 7" }))), index.h("h1", { class: "title" }, "You're going!"), index.h("p", { class: "lead" }, order?.orderNumber
138
- ? `Order ${order.orderNumber} is confirmed. Your tickets are on their way to your email.`
139
- : 'Your order is confirmed. Your tickets are on their way to your email.'), this.error && !order && (index.h("p", { class: "error" }, "We couldn't load your order details yet. ", this.error)), order && Array.isArray(order.items) && (index.h("div", { class: "summary" }, this.renderRows(order), index.h("ul", { class: "lines" }, orderSummary.ticketItems(order).map((item, i) => (index.h("li", { class: "line", key: i }, index.h("span", { class: "line-name" }, item.quantity, " x ", item.name), index.h("span", { class: "line-price" }, orderSummary.formatPrice(item.subtotal, order.currency)))))), this.renderTotals(order))), this.showTickets && order && (index.h("div", { class: "tickets" }, index.h("h2", { class: "subtitle" }, "Your tickets"), index.h("tl-order-tickets", { orderId: orderId, columns: this.columns }), index.h("p", { class: "hint" }, "Show these QR codes at the door for entry. Use Download PDF on a ticket to save it.")))));
94
+ return (index.h("div", { class: "confirmation" }, index.h("div", { class: "check", "aria-hidden": "true" }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M5 13l4 4L19 7" }))), index.h("h1", { class: "title" }, strings.title), index.h("p", { class: "lead" }, derived.leadText), derived.showError && (index.h("p", { class: "error" }, strings.errorPrefix, state.error)), derived.showSummary && (index.h("div", { class: "summary" }, this.renderRows(), index.h("ul", { class: "lines" }, derived.lines.map((line, i) => (index.h("li", { class: "line", key: i }, index.h("span", { class: "line-name" }, line.label), index.h("span", { class: "line-price" }, line.priceLabel))))), this.renderTotals())), derived.showTickets && (index.h("div", { class: "tickets" }, index.h("h2", { class: "subtitle" }, strings.ticketsTitle), index.h("tl-order-tickets", { orderId: derived.ticketsOrderId, columns: this.columns }), index.h("p", { class: "hint" }, strings.ticketsHint)))));
140
95
  }
141
96
  static get watchers() { return {
142
97
  "orderId": [{
143
98
  "watchOrderId": 0
99
+ }],
100
+ "customerEmail": [{
101
+ "syncProps": 0
102
+ }],
103
+ "showTickets": [{
104
+ "syncProps": 0
105
+ }],
106
+ "columns": [{
107
+ "syncProps": 0
144
108
  }]
145
109
  }; }
146
110
  };
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-I9CoYv3k.js');
3
+ var index = require('./index-DanPUX0s.js');
4
4
  var sdkConnector = require('./sdk-connector-ClDF3013.js');
5
+ var ticketSelector = require('./ticket-selector-BYVL13k_.js');
5
6
 
6
7
  const tlOrderTicketsCss = () => `:host{display:block;font-family:var(--tl-font-family)}.grid{display:grid;gap:var(--tl-spacing-4);grid-template-columns:1fr}@media (min-width: 480px){.grid.cols-2{grid-template-columns:repeat(2, 1fr)}.grid.cols-3{grid-template-columns:repeat(3, 1fr)}}.state{padding:var(--tl-spacing-6);text-align:center;color:var(--tl-muted-foreground);font-size:0.875rem}.state.error{color:var(--tl-error)}.state.issuing{display:flex;align-items:center;justify-content:center;gap:var(--tl-spacing-2)}.spinner{width:0.875rem;height:0.875rem;border:2px solid var(--tl-border);border-top-color:var(--tl-primary);border-radius:50%;animation:tl-spin 0.7s linear infinite;flex:none}@keyframes tl-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spinner{animation:none;border-top-color:var(--tl-border)}}`;
7
8
 
@@ -10,97 +11,70 @@ const TlOrderTickets = class {
10
11
  index.registerInstance(this, hostRef);
11
12
  /** Columns in the grid (default 2). */
12
13
  this.columns = 2;
13
- this.tickets = [];
14
- this.loading = true;
15
- this.error = null;
16
- /** The order loaded, but has no tickets yet and we are still waiting. */
17
- this.issuing = false;
18
- this.poll = 0;
14
+ this.element = ticketSelector.createElement(ticketSelector.orderTicketsCore, {
15
+ client: () => sdkConnector.getSDK(),
16
+ clientReady: () => sdkConnector.whenSDK(),
17
+ emit: (event, detail) => this.forward(event, detail),
18
+ });
19
+ /** The core's whole view. Assigning it is what makes Stencil re-render. */
20
+ this.view = this.element.view;
19
21
  }
22
+ /** A different order: forget this one and read again, from the top. */
20
23
  watchOrder() {
21
- this.reset();
22
- this.load();
24
+ this.syncProps();
25
+ this.element.actions.orderIdChanged();
23
26
  }
24
- async componentWillLoad() {
25
- await this.load();
27
+ syncProps() {
28
+ this.element.setProps({ orderId: this.orderId, columns: this.columns });
29
+ }
30
+ connectedCallback() {
31
+ this.syncProps();
32
+ this.unsubscribe ?? (this.unsubscribe = this.element.subscribe((view) => {
33
+ this.view = view;
34
+ }));
35
+ this.view = this.element.view;
36
+ this.teardown = this.element.mount();
26
37
  }
38
+ /**
39
+ * Off screen: run the mount's teardown, which is what stops the polling.
40
+ * Not `destroy()`: Stencil calls this for a DOM move as well as a removal,
41
+ * and a destroyed core never mounts again.
42
+ */
27
43
  disconnectedCallback() {
28
- this.stopPolling();
44
+ this.teardown?.();
45
+ this.teardown = undefined;
46
+ this.unsubscribe?.();
47
+ this.unsubscribe = undefined;
29
48
  }
30
- reset() {
31
- this.stopPolling();
32
- this.poll = 0;
33
- this.tickets = [];
34
- this.issuing = false;
35
- }
36
- stopPolling() {
37
- if (this.timer !== undefined) {
38
- clearTimeout(this.timer);
39
- this.timer = undefined;
40
- }
41
- }
42
- async load() {
43
- try {
44
- this.error = null;
45
- const sdk = await sdkConnector.whenSDK();
46
- const orders = sdk.getOrdersManager?.();
47
- if (!orders)
48
- throw new Error('Tickets are not available');
49
- const order = (await orders.get(this.orderId));
50
- this.tickets = order?.tickets ?? [];
51
- if (this.tickets.length > 0) {
52
- // Arrived. Stop asking.
53
- this.issuing = false;
54
- this.stopPolling();
55
- }
56
- else {
57
- const delay = TlOrderTickets.POLL_DELAYS_MS[this.poll];
58
- // `undefined` once the schedule runs out: give up waiting, and say so.
59
- this.issuing = delay !== undefined;
60
- if (delay !== undefined) {
61
- this.poll += 1;
62
- this.stopPolling();
63
- this.timer = setTimeout(() => this.load(), delay);
64
- }
65
- }
66
- }
67
- catch (err) {
68
- // A failed request is a different thing from an order with no tickets,
69
- // and stops the polling: retrying a 403 a dozen times helps nobody.
70
- this.stopPolling();
71
- this.issuing = false;
72
- this.error = err instanceof Error ? err.message : 'Failed to load tickets';
73
- }
74
- finally {
75
- this.loading = false;
76
- }
49
+ /** The core declares no events, so nothing ever reaches here. */
50
+ forward(_event, _detail) {
51
+ // Intentionally empty: tl-order-tickets announces nothing to its host.
77
52
  }
78
53
  render() {
79
- if (this.loading) {
80
- return index.h("div", { class: "state" }, "Loading tickets\u2026");
54
+ const { status, state, strings, derived } = this.view;
55
+ if (status === 'loading') {
56
+ return index.h("div", { class: "state" }, strings.loading);
57
+ }
58
+ if (status === 'error') {
59
+ return index.h("div", { class: "state error" }, state.error);
81
60
  }
82
- if (this.error) {
83
- return index.h("div", { class: "state error" }, this.error);
61
+ if (status === 'issuing') {
62
+ return (index.h("div", { class: "state issuing", role: "status", "aria-live": "polite" }, index.h("span", { class: "spinner", "aria-hidden": "true" }), strings.preparing));
84
63
  }
85
- if (this.tickets.length === 0) {
86
- return this.issuing ? (index.h("div", { class: "state issuing", role: "status", "aria-live": "polite" }, index.h("span", { class: "spinner", "aria-hidden": "true" }), "Preparing your tickets\u2026")) : (index.h("div", { class: "state", role: "status" }, "Your tickets are taking longer than usual. They will be emailed to you as soon as they are ready."));
64
+ if (status === 'delayed') {
65
+ return (index.h("div", { class: "state", role: "status" }, strings.delayed));
87
66
  }
88
- return (index.h("div", { class: `grid cols-${this.columns}` }, this.tickets.map((t) => (index.h("tl-ticket", { key: t.id, ticket: t, orderId: this.orderId })))));
67
+ return (index.h("div", { class: `grid cols-${derived.columns}` }, derived.tickets.map((t) => (index.h("tl-ticket", { key: t.id, ticket: t, orderId: derived.orderId })))));
89
68
  }
90
69
  static get watchers() { return {
91
70
  "orderId": [{
92
71
  "watchOrder": 0
72
+ }],
73
+ "columns": [{
74
+ "syncProps": 0
93
75
  }]
94
76
  }; }
95
77
  };
96
- /**
97
- * Gaps between polls, in milliseconds. Front-loaded because issuance
98
- * usually lands in the first few seconds, then widening so a genuinely
99
- * stuck order is not hammered. Sums to roughly one minute.
100
- */
101
- TlOrderTickets.POLL_DELAYS_MS = [
102
- 1000, 1500, 2000, 3000, 4000, 5000, 6000, 8000, 10000, 12000,
103
- ];
104
78
  TlOrderTickets.style = tlOrderTicketsCss();
105
79
 
106
80
  function getDefaultExportFromCjs (x) {
@@ -1,9 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-I9CoYv3k.js');
3
+ var index = require('./index-DanPUX0s.js');
4
4
  var sdkConnector = require('./sdk-connector-ClDF3013.js');
5
- var orderSummary = require('./order-summary-X3TlZxc2.js');
6
- require('./money-BtmM2gt-.js');
5
+ var ticketSelector = require('./ticket-selector-BYVL13k_.js');
7
6
 
8
7
  const tlPromoCodeCss = () => `:host{display:block;font-family:var(--tl-font-family);color:var(--tl-foreground)}.field{display:flex;gap:var(--tl-spacing-2)}.input{flex:1;min-width:0;padding:var(--tl-spacing-3);font:inherit;font-size:0.875rem;color:var(--tl-foreground);background:var(--tl-background);border:1px solid var(--tl-border);border-radius:var(--tl-radius-md);text-transform:uppercase}.input::placeholder{text-transform:none;color:var(--tl-muted-foreground)}.input:focus{outline:2px solid var(--tl-primary);outline-offset:1px}.apply{padding:var(--tl-spacing-3) var(--tl-spacing-4);font:inherit;font-size:0.875rem;font-weight:500;color:var(--tl-primary-foreground);background:var(--tl-primary);border:none;border-radius:var(--tl-radius-md);cursor:pointer;white-space:nowrap}.apply:hover:not(:disabled){opacity:0.9}.apply:disabled,.input:disabled{opacity:0.6;cursor:not-allowed}.error{margin:var(--tl-spacing-2) 0 0;font-size:0.8125rem;color:var(--tl-error)}.applied{display:flex;align-items:center;justify-content:space-between;gap:var(--tl-spacing-3);padding:var(--tl-spacing-3);font-size:0.875rem;background:var(--tl-muted);border:1px solid var(--tl-border);border-radius:var(--tl-radius-md)}.applied-text{display:flex;align-items:center;gap:var(--tl-spacing-2)}.icon{width:1rem;height:1rem;flex-shrink:0;color:var(--tl-success)}.code{font-family:var(--tl-font-family-mono)}.link{padding:0;font:inherit;font-size:0.8125rem;color:var(--tl-primary);background:none;border:none;cursor:pointer;white-space:nowrap}.link:hover{text-decoration:underline}`;
9
8
 
@@ -16,60 +15,64 @@ const TlPromoCode = class {
16
15
  this.placeholder = 'Promo or presale code';
17
16
  /** Apply button label. */
18
17
  this.buttonLabel = 'Apply';
19
- this.code = '';
20
- this.applying = false;
21
- this.applied = null;
22
- this.error = null;
18
+ this.element = ticketSelector.createElement(ticketSelector.promoCodeCore, {
19
+ client: () => sdkConnector.getSDK(),
20
+ clientReady: () => sdkConnector.whenSDK(),
21
+ emit: (event, detail) => this.forward(event, detail),
22
+ });
23
+ /** The core's whole view. Assigning it is what makes Stencil re-render. */
24
+ this.view = this.element.view;
23
25
  this.handleInput = (e) => {
24
- this.code = e.target.value;
25
- this.error = null;
26
+ this.element.actions.setCode(e.target.value);
26
27
  };
27
28
  this.handleSubmit = (e) => {
28
29
  e.preventDefault();
29
- this.apply();
30
- };
31
- this.reset = () => {
32
- this.applied = null;
33
- this.error = null;
30
+ this.element.actions.apply();
34
31
  };
32
+ this.reset = () => this.element.actions.reset();
35
33
  }
36
- async apply() {
37
- const code = this.code.trim();
38
- if (!code) {
39
- this.error = 'Enter a code';
40
- return;
41
- }
42
- this.applying = true;
43
- this.error = null;
44
- try {
45
- const sdk = await sdkConnector.whenSDK();
46
- const presale = sdk.getPresaleManager?.();
47
- if (!presale)
48
- throw new Error('Promo codes are not available');
49
- const result = await presale.redeem(code);
50
- // The SDK refreshed the cart on redeem; read the cached copy for the payload.
51
- const cart = await sdk.getCartManager?.()?.get().catch(() => null) ?? null;
52
- this.applied = { code: code.toUpperCase(), ...result, cart };
53
- this.code = '';
54
- this.tlPromoApplied.emit(this.applied);
55
- }
56
- catch (err) {
57
- console.error('[tl-promo-code] Redeem failed:', err);
58
- this.error = orderSummary.isAuthError(err)
59
- ? 'Sign in to use this code'
60
- : orderSummary.errorMessage(err, 'That code could not be applied');
61
- this.tlError.emit({ message: this.error });
62
- }
63
- finally {
64
- this.applying = false;
65
- }
34
+ syncProps() {
35
+ this.element.setProps({ placeholder: this.placeholder, buttonLabel: this.buttonLabel });
36
+ }
37
+ /**
38
+ * This core has nothing to do on mount, and the harness calls `mount()`
39
+ * anyway: a harness never asks what a core's lifecycle means (TKT-197).
40
+ */
41
+ connectedCallback() {
42
+ this.syncProps();
43
+ this.unsubscribe ?? (this.unsubscribe = this.element.subscribe((view) => {
44
+ this.view = view;
45
+ }));
46
+ this.view = this.element.view;
47
+ this.teardown = this.element.mount();
48
+ }
49
+ disconnectedCallback() {
50
+ this.teardown?.();
51
+ this.teardown = undefined;
52
+ this.unsubscribe?.();
53
+ this.unsubscribe = undefined;
54
+ }
55
+ forward(event, detail) {
56
+ if (event === 'tlPromoApplied')
57
+ this.tlPromoApplied.emit(detail);
58
+ else if (event === 'tlError')
59
+ this.tlError.emit(detail);
66
60
  }
67
61
  render() {
68
- if (this.applied) {
69
- return (index.h("div", { class: "applied", role: "status" }, index.h("span", { class: "applied-text" }, index.h("svg", { class: "icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "aria-hidden": "true" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M5 13l4 4L19 7" })), "Code ", index.h("strong", { class: "code" }, this.applied.code), this.applied.alreadyHeld ? ' was already applied' : ' applied'), index.h("button", { type: "button", class: "link", onClick: this.reset }, "Use a different code")));
62
+ const { status, state, strings, derived } = this.view;
63
+ if (status === 'applied') {
64
+ return (index.h("div", { class: "applied", role: "status" }, index.h("span", { class: "applied-text" }, index.h("svg", { class: "icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "aria-hidden": "true" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M5 13l4 4L19 7" })), strings.codePrefix, index.h("strong", { class: "code" }, derived.appliedCode), derived.appliedSuffix), index.h("button", { type: "button", class: "link", onClick: this.reset }, strings.useDifferent)));
70
65
  }
71
- return (index.h("form", { class: "promo", onSubmit: this.handleSubmit }, index.h("div", { class: "field" }, index.h("input", { class: "input", type: "text", autocomplete: "off", autoCapitalize: "characters", spellcheck: false, "aria-label": this.placeholder, placeholder: this.placeholder, value: this.code, disabled: this.applying, onInput: this.handleInput }), index.h("button", { type: "submit", class: "apply", disabled: this.applying }, this.applying ? 'Applying…' : this.buttonLabel)), this.error && (index.h("p", { class: "error", role: "alert" }, this.error))));
66
+ return (index.h("form", { class: "promo", onSubmit: this.handleSubmit }, index.h("div", { class: "field" }, index.h("input", { class: "input", type: "text", autocomplete: "off", autoCapitalize: "characters", spellcheck: false, "aria-label": this.placeholder, placeholder: this.placeholder, value: state.code, disabled: derived.disabled, onInput: this.handleInput }), index.h("button", { type: "submit", class: "apply", disabled: derived.disabled }, derived.actionLabel)), state.error && (index.h("p", { class: "error", role: "alert" }, state.error))));
72
67
  }
68
+ static get watchers() { return {
69
+ "placeholder": [{
70
+ "syncProps": 0
71
+ }],
72
+ "buttonLabel": [{
73
+ "syncProps": 0
74
+ }]
75
+ }; }
73
76
  };
74
77
  TlPromoCode.style = tlPromoCodeCss();
75
78
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-I9CoYv3k.js');
3
+ var index = require('./index-DanPUX0s.js');
4
4
  var sdkConnector = require('./sdk-connector-ClDF3013.js');
5
5
 
6
6
  const tlSeatMapCss = () => `:host{display:block;font-family:var(--tl-font-family)}.seat-map-container{position:relative;overflow:hidden;border-radius:var(--tl-radius-md);background:var(--tl-color-background)}.seat-map-iframe{width:100%;height:100%;border:none}.seat-map-iframe.hidden{display:none}.loading{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--tl-color-background);color:var(--tl-color-foreground);gap:1rem}.loading p{margin:0;font-size:0.875rem;color:var(--tl-color-muted-foreground)}.spinner{width:40px;height:40px;border:3px solid var(--tl-color-border);border-top-color:var(--tl-color-primary);border-radius:50%;animation:tl-seat-map-spin 1s linear infinite}@keyframes tl-seat-map-spin{to{transform:rotate(360deg)}}.error{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--tl-color-background);color:var(--tl-color-error);padding:1.5rem;text-align:center}.error-title{margin:0 0 0.5rem;font-size:1.125rem;font-weight:600}.error-message{margin:0;font-size:0.875rem;opacity:0.9}`;
@@ -127,10 +127,10 @@ const TlSeatMap = class {
127
127
  // Render
128
128
  // -------------------------------------------------------------------------
129
129
  render() {
130
- return (index.h("div", { key: 'c9beadc1792d7825ac3f99e6abc8b181e28fd1b6', class: "seat-map-container", style: {
130
+ return (index.h("div", { key: '1c6a23b0aa021c58fa62c106a92a2e970ca7f6d1', class: "seat-map-container", style: {
131
131
  width: this.width,
132
132
  height: this.height,
133
- } }, this.isLoading && (index.h("div", { key: 'ad792ea35f433a268c81722ce4e7d0e34780d337', class: "loading" }, index.h("div", { key: 'dd3e0657b16c2f265f59fbaa2ac39c559c2093b7', class: "spinner" }), index.h("p", { key: '2714e3073d0e5cddc50d530aa1cf46a7f73ba96f' }, "Loading seat map..."))), this.error && (index.h("div", { key: '3de9d73ab89a1ee963e73b4192d5c93e9667f11b', class: "error" }, index.h("p", { key: '0fea5c828b5b212ffdb45c9c7702d241e2b79cc4', class: "error-title" }, "Error"), index.h("p", { key: 'f2c090b982bb1ee6fb7d347d8860b4ce4798a891', class: "error-message" }, this.error))), index.h("iframe", { key: '8023219fdd467ec736f9627190690a6f73df3bb3', ref: (el) => (this.iframeRef = el), src: this.getIframeSrc(), class: {
133
+ } }, this.isLoading && (index.h("div", { key: '4a09ddbdbd38eb68675bb320cf33fd3ead5974a4', class: "loading" }, index.h("div", { key: 'c622ba1f996427f0624cfda2c782abd49ec72e19', class: "spinner" }), index.h("p", { key: '802f42554fc238a1ddc0f8a0f6a6b0de89bdfb60' }, "Loading seat map..."))), this.error && (index.h("div", { key: 'dde73e2430bad68c0a67306c0aa2b44810007cc5', class: "error" }, index.h("p", { key: '392d51bbc47ab34eab5670aa7a2faf800dabe638', class: "error-title" }, "Error"), index.h("p", { key: 'fcf6810f767f34bf3490c1af21320d262bdb961b', class: "error-message" }, this.error))), index.h("iframe", { key: '2333206fa6eb4fe6cdcbb1d30864d56d54583e1f', ref: (el) => (this.iframeRef = el), src: this.getIframeSrc(), class: {
134
134
  'seat-map-iframe': true,
135
135
  hidden: this.isLoading || !!this.error,
136
136
  }, title: "Ticketlayer Seat Map", allow: "fullscreen" })));
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ const webQuery = {
4
+ get(name) {
5
+ if (typeof window === 'undefined' || !window.location?.search)
6
+ return null;
7
+ try {
8
+ return new URLSearchParams(window.location.search).get(name);
9
+ }
10
+ catch {
11
+ return null;
12
+ }
13
+ },
14
+ };
15
+
16
+ exports.webQuery = webQuery;
@@ -126,10 +126,10 @@ export class TlBuyModal {
126
126
  }
127
127
  }
128
128
  render() {
129
- return (h(Host, { key: '1245e518c2b5232f4d9dba091cf808cd3867fbef' }, h("div", { key: '4e770fccdd785444f1cc87df4adab5a5dc1bf58a', class: "overlay", onClick: (e) => {
129
+ return (h(Host, { key: 'f28be761216b4a84904c1e325dc34d848625db14' }, h("div", { key: '0f36708a6b52d19ee987b211588e759aaf82ac03', class: "overlay", onClick: (e) => {
130
130
  if (e.target === e.currentTarget)
131
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"))))), h("div", { key: '9acdd36744d363f41f0bed7938ecea33322362d1', class: "powered-by" }, h("div", { key: 'f45545a8fc625336618352f0c0e9e84a1babce96', class: "pb-links" }, h("a", { key: 'dd929b12419b8353d9a09ad242a9f351dfd699e2', href: "https://ticketlayer.com/privacy", target: "_blank", rel: "noopener noreferrer" }, "Privacy Policy"), h("a", { key: '859be221bdc76602defaebdb89a997778cda6a91', href: "https://ticketlayer.com/report-abuse", target: "_blank", rel: "noopener noreferrer" }, "Report Abuse")), h("a", { key: 'd4e1f44b3b084160d2df8b9d15e075ddc5e05363', class: "pb-brand", href: "https://ticketlayer.com", target: "_blank", rel: "noopener noreferrer" }, h("span", { key: 'fe7fd86576a4e9772daa2c4c449da060f20fa143', class: "pb-pre" }, "Powered by"), h("svg", { key: '19412bd9e5522f0af9f847fe8fda6aa0f0004a3a', width: "14", height: "14", viewBox: "0 0 50 50", fill: "none", "aria-hidden": "true" }, h("g", { key: '8e82f14ab1e8094a210db95b1310ce6c0feef446', transform: "matrix(0.0129 0 0 -0.0129 25.4752 25.4752)" }, h("path", { key: 'b50b04cfc07c4e55fcf5ce92967f69b99d34dd34', fill: "currentColor", transform: "translate(-1781.5, -1759.4003)", d: "M 41 2973 c 1 -285 5 -734 9 -998 c 7 -444 9 -488 30 -580 c 81 -364 235 -634 512 -900 c 135 -130 263 -220 423 -299 c 156 -77 249 -109 409 -143 c 110 -23 142 -25 354 -24 c 230 1 310 8 427 37 c 241 60 453 162 640 309 c 82 64 252 234 317 315 c 210 264 340 604 355 926 l 6 121 l -69 6 c -86 8 -706 9 -755 1 l -36 -6 l -21 -125 c -34 -191 -98 -317 -236 -462 c -111 -115 -249 -198 -396 -238 c -98 -27 -356 -24 -463 5 c -100 27 -183 69 -273 137 c -226 173 -353 409 -354 660 c 0 44 -5 120 -10 169 c -6 49 -8 91 -6 94 c 3 3 65 -22 138 -55 c 140 -64 251 -103 358 -127 c 71 -17 295 -46 347 -46 l 33 0 l 0 434 l 0 434 l -67 7 c -147 14 -269 56 -393 133 c -222 139 -378 393 -397 648 l -6 71 l -75 7 c -41 3 -239 6 -439 6 l -363 0 l 1 -517 z" }))), h("span", { key: '2623449abd22f36f5af80d5605d3b274a4c214c4', class: "pb-word" }, "ticketlayer"))))));
132
+ } }, h("div", { key: '0b2bc062c89e8b821763e163bdedc44047571390', class: { panel: true, 'panel--wide': this.step === 'occurrence' }, role: "dialog", "aria-modal": "true", "aria-label": this.eventName }, h("header", { key: 'c9e3cc54615dace1842ceed226acff23ed0dc0d3', class: "panel-header" }, this.imageUrl && (h("div", { key: '18ffd6168344f65231fa40252361b03ac65ae91a', class: "event-thumb", style: { backgroundImage: `url(${this.imageUrl})` } })), h("div", { key: '4ccbf9a0477948bcb4202310f80cceb1d6e5ad0f', class: "titles" }, h("span", { key: '1a72eb71baaf9eff16aabc5d20c22b02e9b5cc99', class: "kicker" }, this.stepKicker()), h("h2", { key: 'f7dbc184bb016652c1ffe2fe24a551207f226942', class: "event-name" }, this.eventName), this.venueLabel && h("p", { key: 'db7ebd34f688b36b5610aa6adf0d8ab766f00ac2', class: "event-meta" }, this.venueLabel), this.dateSummary && h("p", { key: '00812c8b7b9abf85343f3d6bda433251468da1d9', class: "event-meta" }, this.dateSummary)), h("button", { key: 'e3f7252979794959d6e5070d549010567c0aa349', class: "close-btn", "aria-label": "Close", onClick: this.close }, h("svg", { key: 'd692c47bb8c614b41e19866c5fe4a65b0e083686', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: 'cbb9a7bd3ce4ed2685a781729110bccd36b425a9', d: "M6 6l12 12M18 6L6 18", "stroke-linecap": "round" })))), h("div", { key: 'c14af096c9e1cfd9bcead143c1b8a106a4b28018', class: "panel-body" }, this.step === 'loading' && (h("div", { key: '108d1073d572f841f1945147a787b8bdea66cfba', class: "state-msg" }, h("span", { key: '27c2b7473c6edb14ade3b7104f728136c0a2b052', class: "spinner" }), " Loading\u2026")), this.step === 'error' && h("div", { key: '0e3f927f626d51dffc30bb7da7093b6a7cd90a2a', class: "state-msg error" }, this.error), this.step === 'occurrence' && (h("tl-occurrence-selector", { key: 'bfab02d294de3eb1bce39d3e39c21f450b474c99', eventId: this.eventId, onTlSelect: this.handleOccurrenceSelect })), this.step === 'tickets' && this.selectedOccurrenceId && (h("div", { key: '109be73c93b0b604b435cbbd540d5dd5c48eacfe', class: "tickets-step" }, this.occurrenceCount > 1 && (h("button", { key: '2769d896476487e1412ac37309cd2e162b4bd275', class: "back-link", onClick: this.backToDates }, "\u2190 Change date")), this.occurrenceLabel && h("p", { key: '0c709ed8ba75b9e13a141ae755353fc694532935', class: "occ-label" }, this.occurrenceLabel), h("tl-ticket-selector", { key: 'cdf66533a591e89dc265532a2578c30327fd06c8', eventId: this.eventId, occurrenceId: this.selectedOccurrenceId, onTlAddToCart: this.handleAdded }))), this.step === 'done' && (h("div", { key: '6c4b294a4b9412e643a230f4064d15a587f79383', class: "done-step" }, h("div", { key: 'ba0e663e731402192675db509c886c2ce6a2418b', class: "done-mark" }, "\uD83C\uDF9F\uFE0F"), h("p", { key: '8d0f07758d3978080177a99e580f59fbcfefb611', class: "done-title" }, "Added to your cart"), h("p", { key: 'bbf4bd073f021a2f516f91528311d494c40faa85', class: "done-sub" }, "Held for you while you check out."), h("button", { key: '71c90ad945ced314321d964795beed8301c989ac', class: "primary-btn", onClick: this.goCheckout }, "Go to checkout"), h("button", { key: 'b37ad6f8adeb1edb7c786b33974b845c31b963f2', class: "ghost-btn", onClick: this.close }, "Keep browsing"))))), h("div", { key: '5a175094620f6837ae91a5a394f16c79df94c859', class: "powered-by" }, h("div", { key: '63c095dc7e954042c5fb36ccd8ca92a33d7b6632', class: "pb-links" }, h("a", { key: '875fa14d6218853b96d4d817a243701b228b20f0', href: "https://ticketlayer.com/privacy", target: "_blank", rel: "noopener noreferrer" }, "Privacy Policy"), h("a", { key: '7de77189ecd8277acade45437819b4fa9ef2002b', href: "https://ticketlayer.com/report-abuse", target: "_blank", rel: "noopener noreferrer" }, "Report Abuse")), h("a", { key: '5f62bbe303398e9ad09703fbd706953502f441a1', class: "pb-brand", href: "https://ticketlayer.com", target: "_blank", rel: "noopener noreferrer" }, h("span", { key: '0101948057126320d180a452870eade9f540b119', class: "pb-pre" }, "Powered by"), h("svg", { key: 'c93e4184b3bd8bbb89b5909ec886b22d22322bb1', width: "14", height: "14", viewBox: "0 0 50 50", fill: "none", "aria-hidden": "true" }, h("g", { key: '5461e514631e1cb670e974b47ecc144e1a62e7a3', transform: "matrix(0.0129 0 0 -0.0129 25.4752 25.4752)" }, h("path", { key: 'af6f137d33f09ef4befb9a4b31834d6d2f04ab3d', fill: "currentColor", transform: "translate(-1781.5, -1759.4003)", d: "M 41 2973 c 1 -285 5 -734 9 -998 c 7 -444 9 -488 30 -580 c 81 -364 235 -634 512 -900 c 135 -130 263 -220 423 -299 c 156 -77 249 -109 409 -143 c 110 -23 142 -25 354 -24 c 230 1 310 8 427 37 c 241 60 453 162 640 309 c 82 64 252 234 317 315 c 210 264 340 604 355 926 l 6 121 l -69 6 c -86 8 -706 9 -755 1 l -36 -6 l -21 -125 c -34 -191 -98 -317 -236 -462 c -111 -115 -249 -198 -396 -238 c -98 -27 -356 -24 -463 5 c -100 27 -183 69 -273 137 c -226 173 -353 409 -354 660 c 0 44 -5 120 -10 169 c -6 49 -8 91 -6 94 c 3 3 65 -22 138 -55 c 140 -64 251 -103 358 -127 c 71 -17 295 -46 347 -46 l 33 0 l 0 434 l 0 434 l -67 7 c -147 14 -269 56 -393 133 c -222 139 -378 393 -397 648 l -6 71 l -75 7 c -41 3 -239 6 -439 6 l -363 0 l 1 -517 z" }))), h("span", { key: 'd4f15a3fb911e2f78eb203fdd5079d3119ee9803', class: "pb-word" }, "ticketlayer"))))));
133
133
  }
134
134
  static get is() { return "tl-buy-modal"; }
135
135
  static get encapsulation() { return "shadow"; }