@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
|
@@ -1,980 +0,0 @@
|
|
|
1
|
-
import { _ as e, v as t, x as n } from "./Button-Cm6xkipe.js";
|
|
2
|
-
import { i as r, n as i, t as a, y as o } from "./defaultLabels-BdLGAc3u.js";
|
|
3
|
-
import { n as s, r as c, t as l } from "./CloseIcon-D3NjpzeW.js";
|
|
4
|
-
import { i as u } from "./Input-CIRGYHTC.js";
|
|
5
|
-
import { C as d, O as f, m as p } from "./constants-q-jR2-bz.js";
|
|
6
|
-
import { t as m } from "./TagIcon-CCyZd0sm.js";
|
|
7
|
-
import { t as h } from "./WarningTriIcon-0hefhcdZ.js";
|
|
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-Bat2EL64.js";
|
|
10
|
-
import { n as C, t as w } from "./serverTotals-BBlkfqMf.js";
|
|
11
|
-
import { a as T, i as E, n as D, r as O, t as k } from "./ModalFooter-DlRXuHQz.js";
|
|
12
|
-
import { a as A, o as te, s as j, v as ne } from "./api-QG8CoGcM.js";
|
|
13
|
-
import { t as re } from "./venue-CBos8YTa.js";
|
|
14
|
-
import { t as ie } from "./event-transform-DQmD2u_S.js";
|
|
15
|
-
import { _ as ae, h as oe, l as M, r as se, y as N } from "./utils-ChgG4jiQ.js";
|
|
16
|
-
import { a as ce, n as le } from "./promo-DWzTN7u9.js";
|
|
17
|
-
import { r as ue } from "./order-totals-Ci_p6SG6.js";
|
|
18
|
-
import de, { n as P, t as fe } from "./Checkout-Ddcw2_8F.js";
|
|
19
|
-
import { n as pe } from "./buyerEmail-BfCq-gDt.js";
|
|
20
|
-
import "svelte/internal/disclose-version";
|
|
21
|
-
import * as F from "svelte/internal/client";
|
|
22
|
-
import { onMount as me } from "svelte";
|
|
23
|
-
//#region node_modules/@stripe/stripe-js/dist/index.mjs
|
|
24
|
-
function I(e) {
|
|
25
|
-
"@babel/helpers - typeof";
|
|
26
|
-
return I = 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
|
-
}, I(e);
|
|
31
|
-
}
|
|
32
|
-
var L = "dahlia", he = function(e) {
|
|
33
|
-
return e === 3 ? "v3" : e;
|
|
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++) {
|
|
38
|
-
var n = e[t];
|
|
39
|
-
if (U(n.src)) return n;
|
|
40
|
-
}
|
|
41
|
-
return null;
|
|
42
|
-
}, _e = function(e) {
|
|
43
|
-
var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
|
|
44
|
-
n.src = `${z}${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
|
-
}, W = function(e, t) {
|
|
49
|
-
!e || !e._registerWrapper || e._registerWrapper({
|
|
50
|
-
name: "stripe-js",
|
|
51
|
-
version: "9.13.0",
|
|
52
|
-
startTime: t
|
|
53
|
-
});
|
|
54
|
-
}, G = null, K = null, q = null, J = function(e) {
|
|
55
|
-
return function(t) {
|
|
56
|
-
e(Error("Failed to load Stripe.js", { cause: t }));
|
|
57
|
-
};
|
|
58
|
-
}, ve = function(e, t) {
|
|
59
|
-
return function() {
|
|
60
|
-
window.Stripe ? e(window.Stripe) : t(/* @__PURE__ */ Error("Stripe.js not available"));
|
|
61
|
-
};
|
|
62
|
-
}, ye = function(e) {
|
|
63
|
-
return G === null ? (G = 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(H), window.Stripe) {
|
|
69
|
-
t(window.Stripe);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
try {
|
|
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) {
|
|
77
|
-
var i;
|
|
78
|
-
r.removeEventListener("load", q), r.removeEventListener("error", K), (i = r.parentNode) == null || i.removeChild(r), r = _e(e);
|
|
79
|
-
}
|
|
80
|
-
q = ve(t, n), K = J(n), r.addEventListener("load", q), r.addEventListener("error", K);
|
|
81
|
-
} catch (e) {
|
|
82
|
-
n(e);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
}), G.catch(function(e) {
|
|
86
|
-
return G = null, Promise.reject(e);
|
|
87
|
-
})) : G;
|
|
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 ${I(r)} instead.`);
|
|
92
|
-
var i = r.match(/^pk_test/), a = he(e.version), o = L;
|
|
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 W(s, n), s;
|
|
96
|
-
}, X, be = !1, xe = function() {
|
|
97
|
-
return X || (X = ye(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 = a) {
|
|
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 = 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) {
|
|
188
|
-
F.push(i, !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);
|
|
190
|
-
F.user_effect(() => {
|
|
191
|
-
if (!i.cartId || F.get(x).length > 0) return;
|
|
192
|
-
let e = !1;
|
|
193
|
-
return b(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 && (F.set(x, n.map((e) => ({
|
|
197
|
-
giftCardId: e.giftCardId,
|
|
198
|
-
code: e.maskedCode,
|
|
199
|
-
giftCardAmount: e.amount
|
|
200
|
-
})), !0), F.set(C, F.get(x).reduce((e, t) => e + (t.giftCardAmount || 0), 0) + (p() || 0)));
|
|
201
|
-
}).catch((e) => Q.error("Could not restore applied gift cards:", e)), () => {
|
|
202
|
-
e = !0;
|
|
203
|
-
};
|
|
204
|
-
});
|
|
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) {
|
|
208
|
-
c()();
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
o()({
|
|
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)
|
|
218
|
-
});
|
|
219
|
-
}
|
|
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);
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
F.set(v, !0), F.set(y, "");
|
|
228
|
-
try {
|
|
229
|
-
let t = await A(i.cartId, e);
|
|
230
|
-
t.valid ? (F.set(x, [...F.get(x), {
|
|
231
|
-
code: t.giftCardCode || e,
|
|
232
|
-
giftCardAmount: t.giftCardAmount || 0
|
|
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);
|
|
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
|
-
F.set(y, t || f().failedToApplyGiftCard || "Failed to apply gift card. Please try again", !0);
|
|
238
|
-
}
|
|
239
|
-
F.set(v, !1);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
async function k(e) {
|
|
243
|
-
if (!(F.get(v) || !i.cartId)) {
|
|
244
|
-
F.set(v, !0), F.set(y, "");
|
|
245
|
-
try {
|
|
246
|
-
let t = F.get(x).find((t) => t.code === e), n = await j(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);
|
|
248
|
-
} catch (e) {
|
|
249
|
-
Q.error("Error removing gift card:", e), F.set(y, f().failedToRemoveGiftCard || "Failed to remove gift card. Please try again", !0);
|
|
250
|
-
}
|
|
251
|
-
F.set(v, !1);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
function te(e) {
|
|
255
|
-
e.key === "Enter" && !F.get(v) && O();
|
|
256
|
-
}
|
|
257
|
-
function ne() {
|
|
258
|
-
F.set(S, !F.get(S)), F.get(S) || (F.set(_, ""), F.set(y, ""));
|
|
259
|
-
}
|
|
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);
|
|
263
|
-
s(o, { size: "16" }), F.reset(a);
|
|
264
|
-
var c = F.sibling(a, 2), p = F.child(c), m = F.child(p, !0);
|
|
265
|
-
F.reset(p);
|
|
266
|
-
var h = F.sibling(p, 2), _ = F.child(h, !0);
|
|
267
|
-
F.reset(h), F.reset(c);
|
|
268
|
-
var y = F.sibling(c, 2), b = F.child(y);
|
|
269
|
-
F.reset(y);
|
|
270
|
-
var x = F.sibling(y, 2);
|
|
271
|
-
{
|
|
272
|
-
let e = F.derived(() => f().removeGiftCard || "Remove gift card");
|
|
273
|
-
r(x, {
|
|
274
|
-
variant: "icon",
|
|
275
|
-
size: "icon-sm",
|
|
276
|
-
class: "rounded-full hover:bg-status-error-bg hover:text-accent-danger",
|
|
277
|
-
onclick: () => k(F.get(t).code),
|
|
278
|
-
get loading() {
|
|
279
|
-
return F.get(v);
|
|
280
|
-
},
|
|
281
|
-
get disabled() {
|
|
282
|
-
return u();
|
|
283
|
-
},
|
|
284
|
-
get "aria-label"() {
|
|
285
|
-
return F.get(e);
|
|
286
|
-
},
|
|
287
|
-
children: (e, t) => {
|
|
288
|
-
l(e, { size: "16" });
|
|
289
|
-
},
|
|
290
|
-
$$slots: { default: !0 }
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
F.reset(i), F.reset(n), F.template_effect((e) => {
|
|
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);
|
|
296
|
-
});
|
|
297
|
-
var ae = F.sibling(ie, 2), oe = (n) => {
|
|
298
|
-
var r = we(), i = F.child(r), a = F.child(i);
|
|
299
|
-
s(a, { size: "16" });
|
|
300
|
-
var o = F.sibling(a, 2), c = F.child(o, !0);
|
|
301
|
-
F.reset(o), F.reset(i), F.reset(r), F.template_effect(() => {
|
|
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");
|
|
303
|
-
}), F.append(n, r);
|
|
304
|
-
};
|
|
305
|
-
F.if(ae, (e) => {
|
|
306
|
-
F.get(E) && e(oe);
|
|
307
|
-
});
|
|
308
|
-
var M = F.sibling(ae, 2), se = F.child(M);
|
|
309
|
-
m(se, {
|
|
310
|
-
size: "20",
|
|
311
|
-
class: "gift-icon"
|
|
312
|
-
});
|
|
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);
|
|
319
|
-
F.remove_input_defaults(a);
|
|
320
|
-
let o;
|
|
321
|
-
var s = F.sibling(a, 2);
|
|
322
|
-
{
|
|
323
|
-
let e = F.derived(() => !F.get(_).trim() || u());
|
|
324
|
-
r(s, {
|
|
325
|
-
variant: "default",
|
|
326
|
-
size: "sm",
|
|
327
|
-
class: "min-w-16 shrink-0",
|
|
328
|
-
onclick: O,
|
|
329
|
-
get loading() {
|
|
330
|
-
return F.get(v);
|
|
331
|
-
},
|
|
332
|
-
get disabled() {
|
|
333
|
-
return F.get(e);
|
|
334
|
-
},
|
|
335
|
-
children: (e, t) => {
|
|
336
|
-
F.next();
|
|
337
|
-
var n = F.text();
|
|
338
|
-
F.template_effect(() => F.set_text(n, f().apply || "Apply")), F.append(e, n);
|
|
339
|
-
},
|
|
340
|
-
$$slots: { default: !0 }
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
F.reset(i);
|
|
344
|
-
var c = F.sibling(i, 2), l = (e) => {
|
|
345
|
-
var t = Te(), n = F.child(t);
|
|
346
|
-
h(n, { size: "16" });
|
|
347
|
-
var r = F.sibling(n, 2), i = F.child(r, !0);
|
|
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);
|
|
349
|
-
};
|
|
350
|
-
F.if(c, (e) => {
|
|
351
|
-
F.get(y) && e(l);
|
|
352
|
-
}), F.reset(n), F.template_effect(() => {
|
|
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);
|
|
355
|
-
};
|
|
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();
|
|
361
|
-
}
|
|
362
|
-
F.delegate(["click", "keydown"]);
|
|
363
|
-
//#endregion
|
|
364
|
-
//#region src/components/Modals/EventUnavailableModal.svelte
|
|
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) {
|
|
367
|
-
F.push(n, !0);
|
|
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");
|
|
369
|
-
T(e, {
|
|
370
|
-
size: "sm",
|
|
371
|
-
role: "alertdialog",
|
|
372
|
-
class: "micdrop",
|
|
373
|
-
get open() {
|
|
374
|
-
return i();
|
|
375
|
-
},
|
|
376
|
-
set open(e) {
|
|
377
|
-
i(e);
|
|
378
|
-
},
|
|
379
|
-
children: (e, n) => {
|
|
380
|
-
var i = Ae(), a = F.first_child(i);
|
|
381
|
-
E(a, {});
|
|
382
|
-
var s = F.sibling(a, 2);
|
|
383
|
-
O(s, {
|
|
384
|
-
children: (e, n) => {
|
|
385
|
-
var i = Ae(), a = F.first_child(i);
|
|
386
|
-
D(a, {
|
|
387
|
-
children: (e, n) => {
|
|
388
|
-
var r = ke(), i = F.child(r), a = F.child(i), o = (e) => {
|
|
389
|
-
u(e, { size: "32" });
|
|
390
|
-
}, s = (e) => {
|
|
391
|
-
c(e, { size: "32" });
|
|
392
|
-
};
|
|
393
|
-
F.if(a, (e) => {
|
|
394
|
-
F.get(l) ? e(o) : e(s, -1);
|
|
395
|
-
}), F.reset(i);
|
|
396
|
-
var p = F.sibling(i, 2), m = F.child(p, !0);
|
|
397
|
-
F.reset(p);
|
|
398
|
-
var h = F.sibling(p, 2), g = F.child(h, !0);
|
|
399
|
-
F.reset(h), F.reset(r), F.template_effect(() => {
|
|
400
|
-
F.set_class(i, 1, `w-16 h-16 rounded-full flex items-center justify-center mb-4 ${F.get(l) ? "bg-accent-danger/10 text-accent-danger" : "bg-accent-warning/10 text-accent-warning"}`), F.set_class(p, 1, `mb-2 ${t.heading ?? ""}`), F.set_text(m, F.get(d)), F.set_text(g, F.get(f));
|
|
401
|
-
}), F.append(e, r);
|
|
402
|
-
},
|
|
403
|
-
$$slots: { default: !0 }
|
|
404
|
-
});
|
|
405
|
-
var s = F.sibling(a, 2);
|
|
406
|
-
k(s, {
|
|
407
|
-
children: (e, t) => {
|
|
408
|
-
r(e, {
|
|
409
|
-
size: "full",
|
|
410
|
-
variant: "default",
|
|
411
|
-
get onclick() {
|
|
412
|
-
return o();
|
|
413
|
-
},
|
|
414
|
-
get "aria-label"() {
|
|
415
|
-
return F.get(p);
|
|
416
|
-
},
|
|
417
|
-
children: (e, t) => {
|
|
418
|
-
F.next();
|
|
419
|
-
var n = F.text();
|
|
420
|
-
F.template_effect(() => F.set_text(n, F.get(p))), F.append(e, n);
|
|
421
|
-
},
|
|
422
|
-
$$slots: { default: !0 }
|
|
423
|
-
});
|
|
424
|
-
},
|
|
425
|
-
$$slots: { default: !0 }
|
|
426
|
-
}), F.append(e, i);
|
|
427
|
-
},
|
|
428
|
-
$$slots: { default: !0 }
|
|
429
|
-
}), F.append(e, i);
|
|
430
|
-
},
|
|
431
|
-
$$slots: { default: !0 }
|
|
432
|
-
}), F.pop();
|
|
433
|
-
}
|
|
434
|
-
//#endregion
|
|
435
|
-
//#region src/components/Views/Checkout.svelte
|
|
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) {
|
|
438
|
-
F.push(t, !0);
|
|
439
|
-
let n = F.prop(t, "availableTickets", 23, () => []);
|
|
440
|
-
F.prop(t, "value", 3, "");
|
|
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);
|
|
454
|
-
F.derived(() => (t.data || {}).orgSlug);
|
|
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),
|
|
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), 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() {
|
|
468
|
-
return {
|
|
469
|
-
value: J?.total ?? null,
|
|
470
|
-
currency: J?.currency || "USD"
|
|
471
|
-
};
|
|
472
|
-
}
|
|
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);
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
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);
|
|
480
|
-
try {
|
|
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);
|
|
483
|
-
} catch (e) {
|
|
484
|
-
$.error("Error loading checkout state:", e), F.set(O, {}, !0), F.set(A, [], !0);
|
|
485
|
-
}
|
|
486
|
-
F.get(A).length > 0 && F.get(E) && (F.get(E).availableTickets = F.get(A), n(F.get(A)));
|
|
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 se(F.get(E)?.venueID || F.get(E)?.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(F.get(O), F.get(A), t);
|
|
509
|
-
Object.keys(F.get(O)).length > 0 && await X();
|
|
510
|
-
let a = 900, s = "";
|
|
511
|
-
if (F.get(D)) {
|
|
512
|
-
let e = ae(F.get(D));
|
|
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 v(F.get(D));
|
|
519
|
-
if (!e.error && e.expiresAt) {
|
|
520
|
-
let t = o(e.expiresAt).getTime();
|
|
521
|
-
a = Math.max(0, Math.floor((t - Date.now()) / 1e3)), s = e.expiresAt, N(F.get(D), t);
|
|
522
|
-
}
|
|
523
|
-
} catch {}
|
|
524
|
-
}
|
|
525
|
-
let c = P(`checkout-promo-discount-type-${e}`), p = [];
|
|
526
|
-
try {
|
|
527
|
-
let t = P(`checkout-promo-ticket-ids-${e}`), n = t ? JSON.parse(t) : [];
|
|
528
|
-
Array.isArray(n) && (p = n);
|
|
529
|
-
} catch {
|
|
530
|
-
p = [];
|
|
531
|
-
}
|
|
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),
|
|
535
|
-
lines: i,
|
|
536
|
-
timerStart: a,
|
|
537
|
-
...s ? { deadlineAt: s } : {},
|
|
538
|
-
promoApplied: !!F.get(j),
|
|
539
|
-
promoDiscount: h,
|
|
540
|
-
forceExpired: !1,
|
|
541
|
-
...J ? { serverTotals: J } : {}
|
|
542
|
-
}, !0), l()) {
|
|
543
|
-
let e = Z(typeof l() == "object" ? l() : {
|
|
544
|
-
code: "card_declined",
|
|
545
|
-
message: "Your card was declined. Please try a different payment method."
|
|
546
|
-
}, d());
|
|
547
|
-
F.set(H, {
|
|
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 (!F.get(D)) {
|
|
557
|
-
$.error("Missing cartId!");
|
|
558
|
-
return;
|
|
559
|
-
}
|
|
560
|
-
let t = Object.fromEntries(Object.entries(F.get(O)).filter(([e, t]) => t > 0));
|
|
561
|
-
try {
|
|
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 ne(F.get(D), F.get(j));
|
|
565
|
-
if (e !== Y) return;
|
|
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));
|
|
567
|
-
}
|
|
568
|
-
let r = await S(F.get(D), t, Object.keys(n).length > 0 ? n : void 0, void 0, m());
|
|
569
|
-
if (e !== Y) return;
|
|
570
|
-
if (!r) {
|
|
571
|
-
F.set(H, { message: d().failedToCreatePaymentIntent || "Failed to create payment intent. Please try again" }, !0);
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
574
|
-
F.set(ve, !1), J = w(r), F.get(q) && F.set(q, {
|
|
575
|
-
...F.get(q),
|
|
576
|
-
serverTotals: J
|
|
577
|
-
}, !0);
|
|
578
|
-
let i = r;
|
|
579
|
-
if (i.requires_stripe === !1 || i.payment_type === "free") {
|
|
580
|
-
F.set(B, "free");
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
F.set(ve, J === null);
|
|
584
|
-
let a = r.stripe_publishable_key;
|
|
585
|
-
if (!a) {
|
|
586
|
-
$.error("No Stripe publishable key in payment intent response"), F.set(H, { message: d().paymentConfigError || "Payment configuration error. Please try again" }, !0);
|
|
587
|
-
return;
|
|
588
|
-
}
|
|
589
|
-
let o = await Se(a);
|
|
590
|
-
if (e !== Y) return;
|
|
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);
|
|
592
|
-
} catch (t) {
|
|
593
|
-
if ($.error("Failed to initialize Stripe payment:", t), e !== Y) return;
|
|
594
|
-
F.set(H, { message: t.message || d().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 || F.get(ee) || "",
|
|
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 || i(),
|
|
608
|
-
imageUrl: e.imageUrl || e.image || "",
|
|
609
|
-
...F.get(T),
|
|
610
|
-
venue: {
|
|
611
|
-
id: e.venueID || e.venueId || 0,
|
|
612
|
-
name: e.venueName || "",
|
|
613
|
-
address: e.venueAddress || "",
|
|
614
|
-
timezone: e.timeZone || e.timezone || i(),
|
|
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: p(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 c = s ?? 0, l = ue(c, n, o);
|
|
665
|
-
r.push({
|
|
666
|
-
ticketId: parseInt(i),
|
|
667
|
-
ticketName: e.name || "",
|
|
668
|
-
quantity: a,
|
|
669
|
-
unitPrice: c,
|
|
670
|
-
fee: l,
|
|
671
|
-
subtotal: f(c * a),
|
|
672
|
-
isDonation: o
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
return r;
|
|
676
|
-
}
|
|
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);
|
|
681
|
-
try {
|
|
682
|
-
if (F.get(R)) {
|
|
683
|
-
F.set(H, { message: d().paymentReinitializing || "Updating your total. Please wait a moment and try again" }, !0);
|
|
684
|
-
return;
|
|
685
|
-
}
|
|
686
|
-
if (F.get(K) && !F.get(K).requiresStripe) {
|
|
687
|
-
await Te(e);
|
|
688
|
-
return;
|
|
689
|
-
}
|
|
690
|
-
if (F.get(Ce) || F.get(B) === "free" || J?.total === 0) {
|
|
691
|
-
await Ee(e);
|
|
692
|
-
return;
|
|
693
|
-
}
|
|
694
|
-
if (!F.get(V)) {
|
|
695
|
-
F.set(H, {
|
|
696
|
-
message: d().paymentFormNotReady || "Payment form is not ready. Please wait a moment and try again",
|
|
697
|
-
blocking: !0
|
|
698
|
-
}, !0), F.set(L, !1);
|
|
699
|
-
return;
|
|
700
|
-
}
|
|
701
|
-
if (!F.get(z)) {
|
|
702
|
-
F.set(H, {
|
|
703
|
-
message: d().paymentSystemNotInitialized || "Payment system is not initialized. Please refresh the page",
|
|
704
|
-
blocking: !0
|
|
705
|
-
}, !0), F.set(L, !1);
|
|
706
|
-
return;
|
|
707
|
-
}
|
|
708
|
-
let { error: n } = await F.get(V).submit();
|
|
709
|
-
if (n) {
|
|
710
|
-
let e = Z(n, d());
|
|
711
|
-
F.set(H, {
|
|
712
|
-
message: e.message,
|
|
713
|
-
suggestion: e.suggestion
|
|
714
|
-
}, !0), F.set(L, !1);
|
|
715
|
-
return;
|
|
716
|
-
}
|
|
717
|
-
let i = await F.get(z).confirmPayment({
|
|
718
|
-
elements: F.get(V),
|
|
719
|
-
redirect: "if_required"
|
|
720
|
-
});
|
|
721
|
-
if (i.error) {
|
|
722
|
-
let e = Z(i.error, d());
|
|
723
|
-
F.set(H, {
|
|
724
|
-
message: e.message,
|
|
725
|
-
suggestion: e.suggestion
|
|
726
|
-
}, !0), F.set(L, !1);
|
|
727
|
-
return;
|
|
728
|
-
}
|
|
729
|
-
let a = {
|
|
730
|
-
id: F.get(D),
|
|
731
|
-
paymentIntentId: i.paymentIntent.id,
|
|
732
|
-
tickets: F.get(O),
|
|
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
|
-
}, o = await x(F.get(D), a, m());
|
|
742
|
-
if (o?.eventCanceled || o?.eventPostponed) {
|
|
743
|
-
F.set(W, o.eventCanceled ? "canceled" : "postponed", !0), F.set(H, null);
|
|
744
|
-
return;
|
|
745
|
-
}
|
|
746
|
-
if (o?.status === "Payment succeeded") {
|
|
747
|
-
pe(F.get(D), e.email);
|
|
748
|
-
let n = {
|
|
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()
|
|
755
|
-
};
|
|
756
|
-
t.onNavigateToSuccess && t.onNavigateToSuccess(n);
|
|
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);
|
|
758
|
-
} catch (e) {
|
|
759
|
-
$.error("Payment execution error:", e);
|
|
760
|
-
let t = Z(e, d());
|
|
761
|
-
F.set(H, {
|
|
762
|
-
message: t.message,
|
|
763
|
-
suggestion: t.suggestion
|
|
764
|
-
}, !0);
|
|
765
|
-
} finally {
|
|
766
|
-
F.set(L, !1);
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
async function Te(e) {
|
|
771
|
-
try {
|
|
772
|
-
let n = await te(F.get(D), {
|
|
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
|
-
}, m());
|
|
780
|
-
if (n?.success) {
|
|
781
|
-
pe(n.orderId || F.get(D), e.email);
|
|
782
|
-
let i = {
|
|
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,
|
|
788
|
-
paymentType: "gift_card_only",
|
|
789
|
-
...ye()
|
|
790
|
-
};
|
|
791
|
-
t.onNavigateToSuccess && t.onNavigateToSuccess(i);
|
|
792
|
-
} else F.set(H, { message: n?.error || d().failedToCompleteOrder || "Failed to complete order. Please try again" }, !0);
|
|
793
|
-
} catch (e) {
|
|
794
|
-
$.error("Gift card payment error:", e);
|
|
795
|
-
let t = Z(e, d());
|
|
796
|
-
F.set(H, {
|
|
797
|
-
message: t.message,
|
|
798
|
-
suggestion: t.suggestion
|
|
799
|
-
}, !0);
|
|
800
|
-
} finally {
|
|
801
|
-
F.set(L, !1);
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
async function Ee(e) {
|
|
805
|
-
try {
|
|
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, {
|
|
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
|
-
}, m());
|
|
814
|
-
if (a?.requires_stripe !== !1 && a?.payment_type !== "free" || a?.order_finalized === !1) {
|
|
815
|
-
F.set(H, { message: d().failedToCompleteOrder || "Failed to complete order. Please try again" }, !0);
|
|
816
|
-
return;
|
|
817
|
-
}
|
|
818
|
-
F.set(B, "free"), pe(F.get(D), e.email);
|
|
819
|
-
let o = {
|
|
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,
|
|
825
|
-
paymentType: "free",
|
|
826
|
-
...ye()
|
|
827
|
-
};
|
|
828
|
-
t.onNavigateToSuccess && t.onNavigateToSuccess(o);
|
|
829
|
-
} catch (e) {
|
|
830
|
-
$.error("Free order completion error:", e);
|
|
831
|
-
let t = Z(e, d());
|
|
832
|
-
F.set(H, {
|
|
833
|
-
message: t.message,
|
|
834
|
-
suggestion: t.suggestion
|
|
835
|
-
}, !0);
|
|
836
|
-
} finally {
|
|
837
|
-
F.set(L, !1);
|
|
838
|
-
}
|
|
839
|
-
}
|
|
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);
|
|
847
|
-
try {
|
|
848
|
-
await X();
|
|
849
|
-
} finally {
|
|
850
|
-
F.set(R, !1);
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
}
|
|
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);
|
|
860
|
-
try {
|
|
861
|
-
await X();
|
|
862
|
-
} finally {
|
|
863
|
-
F.set(R, !1);
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
function Ae() {
|
|
868
|
-
c() ? c()() : window.history.back();
|
|
869
|
-
}
|
|
870
|
-
function Fe() {
|
|
871
|
-
c() ? c()() : window.history.back();
|
|
872
|
-
}
|
|
873
|
-
function Ie() {
|
|
874
|
-
F.set(W, null), Ae();
|
|
875
|
-
}
|
|
876
|
-
async function Le() {
|
|
877
|
-
if (!F.get(D)) return null;
|
|
878
|
-
try {
|
|
879
|
-
let e = await y(F.get(D));
|
|
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 = F.first_child(Re), Be = (e) => {
|
|
889
|
-
{
|
|
890
|
-
let t = (e) => {
|
|
891
|
-
{
|
|
892
|
-
let t = F.derived(() => F.get(L) || F.get(R)), n = F.derived(() => F.get(q)?.serverTotals?.total ?? 0);
|
|
893
|
-
Oe(e, {
|
|
894
|
-
get cartId() {
|
|
895
|
-
return F.get(D);
|
|
896
|
-
},
|
|
897
|
-
onApplied: De,
|
|
898
|
-
onRemoved: ke,
|
|
899
|
-
get disabled() {
|
|
900
|
-
return F.get(t);
|
|
901
|
-
},
|
|
902
|
-
get owedTotal() {
|
|
903
|
-
return F.get(n);
|
|
904
|
-
},
|
|
905
|
-
get labels() {
|
|
906
|
-
return d();
|
|
907
|
-
}
|
|
908
|
-
});
|
|
909
|
-
}
|
|
910
|
-
}, n = F.derived(() => F.get(H) ?? (F.get(U) ? { message: F.get(U) } : null));
|
|
911
|
-
de(e, {
|
|
912
|
-
get config() {
|
|
913
|
-
return F.get(q);
|
|
914
|
-
},
|
|
915
|
-
onPlaceOrder: we,
|
|
916
|
-
onBack: Ae,
|
|
917
|
-
onRetryExpired: Fe,
|
|
918
|
-
onExtendSession: Le,
|
|
919
|
-
get stripe() {
|
|
920
|
-
return F.get(z);
|
|
921
|
-
},
|
|
922
|
-
get paymentIntent() {
|
|
923
|
-
return F.get(B);
|
|
924
|
-
},
|
|
925
|
-
get serverTotalsUnavailable() {
|
|
926
|
-
return F.get(ve);
|
|
927
|
-
},
|
|
928
|
-
get paymentError() {
|
|
929
|
-
return F.get(n);
|
|
930
|
-
},
|
|
931
|
-
get labels() {
|
|
932
|
-
return d();
|
|
933
|
-
},
|
|
934
|
-
get locale() {
|
|
935
|
-
return m();
|
|
936
|
-
},
|
|
937
|
-
get elements() {
|
|
938
|
-
return F.get(V);
|
|
939
|
-
},
|
|
940
|
-
set elements(e) {
|
|
941
|
-
F.set(V, e, !0);
|
|
942
|
-
},
|
|
943
|
-
get eventEnded() {
|
|
944
|
-
return F.get(he);
|
|
945
|
-
},
|
|
946
|
-
set eventEnded(e) {
|
|
947
|
-
F.set(he, e, !0);
|
|
948
|
-
},
|
|
949
|
-
giftCard: t,
|
|
950
|
-
$$slots: { giftCard: !0 }
|
|
951
|
-
});
|
|
952
|
-
}
|
|
953
|
-
}, Ve = (e) => {
|
|
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);
|
|
958
|
-
F.reset(n), F.reset(t), F.template_effect(() => F.set_text(r, d().loadingSecurePaymentForm || "Loading secure payment form...")), F.append(e, t);
|
|
959
|
-
};
|
|
960
|
-
F.if(ze, (e) => {
|
|
961
|
-
F.get(q) ? e(Be) : F.get(ge) ? e(Ve, 1) : e(He, -1);
|
|
962
|
-
});
|
|
963
|
-
var Ue = F.sibling(ze, 2), We = (e) => {
|
|
964
|
-
je(e, {
|
|
965
|
-
open: !0,
|
|
966
|
-
get reason() {
|
|
967
|
-
return F.get(W);
|
|
968
|
-
},
|
|
969
|
-
onBackToEvents: Ie,
|
|
970
|
-
get labels() {
|
|
971
|
-
return d();
|
|
972
|
-
}
|
|
973
|
-
});
|
|
974
|
-
};
|
|
975
|
-
F.if(Ue, (e) => {
|
|
976
|
-
F.get(G) && e(We);
|
|
977
|
-
}), F.append(e, Re), F.pop();
|
|
978
|
-
}
|
|
979
|
-
//#endregion
|
|
980
|
-
export { Fe as default };
|