@getmicdrop/venue-calendar 4.0.61 → 4.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CarouselView.legacy-CeF35JD5.js → CarouselView.legacy-B4dmOmg6.js} +3 -3
- package/dist/{CarouselView.legacy-CeF35JD5.js.map → CarouselView.legacy-B4dmOmg6.js.map} +1 -1
- package/dist/{CartView-DFikzyl0.js → CartView-kqUZBGpU.js} +3 -3
- package/dist/{CartView-DFikzyl0.js.map → CartView-kqUZBGpU.js.map} +1 -1
- package/dist/{Checkout-De-WQX6X.js → Checkout-C0x-bS6h.js} +112 -90
- package/dist/{Checkout-De-WQX6X.js.map → Checkout-C0x-bS6h.js.map} +1 -1
- package/dist/{Checkout-E6KkN6VD.js → Checkout-DConUsDx.js} +5 -5
- package/dist/{Checkout-E6KkN6VD.js.map → Checkout-DConUsDx.js.map} +1 -1
- package/dist/{Checkout.legacy-n_GNBUZa.js → Checkout.legacy-R-EhfHV-.js} +4 -4
- package/dist/{Checkout.legacy-n_GNBUZa.js.map → Checkout.legacy-R-EhfHV-.js.map} +1 -1
- package/dist/{CheckoutTimer-AoMKJYOB.js → CheckoutTimer-B7ilb5yz.js} +2 -2
- package/dist/{CheckoutTimer-AoMKJYOB.js.map → CheckoutTimer-B7ilb5yz.js.map} +1 -1
- package/dist/{CollectionView-D8oJEVNN.js → CollectionView-Chx2gZi9.js} +5 -5
- package/dist/{CollectionView-D8oJEVNN.js.map → CollectionView-Chx2gZi9.js.map} +1 -1
- package/dist/{CollectionView.legacy-CAN2aOFr.js → CollectionView.legacy-Bz7MZc_d.js} +3 -3
- package/dist/{CollectionView.legacy-CAN2aOFr.js.map → CollectionView.legacy-Bz7MZc_d.js.map} +1 -1
- package/dist/{Event-AXym3kXQ.js → Event-Rr8PlUUQ.js} +4 -4
- package/dist/{Event-AXym3kXQ.js.map → Event-Rr8PlUUQ.js.map} +1 -1
- package/dist/{EventDetailsView-D9Amh6se.js → EventDetailsView-V9ot4_05.js} +5 -5
- package/dist/{EventDetailsView-D9Amh6se.js.map → EventDetailsView-V9ot4_05.js.map} +1 -1
- package/dist/{FeaturedView.legacy-V0vZQajE.js → FeaturedView.legacy-sPdXFbtd.js} +2 -2
- package/dist/{FeaturedView.legacy-V0vZQajE.js.map → FeaturedView.legacy-sPdXFbtd.js.map} +1 -1
- package/dist/{GalleryCard-CgqrGk7u.js → GalleryCard-Cg746_4p.js} +2 -2
- package/dist/{GalleryCard-CgqrGk7u.js.map → GalleryCard-Cg746_4p.js.map} +1 -1
- package/dist/{GalleryView.legacy-kxopi60e.js → GalleryView.legacy-DwXpqJQk.js} +3 -3
- package/dist/{GalleryView.legacy-kxopi60e.js.map → GalleryView.legacy-DwXpqJQk.js.map} +1 -1
- package/dist/{GroupedListView.legacy-DFrZgftD.js → GroupedListView.legacy-Cvlohg0H.js} +2 -2
- package/dist/{GroupedListView.legacy-DFrZgftD.js.map → GroupedListView.legacy-Cvlohg0H.js.map} +1 -1
- package/dist/OrderSummary-DSFp-LYT.js +496 -0
- package/dist/{OrderSummary-Cl9lu9bR.js.map → OrderSummary-DSFp-LYT.js.map} +1 -1
- package/dist/{PromoCodeInput-DnAj8tsg.js → PromoCodeInput-Z96Jxbqq.js} +122 -122
- package/dist/PromoCodeInput-Z96Jxbqq.js.map +1 -0
- package/dist/{SeriesPage-DpYYp3Us.js → SeriesPage-OSFghrKu.js} +5 -5
- package/dist/{SeriesPage-DpYYp3Us.js.map → SeriesPage-OSFghrKu.js.map} +1 -1
- package/dist/{SeriesPage.legacy-C1Lv0A5H.js → SeriesPage.legacy-DmnH3x5t.js} +2 -2
- package/dist/{SeriesPage.legacy-C1Lv0A5H.js.map → SeriesPage.legacy-DmnH3x5t.js.map} +1 -1
- package/dist/{Success-DG12w5iQ.js → Success-CaCG95BV.js} +6 -6
- package/dist/{Success-DG12w5iQ.js.map → Success-CaCG95BV.js.map} +1 -1
- package/dist/{Success.legacy-DgtN2cHi.js → Success.legacy-DqyTto5K.js} +2 -2
- package/dist/{Success.legacy-DgtN2cHi.js.map → Success.legacy-DqyTto5K.js.map} +1 -1
- package/dist/{VenueCalendar-B4jzaQR8.js → VenueCalendar-D8NsQUaM.js} +14 -14
- package/dist/{VenueCalendar-B4jzaQR8.js.map → VenueCalendar-D8NsQUaM.js.map} +1 -1
- package/dist/{ViewTicketsEmbed-B5aglpCR.js → ViewTicketsEmbed-DUMSBTMV.js} +2 -2
- package/dist/{ViewTicketsEmbed-B5aglpCR.js.map → ViewTicketsEmbed-DUMSBTMV.js.map} +1 -1
- package/dist/{data-toggle-store.svelte-6-mhqMfU.js → data-toggle-store.svelte-CFExWcyA.js} +2 -2
- package/dist/{data-toggle-store.svelte-6-mhqMfU.js.map → data-toggle-store.svelte-CFExWcyA.js.map} +1 -1
- package/dist/{transform-D7SaOYFK.js → transform-XHY0K9GS.js} +2 -2
- package/dist/{transform-D7SaOYFK.js.map → transform-XHY0K9GS.js.map} +1 -1
- package/dist/venue-calendar.es.js +1 -1
- package/dist/venue-calendar.iife.js +32 -32
- package/dist/venue-calendar.iife.js.map +1 -1
- package/dist/venue-calendar.umd.js +29 -29
- package/dist/venue-calendar.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/OrderSummary-Cl9lu9bR.js +0 -466
- package/dist/PromoCodeInput-DnAj8tsg.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,466 +0,0 @@
|
|
|
1
|
-
import "svelte/internal/disclose-version";
|
|
2
|
-
import * as e from "svelte/internal/client";
|
|
3
|
-
import { ae as H, at as k, Q as M, f as R } from "./VenueCalendar-B4jzaQR8.js";
|
|
4
|
-
import { T as x } from "./Text-CXR2fhx6.js";
|
|
5
|
-
import "svelte/transition";
|
|
6
|
-
import "svelte/easing";
|
|
7
|
-
function F(t) {
|
|
8
|
-
if (!t || !(t.isHidden === !0 || typeof t.visibility == "number" && t.visibility >= 2) || t.salesChannel === 2) return !1;
|
|
9
|
-
const n = /* @__PURE__ */ new Date(), i = t.salesBegin || t.salesStart || t.saleBegin || t.onSaleStart, d = t.salesEnd || t.saleEnd || t.onSaleEnd;
|
|
10
|
-
if (i && new Date(i) > n || d && new Date(d) < n) return !1;
|
|
11
|
-
const _ = t.remainingCapacity ?? t.quantityRemaining ?? t.quantity;
|
|
12
|
-
return !(t.soldOut || _ != null && _ <= 0);
|
|
13
|
-
}
|
|
14
|
-
function N(t, s, n = {}) {
|
|
15
|
-
const {
|
|
16
|
-
cancelled: i = !1,
|
|
17
|
-
isRegistration: d = !1,
|
|
18
|
-
waitlistEnabled: _ = !1
|
|
19
|
-
} = n, v = /* @__PURE__ */ new Date();
|
|
20
|
-
if (i)
|
|
21
|
-
return { text: "Cancelled", disabled: !0, reason: "cancelled" };
|
|
22
|
-
const o = t.endDateTime || t.startDateTime;
|
|
23
|
-
if (o && new Date(o) < v)
|
|
24
|
-
return { text: "Sales ended", disabled: !0, reason: "event_past" };
|
|
25
|
-
const C = t?.hasPurchasableHiddenTickets === !0 || Array.isArray(s) && s.some(F), c = (s || []).filter(
|
|
26
|
-
(r) => r.salesChannel !== 2 && !r.isHidden && !(typeof r.visibility == "number" && r.visibility >= 2)
|
|
27
|
-
);
|
|
28
|
-
if (c.length === 0)
|
|
29
|
-
return C ? {
|
|
30
|
-
text: d ? "Reserve a spot" : "Get tickets",
|
|
31
|
-
disabled: !1,
|
|
32
|
-
reason: "hidden_only"
|
|
33
|
-
} : {
|
|
34
|
-
text: "No tickets available",
|
|
35
|
-
disabled: !0,
|
|
36
|
-
reason: "no_tickets"
|
|
37
|
-
};
|
|
38
|
-
let y = !1, E = !0, P = !0, p = null;
|
|
39
|
-
for (const r of c) {
|
|
40
|
-
const g = r.salesBegin || r.salesStart || r.saleBegin || r.onSaleStart, S = r.salesEnd || r.saleEnd || r.onSaleEnd, h = r.remainingCapacity ?? r.quantityRemaining ?? r.quantity, $ = r.soldOut || h != null && h <= 0, b = g ? new Date(g) > v : !1, O = S ? new Date(S) < v : !1;
|
|
41
|
-
if (!$ && !b && !O && (y = !0), $ || (E = !1), b || (P = !1), b && g && !$ && !O) {
|
|
42
|
-
const z = new Date(g);
|
|
43
|
-
(!p || z < p) && (p = z);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (y)
|
|
47
|
-
return {
|
|
48
|
-
text: d ? "Reserve a spot" : "Get tickets",
|
|
49
|
-
disabled: !1,
|
|
50
|
-
reason: "available"
|
|
51
|
-
};
|
|
52
|
-
if (P && p) {
|
|
53
|
-
if (C)
|
|
54
|
-
return {
|
|
55
|
-
text: d ? "Reserve a spot" : "Get tickets",
|
|
56
|
-
disabled: !1,
|
|
57
|
-
reason: "hidden_only"
|
|
58
|
-
};
|
|
59
|
-
const r = p.getTime() - v.getTime(), g = r / (1e3 * 60 * 60), S = r / (1e3 * 60 * 60 * 24);
|
|
60
|
-
let h;
|
|
61
|
-
if (g < 24)
|
|
62
|
-
h = H(p, { hour12: !0 }, "en-US");
|
|
63
|
-
else if (S <= 7)
|
|
64
|
-
h = k(
|
|
65
|
-
p,
|
|
66
|
-
{ weekday: "short", hour: "numeric", minute: "2-digit", hour12: !0 },
|
|
67
|
-
"en-US"
|
|
68
|
-
);
|
|
69
|
-
else {
|
|
70
|
-
const $ = k(
|
|
71
|
-
p,
|
|
72
|
-
{ month: "short", day: "numeric" },
|
|
73
|
-
"en-US"
|
|
74
|
-
), b = H(p, { hour12: !0 }, "en-US");
|
|
75
|
-
h = `${$} ${b}`;
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
text: `On sale ${h}`,
|
|
79
|
-
disabled: !0,
|
|
80
|
-
reason: "coming_soon"
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
return E ? C ? {
|
|
84
|
-
text: d ? "Reserve a spot" : "Get tickets",
|
|
85
|
-
disabled: !1,
|
|
86
|
-
reason: "hidden_only"
|
|
87
|
-
} : _ ? {
|
|
88
|
-
text: "Join Waitlist",
|
|
89
|
-
disabled: !1,
|
|
90
|
-
reason: "sold_out_waitlist"
|
|
91
|
-
} : { text: "Sold out", disabled: !0, reason: "sold_out" } : C ? {
|
|
92
|
-
text: d ? "Reserve a spot" : "Get tickets",
|
|
93
|
-
disabled: !1,
|
|
94
|
-
reason: "hidden_only"
|
|
95
|
-
} : { text: "Sales ended", disabled: !0, reason: "sales_ended" };
|
|
96
|
-
}
|
|
97
|
-
const U = {
|
|
98
|
-
URGENT: 0.1,
|
|
99
|
-
// ≤10% remaining → urgent ("Only X left")
|
|
100
|
-
LOW: 0.2,
|
|
101
|
-
// ≤20% remaining (80%+ sold) → "Selling fast"
|
|
102
|
-
MAX_EXACT_COUNT: 20
|
|
103
|
-
// Don't show exact count above 20
|
|
104
|
-
};
|
|
105
|
-
function te(t, s) {
|
|
106
|
-
if (s === 0) return "none";
|
|
107
|
-
if (t <= 0) return "sold_out";
|
|
108
|
-
const n = t / s;
|
|
109
|
-
return n <= U.URGENT ? "urgent" : n <= U.LOW ? "low" : "none";
|
|
110
|
-
}
|
|
111
|
-
function se(t, s, n, i) {
|
|
112
|
-
return t === "none" ? null : t === "sold_out" ? "Sold out" : t === "urgent" && n !== "browse" && s <= U.MAX_EXACT_COUNT ? `Only ${s} left` : t === "low" || t === "urgent" ? "Selling fast" : null;
|
|
113
|
-
}
|
|
114
|
-
function ae(t) {
|
|
115
|
-
const s = t.tickets.map((i) => ({
|
|
116
|
-
salesBegin: i.salesStartDate,
|
|
117
|
-
salesEnd: i.salesEndDate,
|
|
118
|
-
remainingCapacity: i.quantityAvailable,
|
|
119
|
-
totalCapacity: i.quantityTotal,
|
|
120
|
-
soldOut: i.status === "sold_out",
|
|
121
|
-
salesChannel: 1,
|
|
122
|
-
// All our tickets are online (not "at the door only")
|
|
123
|
-
isHidden: i.isHidden
|
|
124
|
-
}));
|
|
125
|
-
if (t.status === "cancelled")
|
|
126
|
-
return {
|
|
127
|
-
text: "Cancelled",
|
|
128
|
-
disabled: !0,
|
|
129
|
-
reason: "This event has been cancelled"
|
|
130
|
-
};
|
|
131
|
-
if (t.status === "past")
|
|
132
|
-
return {
|
|
133
|
-
text: "Event ended",
|
|
134
|
-
disabled: !0,
|
|
135
|
-
reason: "This event has ended"
|
|
136
|
-
};
|
|
137
|
-
const n = N(
|
|
138
|
-
{ startDateTime: t.startDateTime, endDateTime: t.endDateTime },
|
|
139
|
-
s,
|
|
140
|
-
{
|
|
141
|
-
cancelled: !1,
|
|
142
|
-
isRegistration: t.isRegistrationEvent,
|
|
143
|
-
waitlistEnabled: !1
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
return {
|
|
147
|
-
text: n.text,
|
|
148
|
-
disabled: n.disabled,
|
|
149
|
-
reason: n.disabled ? j(n.reason) : void 0
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
function j(t) {
|
|
153
|
-
if (t)
|
|
154
|
-
switch (t) {
|
|
155
|
-
case "cancelled":
|
|
156
|
-
return "This event has been cancelled.";
|
|
157
|
-
case "event_past":
|
|
158
|
-
return "This event has already happened.";
|
|
159
|
-
case "no_tickets":
|
|
160
|
-
return "There are no tickets configured for this event.";
|
|
161
|
-
case "coming_soon":
|
|
162
|
-
return;
|
|
163
|
-
// text already shows "On sale <date>"
|
|
164
|
-
case "sold_out":
|
|
165
|
-
return;
|
|
166
|
-
// text already shows "Sold out"
|
|
167
|
-
case "sold_out_waitlist":
|
|
168
|
-
return "All tickets are claimed. Join the waitlist to be notified.";
|
|
169
|
-
case "sales_ended":
|
|
170
|
-
return;
|
|
171
|
-
// text already shows "Sales ended"
|
|
172
|
-
default:
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
function ne(t) {
|
|
177
|
-
const s = t.tickets.filter(
|
|
178
|
-
(o) => o.status === "on_sale" && !o.isHidden
|
|
179
|
-
);
|
|
180
|
-
if (s.length === 0) return null;
|
|
181
|
-
const n = s.some(
|
|
182
|
-
(o) => o.isDonation || o.ticketType === 2
|
|
183
|
-
), i = s.filter(
|
|
184
|
-
(o) => !o.isDonation && o.ticketType !== 2
|
|
185
|
-
), d = i.some((o) => o.price === 0), _ = i.filter((o) => o.price > 0);
|
|
186
|
-
if (_.length === 0 && !d && n) return "Donation";
|
|
187
|
-
if (_.length === 0 && d) return null;
|
|
188
|
-
const v = Math.min(..._.map((o) => o.price));
|
|
189
|
-
return d ? null : n ? `From $${v}` : _.length === 1 ? `$${v}` : `From $${v}`;
|
|
190
|
-
}
|
|
191
|
-
function re(t, s) {
|
|
192
|
-
return M(t * (s / 100));
|
|
193
|
-
}
|
|
194
|
-
const q = {
|
|
195
|
-
normal: 300
|
|
196
|
-
};
|
|
197
|
-
function ie(t) {
|
|
198
|
-
if (!t) return "";
|
|
199
|
-
const s = new Date(t), n = /* @__PURE__ */ new Date(), i = s.getTime() - n.getTime(), d = Math.round(i / (1e3 * 60)), _ = i / (1e3 * 60 * 60);
|
|
200
|
-
if (d > 0 && d < 60) {
|
|
201
|
-
const c = Math.max(1, d);
|
|
202
|
-
return `in ${c} minute${c !== 1 ? "s" : ""}`;
|
|
203
|
-
}
|
|
204
|
-
if (_ > 0 && _ < 24) {
|
|
205
|
-
const c = Math.max(1, Math.round(_));
|
|
206
|
-
return `in ${c} hour${c !== 1 ? "s" : ""}`;
|
|
207
|
-
}
|
|
208
|
-
const v = new Date(n);
|
|
209
|
-
if (v.setDate(v.getDate() + 1), s.toDateString() === v.toDateString())
|
|
210
|
-
return `tomorrow at ${H(
|
|
211
|
-
s,
|
|
212
|
-
{ hour: "numeric", minute: "2-digit" },
|
|
213
|
-
"en-US"
|
|
214
|
-
)}`;
|
|
215
|
-
const o = i / (1e3 * 60 * 60 * 24);
|
|
216
|
-
if (o > 0 && o <= 7) {
|
|
217
|
-
const c = new Intl.DateTimeFormat("en-US", {
|
|
218
|
-
weekday: "long"
|
|
219
|
-
}).format(s), y = H(
|
|
220
|
-
s,
|
|
221
|
-
{ hour: "numeric", minute: "2-digit" },
|
|
222
|
-
"en-US"
|
|
223
|
-
);
|
|
224
|
-
return `on ${c} at ${y}`;
|
|
225
|
-
}
|
|
226
|
-
return `on ${new Intl.DateTimeFormat("en-US", {
|
|
227
|
-
month: "short",
|
|
228
|
-
day: "numeric"
|
|
229
|
-
}).format(s)}`;
|
|
230
|
-
}
|
|
231
|
-
function oe() {
|
|
232
|
-
return {
|
|
233
|
-
code: "",
|
|
234
|
-
isApplied: !1,
|
|
235
|
-
isValidating: !1,
|
|
236
|
-
error: "",
|
|
237
|
-
hint: "",
|
|
238
|
-
discountAmount: 0,
|
|
239
|
-
discountType: "",
|
|
240
|
-
discountTicketIds: [],
|
|
241
|
-
revealHiddenTickets: !1,
|
|
242
|
-
revealTicketIds: []
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
var B = e.from_html('<div class="flex justify-between"><!> <!></div>'), G = e.from_html('<div class="flex justify-between pt-1 border-t border-default"><!> <!></div>'), I = e.from_html('<div class="flex justify-between"><!> <!></div>'), L = e.from_html('<div class="flex justify-between"><!> <!></div>'), X = e.from_html('<div class="flex justify-between"><!> <!></div>'), W = e.from_html('<div class="flex justify-between"><!> <!></div>'), J = e.from_html('<!> <!> <!> <!> <div class="flex justify-between pt-2 border-t border-default"><!> <!></div>', 1), Q = e.from_html('<div class="space-y-2"><!> <!></div>');
|
|
246
|
-
function le(t, s) {
|
|
247
|
-
e.push(s, !0);
|
|
248
|
-
let n = e.prop(s, "labels", 19, () => ({})), i = e.prop(s, "mode", 3, "full");
|
|
249
|
-
var d = Q(), _ = e.child(d);
|
|
250
|
-
{
|
|
251
|
-
var v = (c) => {
|
|
252
|
-
var y = e.comment(), E = e.first_child(y);
|
|
253
|
-
e.each(E, 17, () => s.orderTotals.lines, (P) => P.ticketId, (P, p) => {
|
|
254
|
-
var r = B(), g = e.child(r);
|
|
255
|
-
x(g, {
|
|
256
|
-
size: "sm",
|
|
257
|
-
children: (h, $) => {
|
|
258
|
-
e.next();
|
|
259
|
-
var b = e.text();
|
|
260
|
-
e.template_effect(() => e.set_text(b, `${e.get(p).quantity ?? ""}x ${e.get(p).ticketName ?? ""}`)), e.append(h, b);
|
|
261
|
-
},
|
|
262
|
-
$$slots: { default: !0 }
|
|
263
|
-
});
|
|
264
|
-
var S = e.sibling(g, 2);
|
|
265
|
-
x(S, {
|
|
266
|
-
size: "sm",
|
|
267
|
-
children: (h, $) => {
|
|
268
|
-
e.next();
|
|
269
|
-
var b = e.text();
|
|
270
|
-
e.template_effect((O) => e.set_text(b, O), [() => R(e.get(p).subtotal)]), e.append(h, b);
|
|
271
|
-
},
|
|
272
|
-
$$slots: { default: !0 }
|
|
273
|
-
}), e.reset(r), e.append(P, r);
|
|
274
|
-
}), e.append(c, y);
|
|
275
|
-
};
|
|
276
|
-
e.if(_, (c) => {
|
|
277
|
-
i() !== "totals" && c(v);
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
var o = e.sibling(_, 2);
|
|
281
|
-
{
|
|
282
|
-
var C = (c) => {
|
|
283
|
-
var y = J(), E = e.first_child(y);
|
|
284
|
-
{
|
|
285
|
-
var P = (l) => {
|
|
286
|
-
var u = G(), f = e.child(u);
|
|
287
|
-
x(f, {
|
|
288
|
-
size: "sm",
|
|
289
|
-
color: "muted",
|
|
290
|
-
children: (m, D) => {
|
|
291
|
-
e.next();
|
|
292
|
-
var a = e.text();
|
|
293
|
-
e.template_effect(() => e.set_text(a, n().subtotal || "Subtotal")), e.append(m, a);
|
|
294
|
-
},
|
|
295
|
-
$$slots: { default: !0 }
|
|
296
|
-
});
|
|
297
|
-
var T = e.sibling(f, 2);
|
|
298
|
-
x(T, {
|
|
299
|
-
size: "sm",
|
|
300
|
-
color: "muted",
|
|
301
|
-
children: (m, D) => {
|
|
302
|
-
e.next();
|
|
303
|
-
var a = e.text();
|
|
304
|
-
e.template_effect((w) => e.set_text(a, w), [() => R(s.orderTotals.subtotal)]), e.append(m, a);
|
|
305
|
-
},
|
|
306
|
-
$$slots: { default: !0 }
|
|
307
|
-
}), e.reset(u), e.append(l, u);
|
|
308
|
-
}, p = (l) => {
|
|
309
|
-
var u = I(), f = e.child(u);
|
|
310
|
-
x(f, {
|
|
311
|
-
size: "sm",
|
|
312
|
-
color: "muted",
|
|
313
|
-
children: (m, D) => {
|
|
314
|
-
e.next();
|
|
315
|
-
var a = e.text();
|
|
316
|
-
e.template_effect(() => e.set_text(a, n().subtotal || "Subtotal")), e.append(m, a);
|
|
317
|
-
},
|
|
318
|
-
$$slots: { default: !0 }
|
|
319
|
-
});
|
|
320
|
-
var T = e.sibling(f, 2);
|
|
321
|
-
x(T, {
|
|
322
|
-
size: "sm",
|
|
323
|
-
color: "muted",
|
|
324
|
-
children: (m, D) => {
|
|
325
|
-
e.next();
|
|
326
|
-
var a = e.text();
|
|
327
|
-
e.template_effect((w) => e.set_text(a, w), [() => R(s.orderTotals.subtotal)]), e.append(m, a);
|
|
328
|
-
},
|
|
329
|
-
$$slots: { default: !0 }
|
|
330
|
-
}), e.reset(u), e.append(l, u);
|
|
331
|
-
};
|
|
332
|
-
e.if(E, (l) => {
|
|
333
|
-
i() === "full" && s.orderTotals.lines.length > 1 ? l(P) : s.orderTotals.lines.length > 1 && l(p, 1);
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
var r = e.sibling(E, 2);
|
|
337
|
-
{
|
|
338
|
-
var g = (l) => {
|
|
339
|
-
var u = L(), f = e.child(u);
|
|
340
|
-
x(f, {
|
|
341
|
-
size: "sm",
|
|
342
|
-
color: "muted",
|
|
343
|
-
children: (m, D) => {
|
|
344
|
-
e.next();
|
|
345
|
-
var a = e.text();
|
|
346
|
-
e.template_effect(() => e.set_text(a, n().serviceFees || "Service fees")), e.append(m, a);
|
|
347
|
-
},
|
|
348
|
-
$$slots: { default: !0 }
|
|
349
|
-
});
|
|
350
|
-
var T = e.sibling(f, 2);
|
|
351
|
-
x(T, {
|
|
352
|
-
size: "sm",
|
|
353
|
-
color: "muted",
|
|
354
|
-
children: (m, D) => {
|
|
355
|
-
e.next();
|
|
356
|
-
var a = e.text();
|
|
357
|
-
e.template_effect((w) => e.set_text(a, w), [() => R(s.orderTotals.fees)]), e.append(m, a);
|
|
358
|
-
},
|
|
359
|
-
$$slots: { default: !0 }
|
|
360
|
-
}), e.reset(u), e.append(l, u);
|
|
361
|
-
};
|
|
362
|
-
e.if(r, (l) => {
|
|
363
|
-
s.orderTotals.fees > 0 && l(g);
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
var S = e.sibling(r, 2);
|
|
367
|
-
{
|
|
368
|
-
var h = (l) => {
|
|
369
|
-
var u = X(), f = e.child(u);
|
|
370
|
-
x(f, {
|
|
371
|
-
size: "sm",
|
|
372
|
-
color: "muted",
|
|
373
|
-
children: (m, D) => {
|
|
374
|
-
e.next();
|
|
375
|
-
var a = e.text();
|
|
376
|
-
e.template_effect(() => e.set_text(a, n().taxes || "Taxes")), e.append(m, a);
|
|
377
|
-
},
|
|
378
|
-
$$slots: { default: !0 }
|
|
379
|
-
});
|
|
380
|
-
var T = e.sibling(f, 2);
|
|
381
|
-
x(T, {
|
|
382
|
-
size: "sm",
|
|
383
|
-
color: "muted",
|
|
384
|
-
children: (m, D) => {
|
|
385
|
-
e.next();
|
|
386
|
-
var a = e.text();
|
|
387
|
-
e.template_effect((w) => e.set_text(a, w), [() => R(s.orderTotals.taxes)]), e.append(m, a);
|
|
388
|
-
},
|
|
389
|
-
$$slots: { default: !0 }
|
|
390
|
-
}), e.reset(u), e.append(l, u);
|
|
391
|
-
};
|
|
392
|
-
e.if(S, (l) => {
|
|
393
|
-
s.orderTotals.taxes > 0 && l(h);
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
var $ = e.sibling(S, 2);
|
|
397
|
-
{
|
|
398
|
-
var b = (l) => {
|
|
399
|
-
var u = W(), f = e.child(u);
|
|
400
|
-
x(f, {
|
|
401
|
-
size: "sm",
|
|
402
|
-
color: "success",
|
|
403
|
-
children: (m, D) => {
|
|
404
|
-
e.next();
|
|
405
|
-
var a = e.text();
|
|
406
|
-
e.template_effect(() => e.set_text(a, n().promoDiscount || "Promo discount")), e.append(m, a);
|
|
407
|
-
},
|
|
408
|
-
$$slots: { default: !0 }
|
|
409
|
-
});
|
|
410
|
-
var T = e.sibling(f, 2);
|
|
411
|
-
x(T, {
|
|
412
|
-
size: "sm",
|
|
413
|
-
color: "success",
|
|
414
|
-
children: (m, D) => {
|
|
415
|
-
e.next();
|
|
416
|
-
var a = e.text();
|
|
417
|
-
e.template_effect((w) => e.set_text(a, `-${w ?? ""}`), [() => R(s.orderTotals.promoDiscount)]), e.append(m, a);
|
|
418
|
-
},
|
|
419
|
-
$$slots: { default: !0 }
|
|
420
|
-
}), e.reset(u), e.append(l, u);
|
|
421
|
-
};
|
|
422
|
-
e.if($, (l) => {
|
|
423
|
-
s.orderTotals.promoDiscount > 0 && l(b);
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
var O = e.sibling($, 2), A = e.child(O);
|
|
427
|
-
x(A, {
|
|
428
|
-
size: "base",
|
|
429
|
-
class: "font-semibold",
|
|
430
|
-
children: (l, u) => {
|
|
431
|
-
e.next();
|
|
432
|
-
var f = e.text();
|
|
433
|
-
e.template_effect(() => e.set_text(f, n().total || "Total")), e.append(l, f);
|
|
434
|
-
},
|
|
435
|
-
$$slots: { default: !0 }
|
|
436
|
-
});
|
|
437
|
-
var z = e.sibling(A, 2);
|
|
438
|
-
x(z, {
|
|
439
|
-
size: "base",
|
|
440
|
-
class: "font-semibold",
|
|
441
|
-
children: (l, u) => {
|
|
442
|
-
e.next();
|
|
443
|
-
var f = e.text();
|
|
444
|
-
e.template_effect((T) => e.set_text(f, T), [() => R(s.orderTotals.total)]), e.append(l, f);
|
|
445
|
-
},
|
|
446
|
-
$$slots: { default: !0 }
|
|
447
|
-
}), e.reset(O), e.append(c, y);
|
|
448
|
-
};
|
|
449
|
-
e.if(o, (c) => {
|
|
450
|
-
i() !== "lines" && c(C);
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
e.reset(d), e.template_effect(() => e.set_style(d, `transition-duration: ${q.normal}ms;`)), e.append(t, d), e.pop();
|
|
454
|
-
}
|
|
455
|
-
export {
|
|
456
|
-
q as D,
|
|
457
|
-
le as O,
|
|
458
|
-
re as a,
|
|
459
|
-
se as b,
|
|
460
|
-
oe as c,
|
|
461
|
-
ae as d,
|
|
462
|
-
ne as e,
|
|
463
|
-
ie as f,
|
|
464
|
-
te as g
|
|
465
|
-
};
|
|
466
|
-
//# sourceMappingURL=OrderSummary-Cl9lu9bR.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PromoCodeInput-DnAj8tsg.js","sources":["../src/lib/utils/haptic.ts","../src/lib/public-calendar-flow/TicketCard.svelte","../src/lib/public-calendar-flow/PromoCodeInput.svelte"],"sourcesContent":["/**\r\n * Haptic feedback helper.\r\n *\r\n * One call site for `navigator.vibrate` so consumers don't repeat the\r\n * SSR + capability check. Android browsers vibrate; iOS Safari silently\r\n * no-ops (Apple deliberate — they reserve haptics for native apps via\r\n * the Taptic Engine, no web API exposed). Future-proof: if Apple ever\r\n * ships a web haptic API, swap the impl here and every consumer gets it.\r\n *\r\n * Styles:\r\n * - 'light' (8ms) — UI tick on small interactions (ticket +/-, tap)\r\n * - 'medium' (18ms) — committed state change (drawer snap, month flip)\r\n * - 'heavy' (32ms) — destructive / important confirmations\r\n */\r\nexport function tick(style: 'light' | 'medium' | 'heavy' = 'light'): void {\r\n\tif (typeof window === 'undefined') return;\r\n\tif (typeof navigator === 'undefined' || !navigator.vibrate) return;\r\n\tconst ms = style === 'light' ? 8 : style === 'medium' ? 18 : 32;\r\n\tnavigator.vibrate(ms);\r\n}\r\n","<script lang=\"ts\">\r\n\timport { Add, Subtract } from 'carbon-icons-svelte';\r\n\timport { Badge, Button, Heading, Input, Text, asTicketId, formatCurrency } from '@getmicdrop/svelte-components';\r\n\timport type { TicketId, USD } from '@getmicdrop/svelte-components';\r\n\timport ScarcityBadge from '../../components/ScarcityBadge.svelte';\r\n\timport { tick } from '$lib/utils/haptic';\r\n\timport type { TicketTypeData, ScarcityLevel } from '$lib/public-calendar-flow/types';\r\n\timport {\r\n\t\tgetScarcityLevel,\r\n\t\tgetScarcityText,\r\n\t\tformatSmartSalesDate,\r\n\t\tDURATION\r\n\t} from '$lib/public-calendar-flow/defaults';\r\n\r\n\tinterface Props {\r\n\t\tticket: TicketTypeData;\r\n\t\tquantity: number;\r\n\t\tonQuantityChange: (ticketId: TicketId, quantity: number) => void;\r\n\t\tdonationAmount?: string;\r\n\t\tonDonationChange?: (ticketId: TicketId, amount: string) => void;\r\n\t\tisRevealedByPromo?: boolean;\r\n\t\tisDiscountedByPromo?: boolean;\r\n\t\tdiscountedPrice?: number | null;\r\n\t\t\tlabels?: Record<string, string>;\r\n\t}\r\n\r\n\tlet {\r\n\t\tticket,\r\n\t\tquantity,\r\n\t\tonQuantityChange,\r\n\t\tdonationAmount = '',\r\n\t\tonDonationChange,\r\n\t\tisRevealedByPromo = false,\r\n\t\tisDiscountedByPromo = false,\r\n\t\tdiscountedPrice = null,\r\n\t\tlabels = {},\r\n\t}: Props = $props();\r\n\r\n\t// --- State detection ---\r\n\tlet isDonation = $derived(ticket.isDonation || ticket.ticketType === 2);\r\n\tlet isSoldOut = $derived(ticket.status === 'sold_out' || ticket.quantityAvailable === 0);\r\n\tlet isComingSoon = $derived(ticket.status === 'coming_soon');\r\n\tlet isSalesEnded = $derived(ticket.status === 'sales_ended');\r\n\tlet isDisabled = $derived(isSoldOut || isComingSoon || isSalesEnded);\r\n\r\n\tlet scarcityLevel: ScarcityLevel = $derived(\r\n\t\tgetScarcityLevel(ticket.quantityAvailable, ticket.quantityTotal)\r\n\t);\r\n\tlet scarcityText = $derived(getScarcityText(scarcityLevel, ticket.quantityAvailable, 'ticket'));\r\n\r\n\t// Donation validation\r\n\tlet donationValue = $derived(parseFloat(donationAmount) || 0);\r\n\tlet donationError = $derived(\r\n\t\tisDonation && donationAmount !== '' && donationValue < 1 ? 'Minimum $1.00' : ''\r\n\t);\r\n\tlet isDonationValid = $derived(!isDonation || (donationAmount !== '' && donationValue >= 1));\r\n\r\n\tlet canDecrement = $derived(quantity > 0);\r\n\tlet canIncrement = $derived(\r\n\t\t!isDisabled &&\r\n\t\tquantity < ticket.maxPerOrder &&\r\n\t\tquantity < ticket.quantityAvailable &&\r\n\t\tisDonationValid\r\n\t);\r\n\r\n\tfunction decrement() {\r\n\t\tif (canDecrement) {\r\n\t\t\t// If decrementing would go below minimum, jump to 0 (remove from cart)\r\n\t\t\tconst newQty = quantity - 1;\r\n\t\t\tonQuantityChange(asTicketId(ticket.id), newQty < ticket.minPerOrder ? 0 : newQty);\r\n\t\t\ttick('light');\r\n\t\t}\r\n\t}\r\n\r\n\tfunction increment() {\r\n\t\tif (canIncrement) {\r\n\t\t\t// If at 0, jump to minimum purchase quantity\r\n\t\t\tconst newQty = quantity === 0 ? ticket.minPerOrder : quantity + 1;\r\n\t\t\tonQuantityChange(asTicketId(ticket.id), newQty);\r\n\t\t\ttick('light');\r\n\t\t}\r\n\t}\r\n\r\n\tlet donationInputValue = $state(donationAmount);\r\n\r\n\t// Sync external donationAmount prop to local state\r\n\t$effect(() => {\r\n\t\tdonationInputValue = donationAmount;\r\n\t});\r\n\r\n\t// Push local changes upstream\r\n\tfunction syncDonation() {\r\n\t\tif (donationInputValue !== donationAmount) {\r\n\t\t\t// eslint-disable-next-line micdrop/boundary-only-as-cast -- API response mapper: ticket.id arrives as raw number from server\r\n\t\tonDonationChange?.(asTicketId(ticket.id), donationInputValue);\r\n\t\t}\r\n\t}\r\n\r\n\t// Price display — show total inclusive of fees (matching production TicketBlock.svelte)\r\n\tlet totalPrice = $derived(isDonation ? 0 : ticket.price + (ticket.price === 0 ? 0 : ticket.fee));\r\n\tlet priceDisplay = $derived(\r\n\t\tisDonation ? '' : ticket.price === 0 ? (labels.free || 'Free') : `{formatCurrency(totalPrice as USD /* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */)}`\r\n\t);\r\n\tlet feeCaption = $derived(\r\n\t\t!isDonation && ticket.fee > 0 && ticket.price > 0 ? `incl. {formatCurrency(ticket.fee as USD /* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */)} ${labels.fee || 'fee'}` : ''\r\n\t);\r\n\r\n\t// Sales start display for coming soon tickets\r\n\tlet salesStartDisplay = $derived(\r\n\t\tisComingSoon && ticket.salesStartDate\r\n\t\t\t? `Sales start ${formatSmartSalesDate(ticket.salesStartDate)}`\r\n\t\t\t: isComingSoon\r\n\t\t\t\t? 'Coming soon'\r\n\t\t\t\t: ''\r\n\t);\r\n</script>\r\n\r\n<article\r\n\tclass=\"ticket-card rounded-lg border p-4 transition-all\"\r\n\tclass:disabled-ticket={isDisabled}\r\n\tclass:revealed={isRevealedByPromo && !isDisabled}\r\n\tstyle=\"transition-duration: {DURATION.normal}ms;\"\r\n>\r\n\t<div class=\"vc-flex-between-start gap-4\">\r\n\t\t<!-- Ticket info -->\r\n\t\t<div class=\"flex-1 min-w-0\">\r\n\t\t\t<div class=\"flex-row-2 flex-wrap\">\r\n\t\t\t\t<Heading level={4} size=\"sm\" weight=\"semibold\">\r\n\t\t\t\t\t{ticket.name}\r\n\t\t\t\t</Heading>\r\n\t\t\t\t{#if isSoldOut}\r\n\t\t\t\t\t<Badge variant=\"error\">{labels.soldOut || 'Sold out'}</Badge>\r\n\t\t\t\t{:else if isSalesEnded}\r\n\t\t\t\t\t<Badge variant=\"neutral\">Sales ended</Badge>\r\n\t\t\t\t{:else if isRevealedByPromo}\r\n\t\t\t\t\t<Badge variant=\"success\">Unlocked</Badge>\r\n\t\t\t\t{:else if isDiscountedByPromo}\r\n\t\t\t\t\t<Badge variant=\"green\">Discount applied</Badge>\r\n\t\t\t\t{:else if scarcityText && !isComingSoon}\r\n\t\t\t\t\t<ScarcityBadge\r\n\t\t\t\t\t\tremaining={ticket.quantityAvailable}\r\n\t\t\t\t\t\ttotal={ticket.quantityTotal}\r\n\t\t\t\t\t\tcontext=\"ticket\"\r\n\t\t\t\t\t/>\r\n\t\t\t\t{/if}\r\n\t\t\t</div>\r\n\r\n\t\t\t{#if ticket.description}\r\n\t\t\t\t<Text size=\"xs\" color=\"muted\" class=\"block mt-1 line-clamp-2\">\r\n\t\t\t\t\t{ticket.description}\r\n\t\t\t\t</Text>\r\n\t\t\t{/if}\r\n\r\n\t\t\t<!-- Price row -->\r\n\t\t\t<div class=\"flex-row-2 mt-2\">\r\n\t\t\t\t{#if isDonation}\r\n\t\t\t\t\t<!-- Donation: $ input -->\r\n\t\t\t\t\t<!-- svelte-ignore a11y_no_static_element_interactions -->\r\n\t\t\t\t\t<div class=\"donation-input-wrapper\" oninput={syncDonation}>\r\n\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\tlabel=\"Donation amount\"\r\n\t\t\t\t\t\t\tsize=\"md\"\r\n\t\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\t\tplaceholder=\"0.00\"\r\n\t\t\t\t\t\t\tbind:value={donationInputValue}\r\n\t\t\t\t\t\t\tdisabled={isDisabled}\r\n\t\t\t\t\t\t\terrorText={donationError}\r\n\t\t\t\t\t\t\tcolor={donationError ? 'red' : 'base'}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t{:else if isDiscountedByPromo && discountedPrice !== null}\r\n\t\t\t\t\t<!-- Discounted: strikethrough original total + discounted total (both inclusive of fee) -->\r\n\t\t\t\t\t{@const discountedTotal = discountedPrice + (discountedPrice === 0 ? 0 : ticket.fee)}\r\n\t\t\t\t\t<span class=\"price-strikethrough\">{formatCurrency(totalPrice as USD /* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */)}</span>\r\n\t\t\t\t\t<span class=\"price-discounted\">{formatCurrency(discountedTotal as USD /* FIXME(canonical-cleanup:toFixed): this cast bypasses the brand boundary; replace with toCents/toUSD at the API-response-transform layer. */)}</span>\r\n\t\t\t\t\t{#if feeCaption}\r\n\t\t\t\t\t\t<span class=\"price-fee\">{feeCaption}</span>\r\n\t\t\t\t\t{/if}\r\n\t\t\t\t{:else if isComingSoon}\r\n\t\t\t\t\t<!-- Coming soon: show price dimmed -->\r\n\t\t\t\t\t<span class=\"price-lg text-color-muted\">{priceDisplay}</span>\r\n\t\t\t\t{:else}\r\n\t\t\t\t\t<!-- Standard price -->\r\n\t\t\t\t\t<span class=\"price-lg text-color-primary\">{priceDisplay}</span>\r\n\t\t\t\t\t{#if feeCaption}\r\n\t\t\t\t\t\t<span class=\"price-fee\">{feeCaption}</span>\r\n\t\t\t\t\t{/if}\r\n\t\t\t\t{/if}\r\n\t\t\t</div>\r\n\r\n\t\t\t<!-- Coming soon / sales ended message -->\r\n\t\t\t{#if salesStartDisplay}\r\n\t\t\t\t<Text size=\"xs\" color=\"muted\" class=\"block mt-1.5\">\r\n\t\t\t\t\t{salesStartDisplay}\r\n\t\t\t\t</Text>\r\n\t\t\t{/if}\r\n\t\t</div>\r\n\r\n\t\t<!-- Quantity controls -->\r\n\t\t<div class=\"flex items-center quantity-selector\">\r\n\t\t\t{#if isSoldOut || isComingSoon || isSalesEnded}\r\n\t\t\t\t<!-- No controls for coming soon / sales ended -->\r\n\t\t\t{:else}\r\n\t\t\t\t<Button\r\n\t\t\t\t\tvariant=\"alternative\"\r\n\t\t\t\t\tsize=\"icon-lg\"\r\n\t\t\t\t\tonclick={decrement}\r\n\t\t\t\t\tdisabled={!canDecrement}\r\n\t\t\t\t\taria-label=\"{labels.decrease || 'Decrease'} {ticket.name} {labels.quantity || 'quantity'}\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<Subtract size={16} />\r\n\t\t\t\t</Button>\r\n\r\n\t\t\t\t<span\r\n\t\t\t\t\tclass=\"qty-display\"\r\n\t\t\t\t\taria-live=\"polite\"\r\n\t\t\t\t\taria-label=\"{ticket.name} {labels.quantity || 'quantity'}: {quantity}\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{quantity}\r\n\t\t\t\t</span>\r\n\r\n\t\t\t\t<Button\r\n\t\t\t\t\tvariant=\"alternative\"\r\n\t\t\t\t\tsize=\"icon-lg\"\r\n\t\t\t\t\tonclick={increment}\r\n\t\t\t\t\tdisabled={!canIncrement}\r\n\t\t\t\t\taria-label=\"{labels.increase || 'Increase'} {ticket.name} {labels.quantity || 'quantity'}\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<Add size={16} />\r\n\t\t\t\t</Button>\r\n\t\t\t{/if}\r\n\t\t</div>\r\n\t</div>\r\n</article>\r\n\r\n<style>\r\n\t/* Card states using HSL CSS variables (matching TicketBlock.svelte) */\r\n\t.ticket-card {\r\n\t\tborder-color: hsl(var(--stroke-secondary, 220 13% 91%));\r\n\t\tbackground-color: hsl(var(--ts-card-bg, var(--bg-primary, 0 0% 100%)));\r\n\t}\r\n\r\n\t.ticket-card.revealed {\r\n\t\tborder-color: hsl(var(--accent-success) / 50%);\r\n\t\tbackground-color: hsl(var(--accent-success) / 8%);\r\n\t}\r\n\r\n\t.ticket-card.disabled-ticket {\r\n\t\topacity: 0.5;\r\n\t}\r\n\r\n\t/* Quantity selector */\r\n\t.quantity-selector {\r\n\t\tgap: 0.5rem;\r\n\t\tuser-select: none;\r\n\t\tuser-select: none;\r\n\t}\r\n\r\n\t.qty-display {\r\n\t\tmin-width: 2rem;\r\n\t\tdisplay: flex;\r\n\t\talign-items: center;\r\n\t\tjustify-content: center;\r\n\t\tfont-size: 1.125rem;\r\n\t\tfont-weight: 600;\r\n\t\tcolor: hsl(var(--text-primary, 222 47% 11%));\r\n\t\tuser-select: none;\r\n\t\tuser-select: none;\r\n\t}\r\n\r\n\t/* Discounted price green text */\r\n\t.price-discounted {\r\n\t\tfont-size: 0.875rem;\r\n\t\tline-height: 1.25rem;\r\n\t\tfont-weight: 600;\r\n\t\tcolor: hsl(var(--accent-success)); /* green-600 */\r\n\t}\r\n\r\n\t/* Donation input wrapper */\r\n\t.donation-input-wrapper {\r\n\t\tmin-width: 10rem;\r\n\t}\r\n\r\n .ticket-card {\r\n &:is([data-theme=\"dark\"], [data-theme=\"dark\"] *) {\r\n\t\tborder-color: hsl(var(--stroke-secondary, 215 19% 35%));\r\n\t\tbackground-color: hsl(var(--ts-card-bg, var(--bg-primary, 222 47% 11%)));\r\n\t }\r\n }\r\n\r\n .ticket-card.revealed {\r\n &:is([data-theme=\"dark\"], [data-theme=\"dark\"] *) {\r\n\t\tborder-color: hsl(var(--accent-success)); /* green-700 */\r\n\t\tbackground-color: hsl(var(--accent-success));\r\n\t }\r\n }\r\n\r\n .qty-display {\r\n &:is([data-theme=\"dark\"], [data-theme=\"dark\"] *) {\r\n\t\tcolor: hsl(var(--text-primary, 0 0% 100%));\r\n\t }\r\n }\r\n</style>\r\n","<script lang=\"ts\">\r\n\timport { Input, Button } from '@getmicdrop/svelte-components';\r\n\timport type { PromoCodeState } from '$lib/public-calendar-flow/types';\r\n\timport { DURATION } from '$lib/public-calendar-flow/defaults';\r\n\r\n\tinterface Props {\r\n\t\tpromoState: PromoCodeState;\r\n\t\tonApply: (code: string) => void;\r\n\t\tonRemove: () => void;\r\n\t\t\tlabels?: Record<string, string>;\r\n\t}\r\n\r\n\tlet { promoState, onApply, onRemove, labels = {}, }: Props = $props();\r\n\r\n\tlet isExpanded = $state(false);\r\n\tlet inputValue = $state('');\r\n\r\n\tfunction handleApply() {\r\n\t\tconst trimmed = inputValue.trim();\r\n\t\tif (!trimmed) return;\r\n\t\tonApply(trimmed);\r\n\t}\r\n\r\n\tfunction handleRemove() {\r\n\t\tinputValue = '';\r\n\t\tonRemove();\r\n\t}\r\n\r\n\tfunction handleKeydown(e: KeyboardEvent) {\r\n\t\tif (e.key === 'Enter') {\r\n\t\t\te.preventDefault();\r\n\t\t\thandleApply();\r\n\t\t}\r\n\t}\r\n\r\n\t// Auto-expand when promo is applied (e.g. on restore)\r\n\tlet shouldExpand = $derived(promoState.isApplied || isExpanded);\r\n</script>\r\n\r\n<div class=\"promo-section\" role=\"group\" aria-labelledby=\"promo-label\">\r\n\t<span id=\"promo-label\" class=\"sr-only\">Promo code entry</span>\r\n\t{#if !shouldExpand}\r\n\t\t<Button variant=\"link\" onclick={() => (isExpanded = true)}>\r\n\t\t\t{labels.havePromoCode || 'Have a promo code?'}\r\n\t\t</Button>\r\n\t{:else}\r\n\t\t<div\r\n\t\t\tclass=\"space-y-2\"\r\n\t\t\tstyle=\"animation: promoSlideIn {DURATION.normal}ms ease-out;\"\r\n\t\t>\r\n\t\t\t<!-- svelte-ignore a11y_no_static_element_interactions -->\r\n\t\t\t<div class=\"promo-input-wrapper\" onkeydown={handleKeydown}>\r\n\t\t\t\t<div class=\"flex-1\">\r\n\t\t\t\t\t<Input\r\n\t\t\t\t\t\tlabel={labels.promoCode || 'Promo code'}\r\n\t\t\t\t\t\tplaceholder={labels.enterCode || 'Enter code'}\r\n\t\t\t\t\t\tsize=\"md\"\r\n\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\tbind:value={inputValue}\r\n\t\t\t\t\t\tdisabled={promoState.isApplied || promoState.isValidating}\r\n\t\t\t\t\t\terrorText={promoState.error || ''}\r\n\t\t\t\t\t\tcolor={promoState.error ? 'red' : 'base'}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t{#if promoState.isApplied}\r\n\t\t\t\t\t<Button variant=\"outline\" onclick={handleRemove} class=\"h-10 self-start mt-5\" aria-label={labels.removePromoCode || 'Remove promo code'}>\r\n\t\t\t\t\t\t{labels.remove || 'Remove'}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t{:else}\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\tonclick={handleApply}\r\n\t\t\t\t\t\tdisabled={promoState.isValidating || !inputValue.trim()}\r\n\t\t\t\t\t\tclass=\"h-10 self-start mt-5\"\r\n\t\t\t\t\t\taria-label={promoState.isValidating ? (labels.checkingPromoCode || 'Checking promo code') : (labels.applyPromoCode || 'Apply promo code')}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{promoState.isValidating ? (labels.checking || 'Checking...') : (labels.apply || 'Apply')}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t{/if}\r\n\t\t\t</div>\r\n\r\n\t\t\t<!-- Success hint -->\r\n\t\t\t{#if promoState.hint}\r\n\t\t\t\t<p class=\"promo-message success body-sm\" role=\"status\" aria-live=\"polite\">\r\n\t\t\t\t\t{promoState.hint}\r\n\t\t\t\t</p>\r\n\t\t\t{/if}\r\n\t\t</div>\r\n\t{/if}\r\n</div>\r\n\r\n<style>\r\n\t.promo-section {\r\n\t\tmargin-top: 1rem;\r\n\t}\r\n\r\n\t.promo-input-wrapper {\r\n\t\tdisplay: flex;\r\n\t\tgap: 0.5rem;\r\n\t\talign-items: flex-start;\r\n\t}\r\n\r\n\t.promo-message {\r\n\t\tmargin-top: 0.5rem;\r\n\t}\r\n\r\n\t.promo-message.success {\r\n\t\tcolor: hsl(var(--accent-success)); /* green-600 */\r\n\t}\r\n\r\n\t@keyframes promoSlideIn {\r\n\t\tfrom {\r\n\t\t\topacity: 0;\r\n\t\t\ttransform: translateY(-4px);\r\n\t\t}\r\n\r\n\t\tto {\r\n\t\t\topacity: 1;\r\n\t\t\ttransform: translateY(0);\r\n\t\t}\r\n\t}\r\n</style>\r\n"],"names":["tick","style","ms","donationAmount","isRevealedByPromo","isDiscountedByPromo","discountedPrice","labels","$","$$props","isDonation","isSoldOut","isComingSoon","isSalesEnded","isDisabled","scarcityLevel","getScarcityLevel","scarcityText","getScarcityText","donationValue","donationError","isDonationValid","canDecrement","canIncrement","decrement","newQty","asTicketId","increment","donationInputValue","syncDonation","totalPrice","priceDisplay","feeCaption","salesStartDisplay","formatSmartSalesDate","article","root","div","div_1","div_2","Heading","node","Badge","$$anchor","ScarcityBadge","$$render","consequent","consequent_1","consequent_3","consequent_4","Text","consequent_5","div_3","node_2","div_4","root_13","Input","node_4","$$value","discountedTotal","span","fragment_9","span_1","span_2","root_15","consequent_7","formatCurrency","span_3","root_16","span_4","fragment_10","span_5","root_18","consequent_10","consequent_9","alternate","consequent_11","div_5","Button","node_9","Subtract","span_6","node_10","Add","consequent_12","alternate_1","classes","DURATION","isExpanded","inputValue","handleApply","trimmed","handleRemove","handleKeydown","e","shouldExpand","root_3","$2","$3","node_1","p","root_8","consequent_2"],"mappings":";;;;;;;;AAcO,SAASA,GAAKC,IAAsC,SAAe;AAEzE,MADI,OAAO,SAAW,OAClB,OAAO,YAAc,OAAe,CAAC,UAAU,QAAS;AAC5D,QAAMC,IAAKD,MAAU,UAAU,IAAIA,MAAU,WAAW,KAAK;AAC7D,YAAU,QAAQC,CAAE;AACrB;;kBCnBA;;AA8BE,MAAAC,mCAAiB,EAAE,GAEnBC,sCAAoB,EAAK,GACzBC,wCAAsB,EAAK,GAC3BC,oCAAkB,IAAI,GACtBC,IAAMC,EAAA,KAAAC,GAAA,UAAA,IAAA,OAAA,CAAA,EAAA,GAIHC,IAAUF,EAAA,QAAA,MAAAC,EAAA,OAAmB,cAAUA,EAAA,OAAW,eAAe,CAAC,GAClEE,6BAA4B,WAAW,cAAUF,EAAA,OAAW,sBAAsB,CAAC,GACnFG,IAAYJ,EAAA,QAAA,MAAAC,EAAA,OAAmB,WAAW,aAAa,GACvDI,IAAYL,EAAA,QAAA,MAAAC,EAAA,OAAmB,WAAW,aAAa,GACvDK,IAAUN,EAAA,QAAA,MAAAA,EAAA,IAAYG,CAAS,KAAAH,EAAA,IAAII,CAAY,WAAIC,CAAY,CAAA,GAE/DE,IAA4BP,EAAA,QAAA,MAC/BQ,GAAgBP,EAAA,OAAQ,4BAA0B,aAAa,CAAA,GAE5DQ,oBAAwBC,GAAeV,EAAA,IAACO,CAAa,GAAAN,EAAA,OAAS,mBAAmB,QAAQ,CAAA,GAGzFU,IAAaX,EAAA,QAAA,MAAY,WAAWL,EAAc,MAAK,CAAC,GACxDiB,IAAaZ,EAAA,QAAA,MAAAA,EAAA,IAChBE,CAAU,KAAIP,EAAc,MAAK,MAAEK,EAA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