@getmicdrop/venue-calendar 4.3.8 → 4.3.9
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/{ArrowLeftIcon-DvIbVly-.js → ArrowLeftIcon-B6RmtBIh.js} +1 -1
- package/dist/{Badge-vsC_L__r.js → Badge-DsuBHDo4.js} +1 -2
- package/dist/{BlockPlaceholder-BMD1gnmE.js → BlockPlaceholder-BvArmbbO.js} +2 -2
- package/dist/{Button-Cm6xkipe.js → Button-CxQO7vwF.js} +88 -63
- package/dist/{Calendar-CPD8dS_i.js → Calendar-Dei3Ahdk.js} +93 -94
- package/dist/{CalendarFoundryView-BY1uJgYA.js → CalendarFoundryView-Df10CTZS.js} +5398 -5389
- package/dist/{CalendarIcon-CCgHZAu4.js → CalendarIcon-DJh5V_U9.js} +1 -1
- package/dist/CartView-DPzvlZwV.js +2245 -0
- package/dist/Checkout-CZGmzTDh.js +983 -0
- package/dist/{Checkout-Ddcw2_8F.js → Checkout-CaamQTXi.js} +368 -368
- package/dist/{CheckoutTimer-CgGCv_jP.js → CheckoutTimer-BubF7ziC.js} +15 -15
- package/dist/{ChevronDownIcon-gELqaIeP.js → ChevronDownIcon-MTzda9yz.js} +1 -1
- package/dist/{ClockIcon-C4MxWMqH.js → ClockIcon-Dit8R1GZ.js} +1 -1
- package/dist/{CloseIcon-D3NjpzeW.js → CloseIcon-XqvbBmiA.js} +1 -1
- package/dist/{CollectionView-C55yLTPR.js → CollectionView-B_rrXaQH.js} +17 -17
- package/dist/CropImage-mVbYhD9Y.js +527 -0
- package/dist/{Event-ClxgC-gP.js → Event-WtVZMQfA.js} +585 -585
- package/dist/{EventPage-ziJYmBIZ.js → EventPage-B14U0-Hm.js} +132 -131
- package/dist/{Heading-D7TEStkb.js → Heading-PKl9dm72.js} +3 -4
- package/dist/{Image-CjM21MQP.js → Image-BWo4QBld.js} +12 -13
- package/dist/{Input-CIRGYHTC.js → Input-Bl1wqeUH.js} +2 -2
- package/dist/{MailIcon-iy7T12Hz.js → MailIcon-DQTusrr4.js} +1 -1
- package/dist/{Modal-wQSo-C1f.js → Modal-CDIhIlu-.js} +2 -2
- package/dist/ModalFooter-DwkZn9ls.js +471 -0
- package/dist/ModalHeader-BSsyLaXY.js +18 -0
- package/dist/{PasswordInput-Cj8i4djG.js → PasswordInput-CnjRiZJ7.js} +2 -2
- package/dist/{ScarcityBadge-DbUVeqpx.js → ScarcityBadge-B4e3Z_Oz.js} +24 -24
- package/dist/{SeriesPage-doki-1XH.js → SeriesPage-DszQMCy9.js} +5 -5
- package/dist/{Spinner-Dua8H4Z1.js → Spinner-BRgBJYJn.js} +2 -2
- package/dist/{Success-DZOYl6St.js → Success-BYVtvNeO.js} +106 -106
- package/dist/{TagIcon-CCyZd0sm.js → TagIcon-BAZxGlbC.js} +1 -1
- package/dist/{ViewTicketsEmbed-CF2Aq-qy.js → ViewTicketsEmbed-BHDAkYuv.js} +97 -97
- package/dist/{WarningCircleIcon-BuVhRrHd.js → WarningCircleIcon-SBK0lpqR.js} +1 -1
- package/dist/{WarningTriIcon-0hefhcdZ.js → WarningTriIcon-Bj3xpe3S.js} +1 -1
- package/dist/{__SKIP_PATHS__-Dyw31EsB.js → __SKIP_PATHS__-B3-kZeYN.js} +1 -1
- package/dist/api/api.cjs +1 -1
- package/dist/api/api.mjs +239 -237
- package/dist/{api-QG8CoGcM.js → api-CTiZ6rza.js} +113 -111
- package/dist/{browser-viCaCwoW.js → browser-CziWLQ0z.js} +1 -1
- package/dist/{constants-q-jR2-bz.js → constants-rFRS1lF-.js} +1 -1
- package/dist/{copyToClipboard-C7KGa7gG.js → copyToClipboard-C5D-wCS_.js} +1 -1
- package/dist/{defaultLabels-BdLGAc3u.js → defaultLabels-CpurXn7c.js} +336 -361
- package/dist/{event-CyPf2sZS.js → event-d06xVg2P.js} +1 -1
- package/dist/{event-transform-DQmD2u_S.js → event-transform-BjPTqPq1.js} +23 -23
- package/dist/{eventStatusStream-BFOvtJyO.js → eventStatusStream-BhQUTdOZ.js} +2 -2
- package/dist/{href-CbfSre4l.js → href-DMLDnIDe.js} +3 -3
- package/dist/{i18n-D54CGXK2.js → i18n--3wPB7-n.js} +2 -2
- package/dist/{i18n-CSftOFAS.js → i18n-CASpRf85.js} +135 -135
- package/dist/imageOptimizer-D8g9XVns.js +141 -0
- package/dist/{labels-0dEJldQX.js → labels-IV_I9087.js} +1 -1
- package/dist/modalManager.svelte-Cz_6x1Qd.js +37 -0
- package/dist/{order-totals-Ci_p6SG6.js → order-totals-Buq9HeZa.js} +33 -33
- package/dist/{orders-Bat2EL64.js → orders-BK47iONR.js} +2 -2
- package/dist/{phoneUtils-Cm9iv40N.js → phoneUtils-YjT5IJ25.js} +1 -1
- package/dist/{pixels-Ha6vOCaS.js → pixels-DjK-0XYz.js} +3 -3
- package/dist/{promo-DWzTN7u9.js → promo-DkM9sLly.js} +1 -1
- package/dist/{serverTotals-BBlkfqMf.js → serverTotals-CvJBYArq.js} +1 -1
- package/dist/{shareCopyFeedback.svelte-CW0Yy9Oz.js → shareCopyFeedback.svelte-oxKGmiOe.js} +65 -65
- package/dist/{showcase-state-options-CxRQ-phi.js → showcase-state-options-x_9iSBsd.js} +1 -1
- package/dist/{to-event-card-props-BIl0qQs0.js → to-event-card-props-9y7sVBi_.js} +49 -49
- package/dist/{utils-ChgG4jiQ.js → utils-D80jLqKH.js} +3 -3
- package/dist/venue-calendar.css +1 -1
- package/dist/venue-calendar.es.js +986 -986
- package/dist/venue-calendar.iife.js +57 -57
- package/dist/venue-calendar.umd.js +52 -52
- package/package.json +2 -2
- package/dist/CartView-DVugxQ3D.js +0 -2245
- package/dist/Checkout-D7KSikhw.js +0 -980
- package/dist/CropImage-CxLcNArr.js +0 -445
- package/dist/ModalFooter-DlRXuHQz.js +0 -301
- package/dist/imageOptimizer-BwLwBMI6.js +0 -112
- package/dist/modalManager.svelte-Dnv5jhxp.js +0 -53
- package/dist/portal-DqxEuE-7.js +0 -166
- /package/dist/locales/{4.3.8 → 4.3.9}/flow/de.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/flow/es.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/flow/fr.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/flow/id.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/flow/it.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/flow/ja.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/flow/ko.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/flow/nl.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/flow/pl.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/flow/pt-br.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/flow/tr.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/flow/zh.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/main/de.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/main/es.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/main/fr.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/main/id.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/main/it.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/main/ja.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/main/ko.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/main/nl.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/main/pl.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/main/pt-br.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/main/tr.js +0 -0
- /package/dist/locales/{4.3.8 → 4.3.9}/main/zh.js +0 -0
|
@@ -0,0 +1,983 @@
|
|
|
1
|
+
import { _ as e, v as t, x as n } from "./Button-CxQO7vwF.js";
|
|
2
|
+
import { n as r, r as i, t as a } from "./CloseIcon-XqvbBmiA.js";
|
|
3
|
+
import { i as o } from "./Input-Bl1wqeUH.js";
|
|
4
|
+
import { C as s, O as c, m as l } from "./constants-rFRS1lF-.js";
|
|
5
|
+
import { t as u } from "./TagIcon-BAZxGlbC.js";
|
|
6
|
+
import { t as d } from "./WarningTriIcon-Bj3xpe3S.js";
|
|
7
|
+
import { d as f, n as p } from "./z-index-BgKs9X9U.js";
|
|
8
|
+
import { i as m, n as h, t as g, y as ee } from "./defaultLabels-CpurXn7c.js";
|
|
9
|
+
import { f as te, i as _, n as v, r as y, s as b, t as x } from "./orders-BK47iONR.js";
|
|
10
|
+
import { n as S, t as C } from "./serverTotals-CvJBYArq.js";
|
|
11
|
+
import { a as w, i as T, n as E, r as D, t as O } from "./ModalFooter-DwkZn9ls.js";
|
|
12
|
+
import { a as k, o as ne, s as A, v as re } from "./api-CTiZ6rza.js";
|
|
13
|
+
import { t as ie } from "./venue-CBos8YTa.js";
|
|
14
|
+
import { t as ae } from "./event-transform-BjPTqPq1.js";
|
|
15
|
+
import { _ as oe, h as se, l as ce, r as j, y as le } from "./utils-D80jLqKH.js";
|
|
16
|
+
import { a as M, n as ue } from "./promo-DkM9sLly.js";
|
|
17
|
+
import { r as de } from "./order-totals-Buq9HeZa.js";
|
|
18
|
+
import fe, { n as N, t as pe } from "./Checkout-CaamQTXi.js";
|
|
19
|
+
import { n as me } from "./buyerEmail-BfCq-gDt.js";
|
|
20
|
+
import "svelte/internal/disclose-version";
|
|
21
|
+
import * as P from "svelte/internal/client";
|
|
22
|
+
import { onMount as he } from "svelte";
|
|
23
|
+
//#region node_modules/@stripe/stripe-js/dist/index.mjs
|
|
24
|
+
function F(e) {
|
|
25
|
+
"@babel/helpers - typeof";
|
|
26
|
+
return F = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
27
|
+
return typeof e;
|
|
28
|
+
} : function(e) {
|
|
29
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
30
|
+
}, F(e);
|
|
31
|
+
}
|
|
32
|
+
var I = "dahlia", ge = function(e) {
|
|
33
|
+
return e === 3 ? "v3" : e;
|
|
34
|
+
}, L = "https://js.stripe.com", R = `${L}/${I}/stripe.js`, z = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, B = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/, V = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", H = function(e) {
|
|
35
|
+
return z.test(e) || B.test(e);
|
|
36
|
+
}, _e = function() {
|
|
37
|
+
for (var e = document.querySelectorAll(`script[src^="${L}"]`), t = 0; t < e.length; t++) {
|
|
38
|
+
var n = e[t];
|
|
39
|
+
if (H(n.src)) return n;
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}, ve = function(e) {
|
|
43
|
+
var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
|
|
44
|
+
n.src = `${R}${t}`;
|
|
45
|
+
var r = document.head || document.body;
|
|
46
|
+
if (!r) throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
47
|
+
return r.appendChild(n), n;
|
|
48
|
+
}, U = function(e, t) {
|
|
49
|
+
!e || !e._registerWrapper || e._registerWrapper({
|
|
50
|
+
name: "stripe-js",
|
|
51
|
+
version: "9.13.0",
|
|
52
|
+
startTime: t
|
|
53
|
+
});
|
|
54
|
+
}, W = null, G = null, K = null, q = function(e) {
|
|
55
|
+
return function(t) {
|
|
56
|
+
e(Error("Failed to load Stripe.js", { cause: t }));
|
|
57
|
+
};
|
|
58
|
+
}, ye = function(e, t) {
|
|
59
|
+
return function() {
|
|
60
|
+
window.Stripe ? e(window.Stripe) : t(/* @__PURE__ */ Error("Stripe.js not available"));
|
|
61
|
+
};
|
|
62
|
+
}, J = function(e) {
|
|
63
|
+
return W === null ? (W = new Promise(function(t, n) {
|
|
64
|
+
if (typeof window > "u" || typeof document > "u") {
|
|
65
|
+
t(null);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (window.Stripe && e && console.warn(V), window.Stripe) {
|
|
69
|
+
t(window.Stripe);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
var r = _e();
|
|
74
|
+
if (r && e) console.warn(V);
|
|
75
|
+
else if (!r) r = ve(e);
|
|
76
|
+
else if (r && K !== null && G !== null) {
|
|
77
|
+
var i;
|
|
78
|
+
r.removeEventListener("load", K), r.removeEventListener("error", G), (i = r.parentNode) == null || i.removeChild(r), r = ve(e);
|
|
79
|
+
}
|
|
80
|
+
K = ye(t, n), G = q(n), r.addEventListener("load", K), r.addEventListener("error", G);
|
|
81
|
+
} catch (e) {
|
|
82
|
+
n(e);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
}), W.catch(function(e) {
|
|
86
|
+
return W = null, Promise.reject(e);
|
|
87
|
+
})) : W;
|
|
88
|
+
}, Y = function(e, t, n) {
|
|
89
|
+
if (e === null) return null;
|
|
90
|
+
var r = t[0];
|
|
91
|
+
if (typeof r != "string") throw Error(`Expected publishable key to be of type string, got type ${F(r)} instead.`);
|
|
92
|
+
var i = r.match(/^pk_test/), a = ge(e.version), o = I;
|
|
93
|
+
i && a !== o && console.warn(`Stripe.js@${a} was loaded on the page, but @stripe/stripe-js@9.13.0 expected Stripe.js@${o}. This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning`);
|
|
94
|
+
var s = e.apply(void 0, t);
|
|
95
|
+
return U(s, n), s;
|
|
96
|
+
}, X, be = !1, xe = function() {
|
|
97
|
+
return X || (X = J(null).catch(function(e) {
|
|
98
|
+
return X = null, Promise.reject(e);
|
|
99
|
+
}), X);
|
|
100
|
+
};
|
|
101
|
+
Promise.resolve().then(function() {
|
|
102
|
+
return xe();
|
|
103
|
+
}).catch(function(e) {
|
|
104
|
+
be || console.warn(e);
|
|
105
|
+
});
|
|
106
|
+
var Se = function() {
|
|
107
|
+
var e = [...arguments];
|
|
108
|
+
be = !0;
|
|
109
|
+
var t = Date.now();
|
|
110
|
+
return xe().then(function(n) {
|
|
111
|
+
return Y(n, e, t);
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/lib/utils/stripe-errors.ts
|
|
116
|
+
function Z(e, t = g) {
|
|
117
|
+
let n = e?.code || e?.decline_code || "", r = e?.type || "", i = e?.message || "";
|
|
118
|
+
if (n === "card_declined" || r === "card_error") {
|
|
119
|
+
let n = e?.decline_code || "";
|
|
120
|
+
return n === "insufficient_funds" ? {
|
|
121
|
+
type: "card_declined",
|
|
122
|
+
title: t.cardInsufficientFundsTitle || "Insufficient funds",
|
|
123
|
+
message: t.cardInsufficientFundsMessage || "Your card has insufficient funds to complete this purchase",
|
|
124
|
+
suggestion: t.cardInsufficientFundsSuggestion || "Please try a different payment method or contact your bank",
|
|
125
|
+
retryable: !0
|
|
126
|
+
} : n === "lost_card" || n === "stolen_card" ? {
|
|
127
|
+
type: "card_declined",
|
|
128
|
+
title: t.cardUnusableTitle || "Card cannot be used",
|
|
129
|
+
message: t.cardUnusableMessage || "This card cannot be used for this transaction",
|
|
130
|
+
suggestion: t.cardUnusableSuggestion || "Please use a different payment method",
|
|
131
|
+
retryable: !0
|
|
132
|
+
} : n === "expired_card" ? {
|
|
133
|
+
type: "card_declined",
|
|
134
|
+
title: t.cardExpiredTitle || "Card expired",
|
|
135
|
+
message: t.cardExpiredMessage || "Your card has expired",
|
|
136
|
+
suggestion: t.cardExpiredSuggestion || "Please use a different card or update your card details",
|
|
137
|
+
retryable: !0
|
|
138
|
+
} : {
|
|
139
|
+
type: "card_declined",
|
|
140
|
+
title: t.cardDeclinedTitle || "Card declined",
|
|
141
|
+
message: t.cardDeclinedMessage || "Your card was declined by your bank",
|
|
142
|
+
suggestion: t.cardDeclinedSuggestion || "Please try a different card or contact your bank for more information",
|
|
143
|
+
retryable: !0
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return r === "api_connection_error" || i.includes("network") || i.includes("connection") ? {
|
|
147
|
+
type: "network",
|
|
148
|
+
title: t.connectionError || "Connection error",
|
|
149
|
+
message: t.paymentConnectionErrorMessage || "We couldn't connect to the payment server",
|
|
150
|
+
suggestion: t.paymentConnectionErrorSuggestion || "Please check your internet connection and try again",
|
|
151
|
+
retryable: !0
|
|
152
|
+
} : n === "rate_limit" ? {
|
|
153
|
+
type: "rate_limit",
|
|
154
|
+
title: t.tooManyAttemptsTitle || "Too many attempts",
|
|
155
|
+
message: t.tooManyAttemptsMessage || "Too many payment attempts. Please wait a moment",
|
|
156
|
+
suggestion: t.tooManyAttemptsSuggestion || "Wait 30 seconds before trying again",
|
|
157
|
+
retryable: !0
|
|
158
|
+
} : n === "incorrect_number" || n === "invalid_number" ? {
|
|
159
|
+
type: "validation",
|
|
160
|
+
title: t.invalidCardNumberTitle || "Invalid card number",
|
|
161
|
+
message: t.invalidCardNumberMessage || "The card number you entered is invalid",
|
|
162
|
+
suggestion: t.invalidCardNumberSuggestion || "Please check your card number and try again",
|
|
163
|
+
retryable: !0
|
|
164
|
+
} : n === "incorrect_cvc" || n === "invalid_cvc" ? {
|
|
165
|
+
type: "validation",
|
|
166
|
+
title: t.invalidCvcTitle || "Invalid security code",
|
|
167
|
+
message: t.invalidCvcMessage || "The security code (CVC) is incorrect",
|
|
168
|
+
suggestion: t.invalidCvcSuggestion || "Please check the 3-digit code on the back of your card",
|
|
169
|
+
retryable: !0
|
|
170
|
+
} : n === "invalid_expiry_month" || n === "invalid_expiry_year" ? {
|
|
171
|
+
type: "validation",
|
|
172
|
+
title: t.invalidExpiryTitle || "Invalid expiration date",
|
|
173
|
+
message: t.invalidExpiryMessage || "The expiration date is invalid",
|
|
174
|
+
suggestion: t.invalidExpirySuggestion || "Please check your card's expiration date",
|
|
175
|
+
retryable: !0
|
|
176
|
+
} : {
|
|
177
|
+
type: "general",
|
|
178
|
+
title: t.paymentFailedTitle || "Payment failed",
|
|
179
|
+
message: i || t.paymentFailedMessage || "Something went wrong with your payment",
|
|
180
|
+
suggestion: t.paymentFailedSuggestion || "Please try again or use a different payment method",
|
|
181
|
+
retryable: !0
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/components/Events/Checkout/GiftCardInput.svelte
|
|
186
|
+
var Q = n("GiftCardInput"), Ce = P.from_html("<div class=\"applied-card mb-2 svelte-emw0hd\"><div class=\"flex items-center gap-3\"><div class=\"applied-icon svelte-emw0hd\"><!></div> <div class=\"flex flex-col flex-1\"><span class=\"type-caption text-status-success-text\"> </span> <span class=\"type-body font-mono text-text-primary\"> </span></div> <span class=\"type-label text-accent-success\"> </span> <!></div></div>"), we = P.from_html("<div class=\"applied-card mb-3 svelte-emw0hd\"><div><!> <span> </span></div></div>"), Te = P.from_html("<div class=\"flex items-center gap-1.5 mt-2 type-body text-accent-danger\"><!> <span> </span></div>"), Ee = P.from_html("<div class=\"input-section svelte-emw0hd\"><div class=\"flex gap-2\"><input type=\"text\" name=\"giftCardCode\" autocomplete=\"off\" autocapitalize=\"characters\"/> <!></div> <!></div>"), De = P.from_html("<div class=\"mb-4\"><!> <!> <button type=\"button\"><!> <span> </span> <span class=\"toggle-indicator svelte-emw0hd\"> </span></button> <!></div>");
|
|
187
|
+
function Oe(n, i) {
|
|
188
|
+
P.push(i, !0);
|
|
189
|
+
let o = P.prop(i, "onApplied", 3, () => {}), c = P.prop(i, "onRemoved", 3, () => {}), l = P.prop(i, "disabled", 3, !1), h = P.prop(i, "labels", 3, g), ee = P.prop(i, "owedTotal", 3, 0), te = P.prop(i, "serverGiftCardAmount", 3, null), _ = P.state(""), v = P.state(!1), b = P.state(""), x = P.state(P.proxy([])), S = P.state(!1), C = P.state(0);
|
|
190
|
+
P.user_effect(() => {
|
|
191
|
+
if (!i.cartId || P.get(x).length > 0 || te() === 0) return;
|
|
192
|
+
let e = !1;
|
|
193
|
+
return y(i.cartId).then((t) => {
|
|
194
|
+
if (e || !t?.giftCards?.length) return;
|
|
195
|
+
let n = t.giftCards.filter((e) => typeof e.amount == "number");
|
|
196
|
+
n.length !== t.giftCards.length && Q.error("Ignored applied gift card(s) with an unusable amount while restoring the panel"), n.length !== 0 && (P.set(x, n.map((e) => ({
|
|
197
|
+
giftCardId: e.giftCardId,
|
|
198
|
+
code: e.maskedCode,
|
|
199
|
+
giftCardAmount: e.amount
|
|
200
|
+
})), !0), P.set(C, P.get(x).reduce((e, t) => e + (t.giftCardAmount || 0), 0) + (ee() || 0)));
|
|
201
|
+
}).catch((e) => Q.error("Could not restore applied gift cards:", e)), () => {
|
|
202
|
+
e = !0;
|
|
203
|
+
};
|
|
204
|
+
});
|
|
205
|
+
let w = P.derived(() => P.get(x).reduce((e, t) => e + (t.giftCardAmount || 0), 0)), T = P.derived(() => Math.max(0, P.get(C) - P.get(w))), E = P.derived(() => P.get(x).length > 0 && P.get(T) <= 0);
|
|
206
|
+
function D() {
|
|
207
|
+
if (P.get(x).length === 0) {
|
|
208
|
+
c()();
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
o()({
|
|
212
|
+
code: P.get(x).map((e) => e.code).join(", "),
|
|
213
|
+
giftCardAmount: P.get(w),
|
|
214
|
+
stripeAmount: P.get(T),
|
|
215
|
+
requiresStripe: P.get(T) > 0,
|
|
216
|
+
paymentType: P.get(T) > 0 ? "split" : "gift_card_only",
|
|
217
|
+
orderTotal: P.get(C)
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
async function O() {
|
|
221
|
+
let e = P.get(_).trim().toUpperCase();
|
|
222
|
+
if (!(!e || P.get(v) || !i.cartId)) {
|
|
223
|
+
if (P.get(x).some((t) => t.code === e)) {
|
|
224
|
+
P.set(b, h().giftCardAlreadyApplied || "That gift card is already applied", !0);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
P.set(v, !0), P.set(b, "");
|
|
228
|
+
try {
|
|
229
|
+
let t = await k(i.cartId, e);
|
|
230
|
+
t.valid ? (P.set(x, [...P.get(x), {
|
|
231
|
+
code: t.giftCardCode || e,
|
|
232
|
+
giftCardAmount: t.giftCardAmount || 0
|
|
233
|
+
}], !0), P.set(C, P.get(w) + (t.stripeAmount || 0)), P.set(_, ""), P.set(S, !1), D()) : P.set(b, t.error || h().invalidGiftCardCode || "Invalid gift card code", !0);
|
|
234
|
+
} catch (e) {
|
|
235
|
+
Q.error("Error applying gift card:", e);
|
|
236
|
+
let t = e && typeof e == "object" && typeof e.message == "string" ? e.message : "";
|
|
237
|
+
P.set(b, t || h().failedToApplyGiftCard || "Failed to apply gift card. Please try again", !0);
|
|
238
|
+
}
|
|
239
|
+
P.set(v, !1);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
async function ne(e) {
|
|
243
|
+
if (!(P.get(v) || !i.cartId)) {
|
|
244
|
+
P.set(v, !0), P.set(b, "");
|
|
245
|
+
try {
|
|
246
|
+
let t = P.get(x).find((t) => t.code === e), n = await A(i.cartId, t?.giftCardId ? { giftCardId: t.giftCardId } : { code: e });
|
|
247
|
+
n.success !== !1 && !n.error ? (P.set(x, P.get(x).filter((t) => t.code !== e), !0), typeof n.remainingTotal == "number" && P.set(C, P.get(w) + n.remainingTotal), D()) : P.set(b, n.error || h().failedToRemoveGiftCard || "Failed to remove gift card. Please try again", !0);
|
|
248
|
+
} catch (e) {
|
|
249
|
+
Q.error("Error removing gift card:", e), P.set(b, h().failedToRemoveGiftCard || "Failed to remove gift card. Please try again", !0);
|
|
250
|
+
}
|
|
251
|
+
P.set(v, !1);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function re(e) {
|
|
255
|
+
e.key === "Enter" && !P.get(v) && O();
|
|
256
|
+
}
|
|
257
|
+
function ie() {
|
|
258
|
+
P.set(S, !P.get(S)), P.get(S) || (P.set(_, ""), P.set(b, ""));
|
|
259
|
+
}
|
|
260
|
+
var ae = De(), oe = P.child(ae);
|
|
261
|
+
P.each(oe, 17, () => P.get(x), (e) => e.code, (e, t) => {
|
|
262
|
+
var n = Ce(), i = P.child(n), o = P.child(i), c = P.child(o);
|
|
263
|
+
r(c, { size: "16" }), P.reset(o);
|
|
264
|
+
var u = P.sibling(o, 2), d = P.child(u), g = P.child(d, !0);
|
|
265
|
+
P.reset(d);
|
|
266
|
+
var ee = P.sibling(d, 2), te = P.child(ee, !0);
|
|
267
|
+
P.reset(ee), P.reset(u);
|
|
268
|
+
var _ = P.sibling(u, 2), y = P.child(_);
|
|
269
|
+
P.reset(_);
|
|
270
|
+
var b = P.sibling(_, 2);
|
|
271
|
+
{
|
|
272
|
+
let e = P.derived(() => h().removeGiftCard || "Remove gift card");
|
|
273
|
+
m(b, {
|
|
274
|
+
variant: "icon",
|
|
275
|
+
size: "icon-sm",
|
|
276
|
+
class: "rounded-full hover:bg-status-error-bg hover:text-accent-danger",
|
|
277
|
+
onclick: () => ne(P.get(t).code),
|
|
278
|
+
get loading() {
|
|
279
|
+
return P.get(v);
|
|
280
|
+
},
|
|
281
|
+
get disabled() {
|
|
282
|
+
return l();
|
|
283
|
+
},
|
|
284
|
+
get "aria-label"() {
|
|
285
|
+
return P.get(e);
|
|
286
|
+
},
|
|
287
|
+
children: (e, t) => {
|
|
288
|
+
a(e, { size: "16" });
|
|
289
|
+
},
|
|
290
|
+
$$slots: { default: !0 }
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
P.reset(i), P.reset(n), P.template_effect((e) => {
|
|
294
|
+
P.set_text(g, h().giftCardApplied || "Gift card applied"), P.set_text(te, P.get(t).code), P.set_text(y, `-${e ?? ""}`);
|
|
295
|
+
}, [() => s(P.get(t).giftCardAmount)]), P.transition(3, n, () => f, () => ({ duration: p.fast })), P.append(e, n);
|
|
296
|
+
});
|
|
297
|
+
var se = P.sibling(oe, 2), ce = (n) => {
|
|
298
|
+
var i = we(), a = P.child(i), o = P.child(a);
|
|
299
|
+
r(o, { size: "16" });
|
|
300
|
+
var s = P.sibling(o, 2), c = P.child(s, !0);
|
|
301
|
+
P.reset(s), P.reset(a), P.reset(i), P.template_effect(() => {
|
|
302
|
+
P.set_class(a, 1, `full-coverage-badge ${t.caption ?? ""} ${e.emphasis ?? ""}`, "svelte-emw0hd"), P.set_text(c, h().fullyCoveredByGiftCard || "Fully covered by gift card");
|
|
303
|
+
}), P.append(n, i);
|
|
304
|
+
};
|
|
305
|
+
P.if(se, (e) => {
|
|
306
|
+
P.get(E) && e(ce);
|
|
307
|
+
});
|
|
308
|
+
var j = P.sibling(se, 2), le = P.child(j);
|
|
309
|
+
u(le, {
|
|
310
|
+
size: "20",
|
|
311
|
+
class: "gift-icon"
|
|
312
|
+
});
|
|
313
|
+
var M = P.sibling(le, 2), ue = P.child(M, !0);
|
|
314
|
+
P.reset(M);
|
|
315
|
+
var de = P.sibling(M, 2), fe = P.child(de, !0);
|
|
316
|
+
P.reset(de), P.reset(j);
|
|
317
|
+
var N = P.sibling(j, 2), pe = (e) => {
|
|
318
|
+
var n = Ee(), r = P.child(n), i = P.child(r);
|
|
319
|
+
P.remove_input_defaults(i);
|
|
320
|
+
let a;
|
|
321
|
+
var o = P.sibling(i, 2);
|
|
322
|
+
{
|
|
323
|
+
let e = P.derived(() => !P.get(_).trim() || l());
|
|
324
|
+
m(o, {
|
|
325
|
+
variant: "default",
|
|
326
|
+
size: "sm",
|
|
327
|
+
class: "min-w-16 shrink-0",
|
|
328
|
+
onclick: O,
|
|
329
|
+
get loading() {
|
|
330
|
+
return P.get(v);
|
|
331
|
+
},
|
|
332
|
+
get disabled() {
|
|
333
|
+
return P.get(e);
|
|
334
|
+
},
|
|
335
|
+
children: (e, t) => {
|
|
336
|
+
P.next();
|
|
337
|
+
var n = P.text();
|
|
338
|
+
P.template_effect(() => P.set_text(n, h().apply || "Apply")), P.append(e, n);
|
|
339
|
+
},
|
|
340
|
+
$$slots: { default: !0 }
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
P.reset(r);
|
|
344
|
+
var s = P.sibling(r, 2), c = (e) => {
|
|
345
|
+
var t = Te(), n = P.child(t);
|
|
346
|
+
d(n, { size: "16" });
|
|
347
|
+
var r = P.sibling(n, 2), i = P.child(r, !0);
|
|
348
|
+
P.reset(r), P.reset(t), P.template_effect(() => P.set_text(i, P.get(b))), P.transition(3, t, () => f, () => ({ duration: p.micro })), P.append(e, t);
|
|
349
|
+
};
|
|
350
|
+
P.if(s, (e) => {
|
|
351
|
+
P.get(b) && e(c);
|
|
352
|
+
}), P.reset(n), P.template_effect(() => {
|
|
353
|
+
P.set_attribute(i, "aria-label", h().enterGiftCardCode || "Enter gift card code"), P.set_attribute(i, "placeholder", h().enterGiftCardCode || "Enter gift card code"), i.disabled = P.get(v) || l(), a = P.set_class(i, 1, `gift-input ${t.body ?? ""}`, "svelte-emw0hd", a, { "has-error": !!P.get(b) });
|
|
354
|
+
}), P.delegated("keydown", i, re), P.bind_value(i, () => P.get(_), (e) => P.set(_, e)), P.transition(3, n, () => f, () => ({ duration: p.fast })), P.append(e, n);
|
|
355
|
+
};
|
|
356
|
+
P.if(N, (e) => {
|
|
357
|
+
P.get(S) && e(pe);
|
|
358
|
+
}), P.reset(ae), P.template_effect(() => {
|
|
359
|
+
P.set_class(j, 1, `gift-card-toggle ${t.label ?? ""}`, "svelte-emw0hd"), j.disabled = l(), P.set_attribute(j, "aria-expanded", P.get(S)), P.set_text(ue, P.get(x).length > 0 ? h().addAnotherGiftCard || "Add another gift card" : h().haveAGiftCard || "Have a gift card?"), P.set_text(fe, P.get(S) ? "-" : "+");
|
|
360
|
+
}), P.delegated("click", j, ie), P.append(n, ae), P.pop();
|
|
361
|
+
}
|
|
362
|
+
P.delegate(["click", "keydown"]);
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region src/components/Modals/EventUnavailableModal.svelte
|
|
365
|
+
var ke = P.from_html("<div class=\"flex flex-col items-center text-center pt-6 px-4 pb-4\"><div aria-hidden=\"true\"><!></div> <h3 id=\"event-unavailable-title\"> </h3> <p id=\"event-unavailable-body\" class=\"type-body tone-secondary max-w-72\"> </p></div>"), Ae = P.from_html("<!> <!>", 1);
|
|
366
|
+
function je(e, n) {
|
|
367
|
+
P.push(n, !0);
|
|
368
|
+
let r = P.prop(n, "open", 15, !1), a = P.prop(n, "onBackToEvents", 3, () => {}), s = P.prop(n, "labels", 3, g), c = P.derived(() => n.reason === "canceled"), l = P.derived(() => P.get(c) ? s().eventCanceledTitle || "Event cancelled" : s().eventPostponedTitle || "Event postponed"), u = P.derived(() => P.get(c) ? s().eventCanceledBody || "This event was cancelled — you weren't charged" : s().eventPostponedBody || "Sales are paused while this show is rescheduled — you weren't charged"), d = P.derived(() => s().backToEvents || "Back to events");
|
|
369
|
+
w(e, {
|
|
370
|
+
size: "sm",
|
|
371
|
+
role: "alertdialog",
|
|
372
|
+
class: "micdrop",
|
|
373
|
+
get open() {
|
|
374
|
+
return r();
|
|
375
|
+
},
|
|
376
|
+
set open(e) {
|
|
377
|
+
r(e);
|
|
378
|
+
},
|
|
379
|
+
children: (e, n) => {
|
|
380
|
+
var r = Ae(), s = P.first_child(r);
|
|
381
|
+
T(s, {});
|
|
382
|
+
var f = P.sibling(s, 2);
|
|
383
|
+
D(f, {
|
|
384
|
+
children: (e, n) => {
|
|
385
|
+
var r = Ae(), s = P.first_child(r);
|
|
386
|
+
E(s, {
|
|
387
|
+
children: (e, n) => {
|
|
388
|
+
var r = ke(), a = P.child(r), s = P.child(a), d = (e) => {
|
|
389
|
+
o(e, { size: "32" });
|
|
390
|
+
}, f = (e) => {
|
|
391
|
+
i(e, { size: "32" });
|
|
392
|
+
};
|
|
393
|
+
P.if(s, (e) => {
|
|
394
|
+
P.get(c) ? e(d) : e(f, -1);
|
|
395
|
+
}), P.reset(a);
|
|
396
|
+
var p = P.sibling(a, 2), m = P.child(p, !0);
|
|
397
|
+
P.reset(p);
|
|
398
|
+
var h = P.sibling(p, 2), g = P.child(h, !0);
|
|
399
|
+
P.reset(h), P.reset(r), P.template_effect(() => {
|
|
400
|
+
P.set_class(a, 1, `w-16 h-16 rounded-full flex items-center justify-center mb-4 ${P.get(c) ? "bg-accent-danger/10 text-accent-danger" : "bg-accent-warning/10 text-accent-warning"}`), P.set_class(p, 1, `mb-2 ${t.heading ?? ""}`), P.set_text(m, P.get(l)), P.set_text(g, P.get(u));
|
|
401
|
+
}), P.append(e, r);
|
|
402
|
+
},
|
|
403
|
+
$$slots: { default: !0 }
|
|
404
|
+
});
|
|
405
|
+
var f = P.sibling(s, 2);
|
|
406
|
+
O(f, {
|
|
407
|
+
children: (e, t) => {
|
|
408
|
+
m(e, {
|
|
409
|
+
size: "full",
|
|
410
|
+
variant: "default",
|
|
411
|
+
get onclick() {
|
|
412
|
+
return a();
|
|
413
|
+
},
|
|
414
|
+
get "aria-label"() {
|
|
415
|
+
return P.get(d);
|
|
416
|
+
},
|
|
417
|
+
children: (e, t) => {
|
|
418
|
+
P.next();
|
|
419
|
+
var n = P.text();
|
|
420
|
+
P.template_effect(() => P.set_text(n, P.get(d))), P.append(e, n);
|
|
421
|
+
},
|
|
422
|
+
$$slots: { default: !0 }
|
|
423
|
+
});
|
|
424
|
+
},
|
|
425
|
+
$$slots: { default: !0 }
|
|
426
|
+
}), P.append(e, r);
|
|
427
|
+
},
|
|
428
|
+
$$slots: { default: !0 }
|
|
429
|
+
}), P.append(e, r);
|
|
430
|
+
},
|
|
431
|
+
$$slots: { default: !0 }
|
|
432
|
+
}), P.pop();
|
|
433
|
+
}
|
|
434
|
+
//#endregion
|
|
435
|
+
//#region src/components/Views/Checkout.svelte
|
|
436
|
+
var $ = n("Checkout"), Me = P.from_html("<div class=\"p-8 text-center\"><p class=\"text-accent-danger\"> </p></div>"), Ne = P.from_html("<div class=\"p-8 text-center\"><p class=\"tone-muted\"> </p></div>"), Pe = P.from_html("<!> <!>", 1);
|
|
437
|
+
function Fe(e, t) {
|
|
438
|
+
P.push(t, !0);
|
|
439
|
+
let n = P.prop(t, "availableTickets", 23, () => []);
|
|
440
|
+
P.prop(t, "value", 3, "");
|
|
441
|
+
let r = P.prop(t, "venueId", 3, ""), i = P.prop(t, "organizationId", 3, ""), a = P.prop(t, "onNavigateBack", 3, void 0), o = P.prop(t, "initialError", 3, void 0), s = P.prop(t, "widgetId", 3, null), u = P.prop(t, "labels", 3, g), d = P.prop(t, "locale", 3, void 0);
|
|
442
|
+
function f(e) {
|
|
443
|
+
if (!e) return {};
|
|
444
|
+
let t = { ...e.venue ?? {} };
|
|
445
|
+
for (let n of [
|
|
446
|
+
"askForPhoneAtCheckout",
|
|
447
|
+
"requiredPhoneAtCheckout",
|
|
448
|
+
"hasCustomCheckout",
|
|
449
|
+
"questionPrompt"
|
|
450
|
+
]) e[n] !== void 0 && (t[n] = e[n]);
|
|
451
|
+
return t;
|
|
452
|
+
}
|
|
453
|
+
let p = P.derived(() => (t.data || {}).id);
|
|
454
|
+
P.derived(() => (t.data || {}).orgSlug);
|
|
455
|
+
let m = P.derived(() => (t.data || {}).slug), y = P.derived(() => (t.data || {}).event), w = P.derived(() => ie(f(P.get(y)))), T = P.derived(() => P.get(y) ? {
|
|
456
|
+
...ae(P.get(y)),
|
|
457
|
+
...P.get(w)
|
|
458
|
+
} : t.data && (t.data.id || P.get(p)) ? {
|
|
459
|
+
id: t.data.id || P.get(p),
|
|
460
|
+
eventID: t.data.id || P.get(p),
|
|
461
|
+
venueID: t.data.venueID ?? t.data.venueId ?? null,
|
|
462
|
+
venueId: t.data.venueId ?? t.data.venueID ?? null,
|
|
463
|
+
eventTicketingType: 0,
|
|
464
|
+
ticketType: 0,
|
|
465
|
+
availableTickets: []
|
|
466
|
+
} : null), E = P.state(""), D = P.state(P.proxy({})), O = P.state(P.proxy({})), k = P.state(P.proxy([])), A = P.state(""), F = P.state(0), I = P.state(!1), ge = P.state(!1), L = P.state(!1), R = P.state(null), z = P.state(""), B = P.state(void 0), V = P.state(null), H = P.state(""), _e = P.state(!1), ve = P.state(""), U = P.state(null), W = P.derived(() => P.get(U) !== null), G = P.state(null), K = P.state(null), q = null, ye = P.state(!1);
|
|
467
|
+
function J() {
|
|
468
|
+
return {
|
|
469
|
+
value: q?.total ?? null,
|
|
470
|
+
currency: q?.currency || "USD"
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
he(async () => {
|
|
474
|
+
if (P.set(E, N(ce) || N(pe.CHECKOUT_CARTID), !0), !P.get(E)) {
|
|
475
|
+
P.set(_e, !0), P.set(ve, u().noCheckoutSession || "No checkout session found. Please select tickets first", !0);
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
te(P.get(T)?.eventID || P.get(T)?.id || P.get(p), s(), r() || P.get(T)?.venueID || P.get(T)?.venueId || null);
|
|
479
|
+
let e = P.get(T)?.eventID || P.get(T)?.id || P.get(p);
|
|
480
|
+
try {
|
|
481
|
+
let t = se(e);
|
|
482
|
+
P.set(D, t.quantities || {}, !0), P.set(O, t.donationAmounts || {}, !0), P.set(A, t.promocode || "", !0), P.set(F, t.promoDiscountAmount || 0, !0), P.set(k, t.tickets || [], !0);
|
|
483
|
+
} catch (e) {
|
|
484
|
+
$.error("Error loading checkout state:", e), P.set(D, {}, !0), P.set(k, [], !0);
|
|
485
|
+
}
|
|
486
|
+
P.get(k).length > 0 && P.get(T) && (P.get(T).availableTickets = P.get(k), n(P.get(k)));
|
|
487
|
+
let t = {
|
|
488
|
+
serviceFeeCents: 0,
|
|
489
|
+
serviceFeePercentage: 0,
|
|
490
|
+
serviceFeeChargeType: "both",
|
|
491
|
+
maxServiceFeeCents: 0,
|
|
492
|
+
absorbServiceFee: !1,
|
|
493
|
+
taxPercentage: 0
|
|
494
|
+
};
|
|
495
|
+
try {
|
|
496
|
+
let e = await j(P.get(T)?.venueID || P.get(T)?.venueId || r());
|
|
497
|
+
t = {
|
|
498
|
+
serviceFeeCents: Number(e?.serviceFeeCents == null ? 0 : e.serviceFeeCents),
|
|
499
|
+
serviceFeePercentage: Number(e?.serviceFeePercentage ?? 0),
|
|
500
|
+
serviceFeeChargeType: String(e?.serviceFeeChargeType ?? "both"),
|
|
501
|
+
maxServiceFeeCents: Number(e?.maxServiceFeeCents == null ? 0 : e.maxServiceFeeCents),
|
|
502
|
+
absorbServiceFee: e?.absorbServiceFee === !0,
|
|
503
|
+
taxPercentage: Number(e?.taxPercentage ?? 0)
|
|
504
|
+
};
|
|
505
|
+
} catch (e) {
|
|
506
|
+
$.error("Error fetching venue data:", e);
|
|
507
|
+
}
|
|
508
|
+
let i = xe(P.get(D), P.get(k), t);
|
|
509
|
+
Object.keys(P.get(D)).length > 0 && await X();
|
|
510
|
+
let a = 900, l = "";
|
|
511
|
+
if (P.get(E)) {
|
|
512
|
+
let e = oe(P.get(E));
|
|
513
|
+
if (e) {
|
|
514
|
+
let t = Math.max(0, Math.floor((e - Date.now()) / 1e3));
|
|
515
|
+
t > 0 && (a = t);
|
|
516
|
+
}
|
|
517
|
+
try {
|
|
518
|
+
let e = await _(P.get(E));
|
|
519
|
+
if (!e.error && e.expiresAt) {
|
|
520
|
+
let t = ee(e.expiresAt).getTime();
|
|
521
|
+
a = Math.max(0, Math.floor((t - Date.now()) / 1e3)), l = e.expiresAt, le(P.get(E), t);
|
|
522
|
+
}
|
|
523
|
+
} catch {}
|
|
524
|
+
}
|
|
525
|
+
let d = N(`checkout-promo-discount-type-${e}`), f = [];
|
|
526
|
+
try {
|
|
527
|
+
let t = N(`checkout-promo-ticket-ids-${e}`), n = t ? JSON.parse(t) : [];
|
|
528
|
+
Array.isArray(n) && (f = n);
|
|
529
|
+
} catch {
|
|
530
|
+
f = [];
|
|
531
|
+
}
|
|
532
|
+
let m = c(i.filter((e) => ue(f, e.ticketId)).reduce((e, t) => e + (t.subtotal == null ? 0 : t.subtotal), 0)), h = M(m, P.get(F), d);
|
|
533
|
+
if (P.set(K, {
|
|
534
|
+
event: be(P.get(T), t),
|
|
535
|
+
lines: i,
|
|
536
|
+
timerStart: a,
|
|
537
|
+
...l ? { deadlineAt: l } : {},
|
|
538
|
+
promoApplied: !!P.get(A),
|
|
539
|
+
promoDiscount: h,
|
|
540
|
+
forceExpired: !1,
|
|
541
|
+
...q ? { serverTotals: q } : {}
|
|
542
|
+
}, !0), o()) {
|
|
543
|
+
let e = Z(typeof o() == "object" ? o() : {
|
|
544
|
+
code: "card_declined",
|
|
545
|
+
message: "Your card was declined. Please try a different payment method."
|
|
546
|
+
}, u());
|
|
547
|
+
P.set(V, {
|
|
548
|
+
message: e.message,
|
|
549
|
+
suggestion: e.suggestion
|
|
550
|
+
}, !0);
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
let Y = 0;
|
|
554
|
+
async function X() {
|
|
555
|
+
let e = ++Y;
|
|
556
|
+
if (!P.get(E)) {
|
|
557
|
+
$.error("Missing cartId!");
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
let t = Object.fromEntries(Object.entries(P.get(D)).filter(([e, t]) => t > 0));
|
|
561
|
+
try {
|
|
562
|
+
let n = Object.fromEntries(Object.entries(P.get(O)).filter(([, e]) => parseFloat(String(e)) > 0).map(([e, t]) => [parseInt(e, 10), parseFloat(String(t))]));
|
|
563
|
+
if (P.get(A)) {
|
|
564
|
+
let t = await re(P.get(E), P.get(A));
|
|
565
|
+
if (e !== Y) return;
|
|
566
|
+
t.success ? P.set(H, "") : ($.error("Failed to apply promo code to cart:", t.error), P.set(H, (u().promoCodeNotApplied || "We couldn't apply promo code {code}. It isn't included in this total — go back to re-enter it, or continue at the full price").replace("{code}", P.get(A)), !0));
|
|
567
|
+
}
|
|
568
|
+
let r = await x(P.get(E), t, Object.keys(n).length > 0 ? n : void 0, void 0, d());
|
|
569
|
+
if (e !== Y) return;
|
|
570
|
+
if (!r) {
|
|
571
|
+
P.set(V, { message: u().failedToCreatePaymentIntent || "Failed to create payment intent. Please try again" }, !0);
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
P.set(ye, !1), q = C(r), P.get(K) && P.set(K, {
|
|
575
|
+
...P.get(K),
|
|
576
|
+
serverTotals: q
|
|
577
|
+
}, !0);
|
|
578
|
+
let i = r;
|
|
579
|
+
if (i.requires_stripe === !1 || i.payment_type === "free") {
|
|
580
|
+
P.set(z, "free");
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
P.set(ye, q === null);
|
|
584
|
+
let a = r.stripe_publishable_key;
|
|
585
|
+
if (!a) {
|
|
586
|
+
$.error("No Stripe publishable key in payment intent response"), P.set(V, { message: u().paymentConfigError || "Payment configuration error. Please try again" }, !0);
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
let o = await Se(a);
|
|
590
|
+
if (e !== Y) return;
|
|
591
|
+
P.set(R, o, !0), r.client_secret ? P.set(z, r.client_secret, !0) : P.set(V, { message: u().failedToInitPayment || "Failed to initialize payment. Please try again" }, !0);
|
|
592
|
+
} catch (t) {
|
|
593
|
+
if ($.error("Failed to initialize Stripe payment:", t), e !== Y) return;
|
|
594
|
+
P.set(V, { message: t.message || u().failedToInitPayment || "Failed to initialize payment. Please try again" }, !0);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
function be(e, t) {
|
|
598
|
+
return e ? {
|
|
599
|
+
id: e.id || e.eventID,
|
|
600
|
+
title: e.name || e.title || "",
|
|
601
|
+
slug: e.slug || P.get(m) || "",
|
|
602
|
+
description: e.description || "",
|
|
603
|
+
date: e.date || "",
|
|
604
|
+
startDateTime: e.startDateTime || "",
|
|
605
|
+
endDateTime: e.endDateTime || "",
|
|
606
|
+
doorsOpenTime: e.doorsOpenTime || "",
|
|
607
|
+
timezone: e.timeZone || e.timezone || h(),
|
|
608
|
+
imageUrl: e.imageUrl || e.image || "",
|
|
609
|
+
...P.get(w),
|
|
610
|
+
venue: {
|
|
611
|
+
id: e.venueID || e.venueId || 0,
|
|
612
|
+
name: e.venueName || "",
|
|
613
|
+
address: e.venueAddress || "",
|
|
614
|
+
timezone: e.timeZone || e.timezone || h(),
|
|
615
|
+
serviceFeePercentage: t.serviceFeePercentage,
|
|
616
|
+
serviceFeeCents: t.serviceFeeCents,
|
|
617
|
+
taxPercentage: t.taxPercentage,
|
|
618
|
+
serviceFeeChargeType: t.serviceFeeChargeType,
|
|
619
|
+
maxServiceFeeCents: t.maxServiceFeeCents,
|
|
620
|
+
absorbServiceFee: t.absorbServiceFee
|
|
621
|
+
},
|
|
622
|
+
performers: e.performers || [],
|
|
623
|
+
tickets: (e.availableTickets || []).map((e) => ({
|
|
624
|
+
id: e.ID || e.id,
|
|
625
|
+
name: e.name || "",
|
|
626
|
+
description: e.description || "",
|
|
627
|
+
price: l(e.price),
|
|
628
|
+
fee: 0,
|
|
629
|
+
quantityAvailable: e.quantityAvailable || 0,
|
|
630
|
+
quantityTotal: e.quantityTotal || 0,
|
|
631
|
+
minPerOrder: e.minPerOrder || 1,
|
|
632
|
+
maxPerOrder: e.maxPerOrder || 10,
|
|
633
|
+
status: "on_sale",
|
|
634
|
+
isDonation: e.type === 2,
|
|
635
|
+
isHidden: !1
|
|
636
|
+
})),
|
|
637
|
+
faqs: e.faqs || [],
|
|
638
|
+
status: "on_sale",
|
|
639
|
+
isPasswordProtected: !1,
|
|
640
|
+
isRegistrationEvent: e.eventTicketingType === 1 || e.ticketType === 1,
|
|
641
|
+
totalTicketsRemaining: 100,
|
|
642
|
+
totalTicketsCapacity: 100
|
|
643
|
+
} : null;
|
|
644
|
+
}
|
|
645
|
+
function xe(e, t, n) {
|
|
646
|
+
let r = [];
|
|
647
|
+
for (let [i, a] of Object.entries(e)) {
|
|
648
|
+
if (a <= 0) continue;
|
|
649
|
+
let e = t.find((e) => String(e.ID) === i || String(e.id) === i);
|
|
650
|
+
if (!e) continue;
|
|
651
|
+
let o = e.type === 2, s = e.price;
|
|
652
|
+
if (!o && (s == null || !Number.isFinite(s))) {
|
|
653
|
+
r.push({
|
|
654
|
+
ticketId: parseInt(i),
|
|
655
|
+
ticketName: e.name || "",
|
|
656
|
+
quantity: a,
|
|
657
|
+
unitPrice: null,
|
|
658
|
+
fee: 0,
|
|
659
|
+
subtotal: null,
|
|
660
|
+
isDonation: !1
|
|
661
|
+
});
|
|
662
|
+
continue;
|
|
663
|
+
}
|
|
664
|
+
let l = s ?? 0, u = de(l, n, o);
|
|
665
|
+
r.push({
|
|
666
|
+
ticketId: parseInt(i),
|
|
667
|
+
ticketName: e.name || "",
|
|
668
|
+
quantity: a,
|
|
669
|
+
unitPrice: l,
|
|
670
|
+
fee: u,
|
|
671
|
+
subtotal: c(l * a),
|
|
672
|
+
isDonation: o
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
return r;
|
|
676
|
+
}
|
|
677
|
+
let Q = P.derived(() => Object.values(P.get(O)).some((e) => (Number(e) || 0) > 0)), Ce = P.derived(() => !P.get(Q) && (!P.get(K) || P.get(K).lines.every((e) => e.unitPrice === 0)));
|
|
678
|
+
async function we(e) {
|
|
679
|
+
if (!P.get(I)) {
|
|
680
|
+
P.set(I, !0), P.set(V, null);
|
|
681
|
+
try {
|
|
682
|
+
if (P.get(L)) {
|
|
683
|
+
P.set(V, { message: u().paymentReinitializing || "Updating your total. Please wait a moment and try again" }, !0);
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
if (P.get(G) && !P.get(G).requiresStripe) {
|
|
687
|
+
await Te(e);
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
if (P.get(Ce) || P.get(z) === "free" || q?.total === 0) {
|
|
691
|
+
await Ee(e);
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
if (!P.get(B)) {
|
|
695
|
+
P.set(V, {
|
|
696
|
+
message: u().paymentFormNotReady || "Payment form is not ready. Please wait a moment and try again",
|
|
697
|
+
blocking: !0
|
|
698
|
+
}, !0), P.set(I, !1);
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
if (!P.get(R)) {
|
|
702
|
+
P.set(V, {
|
|
703
|
+
message: u().paymentSystemNotInitialized || "Payment system is not initialized. Please refresh the page",
|
|
704
|
+
blocking: !0
|
|
705
|
+
}, !0), P.set(I, !1);
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
let { error: n } = await P.get(B).submit();
|
|
709
|
+
if (n) {
|
|
710
|
+
let e = Z(n, u());
|
|
711
|
+
P.set(V, {
|
|
712
|
+
message: e.message,
|
|
713
|
+
suggestion: e.suggestion
|
|
714
|
+
}, !0), P.set(I, !1);
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
let a = await P.get(R).confirmPayment({
|
|
718
|
+
elements: P.get(B),
|
|
719
|
+
redirect: "if_required"
|
|
720
|
+
});
|
|
721
|
+
if (a.error) {
|
|
722
|
+
let e = Z(a.error, u());
|
|
723
|
+
P.set(V, {
|
|
724
|
+
message: e.message,
|
|
725
|
+
suggestion: e.suggestion
|
|
726
|
+
}, !0), P.set(I, !1);
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
let o = {
|
|
730
|
+
id: P.get(E),
|
|
731
|
+
paymentIntentId: a.paymentIntent.id,
|
|
732
|
+
tickets: P.get(D),
|
|
733
|
+
firstName: e.firstName,
|
|
734
|
+
lastName: e.lastName,
|
|
735
|
+
email: e.email,
|
|
736
|
+
phone: e.phone,
|
|
737
|
+
questionAnswer: e.questionAnswer,
|
|
738
|
+
paymentMethod: "credit-card",
|
|
739
|
+
mailingList: e.keepMeUpdated,
|
|
740
|
+
saleType: "online"
|
|
741
|
+
}, s = await b(P.get(E), o, d());
|
|
742
|
+
if (s?.eventCanceled || s?.eventPostponed) {
|
|
743
|
+
P.set(U, s.eventCanceled ? "canceled" : "postponed", !0), P.set(V, null);
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
if (s?.status === "Payment succeeded") {
|
|
747
|
+
me(P.get(E), e.email);
|
|
748
|
+
let n = {
|
|
749
|
+
orderId: P.get(E),
|
|
750
|
+
eventId: P.get(T)?.id || P.get(T)?.eventID || null,
|
|
751
|
+
event: P.get(T) || null,
|
|
752
|
+
venueId: r() || P.get(T)?.venueId || null,
|
|
753
|
+
organizationId: i() || P.get(T)?.organizationId || null,
|
|
754
|
+
...J()
|
|
755
|
+
};
|
|
756
|
+
t.onNavigateToSuccess && t.onNavigateToSuccess(n);
|
|
757
|
+
} else s?.status === "Payment amount does not match the total price" ? P.set(V, { message: u().paymentAmountMismatch || "Payment amount mismatch. Please refresh and try again" }, !0) : P.set(V, { message: u().paymentValidationFailed || "Payment validation failed. Please try again" }, !0);
|
|
758
|
+
} catch (e) {
|
|
759
|
+
$.error("Payment execution error:", e);
|
|
760
|
+
let t = Z(e, u());
|
|
761
|
+
P.set(V, {
|
|
762
|
+
message: t.message,
|
|
763
|
+
suggestion: t.suggestion
|
|
764
|
+
}, !0);
|
|
765
|
+
} finally {
|
|
766
|
+
P.set(I, !1);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
async function Te(e) {
|
|
771
|
+
try {
|
|
772
|
+
let n = await ne(P.get(E), {
|
|
773
|
+
firstName: e.firstName,
|
|
774
|
+
lastName: e.lastName,
|
|
775
|
+
email: e.email,
|
|
776
|
+
phoneNumber: e.phone || null,
|
|
777
|
+
questionAnswer: e.questionAnswer,
|
|
778
|
+
mailingList: e.keepMeUpdated
|
|
779
|
+
}, d());
|
|
780
|
+
if (n?.success) {
|
|
781
|
+
me(n.orderId || P.get(E), e.email);
|
|
782
|
+
let a = {
|
|
783
|
+
orderId: n.orderId || P.get(E),
|
|
784
|
+
eventId: P.get(T)?.id || P.get(T)?.eventID || null,
|
|
785
|
+
event: P.get(T) || null,
|
|
786
|
+
venueId: r() || P.get(T)?.venueId || null,
|
|
787
|
+
organizationId: i() || P.get(T)?.organizationId || null,
|
|
788
|
+
paymentType: "gift_card_only",
|
|
789
|
+
...J()
|
|
790
|
+
};
|
|
791
|
+
t.onNavigateToSuccess && t.onNavigateToSuccess(a);
|
|
792
|
+
} else P.set(V, { message: n?.error || u().failedToCompleteOrder || "Failed to complete order. Please try again" }, !0);
|
|
793
|
+
} catch (e) {
|
|
794
|
+
$.error("Gift card payment error:", e);
|
|
795
|
+
let t = Z(e, u());
|
|
796
|
+
P.set(V, {
|
|
797
|
+
message: t.message,
|
|
798
|
+
suggestion: t.suggestion
|
|
799
|
+
}, !0);
|
|
800
|
+
} finally {
|
|
801
|
+
P.set(I, !1);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
async function Ee(e) {
|
|
805
|
+
try {
|
|
806
|
+
let n = Object.fromEntries(Object.entries(P.get(D)).filter(([e, t]) => t > 0)), a = Object.fromEntries(Object.entries(P.get(O)).filter(([, e]) => parseFloat(String(e)) > 0).map(([e, t]) => [parseInt(e, 10), parseFloat(String(t))])), o = await x(P.get(E), n, Object.keys(a).length > 0 ? a : void 0, {
|
|
807
|
+
firstName: e.firstName,
|
|
808
|
+
lastName: e.lastName,
|
|
809
|
+
email: e.email,
|
|
810
|
+
phone: e.phone,
|
|
811
|
+
questionAnswer: e.questionAnswer,
|
|
812
|
+
mailingList: e.keepMeUpdated
|
|
813
|
+
}, d());
|
|
814
|
+
if (o?.requires_stripe !== !1 && o?.payment_type !== "free" || o?.order_finalized === !1) {
|
|
815
|
+
P.set(V, { message: u().failedToCompleteOrder || "Failed to complete order. Please try again" }, !0);
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
P.set(z, "free"), me(P.get(E), e.email);
|
|
819
|
+
let s = {
|
|
820
|
+
orderId: P.get(E),
|
|
821
|
+
eventId: P.get(T)?.id || P.get(T)?.eventID || null,
|
|
822
|
+
event: P.get(T) || null,
|
|
823
|
+
venueId: r() || P.get(T)?.venueId || null,
|
|
824
|
+
organizationId: i() || P.get(T)?.organizationId || null,
|
|
825
|
+
paymentType: "free",
|
|
826
|
+
...J()
|
|
827
|
+
};
|
|
828
|
+
t.onNavigateToSuccess && t.onNavigateToSuccess(s);
|
|
829
|
+
} catch (e) {
|
|
830
|
+
$.error("Free order completion error:", e);
|
|
831
|
+
let t = Z(e, u());
|
|
832
|
+
P.set(V, {
|
|
833
|
+
message: t.message,
|
|
834
|
+
suggestion: t.suggestion
|
|
835
|
+
}, !0);
|
|
836
|
+
} finally {
|
|
837
|
+
P.set(I, !1);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
async function De(e) {
|
|
841
|
+
if (P.set(G, e, !0), P.get(K) && q && P.set(K, {
|
|
842
|
+
...P.get(K),
|
|
843
|
+
serverTotals: S(q, e)
|
|
844
|
+
}, !0), !e.requiresStripe) Y++, P.set(B, void 0), P.set(R, null), P.set(z, "");
|
|
845
|
+
else if (P.get(E) && Object.keys(P.get(D)).length > 0) {
|
|
846
|
+
P.set(L, !0);
|
|
847
|
+
try {
|
|
848
|
+
await X();
|
|
849
|
+
} finally {
|
|
850
|
+
P.set(L, !1);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
async function ke() {
|
|
855
|
+
if (P.set(G, null), P.get(K) && q && P.set(K, {
|
|
856
|
+
...P.get(K),
|
|
857
|
+
serverTotals: q
|
|
858
|
+
}, !0), P.get(E) && Object.keys(P.get(D)).length > 0) {
|
|
859
|
+
P.set(L, !0);
|
|
860
|
+
try {
|
|
861
|
+
await X();
|
|
862
|
+
} finally {
|
|
863
|
+
P.set(L, !1);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
function Ae() {
|
|
868
|
+
a() ? a()() : window.history.back();
|
|
869
|
+
}
|
|
870
|
+
function Fe() {
|
|
871
|
+
a() ? a()() : window.history.back();
|
|
872
|
+
}
|
|
873
|
+
function Ie() {
|
|
874
|
+
P.set(U, null), Ae();
|
|
875
|
+
}
|
|
876
|
+
async function Le() {
|
|
877
|
+
if (!P.get(E)) return null;
|
|
878
|
+
try {
|
|
879
|
+
let e = await v(P.get(E));
|
|
880
|
+
return e.success ? {
|
|
881
|
+
newExpiryTime: e.newExpiryTime,
|
|
882
|
+
remainingExtensions: e.remainingExtensions
|
|
883
|
+
} : ($.error("Failed to extend session:", e.error), null);
|
|
884
|
+
} catch (e) {
|
|
885
|
+
return $.error("Error extending checkout session:", e), null;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
var Re = Pe(), ze = P.first_child(Re), Be = (e) => {
|
|
889
|
+
{
|
|
890
|
+
let t = (e) => {
|
|
891
|
+
{
|
|
892
|
+
let t = P.derived(() => P.get(I) || P.get(L)), n = P.derived(() => P.get(K)?.serverTotals?.total ?? 0), r = P.derived(() => P.get(K)?.serverTotals?.giftCardAmount ?? null);
|
|
893
|
+
Oe(e, {
|
|
894
|
+
get cartId() {
|
|
895
|
+
return P.get(E);
|
|
896
|
+
},
|
|
897
|
+
onApplied: De,
|
|
898
|
+
onRemoved: ke,
|
|
899
|
+
get disabled() {
|
|
900
|
+
return P.get(t);
|
|
901
|
+
},
|
|
902
|
+
get owedTotal() {
|
|
903
|
+
return P.get(n);
|
|
904
|
+
},
|
|
905
|
+
get serverGiftCardAmount() {
|
|
906
|
+
return P.get(r);
|
|
907
|
+
},
|
|
908
|
+
get labels() {
|
|
909
|
+
return u();
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
}, n = P.derived(() => P.get(V) ?? (P.get(H) ? { message: P.get(H) } : null));
|
|
914
|
+
fe(e, {
|
|
915
|
+
get config() {
|
|
916
|
+
return P.get(K);
|
|
917
|
+
},
|
|
918
|
+
onPlaceOrder: we,
|
|
919
|
+
onBack: Ae,
|
|
920
|
+
onRetryExpired: Fe,
|
|
921
|
+
onExtendSession: Le,
|
|
922
|
+
get stripe() {
|
|
923
|
+
return P.get(R);
|
|
924
|
+
},
|
|
925
|
+
get paymentIntent() {
|
|
926
|
+
return P.get(z);
|
|
927
|
+
},
|
|
928
|
+
get serverTotalsUnavailable() {
|
|
929
|
+
return P.get(ye);
|
|
930
|
+
},
|
|
931
|
+
get paymentError() {
|
|
932
|
+
return P.get(n);
|
|
933
|
+
},
|
|
934
|
+
get labels() {
|
|
935
|
+
return u();
|
|
936
|
+
},
|
|
937
|
+
get locale() {
|
|
938
|
+
return d();
|
|
939
|
+
},
|
|
940
|
+
get elements() {
|
|
941
|
+
return P.get(B);
|
|
942
|
+
},
|
|
943
|
+
set elements(e) {
|
|
944
|
+
P.set(B, e, !0);
|
|
945
|
+
},
|
|
946
|
+
get eventEnded() {
|
|
947
|
+
return P.get(ge);
|
|
948
|
+
},
|
|
949
|
+
set eventEnded(e) {
|
|
950
|
+
P.set(ge, e, !0);
|
|
951
|
+
},
|
|
952
|
+
giftCard: t,
|
|
953
|
+
$$slots: { giftCard: !0 }
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
}, Ve = (e) => {
|
|
957
|
+
var t = Me(), n = P.child(t), r = P.child(n, !0);
|
|
958
|
+
P.reset(n), P.reset(t), P.template_effect(() => P.set_text(r, P.get(ve))), P.append(e, t);
|
|
959
|
+
}, He = (e) => {
|
|
960
|
+
var t = Ne(), n = P.child(t), r = P.child(n, !0);
|
|
961
|
+
P.reset(n), P.reset(t), P.template_effect(() => P.set_text(r, u().loadingSecurePaymentForm || "Loading secure payment form...")), P.append(e, t);
|
|
962
|
+
};
|
|
963
|
+
P.if(ze, (e) => {
|
|
964
|
+
P.get(K) ? e(Be) : P.get(_e) ? e(Ve, 1) : e(He, -1);
|
|
965
|
+
});
|
|
966
|
+
var Ue = P.sibling(ze, 2), We = (e) => {
|
|
967
|
+
je(e, {
|
|
968
|
+
open: !0,
|
|
969
|
+
get reason() {
|
|
970
|
+
return P.get(U);
|
|
971
|
+
},
|
|
972
|
+
onBackToEvents: Ie,
|
|
973
|
+
get labels() {
|
|
974
|
+
return u();
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
};
|
|
978
|
+
P.if(Ue, (e) => {
|
|
979
|
+
P.get(W) && e(We);
|
|
980
|
+
}), P.append(e, Re), P.pop();
|
|
981
|
+
}
|
|
982
|
+
//#endregion
|
|
983
|
+
export { Fe as default };
|