@getmicdrop/venue-calendar 4.3.4 → 4.3.6
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/{Checkout-BqaJK6UP.js → Checkout-wUH2YI1N.js} +320 -303
- package/dist/{CollectionView-CBGNYA_n.js → CollectionView-CAMsmrmW.js} +2 -2
- package/dist/{Event-BWfr4LV1.js → Event-BQgaaFkh.js} +1 -1
- package/dist/{EventPage-DMpbEjtH.js → EventPage-B9shaVEP.js} +2 -2
- package/dist/{SeriesPage-DNnOtCbs.js → SeriesPage-CNRwP2W0.js} +2 -2
- package/dist/{Success-ClXshzvl.js → Success--2NRdG0V.js} +1 -1
- package/dist/{shareCopyFeedback.svelte-Ba3vibxL.js → shareCopyFeedback.svelte-Cb2Mdn0z.js} +36 -46
- package/dist/venue-CBos8YTa.js +12 -0
- package/dist/venue-calendar.es.js +9 -9
- package/dist/venue-calendar.iife.js +52 -52
- package/dist/venue-calendar.umd.js +42 -42
- package/package.json +1 -1
- /package/dist/locales/{4.3.4 → 4.3.6}/flow/de.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/flow/es.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/flow/fr.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/flow/id.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/flow/it.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/flow/ja.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/flow/ko.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/flow/nl.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/flow/pl.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/flow/pt-br.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/flow/tr.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/flow/zh.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/main/de.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/main/es.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/main/fr.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/main/id.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/main/it.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/main/ja.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/main/ko.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/main/nl.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/main/pl.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/main/pt-br.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/main/tr.js +0 -0
- /package/dist/locales/{4.3.4 → 4.3.6}/main/zh.js +0 -0
|
@@ -5,20 +5,21 @@ import { i as u } from "./Input-D1FpSX5Q.js";
|
|
|
5
5
|
import { C as d, O as f, m as p } from "./constants-PBNG9ikv.js";
|
|
6
6
|
import { t as m } from "./TagIcon-BhLrURo_.js";
|
|
7
7
|
import { t as h } from "./WarningTriIcon-QVzQiEM4.js";
|
|
8
|
-
import { d as g, n as
|
|
9
|
-
import { f as
|
|
10
|
-
import { n as
|
|
11
|
-
import { a as
|
|
12
|
-
import { C as
|
|
13
|
-
import { t as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import { n as fe } from "./
|
|
8
|
+
import { d as g, n as ee } from "./z-index-BgKs9X9U.js";
|
|
9
|
+
import { f as _, i as v, n as y, r as b, s as x, t as S } from "./orders-CFF0Hb2x.js";
|
|
10
|
+
import { n as C, t as w } from "./serverTotals-Dbi69SIr.js";
|
|
11
|
+
import { a as T, i as E, n as D, r as O, t as k } from "./ModalFooter-B_8f1Z5p.js";
|
|
12
|
+
import { C as te, d as ne, f as A, u as j } from "./colors-BsP3TRan.js";
|
|
13
|
+
import { t as re } from "./venue-CBos8YTa.js";
|
|
14
|
+
import { t as ie } from "./event-transform-J7U1JmeK.js";
|
|
15
|
+
import { _ as ae, h as oe, l as M, r as se, y as N } from "./utils-CbacksjX.js";
|
|
16
|
+
import { a as ce, n as le } from "./promo--p3GbP64.js";
|
|
17
|
+
import { r as ue } from "./order-totals-DR-oXumr.js";
|
|
18
|
+
import de, { n as P, t as fe } from "./Checkout-DQWeMchu.js";
|
|
19
|
+
import { n as pe } from "./buyerEmail-BfCq-gDt.js";
|
|
19
20
|
import "svelte/internal/disclose-version";
|
|
20
21
|
import * as F from "svelte/internal/client";
|
|
21
|
-
import { onMount as
|
|
22
|
+
import { onMount as me } from "svelte";
|
|
22
23
|
//#region node_modules/@stripe/stripe-js/dist/index.mjs
|
|
23
24
|
function I(e) {
|
|
24
25
|
"@babel/helpers - typeof";
|
|
@@ -28,86 +29,86 @@ function I(e) {
|
|
|
28
29
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
29
30
|
}, I(e);
|
|
30
31
|
}
|
|
31
|
-
var L = "dahlia",
|
|
32
|
+
var L = "dahlia", he = function(e) {
|
|
32
33
|
return e === 3 ? "v3" : e;
|
|
33
|
-
},
|
|
34
|
-
return
|
|
35
|
-
},
|
|
36
|
-
for (var e = document.querySelectorAll(`script[src^="${
|
|
34
|
+
}, R = "https://js.stripe.com", z = `${R}/${L}/stripe.js`, B = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, V = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/, H = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", U = function(e) {
|
|
35
|
+
return B.test(e) || V.test(e);
|
|
36
|
+
}, ge = function() {
|
|
37
|
+
for (var e = document.querySelectorAll(`script[src^="${R}"]`), t = 0; t < e.length; t++) {
|
|
37
38
|
var n = e[t];
|
|
38
|
-
if (
|
|
39
|
+
if (U(n.src)) return n;
|
|
39
40
|
}
|
|
40
41
|
return null;
|
|
41
|
-
},
|
|
42
|
+
}, _e = function(e) {
|
|
42
43
|
var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
|
|
43
|
-
n.src = `${
|
|
44
|
+
n.src = `${z}${t}`;
|
|
44
45
|
var r = document.head || document.body;
|
|
45
46
|
if (!r) throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
46
47
|
return r.appendChild(n), n;
|
|
47
|
-
},
|
|
48
|
+
}, W = function(e, t) {
|
|
48
49
|
!e || !e._registerWrapper || e._registerWrapper({
|
|
49
50
|
name: "stripe-js",
|
|
50
51
|
version: "9.13.0",
|
|
51
52
|
startTime: t
|
|
52
53
|
});
|
|
53
|
-
},
|
|
54
|
+
}, G = null, K = null, q = null, J = function(e) {
|
|
54
55
|
return function(t) {
|
|
55
56
|
e(Error("Failed to load Stripe.js", { cause: t }));
|
|
56
57
|
};
|
|
57
|
-
},
|
|
58
|
+
}, ve = function(e, t) {
|
|
58
59
|
return function() {
|
|
59
60
|
window.Stripe ? e(window.Stripe) : t(/* @__PURE__ */ Error("Stripe.js not available"));
|
|
60
61
|
};
|
|
61
|
-
},
|
|
62
|
-
return
|
|
62
|
+
}, ye = function(e) {
|
|
63
|
+
return G === null ? (G = new Promise(function(t, n) {
|
|
63
64
|
if (typeof window > "u" || typeof document > "u") {
|
|
64
65
|
t(null);
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
|
-
if (window.Stripe && e && console.warn(
|
|
68
|
+
if (window.Stripe && e && console.warn(H), window.Stripe) {
|
|
68
69
|
t(window.Stripe);
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
71
72
|
try {
|
|
72
|
-
var r =
|
|
73
|
-
if (r && e) console.warn(
|
|
74
|
-
else if (!r) r =
|
|
75
|
-
else if (r &&
|
|
73
|
+
var r = ge();
|
|
74
|
+
if (r && e) console.warn(H);
|
|
75
|
+
else if (!r) r = _e(e);
|
|
76
|
+
else if (r && q !== null && K !== null) {
|
|
76
77
|
var i;
|
|
77
|
-
r.removeEventListener("load",
|
|
78
|
+
r.removeEventListener("load", q), r.removeEventListener("error", K), (i = r.parentNode) == null || i.removeChild(r), r = _e(e);
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
+
q = ve(t, n), K = J(n), r.addEventListener("load", q), r.addEventListener("error", K);
|
|
80
81
|
} catch (e) {
|
|
81
82
|
n(e);
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
|
-
}),
|
|
85
|
-
return
|
|
86
|
-
})) :
|
|
87
|
-
},
|
|
85
|
+
}), G.catch(function(e) {
|
|
86
|
+
return G = null, Promise.reject(e);
|
|
87
|
+
})) : G;
|
|
88
|
+
}, Y = function(e, t, n) {
|
|
88
89
|
if (e === null) return null;
|
|
89
90
|
var r = t[0];
|
|
90
91
|
if (typeof r != "string") throw Error(`Expected publishable key to be of type string, got type ${I(r)} instead.`);
|
|
91
|
-
var i = r.match(/^pk_test/), a =
|
|
92
|
+
var i = r.match(/^pk_test/), a = he(e.version), o = L;
|
|
92
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`);
|
|
93
94
|
var s = e.apply(void 0, t);
|
|
94
|
-
return
|
|
95
|
-
}, X,
|
|
96
|
-
return X || (X =
|
|
95
|
+
return W(s, n), s;
|
|
96
|
+
}, X, be = !1, xe = function() {
|
|
97
|
+
return X || (X = ye(null).catch(function(e) {
|
|
97
98
|
return X = null, Promise.reject(e);
|
|
98
99
|
}), X);
|
|
99
100
|
};
|
|
100
101
|
Promise.resolve().then(function() {
|
|
101
|
-
return
|
|
102
|
+
return xe();
|
|
102
103
|
}).catch(function(e) {
|
|
103
|
-
|
|
104
|
+
be || console.warn(e);
|
|
104
105
|
});
|
|
105
|
-
var
|
|
106
|
+
var Se = function() {
|
|
106
107
|
var e = [...arguments];
|
|
107
|
-
|
|
108
|
+
be = !0;
|
|
108
109
|
var t = Date.now();
|
|
109
|
-
return
|
|
110
|
-
return
|
|
110
|
+
return xe().then(function(n) {
|
|
111
|
+
return Y(n, e, t);
|
|
111
112
|
});
|
|
112
113
|
};
|
|
113
114
|
//#endregion
|
|
@@ -182,100 +183,100 @@ function Z(e, t = a) {
|
|
|
182
183
|
}
|
|
183
184
|
//#endregion
|
|
184
185
|
//#region src/components/Events/Checkout/GiftCardInput.svelte
|
|
185
|
-
var Q = n("GiftCardInput"),
|
|
186
|
-
function
|
|
186
|
+
var Q = n("GiftCardInput"), Ce = F.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 = F.from_html("<div class=\"applied-card mb-3 svelte-emw0hd\"><div><!> <span> </span></div></div>"), Te = F.from_html("<div class=\"flex items-center gap-1.5 mt-2 type-body text-accent-danger\"><!> <span> </span></div>"), Ee = F.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 = F.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) {
|
|
187
188
|
F.push(i, !0);
|
|
188
|
-
let o = F.prop(i, "onApplied", 3, () => {}), c = F.prop(i, "onRemoved", 3, () => {}), u = F.prop(i, "disabled", 3, !1), f = F.prop(i, "labels", 3, a), p = F.prop(i, "owedTotal", 3, 0),
|
|
189
|
+
let o = F.prop(i, "onApplied", 3, () => {}), c = F.prop(i, "onRemoved", 3, () => {}), u = F.prop(i, "disabled", 3, !1), f = F.prop(i, "labels", 3, a), p = F.prop(i, "owedTotal", 3, 0), _ = F.state(""), v = F.state(!1), y = F.state(""), x = F.state(F.proxy([])), S = F.state(!1), C = F.state(0);
|
|
189
190
|
F.user_effect(() => {
|
|
190
|
-
if (!i.cartId || F.get(
|
|
191
|
+
if (!i.cartId || F.get(x).length > 0) return;
|
|
191
192
|
let e = !1;
|
|
192
|
-
return
|
|
193
|
+
return b(i.cartId).then((t) => {
|
|
193
194
|
if (e || !t?.giftCards?.length) return;
|
|
194
195
|
let n = t.giftCards.filter((e) => typeof e.amount == "number");
|
|
195
|
-
n.length !== t.giftCards.length && Q.error("Ignored applied gift card(s) with an unusable amount while restoring the panel"), n.length !== 0 && (F.set(
|
|
196
|
+
n.length !== t.giftCards.length && Q.error("Ignored applied gift card(s) with an unusable amount while restoring the panel"), n.length !== 0 && (F.set(x, n.map((e) => ({
|
|
196
197
|
giftCardId: e.giftCardId,
|
|
197
198
|
code: e.maskedCode,
|
|
198
199
|
giftCardAmount: e.amount
|
|
199
|
-
})), !0), F.set(
|
|
200
|
+
})), !0), F.set(C, F.get(x).reduce((e, t) => e + (t.giftCardAmount || 0), 0) + (p() || 0)));
|
|
200
201
|
}).catch((e) => Q.error("Could not restore applied gift cards:", e)), () => {
|
|
201
202
|
e = !0;
|
|
202
203
|
};
|
|
203
204
|
});
|
|
204
|
-
let
|
|
205
|
-
function
|
|
206
|
-
if (F.get(
|
|
205
|
+
let w = F.derived(() => F.get(x).reduce((e, t) => e + (t.giftCardAmount || 0), 0)), T = F.derived(() => Math.max(0, F.get(C) - F.get(w))), E = F.derived(() => F.get(x).length > 0 && F.get(T) <= 0);
|
|
206
|
+
function D() {
|
|
207
|
+
if (F.get(x).length === 0) {
|
|
207
208
|
c()();
|
|
208
209
|
return;
|
|
209
210
|
}
|
|
210
211
|
o()({
|
|
211
|
-
code: F.get(
|
|
212
|
-
giftCardAmount: F.get(
|
|
213
|
-
stripeAmount: F.get(
|
|
214
|
-
requiresStripe: F.get(
|
|
215
|
-
paymentType: F.get(
|
|
216
|
-
orderTotal: F.get(
|
|
212
|
+
code: F.get(x).map((e) => e.code).join(", "),
|
|
213
|
+
giftCardAmount: F.get(w),
|
|
214
|
+
stripeAmount: F.get(T),
|
|
215
|
+
requiresStripe: F.get(T) > 0,
|
|
216
|
+
paymentType: F.get(T) > 0 ? "split" : "gift_card_only",
|
|
217
|
+
orderTotal: F.get(C)
|
|
217
218
|
});
|
|
218
219
|
}
|
|
219
|
-
async function
|
|
220
|
-
let e = F.get(
|
|
221
|
-
if (!(!e || F.get(
|
|
222
|
-
if (F.get(
|
|
223
|
-
F.set(
|
|
220
|
+
async function O() {
|
|
221
|
+
let e = F.get(_).trim().toUpperCase();
|
|
222
|
+
if (!(!e || F.get(v) || !i.cartId)) {
|
|
223
|
+
if (F.get(x).some((t) => t.code === e)) {
|
|
224
|
+
F.set(y, f().giftCardAlreadyApplied || "That gift card is already applied", !0);
|
|
224
225
|
return;
|
|
225
226
|
}
|
|
226
|
-
F.set(
|
|
227
|
+
F.set(v, !0), F.set(y, "");
|
|
227
228
|
try {
|
|
228
229
|
let t = await j(i.cartId, e);
|
|
229
|
-
t.valid ? (F.set(
|
|
230
|
+
t.valid ? (F.set(x, [...F.get(x), {
|
|
230
231
|
code: t.giftCardCode || e,
|
|
231
232
|
giftCardAmount: t.giftCardAmount || 0
|
|
232
|
-
}], !0), F.set(
|
|
233
|
+
}], !0), F.set(C, F.get(w) + (t.stripeAmount || 0)), F.set(_, ""), F.set(S, !1), D()) : F.set(y, t.error || f().invalidGiftCardCode || "Invalid gift card code", !0);
|
|
233
234
|
} catch (e) {
|
|
234
235
|
Q.error("Error applying gift card:", e);
|
|
235
236
|
let t = e && typeof e == "object" && typeof e.message == "string" ? e.message : "";
|
|
236
|
-
F.set(
|
|
237
|
+
F.set(y, t || f().failedToApplyGiftCard || "Failed to apply gift card. Please try again", !0);
|
|
237
238
|
}
|
|
238
|
-
F.set(
|
|
239
|
+
F.set(v, !1);
|
|
239
240
|
}
|
|
240
241
|
}
|
|
241
|
-
async function
|
|
242
|
-
if (!(F.get(
|
|
243
|
-
F.set(
|
|
242
|
+
async function k(e) {
|
|
243
|
+
if (!(F.get(v) || !i.cartId)) {
|
|
244
|
+
F.set(v, !0), F.set(y, "");
|
|
244
245
|
try {
|
|
245
|
-
let t = F.get(
|
|
246
|
-
n.success !== !1 && !n.error ? (F.set(
|
|
246
|
+
let t = F.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 ? (F.set(x, F.get(x).filter((t) => t.code !== e), !0), typeof n.remainingTotal == "number" && F.set(C, F.get(w) + n.remainingTotal), D()) : F.set(y, n.error || f().failedToRemoveGiftCard || "Failed to remove gift card. Please try again", !0);
|
|
247
248
|
} catch (e) {
|
|
248
|
-
Q.error("Error removing gift card:", e), F.set(
|
|
249
|
+
Q.error("Error removing gift card:", e), F.set(y, f().failedToRemoveGiftCard || "Failed to remove gift card. Please try again", !0);
|
|
249
250
|
}
|
|
250
|
-
F.set(
|
|
251
|
+
F.set(v, !1);
|
|
251
252
|
}
|
|
252
253
|
}
|
|
253
|
-
function
|
|
254
|
-
e.key === "Enter" && !F.get(
|
|
254
|
+
function te(e) {
|
|
255
|
+
e.key === "Enter" && !F.get(v) && O();
|
|
255
256
|
}
|
|
256
|
-
function
|
|
257
|
-
F.set(
|
|
257
|
+
function ne() {
|
|
258
|
+
F.set(S, !F.get(S)), F.get(S) || (F.set(_, ""), F.set(y, ""));
|
|
258
259
|
}
|
|
259
|
-
var
|
|
260
|
-
F.each(
|
|
261
|
-
var n =
|
|
260
|
+
var re = De(), ie = F.child(re);
|
|
261
|
+
F.each(ie, 17, () => F.get(x), (e) => e.code, (e, t) => {
|
|
262
|
+
var n = Ce(), i = F.child(n), a = F.child(i), o = F.child(a);
|
|
262
263
|
s(o, { size: "16" }), F.reset(a);
|
|
263
264
|
var c = F.sibling(a, 2), p = F.child(c), m = F.child(p, !0);
|
|
264
265
|
F.reset(p);
|
|
265
|
-
var h = F.sibling(p, 2),
|
|
266
|
+
var h = F.sibling(p, 2), _ = F.child(h, !0);
|
|
266
267
|
F.reset(h), F.reset(c);
|
|
267
|
-
var
|
|
268
|
-
F.reset(
|
|
269
|
-
var
|
|
268
|
+
var y = F.sibling(c, 2), b = F.child(y);
|
|
269
|
+
F.reset(y);
|
|
270
|
+
var x = F.sibling(y, 2);
|
|
270
271
|
{
|
|
271
272
|
let e = F.derived(() => f().removeGiftCard || "Remove gift card");
|
|
272
|
-
r(
|
|
273
|
+
r(x, {
|
|
273
274
|
variant: "icon",
|
|
274
275
|
size: "icon-sm",
|
|
275
276
|
class: "rounded-full hover:bg-status-error-bg hover:text-accent-danger",
|
|
276
|
-
onclick: () =>
|
|
277
|
+
onclick: () => k(F.get(t).code),
|
|
277
278
|
get loading() {
|
|
278
|
-
return F.get(
|
|
279
|
+
return F.get(v);
|
|
279
280
|
},
|
|
280
281
|
get disabled() {
|
|
281
282
|
return u();
|
|
@@ -290,43 +291,43 @@ function De(n, i) {
|
|
|
290
291
|
});
|
|
291
292
|
}
|
|
292
293
|
F.reset(i), F.reset(n), F.template_effect((e) => {
|
|
293
|
-
F.set_text(m, f().giftCardApplied || "Gift card applied"), F.set_text(
|
|
294
|
-
}, [() => d(F.get(t).giftCardAmount)]), F.transition(3, n, () => g, () => ({ duration:
|
|
294
|
+
F.set_text(m, f().giftCardApplied || "Gift card applied"), F.set_text(_, F.get(t).code), F.set_text(b, `-${e ?? ""}`);
|
|
295
|
+
}, [() => d(F.get(t).giftCardAmount)]), F.transition(3, n, () => g, () => ({ duration: ee.fast })), F.append(e, n);
|
|
295
296
|
});
|
|
296
|
-
var
|
|
297
|
-
var r =
|
|
297
|
+
var ae = F.sibling(ie, 2), oe = (n) => {
|
|
298
|
+
var r = we(), i = F.child(r), a = F.child(i);
|
|
298
299
|
s(a, { size: "16" });
|
|
299
300
|
var o = F.sibling(a, 2), c = F.child(o, !0);
|
|
300
301
|
F.reset(o), F.reset(i), F.reset(r), F.template_effect(() => {
|
|
301
302
|
F.set_class(i, 1, `full-coverage-badge ${t.caption ?? ""} ${e.emphasis ?? ""}`, "svelte-emw0hd"), F.set_text(c, f().fullyCoveredByGiftCard || "Fully covered by gift card");
|
|
302
303
|
}), F.append(n, r);
|
|
303
304
|
};
|
|
304
|
-
F.if(
|
|
305
|
-
F.get(
|
|
305
|
+
F.if(ae, (e) => {
|
|
306
|
+
F.get(E) && e(oe);
|
|
306
307
|
});
|
|
307
|
-
var
|
|
308
|
-
m(
|
|
308
|
+
var M = F.sibling(ae, 2), se = F.child(M);
|
|
309
|
+
m(se, {
|
|
309
310
|
size: "20",
|
|
310
311
|
class: "gift-icon"
|
|
311
312
|
});
|
|
312
|
-
var
|
|
313
|
-
F.reset(
|
|
314
|
-
var le = F.sibling(
|
|
315
|
-
F.reset(le), F.reset(
|
|
316
|
-
var
|
|
317
|
-
var n =
|
|
313
|
+
var N = F.sibling(se, 2), ce = F.child(N, !0);
|
|
314
|
+
F.reset(N);
|
|
315
|
+
var le = F.sibling(N, 2), ue = F.child(le, !0);
|
|
316
|
+
F.reset(le), F.reset(M);
|
|
317
|
+
var de = F.sibling(M, 2), P = (e) => {
|
|
318
|
+
var n = Ee(), i = F.child(n), a = F.child(i);
|
|
318
319
|
F.remove_input_defaults(a);
|
|
319
320
|
let o;
|
|
320
321
|
var s = F.sibling(a, 2);
|
|
321
322
|
{
|
|
322
|
-
let e = F.derived(() => !F.get(
|
|
323
|
+
let e = F.derived(() => !F.get(_).trim() || u());
|
|
323
324
|
r(s, {
|
|
324
325
|
variant: "default",
|
|
325
326
|
size: "sm",
|
|
326
327
|
class: "min-w-16 shrink-0",
|
|
327
|
-
onclick:
|
|
328
|
+
onclick: O,
|
|
328
329
|
get loading() {
|
|
329
|
-
return F.get(
|
|
330
|
+
return F.get(v);
|
|
330
331
|
},
|
|
331
332
|
get disabled() {
|
|
332
333
|
return F.get(e);
|
|
@@ -341,31 +342,31 @@ function De(n, i) {
|
|
|
341
342
|
}
|
|
342
343
|
F.reset(i);
|
|
343
344
|
var c = F.sibling(i, 2), l = (e) => {
|
|
344
|
-
var t =
|
|
345
|
+
var t = Te(), n = F.child(t);
|
|
345
346
|
h(n, { size: "16" });
|
|
346
347
|
var r = F.sibling(n, 2), i = F.child(r, !0);
|
|
347
|
-
F.reset(r), F.reset(t), F.template_effect(() => F.set_text(i, F.get(
|
|
348
|
+
F.reset(r), F.reset(t), F.template_effect(() => F.set_text(i, F.get(y))), F.transition(3, t, () => g, () => ({ duration: ee.micro })), F.append(e, t);
|
|
348
349
|
};
|
|
349
350
|
F.if(c, (e) => {
|
|
350
|
-
F.get(
|
|
351
|
+
F.get(y) && e(l);
|
|
351
352
|
}), F.reset(n), F.template_effect(() => {
|
|
352
|
-
F.set_attribute(a, "aria-label", f().enterGiftCardCode || "Enter gift card code"), F.set_attribute(a, "placeholder", f().enterGiftCardCode || "Enter gift card code"), a.disabled = F.get(
|
|
353
|
-
}), F.delegated("keydown", a,
|
|
353
|
+
F.set_attribute(a, "aria-label", f().enterGiftCardCode || "Enter gift card code"), F.set_attribute(a, "placeholder", f().enterGiftCardCode || "Enter gift card code"), a.disabled = F.get(v) || u(), o = F.set_class(a, 1, `gift-input ${t.body ?? ""}`, "svelte-emw0hd", o, { "has-error": !!F.get(y) });
|
|
354
|
+
}), F.delegated("keydown", a, te), F.bind_value(a, () => F.get(_), (e) => F.set(_, e)), F.transition(3, n, () => g, () => ({ duration: ee.fast })), F.append(e, n);
|
|
354
355
|
};
|
|
355
|
-
F.if(
|
|
356
|
-
F.get(
|
|
357
|
-
}), F.reset(
|
|
358
|
-
F.set_class(
|
|
359
|
-
}), F.delegated("click",
|
|
356
|
+
F.if(de, (e) => {
|
|
357
|
+
F.get(S) && e(P);
|
|
358
|
+
}), F.reset(re), F.template_effect(() => {
|
|
359
|
+
F.set_class(M, 1, `gift-card-toggle ${t.label ?? ""}`, "svelte-emw0hd"), M.disabled = u(), F.set_attribute(M, "aria-expanded", F.get(S)), F.set_text(ce, F.get(x).length > 0 ? f().addAnotherGiftCard || "Add another gift card" : f().haveAGiftCard || "Have a gift card?"), F.set_text(ue, F.get(S) ? "-" : "+");
|
|
360
|
+
}), F.delegated("click", M, ne), F.append(n, re), F.pop();
|
|
360
361
|
}
|
|
361
362
|
F.delegate(["click", "keydown"]);
|
|
362
363
|
//#endregion
|
|
363
364
|
//#region src/components/Modals/EventUnavailableModal.svelte
|
|
364
|
-
var
|
|
365
|
-
function
|
|
365
|
+
var ke = F.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 = F.from_html("<!> <!>", 1);
|
|
366
|
+
function je(e, n) {
|
|
366
367
|
F.push(n, !0);
|
|
367
368
|
let i = F.prop(n, "open", 15, !1), o = F.prop(n, "onBackToEvents", 3, () => {}), s = F.prop(n, "labels", 3, a), l = F.derived(() => n.reason === "canceled"), d = F.derived(() => F.get(l) ? s().eventCanceledTitle || "Event cancelled" : s().eventPostponedTitle || "Event postponed"), f = F.derived(() => F.get(l) ? s().eventCanceledBody || "This event was cancelled — you weren't charged" : s().eventPostponedBody || "Sales are paused while this show is rescheduled — you weren't charged"), p = F.derived(() => s().backToEvents || "Back to events");
|
|
368
|
-
|
|
369
|
+
T(e, {
|
|
369
370
|
size: "sm",
|
|
370
371
|
role: "alertdialog",
|
|
371
372
|
class: "micdrop",
|
|
@@ -376,15 +377,15 @@ function Ae(e, n) {
|
|
|
376
377
|
i(e);
|
|
377
378
|
},
|
|
378
379
|
children: (e, n) => {
|
|
379
|
-
var i =
|
|
380
|
-
|
|
380
|
+
var i = Ae(), a = F.first_child(i);
|
|
381
|
+
E(a, {});
|
|
381
382
|
var s = F.sibling(a, 2);
|
|
382
|
-
|
|
383
|
+
O(s, {
|
|
383
384
|
children: (e, n) => {
|
|
384
|
-
var i =
|
|
385
|
-
|
|
385
|
+
var i = Ae(), a = F.first_child(i);
|
|
386
|
+
D(a, {
|
|
386
387
|
children: (e, n) => {
|
|
387
|
-
var r =
|
|
388
|
+
var r = ke(), i = F.child(r), a = F.child(i), o = (e) => {
|
|
388
389
|
u(e, { size: "32" });
|
|
389
390
|
}, s = (e) => {
|
|
390
391
|
c(e, { size: "32" });
|
|
@@ -402,7 +403,7 @@ function Ae(e, n) {
|
|
|
402
403
|
$$slots: { default: !0 }
|
|
403
404
|
});
|
|
404
405
|
var s = F.sibling(a, 2);
|
|
405
|
-
|
|
406
|
+
k(s, {
|
|
406
407
|
children: (e, t) => {
|
|
407
408
|
r(e, {
|
|
408
409
|
size: "full",
|
|
@@ -432,42 +433,57 @@ function Ae(e, n) {
|
|
|
432
433
|
}
|
|
433
434
|
//#endregion
|
|
434
435
|
//#region src/components/Views/Checkout.svelte
|
|
435
|
-
var $ = n("Checkout"),
|
|
436
|
-
function
|
|
436
|
+
var $ = n("Checkout"), Me = F.from_html("<div class=\"p-8 text-center\"><p class=\"text-accent-danger\"> </p></div>"), Ne = F.from_html("<div class=\"p-8 text-center\"><p class=\"tone-muted\"> </p></div>"), Pe = F.from_html("<!> <!>", 1);
|
|
437
|
+
function Fe(e, t) {
|
|
437
438
|
F.push(t, !0);
|
|
438
439
|
let n = F.prop(t, "availableTickets", 23, () => []);
|
|
439
440
|
F.prop(t, "value", 3, "");
|
|
440
|
-
let r = F.prop(t, "venueId", 3, ""), s = F.prop(t, "organizationId", 3, ""), c = F.prop(t, "onNavigateBack", 3, void 0), l = F.prop(t, "initialError", 3, void 0), u = F.prop(t, "widgetId", 3, null), d = F.prop(t, "labels", 3, a), m = F.prop(t, "locale", 3, void 0)
|
|
441
|
+
let r = F.prop(t, "venueId", 3, ""), s = F.prop(t, "organizationId", 3, ""), c = F.prop(t, "onNavigateBack", 3, void 0), l = F.prop(t, "initialError", 3, void 0), u = F.prop(t, "widgetId", 3, null), d = F.prop(t, "labels", 3, a), m = F.prop(t, "locale", 3, void 0);
|
|
442
|
+
function h(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 g = F.derived(() => (t.data || {}).id);
|
|
441
454
|
F.derived(() => (t.data || {}).orgSlug);
|
|
442
|
-
let
|
|
443
|
-
|
|
444
|
-
|
|
455
|
+
let ee = F.derived(() => (t.data || {}).slug), b = F.derived(() => (t.data || {}).event), T = F.derived(() => re(h(F.get(b)))), E = F.derived(() => F.get(b) ? {
|
|
456
|
+
...ie(F.get(b)),
|
|
457
|
+
...F.get(T)
|
|
458
|
+
} : t.data && (t.data.id || F.get(g)) ? {
|
|
459
|
+
id: t.data.id || F.get(g),
|
|
460
|
+
eventID: t.data.id || F.get(g),
|
|
445
461
|
venueID: t.data.venueID ?? t.data.venueId ?? null,
|
|
446
462
|
venueId: t.data.venueId ?? t.data.venueID ?? null,
|
|
447
463
|
eventTicketingType: 0,
|
|
448
464
|
ticketType: 0,
|
|
449
465
|
availableTickets: []
|
|
450
|
-
} : null),
|
|
451
|
-
function
|
|
466
|
+
} : null), D = F.state(""), O = F.state(F.proxy({})), k = F.state(F.proxy({})), A = F.state(F.proxy([])), j = F.state(""), I = F.state(0), L = F.state(!1), he = F.state(!1), R = F.state(!1), z = F.state(null), B = F.state(""), V = F.state(void 0), H = F.state(null), U = F.state(""), ge = F.state(!1), _e = F.state(""), W = F.state(null), G = F.derived(() => F.get(W) !== null), K = F.state(null), q = F.state(null), J = null, ve = F.state(!1);
|
|
467
|
+
function ye() {
|
|
452
468
|
return {
|
|
453
|
-
value:
|
|
454
|
-
currency:
|
|
469
|
+
value: J?.total ?? null,
|
|
470
|
+
currency: J?.currency || "USD"
|
|
455
471
|
};
|
|
456
472
|
}
|
|
457
|
-
|
|
458
|
-
if (F.set(
|
|
459
|
-
F.set(
|
|
473
|
+
me(async () => {
|
|
474
|
+
if (F.set(D, P(M) || P(fe.CHECKOUT_CARTID), !0), !F.get(D)) {
|
|
475
|
+
F.set(ge, !0), F.set(_e, d().noCheckoutSession || "No checkout session found. Please select tickets first", !0);
|
|
460
476
|
return;
|
|
461
477
|
}
|
|
462
|
-
|
|
463
|
-
let e = F.get(
|
|
478
|
+
_(F.get(E)?.eventID || F.get(E)?.id || F.get(g), u(), r() || F.get(E)?.venueID || F.get(E)?.venueId || null);
|
|
479
|
+
let e = F.get(E)?.eventID || F.get(E)?.id || F.get(g);
|
|
464
480
|
try {
|
|
465
|
-
let t =
|
|
466
|
-
F.set(
|
|
481
|
+
let t = oe(e);
|
|
482
|
+
F.set(O, t.quantities || {}, !0), F.set(k, t.donationAmounts || {}, !0), F.set(j, t.promocode || "", !0), F.set(I, t.promoDiscountAmount || 0, !0), F.set(A, t.tickets || [], !0);
|
|
467
483
|
} catch (e) {
|
|
468
|
-
$.error("Error loading checkout state:", e), F.set(
|
|
484
|
+
$.error("Error loading checkout state:", e), F.set(O, {}, !0), F.set(A, [], !0);
|
|
469
485
|
}
|
|
470
|
-
F.get(
|
|
486
|
+
F.get(A).length > 0 && F.get(E) && (F.get(E).availableTickets = F.get(A), n(F.get(A)));
|
|
471
487
|
let t = {
|
|
472
488
|
serviceFeeCents: 0,
|
|
473
489
|
serviceFeePercentage: 0,
|
|
@@ -477,7 +493,7 @@ function Pe(e, t) {
|
|
|
477
493
|
taxPercentage: 0
|
|
478
494
|
};
|
|
479
495
|
try {
|
|
480
|
-
let e = await
|
|
496
|
+
let e = await se(F.get(E)?.venueID || F.get(E)?.venueId || r());
|
|
481
497
|
t = {
|
|
482
498
|
serviceFeeCents: Number(e?.serviceFeeCents == null ? 0 : e.serviceFeeCents),
|
|
483
499
|
serviceFeePercentage: Number(e?.serviceFeePercentage ?? 0),
|
|
@@ -489,20 +505,20 @@ function Pe(e, t) {
|
|
|
489
505
|
} catch (e) {
|
|
490
506
|
$.error("Error fetching venue data:", e);
|
|
491
507
|
}
|
|
492
|
-
let i =
|
|
493
|
-
Object.keys(F.get(
|
|
508
|
+
let i = xe(F.get(O), F.get(A), t);
|
|
509
|
+
Object.keys(F.get(O)).length > 0 && await X();
|
|
494
510
|
let a = 900, s = "";
|
|
495
|
-
if (F.get(
|
|
496
|
-
let e =
|
|
511
|
+
if (F.get(D)) {
|
|
512
|
+
let e = ae(F.get(D));
|
|
497
513
|
if (e) {
|
|
498
514
|
let t = Math.max(0, Math.floor((e - Date.now()) / 1e3));
|
|
499
515
|
t > 0 && (a = t);
|
|
500
516
|
}
|
|
501
517
|
try {
|
|
502
|
-
let e = await
|
|
518
|
+
let e = await v(F.get(D));
|
|
503
519
|
if (!e.error && e.expiresAt) {
|
|
504
520
|
let t = o(e.expiresAt).getTime();
|
|
505
|
-
a = Math.max(0, Math.floor((t - Date.now()) / 1e3)), s = e.expiresAt,
|
|
521
|
+
a = Math.max(0, Math.floor((t - Date.now()) / 1e3)), s = e.expiresAt, N(F.get(D), t);
|
|
506
522
|
}
|
|
507
523
|
} catch {}
|
|
508
524
|
}
|
|
@@ -513,76 +529,76 @@ function Pe(e, t) {
|
|
|
513
529
|
} catch {
|
|
514
530
|
p = [];
|
|
515
531
|
}
|
|
516
|
-
let m = f(i.filter((e) =>
|
|
517
|
-
if (F.set(
|
|
518
|
-
event:
|
|
532
|
+
let m = f(i.filter((e) => le(p, e.ticketId)).reduce((e, t) => e + (t.subtotal == null ? 0 : t.subtotal), 0)), h = ce(m, F.get(I), c);
|
|
533
|
+
if (F.set(q, {
|
|
534
|
+
event: be(F.get(E), t),
|
|
519
535
|
lines: i,
|
|
520
536
|
timerStart: a,
|
|
521
537
|
...s ? { deadlineAt: s } : {},
|
|
522
|
-
promoApplied: !!F.get(
|
|
523
|
-
promoDiscount:
|
|
538
|
+
promoApplied: !!F.get(j),
|
|
539
|
+
promoDiscount: h,
|
|
524
540
|
forceExpired: !1,
|
|
525
|
-
...
|
|
541
|
+
...J ? { serverTotals: J } : {}
|
|
526
542
|
}, !0), l()) {
|
|
527
543
|
let e = Z(typeof l() == "object" ? l() : {
|
|
528
544
|
code: "card_declined",
|
|
529
545
|
message: "Your card was declined. Please try a different payment method."
|
|
530
546
|
}, d());
|
|
531
|
-
F.set(
|
|
547
|
+
F.set(H, {
|
|
532
548
|
message: e.message,
|
|
533
549
|
suggestion: e.suggestion
|
|
534
550
|
}, !0);
|
|
535
551
|
}
|
|
536
552
|
});
|
|
537
553
|
let Y = 0;
|
|
538
|
-
async function
|
|
554
|
+
async function X() {
|
|
539
555
|
let e = ++Y;
|
|
540
|
-
if (!F.get(
|
|
556
|
+
if (!F.get(D)) {
|
|
541
557
|
$.error("Missing cartId!");
|
|
542
558
|
return;
|
|
543
559
|
}
|
|
544
|
-
let t = Object.fromEntries(Object.entries(F.get(
|
|
560
|
+
let t = Object.fromEntries(Object.entries(F.get(O)).filter(([e, t]) => t > 0));
|
|
545
561
|
try {
|
|
546
|
-
let n = Object.fromEntries(Object.entries(F.get(
|
|
547
|
-
if (F.get(
|
|
548
|
-
let t = await
|
|
562
|
+
let n = Object.fromEntries(Object.entries(F.get(k)).filter(([, e]) => parseFloat(String(e)) > 0).map(([e, t]) => [parseInt(e, 10), parseFloat(String(t))]));
|
|
563
|
+
if (F.get(j)) {
|
|
564
|
+
let t = await te(F.get(D), F.get(j));
|
|
549
565
|
if (e !== Y) return;
|
|
550
|
-
t.success ? F.set(
|
|
566
|
+
t.success ? F.set(U, "") : ($.error("Failed to apply promo code to cart:", t.error), F.set(U, (d().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}", F.get(j)), !0));
|
|
551
567
|
}
|
|
552
|
-
let r = await
|
|
568
|
+
let r = await S(F.get(D), t, Object.keys(n).length > 0 ? n : void 0, void 0, m());
|
|
553
569
|
if (e !== Y) return;
|
|
554
570
|
if (!r) {
|
|
555
|
-
F.set(
|
|
571
|
+
F.set(H, { message: d().failedToCreatePaymentIntent || "Failed to create payment intent. Please try again" }, !0);
|
|
556
572
|
return;
|
|
557
573
|
}
|
|
558
|
-
F.set(
|
|
559
|
-
...F.get(
|
|
560
|
-
serverTotals:
|
|
574
|
+
F.set(ve, !1), J = w(r), F.get(q) && F.set(q, {
|
|
575
|
+
...F.get(q),
|
|
576
|
+
serverTotals: J
|
|
561
577
|
}, !0);
|
|
562
578
|
let i = r;
|
|
563
579
|
if (i.requires_stripe === !1 || i.payment_type === "free") {
|
|
564
|
-
F.set(
|
|
580
|
+
F.set(B, "free");
|
|
565
581
|
return;
|
|
566
582
|
}
|
|
567
|
-
F.set(
|
|
583
|
+
F.set(ve, J === null);
|
|
568
584
|
let a = r.stripe_publishable_key;
|
|
569
585
|
if (!a) {
|
|
570
|
-
$.error("No Stripe publishable key in payment intent response"), F.set(
|
|
586
|
+
$.error("No Stripe publishable key in payment intent response"), F.set(H, { message: d().paymentConfigError || "Payment configuration error. Please try again" }, !0);
|
|
571
587
|
return;
|
|
572
588
|
}
|
|
573
|
-
let o = await
|
|
589
|
+
let o = await Se(a);
|
|
574
590
|
if (e !== Y) return;
|
|
575
|
-
F.set(
|
|
591
|
+
F.set(z, o, !0), r.client_secret ? F.set(B, r.client_secret, !0) : F.set(H, { message: d().failedToInitPayment || "Failed to initialize payment. Please try again" }, !0);
|
|
576
592
|
} catch (t) {
|
|
577
593
|
if ($.error("Failed to initialize Stripe payment:", t), e !== Y) return;
|
|
578
|
-
F.set(
|
|
594
|
+
F.set(H, { message: t.message || d().failedToInitPayment || "Failed to initialize payment. Please try again" }, !0);
|
|
579
595
|
}
|
|
580
596
|
}
|
|
581
|
-
function
|
|
597
|
+
function be(e, t) {
|
|
582
598
|
return e ? {
|
|
583
599
|
id: e.id || e.eventID,
|
|
584
600
|
title: e.name || e.title || "",
|
|
585
|
-
slug: e.slug || F.get(
|
|
601
|
+
slug: e.slug || F.get(ee) || "",
|
|
586
602
|
description: e.description || "",
|
|
587
603
|
date: e.date || "",
|
|
588
604
|
startDateTime: e.startDateTime || "",
|
|
@@ -590,6 +606,7 @@ function Pe(e, t) {
|
|
|
590
606
|
doorsOpenTime: e.doorsOpenTime || "",
|
|
591
607
|
timezone: e.timeZone || e.timezone || i(),
|
|
592
608
|
imageUrl: e.imageUrl || e.image || "",
|
|
609
|
+
...F.get(T),
|
|
593
610
|
venue: {
|
|
594
611
|
id: e.venueID || e.venueId || 0,
|
|
595
612
|
name: e.venueName || "",
|
|
@@ -625,7 +642,7 @@ function Pe(e, t) {
|
|
|
625
642
|
totalTicketsCapacity: 100
|
|
626
643
|
} : null;
|
|
627
644
|
}
|
|
628
|
-
function
|
|
645
|
+
function xe(e, t, n) {
|
|
629
646
|
let r = [];
|
|
630
647
|
for (let [i, a] of Object.entries(e)) {
|
|
631
648
|
if (a <= 0) continue;
|
|
@@ -644,7 +661,7 @@ function Pe(e, t) {
|
|
|
644
661
|
});
|
|
645
662
|
continue;
|
|
646
663
|
}
|
|
647
|
-
let c = s ?? 0, l =
|
|
664
|
+
let c = s ?? 0, l = ue(c, n, o);
|
|
648
665
|
r.push({
|
|
649
666
|
ticketId: parseInt(i),
|
|
650
667
|
ticketName: e.name || "",
|
|
@@ -657,62 +674,62 @@ function Pe(e, t) {
|
|
|
657
674
|
}
|
|
658
675
|
return r;
|
|
659
676
|
}
|
|
660
|
-
let
|
|
661
|
-
async function
|
|
662
|
-
if (!F.get(
|
|
663
|
-
F.set(
|
|
677
|
+
let Q = F.derived(() => Object.values(F.get(k)).some((e) => (Number(e) || 0) > 0)), Ce = F.derived(() => !F.get(Q) && (!F.get(q) || F.get(q).lines.every((e) => e.unitPrice === 0)));
|
|
678
|
+
async function we(e) {
|
|
679
|
+
if (!F.get(L)) {
|
|
680
|
+
F.set(L, !0), F.set(H, null);
|
|
664
681
|
try {
|
|
665
|
-
if (F.get(
|
|
666
|
-
F.set(
|
|
682
|
+
if (F.get(R)) {
|
|
683
|
+
F.set(H, { message: d().paymentReinitializing || "Updating your total. Please wait a moment and try again" }, !0);
|
|
667
684
|
return;
|
|
668
685
|
}
|
|
669
|
-
if (F.get(
|
|
670
|
-
await
|
|
686
|
+
if (F.get(K) && !F.get(K).requiresStripe) {
|
|
687
|
+
await Te(e);
|
|
671
688
|
return;
|
|
672
689
|
}
|
|
673
|
-
if (F.get(
|
|
674
|
-
await
|
|
690
|
+
if (F.get(Ce) || F.get(B) === "free" || J?.total === 0) {
|
|
691
|
+
await Ee(e);
|
|
675
692
|
return;
|
|
676
693
|
}
|
|
677
|
-
if (!F.get(
|
|
678
|
-
F.set(
|
|
694
|
+
if (!F.get(V)) {
|
|
695
|
+
F.set(H, {
|
|
679
696
|
message: d().paymentFormNotReady || "Payment form is not ready. Please wait a moment and try again",
|
|
680
697
|
blocking: !0
|
|
681
|
-
}, !0), F.set(
|
|
698
|
+
}, !0), F.set(L, !1);
|
|
682
699
|
return;
|
|
683
700
|
}
|
|
684
|
-
if (!F.get(
|
|
685
|
-
F.set(
|
|
701
|
+
if (!F.get(z)) {
|
|
702
|
+
F.set(H, {
|
|
686
703
|
message: d().paymentSystemNotInitialized || "Payment system is not initialized. Please refresh the page",
|
|
687
704
|
blocking: !0
|
|
688
|
-
}, !0), F.set(
|
|
705
|
+
}, !0), F.set(L, !1);
|
|
689
706
|
return;
|
|
690
707
|
}
|
|
691
|
-
let { error: n } = await F.get(
|
|
708
|
+
let { error: n } = await F.get(V).submit();
|
|
692
709
|
if (n) {
|
|
693
710
|
let e = Z(n, d());
|
|
694
|
-
F.set(
|
|
711
|
+
F.set(H, {
|
|
695
712
|
message: e.message,
|
|
696
713
|
suggestion: e.suggestion
|
|
697
|
-
}, !0), F.set(
|
|
714
|
+
}, !0), F.set(L, !1);
|
|
698
715
|
return;
|
|
699
716
|
}
|
|
700
|
-
let i = await F.get(
|
|
701
|
-
elements: F.get(
|
|
717
|
+
let i = await F.get(z).confirmPayment({
|
|
718
|
+
elements: F.get(V),
|
|
702
719
|
redirect: "if_required"
|
|
703
720
|
});
|
|
704
721
|
if (i.error) {
|
|
705
722
|
let e = Z(i.error, d());
|
|
706
|
-
F.set(
|
|
723
|
+
F.set(H, {
|
|
707
724
|
message: e.message,
|
|
708
725
|
suggestion: e.suggestion
|
|
709
|
-
}, !0), F.set(
|
|
726
|
+
}, !0), F.set(L, !1);
|
|
710
727
|
return;
|
|
711
728
|
}
|
|
712
729
|
let a = {
|
|
713
|
-
id: F.get(
|
|
730
|
+
id: F.get(D),
|
|
714
731
|
paymentIntentId: i.paymentIntent.id,
|
|
715
|
-
tickets: F.get(
|
|
732
|
+
tickets: F.get(O),
|
|
716
733
|
firstName: e.firstName,
|
|
717
734
|
lastName: e.lastName,
|
|
718
735
|
email: e.email,
|
|
@@ -721,38 +738,38 @@ function Pe(e, t) {
|
|
|
721
738
|
paymentMethod: "credit-card",
|
|
722
739
|
mailingList: e.keepMeUpdated,
|
|
723
740
|
saleType: "online"
|
|
724
|
-
}, o = await
|
|
741
|
+
}, o = await x(F.get(D), a, m());
|
|
725
742
|
if (o?.eventCanceled || o?.eventPostponed) {
|
|
726
|
-
F.set(W, o.eventCanceled ? "canceled" : "postponed", !0), F.set(
|
|
743
|
+
F.set(W, o.eventCanceled ? "canceled" : "postponed", !0), F.set(H, null);
|
|
727
744
|
return;
|
|
728
745
|
}
|
|
729
746
|
if (o?.status === "Payment succeeded") {
|
|
730
|
-
|
|
747
|
+
pe(F.get(D), e.email);
|
|
731
748
|
let n = {
|
|
732
|
-
orderId: F.get(
|
|
733
|
-
eventId: F.get(
|
|
734
|
-
event: F.get(
|
|
735
|
-
venueId: r() || F.get(
|
|
736
|
-
organizationId: s() || F.get(
|
|
737
|
-
...
|
|
749
|
+
orderId: F.get(D),
|
|
750
|
+
eventId: F.get(E)?.id || F.get(E)?.eventID || null,
|
|
751
|
+
event: F.get(E) || null,
|
|
752
|
+
venueId: r() || F.get(E)?.venueId || null,
|
|
753
|
+
organizationId: s() || F.get(E)?.organizationId || null,
|
|
754
|
+
...ye()
|
|
738
755
|
};
|
|
739
756
|
t.onNavigateToSuccess && t.onNavigateToSuccess(n);
|
|
740
|
-
} else o?.status === "Payment amount does not match the total price" ? F.set(
|
|
757
|
+
} else o?.status === "Payment amount does not match the total price" ? F.set(H, { message: d().paymentAmountMismatch || "Payment amount mismatch. Please refresh and try again" }, !0) : F.set(H, { message: d().paymentValidationFailed || "Payment validation failed. Please try again" }, !0);
|
|
741
758
|
} catch (e) {
|
|
742
759
|
$.error("Payment execution error:", e);
|
|
743
760
|
let t = Z(e, d());
|
|
744
|
-
F.set(
|
|
761
|
+
F.set(H, {
|
|
745
762
|
message: t.message,
|
|
746
763
|
suggestion: t.suggestion
|
|
747
764
|
}, !0);
|
|
748
765
|
} finally {
|
|
749
|
-
F.set(
|
|
766
|
+
F.set(L, !1);
|
|
750
767
|
}
|
|
751
768
|
}
|
|
752
769
|
}
|
|
753
|
-
async function
|
|
770
|
+
async function Te(e) {
|
|
754
771
|
try {
|
|
755
|
-
let n = await
|
|
772
|
+
let n = await ne(F.get(D), {
|
|
756
773
|
firstName: e.firstName,
|
|
757
774
|
lastName: e.lastName,
|
|
758
775
|
email: e.email,
|
|
@@ -761,32 +778,32 @@ function Pe(e, t) {
|
|
|
761
778
|
mailingList: e.keepMeUpdated
|
|
762
779
|
}, m());
|
|
763
780
|
if (n?.success) {
|
|
764
|
-
|
|
781
|
+
pe(n.orderId || F.get(D), e.email);
|
|
765
782
|
let i = {
|
|
766
|
-
orderId: n.orderId || F.get(
|
|
767
|
-
eventId: F.get(
|
|
768
|
-
event: F.get(
|
|
769
|
-
venueId: r() || F.get(
|
|
770
|
-
organizationId: s() || F.get(
|
|
783
|
+
orderId: n.orderId || F.get(D),
|
|
784
|
+
eventId: F.get(E)?.id || F.get(E)?.eventID || null,
|
|
785
|
+
event: F.get(E) || null,
|
|
786
|
+
venueId: r() || F.get(E)?.venueId || null,
|
|
787
|
+
organizationId: s() || F.get(E)?.organizationId || null,
|
|
771
788
|
paymentType: "gift_card_only",
|
|
772
|
-
...
|
|
789
|
+
...ye()
|
|
773
790
|
};
|
|
774
791
|
t.onNavigateToSuccess && t.onNavigateToSuccess(i);
|
|
775
|
-
} else F.set(
|
|
792
|
+
} else F.set(H, { message: n?.error || d().failedToCompleteOrder || "Failed to complete order. Please try again" }, !0);
|
|
776
793
|
} catch (e) {
|
|
777
794
|
$.error("Gift card payment error:", e);
|
|
778
795
|
let t = Z(e, d());
|
|
779
|
-
F.set(
|
|
796
|
+
F.set(H, {
|
|
780
797
|
message: t.message,
|
|
781
798
|
suggestion: t.suggestion
|
|
782
799
|
}, !0);
|
|
783
800
|
} finally {
|
|
784
|
-
F.set(
|
|
801
|
+
F.set(L, !1);
|
|
785
802
|
}
|
|
786
803
|
}
|
|
787
|
-
async function
|
|
804
|
+
async function Ee(e) {
|
|
788
805
|
try {
|
|
789
|
-
let n = Object.fromEntries(Object.entries(F.get(
|
|
806
|
+
let n = Object.fromEntries(Object.entries(F.get(O)).filter(([e, t]) => t > 0)), i = Object.fromEntries(Object.entries(F.get(k)).filter(([, e]) => parseFloat(String(e)) > 0).map(([e, t]) => [parseInt(e, 10), parseFloat(String(t))])), a = await S(F.get(D), n, Object.keys(i).length > 0 ? i : void 0, {
|
|
790
807
|
firstName: e.firstName,
|
|
791
808
|
lastName: e.lastName,
|
|
792
809
|
email: e.email,
|
|
@@ -795,71 +812,71 @@ function Pe(e, t) {
|
|
|
795
812
|
mailingList: e.keepMeUpdated
|
|
796
813
|
}, m());
|
|
797
814
|
if (a?.requires_stripe !== !1 && a?.payment_type !== "free" || a?.order_finalized === !1) {
|
|
798
|
-
F.set(
|
|
815
|
+
F.set(H, { message: d().failedToCompleteOrder || "Failed to complete order. Please try again" }, !0);
|
|
799
816
|
return;
|
|
800
817
|
}
|
|
801
|
-
F.set(
|
|
818
|
+
F.set(B, "free"), pe(F.get(D), e.email);
|
|
802
819
|
let o = {
|
|
803
|
-
orderId: F.get(
|
|
804
|
-
eventId: F.get(
|
|
805
|
-
event: F.get(
|
|
806
|
-
venueId: r() || F.get(
|
|
807
|
-
organizationId: s() || F.get(
|
|
820
|
+
orderId: F.get(D),
|
|
821
|
+
eventId: F.get(E)?.id || F.get(E)?.eventID || null,
|
|
822
|
+
event: F.get(E) || null,
|
|
823
|
+
venueId: r() || F.get(E)?.venueId || null,
|
|
824
|
+
organizationId: s() || F.get(E)?.organizationId || null,
|
|
808
825
|
paymentType: "free",
|
|
809
|
-
...
|
|
826
|
+
...ye()
|
|
810
827
|
};
|
|
811
828
|
t.onNavigateToSuccess && t.onNavigateToSuccess(o);
|
|
812
829
|
} catch (e) {
|
|
813
830
|
$.error("Free order completion error:", e);
|
|
814
831
|
let t = Z(e, d());
|
|
815
|
-
F.set(
|
|
832
|
+
F.set(H, {
|
|
816
833
|
message: t.message,
|
|
817
834
|
suggestion: t.suggestion
|
|
818
835
|
}, !0);
|
|
819
836
|
} finally {
|
|
820
|
-
F.set(
|
|
837
|
+
F.set(L, !1);
|
|
821
838
|
}
|
|
822
839
|
}
|
|
823
|
-
async function
|
|
824
|
-
if (F.set(
|
|
825
|
-
...F.get(
|
|
826
|
-
serverTotals:
|
|
827
|
-
}, !0), !e.requiresStripe) Y++, F.set(
|
|
828
|
-
else if (F.get(
|
|
829
|
-
F.set(
|
|
840
|
+
async function De(e) {
|
|
841
|
+
if (F.set(K, e, !0), F.get(q) && J && F.set(q, {
|
|
842
|
+
...F.get(q),
|
|
843
|
+
serverTotals: C(J, e)
|
|
844
|
+
}, !0), !e.requiresStripe) Y++, F.set(V, void 0), F.set(z, null), F.set(B, "");
|
|
845
|
+
else if (F.get(D) && Object.keys(F.get(O)).length > 0) {
|
|
846
|
+
F.set(R, !0);
|
|
830
847
|
try {
|
|
831
|
-
await
|
|
848
|
+
await X();
|
|
832
849
|
} finally {
|
|
833
|
-
F.set(
|
|
850
|
+
F.set(R, !1);
|
|
834
851
|
}
|
|
835
852
|
}
|
|
836
853
|
}
|
|
837
|
-
async function
|
|
838
|
-
if (F.set(
|
|
839
|
-
...F.get(
|
|
840
|
-
serverTotals:
|
|
841
|
-
}, !0), F.get(
|
|
842
|
-
F.set(
|
|
854
|
+
async function ke() {
|
|
855
|
+
if (F.set(K, null), F.get(q) && J && F.set(q, {
|
|
856
|
+
...F.get(q),
|
|
857
|
+
serverTotals: J
|
|
858
|
+
}, !0), F.get(D) && Object.keys(F.get(O)).length > 0) {
|
|
859
|
+
F.set(R, !0);
|
|
843
860
|
try {
|
|
844
|
-
await
|
|
861
|
+
await X();
|
|
845
862
|
} finally {
|
|
846
|
-
F.set(
|
|
863
|
+
F.set(R, !1);
|
|
847
864
|
}
|
|
848
865
|
}
|
|
849
866
|
}
|
|
850
|
-
function
|
|
867
|
+
function Ae() {
|
|
851
868
|
c() ? c()() : window.history.back();
|
|
852
869
|
}
|
|
853
|
-
function
|
|
870
|
+
function Fe() {
|
|
854
871
|
c() ? c()() : window.history.back();
|
|
855
872
|
}
|
|
856
|
-
function
|
|
857
|
-
F.set(W, null),
|
|
873
|
+
function Ie() {
|
|
874
|
+
F.set(W, null), Ae();
|
|
858
875
|
}
|
|
859
|
-
async function
|
|
860
|
-
if (!F.get(
|
|
876
|
+
async function Le() {
|
|
877
|
+
if (!F.get(D)) return null;
|
|
861
878
|
try {
|
|
862
|
-
let e = await
|
|
879
|
+
let e = await y(F.get(D));
|
|
863
880
|
return e.success ? {
|
|
864
881
|
newExpiryTime: e.newExpiryTime,
|
|
865
882
|
remainingExtensions: e.remainingExtensions
|
|
@@ -868,17 +885,17 @@ function Pe(e, t) {
|
|
|
868
885
|
return $.error("Error extending checkout session:", e), null;
|
|
869
886
|
}
|
|
870
887
|
}
|
|
871
|
-
var
|
|
888
|
+
var Re = Pe(), ze = F.first_child(Re), Be = (e) => {
|
|
872
889
|
{
|
|
873
890
|
let t = (e) => {
|
|
874
891
|
{
|
|
875
|
-
let t = F.derived(() => F.get(
|
|
876
|
-
|
|
892
|
+
let t = F.derived(() => F.get(L) || F.get(R)), n = F.derived(() => F.get(q)?.serverTotals?.total ?? 0);
|
|
893
|
+
Oe(e, {
|
|
877
894
|
get cartId() {
|
|
878
|
-
return F.get(
|
|
895
|
+
return F.get(D);
|
|
879
896
|
},
|
|
880
|
-
onApplied:
|
|
881
|
-
onRemoved:
|
|
897
|
+
onApplied: De,
|
|
898
|
+
onRemoved: ke,
|
|
882
899
|
get disabled() {
|
|
883
900
|
return F.get(t);
|
|
884
901
|
},
|
|
@@ -890,23 +907,23 @@ function Pe(e, t) {
|
|
|
890
907
|
}
|
|
891
908
|
});
|
|
892
909
|
}
|
|
893
|
-
}, n = F.derived(() => F.get(
|
|
894
|
-
|
|
910
|
+
}, n = F.derived(() => F.get(H) ?? (F.get(U) ? { message: F.get(U) } : null));
|
|
911
|
+
de(e, {
|
|
895
912
|
get config() {
|
|
896
|
-
return F.get(
|
|
913
|
+
return F.get(q);
|
|
897
914
|
},
|
|
898
|
-
onPlaceOrder:
|
|
899
|
-
onBack:
|
|
900
|
-
onRetryExpired:
|
|
901
|
-
onExtendSession:
|
|
915
|
+
onPlaceOrder: we,
|
|
916
|
+
onBack: Ae,
|
|
917
|
+
onRetryExpired: Fe,
|
|
918
|
+
onExtendSession: Le,
|
|
902
919
|
get stripe() {
|
|
903
|
-
return F.get(
|
|
920
|
+
return F.get(z);
|
|
904
921
|
},
|
|
905
922
|
get paymentIntent() {
|
|
906
|
-
return F.get(
|
|
923
|
+
return F.get(B);
|
|
907
924
|
},
|
|
908
925
|
get serverTotalsUnavailable() {
|
|
909
|
-
return F.get(
|
|
926
|
+
return F.get(ve);
|
|
910
927
|
},
|
|
911
928
|
get paymentError() {
|
|
912
929
|
return F.get(n);
|
|
@@ -918,46 +935,46 @@ function Pe(e, t) {
|
|
|
918
935
|
return m();
|
|
919
936
|
},
|
|
920
937
|
get elements() {
|
|
921
|
-
return F.get(
|
|
938
|
+
return F.get(V);
|
|
922
939
|
},
|
|
923
940
|
set elements(e) {
|
|
924
|
-
F.set(
|
|
941
|
+
F.set(V, e, !0);
|
|
925
942
|
},
|
|
926
943
|
get eventEnded() {
|
|
927
|
-
return F.get(
|
|
944
|
+
return F.get(he);
|
|
928
945
|
},
|
|
929
946
|
set eventEnded(e) {
|
|
930
|
-
F.set(
|
|
947
|
+
F.set(he, e, !0);
|
|
931
948
|
},
|
|
932
949
|
giftCard: t,
|
|
933
950
|
$$slots: { giftCard: !0 }
|
|
934
951
|
});
|
|
935
952
|
}
|
|
936
|
-
},
|
|
937
|
-
var t = je(), n = F.child(t), r = F.child(n, !0);
|
|
938
|
-
F.reset(n), F.reset(t), F.template_effect(() => F.set_text(r, F.get(me))), F.append(e, t);
|
|
939
|
-
}, ze = (e) => {
|
|
953
|
+
}, Ve = (e) => {
|
|
940
954
|
var t = Me(), n = F.child(t), r = F.child(n, !0);
|
|
955
|
+
F.reset(n), F.reset(t), F.template_effect(() => F.set_text(r, F.get(_e))), F.append(e, t);
|
|
956
|
+
}, He = (e) => {
|
|
957
|
+
var t = Ne(), n = F.child(t), r = F.child(n, !0);
|
|
941
958
|
F.reset(n), F.reset(t), F.template_effect(() => F.set_text(r, d().loadingSecurePaymentForm || "Loading secure payment form...")), F.append(e, t);
|
|
942
959
|
};
|
|
943
|
-
F.if(
|
|
944
|
-
F.get(
|
|
960
|
+
F.if(ze, (e) => {
|
|
961
|
+
F.get(q) ? e(Be) : F.get(ge) ? e(Ve, 1) : e(He, -1);
|
|
945
962
|
});
|
|
946
|
-
var
|
|
947
|
-
|
|
963
|
+
var Ue = F.sibling(ze, 2), We = (e) => {
|
|
964
|
+
je(e, {
|
|
948
965
|
open: !0,
|
|
949
966
|
get reason() {
|
|
950
967
|
return F.get(W);
|
|
951
968
|
},
|
|
952
|
-
onBackToEvents:
|
|
969
|
+
onBackToEvents: Ie,
|
|
953
970
|
get labels() {
|
|
954
971
|
return d();
|
|
955
972
|
}
|
|
956
973
|
});
|
|
957
974
|
};
|
|
958
|
-
F.if(
|
|
959
|
-
F.get(
|
|
960
|
-
}), F.append(e,
|
|
975
|
+
F.if(Ue, (e) => {
|
|
976
|
+
F.get(G) && e(We);
|
|
977
|
+
}), F.append(e, Re), F.pop();
|
|
961
978
|
}
|
|
962
979
|
//#endregion
|
|
963
|
-
export {
|
|
980
|
+
export { Fe as default };
|