@getmicdrop/venue-calendar 4.3.8 → 4.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/{ArrowLeftIcon-DvIbVly-.js → ArrowLeftIcon-BYu_Qbkb.js} +1 -1
  2. package/dist/{Badge-vsC_L__r.js → Badge-DCHGGod2.js} +8 -10
  3. package/dist/{BlockPlaceholder-BMD1gnmE.js → BlockPlaceholder-BoPMt_9Z.js} +2 -2
  4. package/dist/{Button-Cm6xkipe.js → Button-vmWb6wKc.js} +117 -63
  5. package/dist/{Calendar-CPD8dS_i.js → Calendar-D11ctjrD.js} +307 -282
  6. package/dist/{CalendarFoundryView-BY1uJgYA.js → CalendarFoundryView-DKhpjxnV.js} +6510 -6504
  7. package/dist/{CalendarIcon-CCgHZAu4.js → CalendarIcon-C8-UVSje.js} +1 -1
  8. package/dist/{CartView-DVugxQ3D.js → CartView-IqOekmQg.js} +814 -814
  9. package/dist/Checkout-ByQsDGg3.js +1005 -0
  10. package/dist/Checkout-C0lQ0AwV.js +1846 -0
  11. package/dist/{CheckoutTimer-CgGCv_jP.js → CheckoutTimer-B0E9KnHc.js} +15 -15
  12. package/dist/{ChevronDownIcon-gELqaIeP.js → ChevronDownIcon-C1uJ2yvz.js} +1 -1
  13. package/dist/{ClockIcon-C4MxWMqH.js → ClockIcon-Dk9q65sX.js} +1 -1
  14. package/dist/{CloseIcon-D3NjpzeW.js → CloseIcon-CyR73vpD.js} +1 -1
  15. package/dist/{CollectionView-C55yLTPR.js → CollectionView-B-CNyf9Z.js} +17 -17
  16. package/dist/CropImage-4WcoXkHt.js +537 -0
  17. package/dist/{Event-ClxgC-gP.js → Event-B4x0sGkc.js} +1142 -870
  18. package/dist/{EventPage-ziJYmBIZ.js → EventPage--xwhM503.js} +244 -236
  19. package/dist/{Heading-D7TEStkb.js → Heading-Br1Yqnvg.js} +3 -4
  20. package/dist/{Image-CjM21MQP.js → Image-M5RaWbKU.js} +12 -13
  21. package/dist/{Input-CIRGYHTC.js → Input-Bk8lP6TX.js} +53 -53
  22. package/dist/{MailIcon-iy7T12Hz.js → MailIcon-Ic2SruY-.js} +1 -1
  23. package/dist/{Modal-wQSo-C1f.js → Modal-CLeZUJ_i.js} +2 -2
  24. package/dist/ModalFooter-CSoG_uic.js +470 -0
  25. package/dist/ModalHeader-DpKxDJT_.js +18 -0
  26. package/dist/{PasswordInput-Cj8i4djG.js → PasswordInput-BHj_lokg.js} +2 -2
  27. package/dist/RecommendationsRail-8AVZ0aLE.js +445 -0
  28. package/dist/{ScarcityBadge-DbUVeqpx.js → ScarcityBadge-DakRfDx4.js} +19 -19
  29. package/dist/{SeriesPage-doki-1XH.js → SeriesPage-BaOeDNb6.js} +5 -5
  30. package/dist/{Spinner-Dua8H4Z1.js → Spinner-a1KCKWxZ.js} +2 -2
  31. package/dist/{Success-DZOYl6St.js → Success-BtUgc4H7.js} +290 -257
  32. package/dist/{TagIcon-CCyZd0sm.js → TagIcon-BiYfs6T7.js} +1 -1
  33. package/dist/{ViewTicketsEmbed-CF2Aq-qy.js → ViewTicketsEmbed-Lxg7n02-.js} +109 -109
  34. package/dist/{WarningCircleIcon-BuVhRrHd.js → WarningCircleIcon-AuYbQdPU.js} +1 -1
  35. package/dist/{WarningTriIcon-0hefhcdZ.js → WarningTriIcon-BzI-tSDG.js} +1 -1
  36. package/dist/{__SKIP_PATHS__-Dyw31EsB.js → __SKIP_PATHS__-B3OPLTzA.js} +1 -1
  37. package/dist/api/api.cjs +1 -1
  38. package/dist/api/api.mjs +239 -237
  39. package/dist/{api-QG8CoGcM.js → api-C1M2t6HU.js} +114 -112
  40. package/dist/{browser-viCaCwoW.js → browser-DrfMvEfn.js} +7 -7
  41. package/dist/{labels-0dEJldQX.js → constants-YG4UeBdR.js} +17 -4
  42. package/dist/{copyToClipboard-C7KGa7gG.js → copyToClipboard-3SejVveg.js} +1 -1
  43. package/dist/{de-K0-gFyNH.js → de-CzupmMIa.js} +14 -1
  44. package/dist/{defaultLabels-BdLGAc3u.js → defaultLabels-CXCsTwix.js} +331 -356
  45. package/dist/{es-DsZSuXW4.js → es-B-vQxM9Z.js} +14 -1
  46. package/dist/{event-CyPf2sZS.js → event-DAjJ01GM.js} +1 -1
  47. package/dist/{event-transform-DQmD2u_S.js → event-transform-DNqGTQhp.js} +54 -53
  48. package/dist/{eventStatusStream-BFOvtJyO.js → eventStatusStream-CLLN-Rvf.js} +2 -2
  49. package/dist/{fr-BmHldIKE.js → fr-B2g-kG7i.js} +14 -1
  50. package/dist/{href-CbfSre4l.js → href-DuxMJt4c.js} +3 -3
  51. package/dist/{i18n-CSftOFAS.js → i18n-Ct9Bo-Vp.js} +179 -129
  52. package/dist/{i18n-D54CGXK2.js → i18n-KdVjJUV5.js} +2 -2
  53. package/dist/{id-CBHA4B6C.js → id-Dgu5-FC6.js} +14 -1
  54. package/dist/imageOptimizer-Ba8P7ZEJ.js +140 -0
  55. package/dist/{it-CK6ravjO.js → it-C580sMYp.js} +14 -1
  56. package/dist/{ja-COO0Ibrr.js → ja-DLki4zXU.js} +14 -1
  57. package/dist/{ko-D8YqNrZs.js → ko-BUcfb1Gi.js} +14 -1
  58. package/dist/locales/4.3.10/flow/de.js +1 -0
  59. package/dist/locales/4.3.10/flow/es.js +1 -0
  60. package/dist/locales/4.3.10/flow/fr.js +1 -0
  61. package/dist/locales/4.3.10/flow/id.js +1 -0
  62. package/dist/locales/4.3.10/flow/it.js +1 -0
  63. package/dist/locales/4.3.10/flow/ja.js +1 -0
  64. package/dist/locales/4.3.10/flow/ko.js +1 -0
  65. package/dist/locales/4.3.10/flow/nl.js +1 -0
  66. package/dist/locales/4.3.10/flow/pl.js +1 -0
  67. package/dist/locales/4.3.10/flow/pt-br.js +1 -0
  68. package/dist/locales/4.3.10/flow/tr.js +1 -0
  69. package/dist/locales/4.3.10/flow/zh.js +1 -0
  70. package/dist/modalManager.svelte-Cz_6x1Qd.js +37 -0
  71. package/dist/{nl-Bk3DPD7e.js → nl-CivAQA0D.js} +14 -1
  72. package/dist/order-totals-DyVkHVqG.js +151 -0
  73. package/dist/{orders-Bat2EL64.js → orders-rH0WZYOW.js} +18 -18
  74. package/dist/{phoneUtils-Cm9iv40N.js → phoneUtils-BFrVEwkQ.js} +1 -1
  75. package/dist/{pixels-Ha6vOCaS.js → pixels-mdd6C3Bk.js} +3 -3
  76. package/dist/{pl-CPmO94ic.js → pl-C5VwFH2B.js} +14 -1
  77. package/dist/{promo-DWzTN7u9.js → promo-CTRn_F4t.js} +1 -1
  78. package/dist/{pt-br-Ch6NFhW6.js → pt-br-B0w9dhVB.js} +14 -1
  79. package/dist/{constants-q-jR2-bz.js → scarcity-Ccj5RlrR.js} +2 -5
  80. package/dist/{serverTotals-BBlkfqMf.js → serverTotals-Dk3z9sIA.js} +1 -1
  81. package/dist/{showcase-state-options-CxRQ-phi.js → showcase-state-options-8-egiV5-.js} +1 -1
  82. package/dist/{to-event-card-props-BIl0qQs0.js → to-event-card-props-a4k6D100.js} +49 -49
  83. package/dist/{tr-CXnalLJT.js → tr-LGkP5gpA.js} +14 -1
  84. package/dist/{utils-ChgG4jiQ.js → utils-BseYYrbn.js} +82 -78
  85. package/dist/venue-calendar.css +1 -1
  86. package/dist/venue-calendar.es.js +994 -996
  87. package/dist/venue-calendar.iife.js +56 -57
  88. package/dist/venue-calendar.umd.js +51 -52
  89. package/dist/{zh-CM2J1Py4.js → zh-D2ZAdq3T.js} +14 -1
  90. package/package.json +2 -2
  91. package/dist/Checkout-D7KSikhw.js +0 -980
  92. package/dist/Checkout-Ddcw2_8F.js +0 -1846
  93. package/dist/CropImage-CxLcNArr.js +0 -445
  94. package/dist/ModalFooter-DlRXuHQz.js +0 -301
  95. package/dist/imageOptimizer-BwLwBMI6.js +0 -112
  96. package/dist/keyboard-fiZFqeNA.js +0 -29
  97. package/dist/locales/4.3.8/flow/de.js +0 -1
  98. package/dist/locales/4.3.8/flow/es.js +0 -1
  99. package/dist/locales/4.3.8/flow/fr.js +0 -1
  100. package/dist/locales/4.3.8/flow/id.js +0 -1
  101. package/dist/locales/4.3.8/flow/it.js +0 -1
  102. package/dist/locales/4.3.8/flow/ja.js +0 -1
  103. package/dist/locales/4.3.8/flow/ko.js +0 -1
  104. package/dist/locales/4.3.8/flow/nl.js +0 -1
  105. package/dist/locales/4.3.8/flow/pl.js +0 -1
  106. package/dist/locales/4.3.8/flow/pt-br.js +0 -1
  107. package/dist/locales/4.3.8/flow/tr.js +0 -1
  108. package/dist/locales/4.3.8/flow/zh.js +0 -1
  109. package/dist/modalManager.svelte-Dnv5jhxp.js +0 -53
  110. package/dist/order-totals-Ci_p6SG6.js +0 -131
  111. package/dist/portal-DqxEuE-7.js +0 -166
  112. package/dist/shareCopyFeedback.svelte-CW0Yy9Oz.js +0 -330
  113. /package/dist/locales/{4.3.8 → 4.3.10}/main/de.js +0 -0
  114. /package/dist/locales/{4.3.8 → 4.3.10}/main/es.js +0 -0
  115. /package/dist/locales/{4.3.8 → 4.3.10}/main/fr.js +0 -0
  116. /package/dist/locales/{4.3.8 → 4.3.10}/main/id.js +0 -0
  117. /package/dist/locales/{4.3.8 → 4.3.10}/main/it.js +0 -0
  118. /package/dist/locales/{4.3.8 → 4.3.10}/main/ja.js +0 -0
  119. /package/dist/locales/{4.3.8 → 4.3.10}/main/ko.js +0 -0
  120. /package/dist/locales/{4.3.8 → 4.3.10}/main/nl.js +0 -0
  121. /package/dist/locales/{4.3.8 → 4.3.10}/main/pl.js +0 -0
  122. /package/dist/locales/{4.3.8 → 4.3.10}/main/pt-br.js +0 -0
  123. /package/dist/locales/{4.3.8 → 4.3.10}/main/tr.js +0 -0
  124. /package/dist/locales/{4.3.8 → 4.3.10}/main/zh.js +0 -0
@@ -0,0 +1,1005 @@
1
+ import { C as e, E as t, S as n } from "./Button-vmWb6wKc.js";
2
+ import { n as r, r as i, t as a } from "./CloseIcon-CyR73vpD.js";
3
+ import { i as o } from "./Input-Bk8lP6TX.js";
4
+ import { D as s, S as c, p as l } from "./scarcity-Ccj5RlrR.js";
5
+ import { t as u } from "./TagIcon-BiYfs6T7.js";
6
+ import { t as d } from "./WarningTriIcon-BzI-tSDG.js";
7
+ import { d as f, n as p } from "./z-index-BgKs9X9U.js";
8
+ import { I as m, i as h, k as ee, n as g, t as _, y as v } from "./defaultLabels-CXCsTwix.js";
9
+ import { f as y, i as b, n as x, r as S, s as C, t as w } from "./orders-rH0WZYOW.js";
10
+ import { n as T, t as E } from "./serverTotals-Dk3z9sIA.js";
11
+ import { a as te, i as D, n as O, r as k, t as A } from "./ModalFooter-CSoG_uic.js";
12
+ import { a as ne, o as re, s as j, v as ie } from "./api-C1M2t6HU.js";
13
+ import { t as ae } from "./venue-CBos8YTa.js";
14
+ import { t as oe } from "./event-transform-DNqGTQhp.js";
15
+ import { _ as se, h as M, l as ce, r as le, y as ue } from "./utils-BseYYrbn.js";
16
+ import { a as de, n as fe } from "./promo-CTRn_F4t.js";
17
+ import { r as pe } from "./order-totals-DyVkHVqG.js";
18
+ import me, { n as N, t as he } from "./Checkout-C0lQ0AwV.js";
19
+ import { n as ge } from "./buyerEmail-BfCq-gDt.js";
20
+ import "svelte/internal/disclose-version";
21
+ import * as P from "svelte/internal/client";
22
+ import { onMount as _e } from "svelte";
23
+ //#region node_modules/@stripe/stripe-js/dist/index.mjs
24
+ function F(e) {
25
+ "@babel/helpers - typeof";
26
+ return F = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
27
+ return typeof e;
28
+ } : function(e) {
29
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
30
+ }, F(e);
31
+ }
32
+ var I = "dahlia", L = function(e) {
33
+ return e === 3 ? "v3" : e;
34
+ }, ve = "https://js.stripe.com", R = `${ve}/${I}/stripe.js`, z = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, B = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/, V = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", H = function(e) {
35
+ return z.test(e) || B.test(e);
36
+ }, U = function() {
37
+ for (var e = document.querySelectorAll(`script[src^="${ve}"]`), t = 0; t < e.length; t++) {
38
+ var n = e[t];
39
+ if (H(n.src)) return n;
40
+ }
41
+ return null;
42
+ }, ye = function(e) {
43
+ var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
44
+ n.src = `${R}${t}`;
45
+ var r = document.head || document.body;
46
+ if (!r) throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
47
+ return r.appendChild(n), n;
48
+ }, be = function(e, t) {
49
+ !e || !e._registerWrapper || e._registerWrapper({
50
+ name: "stripe-js",
51
+ version: "9.13.0",
52
+ startTime: t
53
+ });
54
+ }, W = null, G = null, K = null, q = function(e) {
55
+ return function(t) {
56
+ e(Error("Failed to load Stripe.js", { cause: t }));
57
+ };
58
+ }, J = function(e, t) {
59
+ return function() {
60
+ window.Stripe ? e(window.Stripe) : t(/* @__PURE__ */ Error("Stripe.js not available"));
61
+ };
62
+ }, xe = function(e) {
63
+ return W === null ? (W = new Promise(function(t, n) {
64
+ if (typeof window > "u" || typeof document > "u") {
65
+ t(null);
66
+ return;
67
+ }
68
+ if (window.Stripe && e && console.warn(V), window.Stripe) {
69
+ t(window.Stripe);
70
+ return;
71
+ }
72
+ try {
73
+ var r = U();
74
+ if (r && e) console.warn(V);
75
+ else if (!r) r = ye(e);
76
+ else if (r && K !== null && G !== null) {
77
+ var i;
78
+ r.removeEventListener("load", K), r.removeEventListener("error", G), (i = r.parentNode) == null || i.removeChild(r), r = ye(e);
79
+ }
80
+ K = J(t, n), G = q(n), r.addEventListener("load", K), r.addEventListener("error", G);
81
+ } catch (e) {
82
+ n(e);
83
+ return;
84
+ }
85
+ }), W.catch(function(e) {
86
+ return W = null, Promise.reject(e);
87
+ })) : W;
88
+ }, Se = function(e, t, n) {
89
+ if (e === null) return null;
90
+ var r = t[0];
91
+ if (typeof r != "string") throw Error(`Expected publishable key to be of type string, got type ${F(r)} instead.`);
92
+ var i = r.match(/^pk_test/), a = L(e.version), o = I;
93
+ i && a !== o && console.warn(`Stripe.js@${a} was loaded on the page, but @stripe/stripe-js@9.13.0 expected Stripe.js@${o}. This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning`);
94
+ var s = e.apply(void 0, t);
95
+ return be(s, n), s;
96
+ }, Y, X = !1, Ce = function() {
97
+ return Y || (Y = xe(null).catch(function(e) {
98
+ return Y = null, Promise.reject(e);
99
+ }), Y);
100
+ };
101
+ Promise.resolve().then(function() {
102
+ return Ce();
103
+ }).catch(function(e) {
104
+ X || console.warn(e);
105
+ });
106
+ var we = function() {
107
+ var e = [...arguments];
108
+ X = !0;
109
+ var t = Date.now();
110
+ return Ce().then(function(n) {
111
+ return Se(n, e, t);
112
+ });
113
+ };
114
+ //#endregion
115
+ //#region src/lib/utils/stripe-errors.ts
116
+ function Z(e, t = _) {
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 = t("GiftCardInput"), Te = P.from_html("<div class=\"applied-card mb-2 svelte-emw0hd\"><div class=\"flex items-center gap-3\"><div class=\"applied-icon svelte-emw0hd\"><!></div> <div class=\"flex flex-col flex-1\"><span class=\"type-caption text-status-success-text\"> </span> <span class=\"type-body font-mono text-text-primary\"> </span></div> <span class=\"type-label text-accent-success\"> </span> <!></div></div>"), Ee = P.from_html("<div class=\"applied-card mb-3 svelte-emw0hd\"><div><!> <span> </span></div></div>"), De = P.from_html("<div class=\"flex items-center gap-1.5 mt-2 type-body text-accent-danger\"><!> <span> </span></div>"), Oe = P.from_html("<div class=\"input-section svelte-emw0hd\"><div class=\"flex gap-2\"><input type=\"text\" name=\"giftCardCode\" autocomplete=\"off\" autocapitalize=\"characters\"/> <!></div> <!></div>"), ke = P.from_html("<div class=\"mb-4\"><!> <!> <button type=\"button\"><!> <span> </span> <span class=\"toggle-indicator svelte-emw0hd\"> </span></button> <!></div>");
187
+ function Ae(t, i) {
188
+ P.push(i, !0);
189
+ let o = P.prop(i, "onApplied", 3, () => {}), s = P.prop(i, "onRemoved", 3, () => {}), l = P.prop(i, "disabled", 3, !1), m = P.prop(i, "labels", 3, _), ee = P.prop(i, "owedTotal", 3, 0), g = P.prop(i, "serverGiftCardAmount", 3, null), v = P.state(""), y = P.state(!1), b = P.state(""), x = P.state(P.proxy([])), C = P.state(!1), w = P.state(0);
190
+ P.user_effect(() => {
191
+ if (!i.cartId || P.get(x).length > 0 || g() === 0) return;
192
+ let e = !1;
193
+ return S(i.cartId).then((t) => {
194
+ if (e || !t?.giftCards?.length) return;
195
+ let n = t.giftCards.filter((e) => typeof e.amount == "number");
196
+ n.length !== t.giftCards.length && Q.error("Ignored applied gift card(s) with an unusable amount while restoring the panel"), n.length !== 0 && (P.set(x, n.map((e) => ({
197
+ giftCardId: e.giftCardId,
198
+ code: e.maskedCode,
199
+ giftCardAmount: e.amount
200
+ })), !0), P.set(w, P.get(x).reduce((e, t) => e + (t.giftCardAmount || 0), 0) + (ee() || 0)));
201
+ }).catch((e) => Q.error("Could not restore applied gift cards:", e)), () => {
202
+ e = !0;
203
+ };
204
+ });
205
+ let T = P.derived(() => P.get(x).reduce((e, t) => e + (t.giftCardAmount || 0), 0)), E = P.derived(() => Math.max(0, P.get(w) - P.get(T))), te = P.derived(() => P.get(x).length > 0 && P.get(E) <= 0);
206
+ function D() {
207
+ if (P.get(x).length === 0) {
208
+ s()();
209
+ return;
210
+ }
211
+ o()({
212
+ code: P.get(x).map((e) => e.code).join(", "),
213
+ giftCardAmount: P.get(T),
214
+ stripeAmount: P.get(E),
215
+ requiresStripe: P.get(E) > 0,
216
+ paymentType: P.get(E) > 0 ? "split" : "gift_card_only",
217
+ orderTotal: P.get(w)
218
+ });
219
+ }
220
+ async function O() {
221
+ let e = P.get(v).trim().toUpperCase();
222
+ if (!(!e || P.get(y) || !i.cartId)) {
223
+ if (P.get(x).some((t) => t.code === e)) {
224
+ P.set(b, m().giftCardAlreadyApplied || "That gift card is already applied", !0);
225
+ return;
226
+ }
227
+ P.set(y, !0), P.set(b, "");
228
+ try {
229
+ let t = await ne(i.cartId, e);
230
+ t.valid ? (P.set(x, [...P.get(x), {
231
+ code: t.giftCardCode || e,
232
+ giftCardAmount: t.giftCardAmount || 0
233
+ }], !0), P.set(w, P.get(T) + (t.stripeAmount || 0)), P.set(v, ""), P.set(C, !1), D()) : P.set(b, t.error || m().invalidGiftCardCode || "Invalid gift card code", !0);
234
+ } catch (e) {
235
+ Q.error("Error applying gift card:", e);
236
+ let t = e && typeof e == "object" && typeof e.message == "string" ? e.message : "";
237
+ P.set(b, t || m().failedToApplyGiftCard || "Failed to apply gift card. Please try again", !0);
238
+ }
239
+ P.set(y, !1);
240
+ }
241
+ }
242
+ async function k(e) {
243
+ if (!(P.get(y) || !i.cartId)) {
244
+ P.set(y, !0), P.set(b, "");
245
+ try {
246
+ let t = P.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 ? (P.set(x, P.get(x).filter((t) => t.code !== e), !0), typeof n.remainingTotal == "number" && P.set(w, P.get(T) + n.remainingTotal), D()) : P.set(b, n.error || m().failedToRemoveGiftCard || "Failed to remove gift card. Please try again", !0);
248
+ } catch (e) {
249
+ Q.error("Error removing gift card:", e), P.set(b, m().failedToRemoveGiftCard || "Failed to remove gift card. Please try again", !0);
250
+ }
251
+ P.set(y, !1);
252
+ }
253
+ }
254
+ function A(e) {
255
+ e.key === "Enter" && !P.get(y) && O();
256
+ }
257
+ function re() {
258
+ P.set(C, !P.get(C)), P.get(C) || (P.set(v, ""), P.set(b, ""));
259
+ }
260
+ var ie = ke(), ae = P.child(ie);
261
+ P.each(ae, 17, () => P.get(x), (e) => e.code, (e, t) => {
262
+ var n = Te(), i = P.child(n), o = P.child(i), s = P.child(o);
263
+ r(s, { size: "16" }), P.reset(o);
264
+ var u = P.sibling(o, 2), d = P.child(u), ee = P.child(d, !0);
265
+ P.reset(d);
266
+ var g = P.sibling(d, 2), _ = P.child(g, !0);
267
+ P.reset(g), P.reset(u);
268
+ var v = P.sibling(u, 2), b = P.child(v);
269
+ P.reset(v);
270
+ var x = P.sibling(v, 2);
271
+ {
272
+ let e = P.derived(() => m().removeGiftCard || "Remove gift card");
273
+ h(x, {
274
+ variant: "icon",
275
+ size: "icon-sm",
276
+ class: "rounded-full hover:bg-status-error-bg hover:text-accent-danger",
277
+ onclick: () => k(P.get(t).code),
278
+ get loading() {
279
+ return P.get(y);
280
+ },
281
+ get disabled() {
282
+ return l();
283
+ },
284
+ get "aria-label"() {
285
+ return P.get(e);
286
+ },
287
+ children: (e, t) => {
288
+ a(e, { size: "16" });
289
+ },
290
+ $$slots: { default: !0 }
291
+ });
292
+ }
293
+ P.reset(i), P.reset(n), P.template_effect((e) => {
294
+ P.set_text(ee, m().giftCardApplied || "Gift card applied"), P.set_text(_, P.get(t).code), P.set_text(b, `-${e ?? ""}`);
295
+ }, [() => c(P.get(t).giftCardAmount)]), P.transition(3, n, () => f, () => ({ duration: p.fast })), P.append(e, n);
296
+ });
297
+ var oe = P.sibling(ae, 2), se = (t) => {
298
+ var i = Ee(), a = P.child(i), o = P.child(a);
299
+ r(o, { size: "16" });
300
+ var s = P.sibling(o, 2), c = P.child(s, !0);
301
+ P.reset(s), P.reset(a), P.reset(i), P.template_effect(() => {
302
+ P.set_class(a, 1, `full-coverage-badge ${e.caption ?? ""} ${n.emphasis ?? ""}`, "svelte-emw0hd"), P.set_text(c, m().fullyCoveredByGiftCard || "Fully covered by gift card");
303
+ }), P.append(t, i);
304
+ };
305
+ P.if(oe, (e) => {
306
+ P.get(te) && e(se);
307
+ });
308
+ var M = P.sibling(oe, 2), ce = P.child(M);
309
+ u(ce, {
310
+ size: "20",
311
+ class: "gift-icon"
312
+ });
313
+ var le = P.sibling(ce, 2), ue = P.child(le, !0);
314
+ P.reset(le);
315
+ var de = P.sibling(le, 2), fe = P.child(de, !0);
316
+ P.reset(de), P.reset(M);
317
+ var pe = P.sibling(M, 2), me = (t) => {
318
+ var n = Oe(), r = P.child(n), i = P.child(r);
319
+ P.remove_input_defaults(i);
320
+ let a;
321
+ var o = P.sibling(i, 2);
322
+ {
323
+ let e = P.derived(() => !P.get(v).trim() || l());
324
+ h(o, {
325
+ variant: "default",
326
+ size: "sm",
327
+ class: "min-w-16 shrink-0",
328
+ onclick: O,
329
+ get loading() {
330
+ return P.get(y);
331
+ },
332
+ get disabled() {
333
+ return P.get(e);
334
+ },
335
+ children: (e, t) => {
336
+ P.next();
337
+ var n = P.text();
338
+ P.template_effect(() => P.set_text(n, m().apply || "Apply")), P.append(e, n);
339
+ },
340
+ $$slots: { default: !0 }
341
+ });
342
+ }
343
+ P.reset(r);
344
+ var s = P.sibling(r, 2), c = (e) => {
345
+ var t = De(), n = P.child(t);
346
+ d(n, { size: "16" });
347
+ var r = P.sibling(n, 2), i = P.child(r, !0);
348
+ P.reset(r), P.reset(t), P.template_effect(() => P.set_text(i, P.get(b))), P.transition(3, t, () => f, () => ({ duration: p.micro })), P.append(e, t);
349
+ };
350
+ P.if(s, (e) => {
351
+ P.get(b) && e(c);
352
+ }), P.reset(n), P.template_effect(() => {
353
+ P.set_attribute(i, "aria-label", m().enterGiftCardCode || "Enter gift card code"), P.set_attribute(i, "placeholder", m().enterGiftCardCode || "Enter gift card code"), i.disabled = P.get(y) || l(), a = P.set_class(i, 1, `gift-input ${e.body ?? ""}`, "svelte-emw0hd", a, { "has-error": !!P.get(b) });
354
+ }), P.delegated("keydown", i, A), P.bind_value(i, () => P.get(v), (e) => P.set(v, e)), P.transition(3, n, () => f, () => ({ duration: p.fast })), P.append(t, n);
355
+ };
356
+ P.if(pe, (e) => {
357
+ P.get(C) && e(me);
358
+ }), P.reset(ie), P.template_effect(() => {
359
+ P.set_class(M, 1, `gift-card-toggle ${e.label ?? ""}`, "svelte-emw0hd"), M.disabled = l(), P.set_attribute(M, "aria-expanded", P.get(C)), P.set_text(ue, P.get(x).length > 0 ? m().addAnotherGiftCard || "Add another gift card" : m().haveAGiftCard || "Have a gift card?"), P.set_text(fe, P.get(C) ? "-" : "+");
360
+ }), P.delegated("click", M, re), P.append(t, ie), P.pop();
361
+ }
362
+ P.delegate(["click", "keydown"]);
363
+ //#endregion
364
+ //#region src/components/Modals/EventUnavailableModal.svelte
365
+ var je = P.from_html("<div class=\"flex flex-col items-center text-center pt-6 px-4 pb-4\"><div aria-hidden=\"true\"><!></div> <h3 id=\"event-unavailable-title\"> </h3> <p id=\"event-unavailable-body\" class=\"type-body tone-secondary max-w-72\"> </p></div>"), Me = P.from_html("<!> <!>", 1);
366
+ function Ne(t, n) {
367
+ P.push(n, !0);
368
+ let r = P.prop(n, "open", 15, !1), a = P.prop(n, "onBackToEvents", 3, () => {}), s = P.prop(n, "labels", 3, _), c = P.derived(() => n.reason === "canceled"), l = P.derived(() => P.get(c) ? s().eventCanceledTitle || "Event cancelled" : s().eventPostponedTitle || "Event postponed"), u = P.derived(() => P.get(c) ? s().eventCanceledBody || "This event was cancelled — you weren't charged" : s().eventPostponedBody || "Sales are paused while this show is rescheduled — you weren't charged"), d = P.derived(() => s().backToEvents || "Back to events");
369
+ te(t, {
370
+ size: "sm",
371
+ role: "alertdialog",
372
+ class: "micdrop",
373
+ get open() {
374
+ return r();
375
+ },
376
+ set open(e) {
377
+ r(e);
378
+ },
379
+ children: (t, n) => {
380
+ var r = Me(), s = P.first_child(r);
381
+ D(s, {});
382
+ var f = P.sibling(s, 2);
383
+ k(f, {
384
+ children: (t, n) => {
385
+ var r = Me(), s = P.first_child(r);
386
+ O(s, {
387
+ children: (t, n) => {
388
+ var r = je(), a = P.child(r), s = P.child(a), d = (e) => {
389
+ o(e, { size: "32" });
390
+ }, f = (e) => {
391
+ i(e, { size: "32" });
392
+ };
393
+ P.if(s, (e) => {
394
+ P.get(c) ? e(d) : e(f, -1);
395
+ }), P.reset(a);
396
+ var p = P.sibling(a, 2), m = P.child(p, !0);
397
+ P.reset(p);
398
+ var h = P.sibling(p, 2), ee = P.child(h, !0);
399
+ P.reset(h), P.reset(r), P.template_effect(() => {
400
+ P.set_class(a, 1, `w-16 h-16 rounded-full flex items-center justify-center mb-4 ${P.get(c) ? "bg-accent-danger/10 text-accent-danger" : "bg-accent-warning/10 text-accent-warning"}`), P.set_class(p, 1, `mb-2 ${e.heading ?? ""}`), P.set_text(m, P.get(l)), P.set_text(ee, P.get(u));
401
+ }), P.append(t, r);
402
+ },
403
+ $$slots: { default: !0 }
404
+ });
405
+ var f = P.sibling(s, 2);
406
+ A(f, {
407
+ children: (e, t) => {
408
+ h(e, {
409
+ size: "full",
410
+ variant: "default",
411
+ get onclick() {
412
+ return a();
413
+ },
414
+ get "aria-label"() {
415
+ return P.get(d);
416
+ },
417
+ children: (e, t) => {
418
+ P.next();
419
+ var n = P.text();
420
+ P.template_effect(() => P.set_text(n, P.get(d))), P.append(e, n);
421
+ },
422
+ $$slots: { default: !0 }
423
+ });
424
+ },
425
+ $$slots: { default: !0 }
426
+ }), P.append(t, r);
427
+ },
428
+ $$slots: { default: !0 }
429
+ }), P.append(t, r);
430
+ },
431
+ $$slots: { default: !0 }
432
+ }), P.pop();
433
+ }
434
+ //#endregion
435
+ //#region src/components/Views/Checkout.svelte
436
+ var $ = t("Checkout"), Pe = P.from_html("<div class=\"p-8 text-center\"><p class=\"text-accent-danger\"> </p></div>"), Fe = P.from_html("<div class=\"p-8 text-center\"><p class=\"tone-muted\"> </p></div>"), Ie = P.from_html("<!> <!>", 1);
437
+ function Le(e, t) {
438
+ P.push(t, !0);
439
+ let n = P.prop(t, "availableTickets", 23, () => []);
440
+ P.prop(t, "value", 3, "");
441
+ let r = P.prop(t, "venueId", 3, ""), i = P.prop(t, "organizationId", 3, ""), a = P.prop(t, "onNavigateBack", 3, void 0), o = P.prop(t, "initialError", 3, void 0), c = P.prop(t, "widgetId", 3, null), u = P.prop(t, "labels", 3, _), d = P.prop(t, "locale", 3, void 0);
442
+ function f(e) {
443
+ if (!e) return {};
444
+ let t = { ...e.venue ?? {} };
445
+ for (let n of [
446
+ "askForPhoneAtCheckout",
447
+ "requiredPhoneAtCheckout",
448
+ "hasCustomCheckout",
449
+ "questionPrompt"
450
+ ]) e[n] !== void 0 && (t[n] = e[n]);
451
+ return t;
452
+ }
453
+ let p = P.derived(() => (t.data || {}).id);
454
+ P.derived(() => (t.data || {}).orgSlug);
455
+ let h = P.derived(() => (t.data || {}).slug), S = P.derived(() => (t.data || {}).event), te = P.derived(() => ae(f(P.get(S)))), D = P.derived(() => P.get(S) ? {
456
+ ...oe(P.get(S)),
457
+ ...P.get(te)
458
+ } : t.data && (t.data.id || P.get(p)) ? {
459
+ id: t.data.id || P.get(p),
460
+ eventID: t.data.id || P.get(p),
461
+ venueID: t.data.venueID ?? t.data.venueId ?? null,
462
+ venueId: t.data.venueId ?? t.data.venueID ?? null,
463
+ eventTicketingType: 0,
464
+ ticketType: 0,
465
+ availableTickets: []
466
+ } : null), O = P.state(""), k = P.state(P.proxy({})), A = P.state(P.proxy({})), ne = P.state(P.proxy({})), j = P.state(P.proxy([])), F = P.state(""), I = P.state(0), L = P.state(!1), ve = P.state(!1), R = P.state(!1), z = P.state(null), B = P.state(""), V = P.state(void 0), H = P.state(null), U = P.state(""), ye = P.state(!1), be = P.state(""), W = P.state(null), G = P.derived(() => P.get(W) !== null), K = P.state(null), q = P.state(null), J = null, xe = P.state(!1);
467
+ function Se() {
468
+ return {
469
+ value: J?.total ?? null,
470
+ currency: J?.currency || "USD"
471
+ };
472
+ }
473
+ _e(async () => {
474
+ if (P.set(O, N(ce) || N(he.CHECKOUT_CARTID), !0), !P.get(O)) {
475
+ P.set(ye, !0), P.set(be, u().noCheckoutSession || "No checkout session found. Please select tickets first", !0);
476
+ return;
477
+ }
478
+ y(P.get(D)?.eventID || P.get(D)?.id || P.get(p), c(), r() || P.get(D)?.venueID || P.get(D)?.venueId || null);
479
+ let e = P.get(D)?.eventID || P.get(D)?.id || P.get(p);
480
+ try {
481
+ let t = M(e);
482
+ P.set(k, t.quantities || {}, !0), P.set(A, t.donationAmounts || {}, !0), P.set(ne, t.addOnQuantities || {}, !0), P.set(F, t.promocode || "", !0), P.set(I, t.promoDiscountAmount || 0, !0), P.set(j, t.tickets || [], !0);
483
+ } catch (e) {
484
+ $.error("Error loading checkout state:", e), P.set(k, {}, !0), P.set(ne, {}, !0), P.set(j, [], !0);
485
+ }
486
+ P.get(j).length > 0 && P.get(D) && (P.get(D).availableTickets = P.get(j), n(P.get(j)));
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 le(P.get(D)?.venueID || P.get(D)?.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 = [...Q(P.get(k), P.get(j), t), ...Te(P.get(ne), P.get(D)?.addOns)];
509
+ Object.keys(P.get(k)).length > 0 && await X();
510
+ let a = 900, l = "";
511
+ if (P.get(O)) {
512
+ let e = se(P.get(O));
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 b(P.get(O));
519
+ if (!e.error && e.expiresAt) {
520
+ let t = v(e.expiresAt).getTime();
521
+ a = Math.max(0, Math.floor((t - Date.now()) / 1e3)), l = e.expiresAt, ue(P.get(O), t);
522
+ }
523
+ } catch {}
524
+ }
525
+ let d = N(`checkout-promo-discount-type-${e}`), f = [];
526
+ try {
527
+ let t = N(`checkout-promo-ticket-ids-${e}`), n = t ? JSON.parse(t) : [];
528
+ Array.isArray(n) && (f = n);
529
+ } catch {
530
+ f = [];
531
+ }
532
+ let m = s(i.filter((e) => fe(f, e.ticketId)).reduce((e, t) => e + (t.subtotal == null ? 0 : t.subtotal), 0)), h = de(m, P.get(I), d);
533
+ if (P.set(q, {
534
+ event: Ce(P.get(D), t),
535
+ lines: i,
536
+ timerStart: a,
537
+ ...l ? { deadlineAt: l } : {},
538
+ promoApplied: !!P.get(F),
539
+ promoDiscount: h,
540
+ forceExpired: !1,
541
+ ...J ? { serverTotals: J } : {}
542
+ }, !0), o()) {
543
+ let e = Z(typeof o() == "object" ? o() : {
544
+ code: "card_declined",
545
+ message: "Your card was declined. Please try a different payment method."
546
+ }, u());
547
+ P.set(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 (!P.get(O)) {
557
+ $.error("Missing cartId!");
558
+ return;
559
+ }
560
+ let t = Object.fromEntries(Object.entries(P.get(k)).filter(([e, t]) => t > 0));
561
+ try {
562
+ let n = Object.fromEntries(Object.entries(P.get(A)).filter(([, e]) => parseFloat(String(e)) > 0).map(([e, t]) => [parseInt(e, 10), parseFloat(String(t))]));
563
+ if (P.get(F)) {
564
+ let t = await ie(P.get(O), P.get(F));
565
+ if (e !== Y) return;
566
+ t.success ? P.set(U, "") : ($.error("Failed to apply promo code to cart:", t.error), P.set(U, (u().promoCodeNotApplied || "We couldn't apply promo code {code}. It isn't included in this total — go back to re-enter it, or continue at the full price").replace("{code}", P.get(F)), !0));
567
+ }
568
+ let r = await w(P.get(O), t, Object.keys(n).length > 0 ? n : void 0, void 0, d());
569
+ if (e !== Y) return;
570
+ if (!r) {
571
+ P.set(H, { message: u().failedToCreatePaymentIntent || "Failed to create payment intent. Please try again" }, !0);
572
+ return;
573
+ }
574
+ P.set(xe, !1), J = E(r), P.get(q) && P.set(q, {
575
+ ...P.get(q),
576
+ serverTotals: J
577
+ }, !0);
578
+ let i = r;
579
+ if (i.requires_stripe === !1 || i.payment_type === "free") {
580
+ P.set(B, "free");
581
+ return;
582
+ }
583
+ P.set(xe, J === null);
584
+ let a = r.stripe_publishable_key;
585
+ if (!a) {
586
+ $.error("No Stripe publishable key in payment intent response"), P.set(H, { message: u().paymentConfigError || "Payment configuration error. Please try again" }, !0);
587
+ return;
588
+ }
589
+ let o = await we(a);
590
+ if (e !== Y) return;
591
+ P.set(z, o, !0), r.client_secret ? P.set(B, r.client_secret, !0) : P.set(H, { message: u().failedToInitPayment || "Failed to initialize payment. Please try again" }, !0);
592
+ } catch (t) {
593
+ if ($.error("Failed to initialize Stripe payment:", t), e !== Y) return;
594
+ P.set(H, { message: t.message || u().failedToInitPayment || "Failed to initialize payment. Please try again" }, !0);
595
+ }
596
+ }
597
+ function Ce(e, t) {
598
+ return e ? {
599
+ id: e.id || e.eventID,
600
+ title: e.name || e.title || "",
601
+ slug: e.slug || P.get(h) || "",
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 || g(),
608
+ imageUrl: e.imageUrl || e.image || "",
609
+ ...P.get(te),
610
+ venue: {
611
+ id: e.venueID || e.venueId || 0,
612
+ name: e.venueName || "",
613
+ address: e.venueAddress || "",
614
+ timezone: e.timeZone || e.timezone || g(),
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
+ addOns: e.addOns || [],
624
+ tickets: (e.availableTickets || []).map((e) => ({
625
+ id: e.ID || e.id,
626
+ name: e.name || "",
627
+ description: e.description || "",
628
+ price: l(e.price),
629
+ fee: 0,
630
+ quantityAvailable: e.quantityAvailable || 0,
631
+ quantityTotal: e.quantityTotal || 0,
632
+ minPerOrder: e.minPerOrder || 1,
633
+ maxPerOrder: e.maxPerOrder || 10,
634
+ status: "on_sale",
635
+ isDonation: e.type === 2,
636
+ isHidden: !1
637
+ })),
638
+ faqs: e.faqs || [],
639
+ status: "on_sale",
640
+ isPasswordProtected: !1,
641
+ isRegistrationEvent: e.eventTicketingType === 1 || e.ticketType === 1,
642
+ totalTicketsRemaining: 100,
643
+ totalTicketsCapacity: 100
644
+ } : null;
645
+ }
646
+ function Q(e, t, n) {
647
+ let r = [];
648
+ for (let [i, a] of Object.entries(e)) {
649
+ if (a <= 0) continue;
650
+ let e = t.find((e) => String(e.ID) === i || String(e.id) === i);
651
+ if (!e) continue;
652
+ let o = e.type === 2, c = e.price;
653
+ if (!o && (c == null || !Number.isFinite(c))) {
654
+ r.push({
655
+ ticketId: parseInt(i),
656
+ ticketName: e.name || "",
657
+ quantity: a,
658
+ unitPrice: null,
659
+ fee: 0,
660
+ subtotal: null,
661
+ isDonation: !1
662
+ });
663
+ continue;
664
+ }
665
+ let l = c ?? 0, u = pe(l, n, o);
666
+ r.push({
667
+ ticketId: parseInt(i),
668
+ ticketName: e.name || "",
669
+ quantity: a,
670
+ unitPrice: l,
671
+ fee: u,
672
+ subtotal: s(l * a),
673
+ isDonation: o
674
+ });
675
+ }
676
+ return r;
677
+ }
678
+ function Te(e, t) {
679
+ let n = t || [], r = [];
680
+ for (let [t, i] of Object.entries(e || {})) {
681
+ if (!(i > 0)) continue;
682
+ let e = n.find((e) => String(e.id) === String(t));
683
+ if (!e) continue;
684
+ let a = ee(m(Number(e.priceCents) || 0));
685
+ r.push({
686
+ ticketId: parseInt(t, 10),
687
+ lineKey: `a:${t}`,
688
+ kind: "addon",
689
+ ticketName: e.name || "",
690
+ quantity: i,
691
+ unitPrice: a,
692
+ fee: 0,
693
+ subtotal: s(a * i),
694
+ isDonation: !1
695
+ });
696
+ }
697
+ return r;
698
+ }
699
+ let Ee = P.derived(() => Object.values(P.get(A)).some((e) => (Number(e) || 0) > 0)), De = P.derived(() => !P.get(Ee) && (!P.get(q) || P.get(q).lines.every((e) => e.unitPrice === 0)));
700
+ async function Oe(e) {
701
+ if (!P.get(L)) {
702
+ P.set(L, !0), P.set(H, null);
703
+ try {
704
+ if (P.get(R)) {
705
+ P.set(H, { message: u().paymentReinitializing || "Updating your total. Please wait a moment and try again" }, !0);
706
+ return;
707
+ }
708
+ if (P.get(K) && !P.get(K).requiresStripe) {
709
+ await ke(e);
710
+ return;
711
+ }
712
+ if (P.get(De) || P.get(B) === "free" || J?.total === 0) {
713
+ await je(e);
714
+ return;
715
+ }
716
+ if (!P.get(V)) {
717
+ P.set(H, {
718
+ message: u().paymentFormNotReady || "Payment form is not ready. Please wait a moment and try again",
719
+ blocking: !0
720
+ }, !0), P.set(L, !1);
721
+ return;
722
+ }
723
+ if (!P.get(z)) {
724
+ P.set(H, {
725
+ message: u().paymentSystemNotInitialized || "Payment system is not initialized. Please refresh the page",
726
+ blocking: !0
727
+ }, !0), P.set(L, !1);
728
+ return;
729
+ }
730
+ let { error: n } = await P.get(V).submit();
731
+ if (n) {
732
+ let e = Z(n, u());
733
+ P.set(H, {
734
+ message: e.message,
735
+ suggestion: e.suggestion
736
+ }, !0), P.set(L, !1);
737
+ return;
738
+ }
739
+ let a = await P.get(z).confirmPayment({
740
+ elements: P.get(V),
741
+ redirect: "if_required"
742
+ });
743
+ if (a.error) {
744
+ let e = Z(a.error, u());
745
+ P.set(H, {
746
+ message: e.message,
747
+ suggestion: e.suggestion
748
+ }, !0), P.set(L, !1);
749
+ return;
750
+ }
751
+ let o = {
752
+ id: P.get(O),
753
+ paymentIntentId: a.paymentIntent.id,
754
+ tickets: P.get(k),
755
+ firstName: e.firstName,
756
+ lastName: e.lastName,
757
+ email: e.email,
758
+ phone: e.phone,
759
+ questionAnswer: e.questionAnswer,
760
+ paymentMethod: "credit-card",
761
+ mailingList: e.keepMeUpdated,
762
+ saleType: "online"
763
+ }, s = await C(P.get(O), o, d());
764
+ if (s?.eventCanceled || s?.eventPostponed) {
765
+ P.set(W, s.eventCanceled ? "canceled" : "postponed", !0), P.set(H, null);
766
+ return;
767
+ }
768
+ if (s?.status === "Payment succeeded") {
769
+ ge(P.get(O), e.email);
770
+ let n = {
771
+ orderId: P.get(O),
772
+ eventId: P.get(D)?.id || P.get(D)?.eventID || null,
773
+ event: P.get(D) || null,
774
+ venueId: r() || P.get(D)?.venueId || null,
775
+ organizationId: i() || P.get(D)?.organizationId || null,
776
+ ...Se()
777
+ };
778
+ t.onNavigateToSuccess && t.onNavigateToSuccess(n);
779
+ } else s?.status === "Payment amount does not match the total price" ? P.set(H, { message: u().paymentAmountMismatch || "Payment amount mismatch. Please refresh and try again" }, !0) : P.set(H, { message: u().paymentValidationFailed || "Payment validation failed. Please try again" }, !0);
780
+ } catch (e) {
781
+ $.error("Payment execution error:", e);
782
+ let t = Z(e, u());
783
+ P.set(H, {
784
+ message: t.message,
785
+ suggestion: t.suggestion
786
+ }, !0);
787
+ } finally {
788
+ P.set(L, !1);
789
+ }
790
+ }
791
+ }
792
+ async function ke(e) {
793
+ try {
794
+ let n = await re(P.get(O), {
795
+ firstName: e.firstName,
796
+ lastName: e.lastName,
797
+ email: e.email,
798
+ phoneNumber: e.phone || null,
799
+ questionAnswer: e.questionAnswer,
800
+ mailingList: e.keepMeUpdated
801
+ }, d());
802
+ if (n?.success) {
803
+ ge(n.orderId || P.get(O), e.email);
804
+ let a = {
805
+ orderId: n.orderId || P.get(O),
806
+ eventId: P.get(D)?.id || P.get(D)?.eventID || null,
807
+ event: P.get(D) || null,
808
+ venueId: r() || P.get(D)?.venueId || null,
809
+ organizationId: i() || P.get(D)?.organizationId || null,
810
+ paymentType: "gift_card_only",
811
+ ...Se()
812
+ };
813
+ t.onNavigateToSuccess && t.onNavigateToSuccess(a);
814
+ } else P.set(H, { message: n?.error || u().failedToCompleteOrder || "Failed to complete order. Please try again" }, !0);
815
+ } catch (e) {
816
+ $.error("Gift card payment error:", e);
817
+ let t = Z(e, u());
818
+ P.set(H, {
819
+ message: t.message,
820
+ suggestion: t.suggestion
821
+ }, !0);
822
+ } finally {
823
+ P.set(L, !1);
824
+ }
825
+ }
826
+ async function je(e) {
827
+ try {
828
+ let n = Object.fromEntries(Object.entries(P.get(k)).filter(([e, t]) => t > 0)), a = Object.fromEntries(Object.entries(P.get(A)).filter(([, e]) => parseFloat(String(e)) > 0).map(([e, t]) => [parseInt(e, 10), parseFloat(String(t))])), o = await w(P.get(O), n, Object.keys(a).length > 0 ? a : void 0, {
829
+ firstName: e.firstName,
830
+ lastName: e.lastName,
831
+ email: e.email,
832
+ phone: e.phone,
833
+ questionAnswer: e.questionAnswer,
834
+ mailingList: e.keepMeUpdated
835
+ }, d());
836
+ if (o?.requires_stripe !== !1 && o?.payment_type !== "free" || o?.order_finalized === !1) {
837
+ P.set(H, { message: u().failedToCompleteOrder || "Failed to complete order. Please try again" }, !0);
838
+ return;
839
+ }
840
+ P.set(B, "free"), ge(P.get(O), e.email);
841
+ let s = {
842
+ orderId: P.get(O),
843
+ eventId: P.get(D)?.id || P.get(D)?.eventID || null,
844
+ event: P.get(D) || null,
845
+ venueId: r() || P.get(D)?.venueId || null,
846
+ organizationId: i() || P.get(D)?.organizationId || null,
847
+ paymentType: "free",
848
+ ...Se()
849
+ };
850
+ t.onNavigateToSuccess && t.onNavigateToSuccess(s);
851
+ } catch (e) {
852
+ $.error("Free order completion error:", e);
853
+ let t = Z(e, u());
854
+ P.set(H, {
855
+ message: t.message,
856
+ suggestion: t.suggestion
857
+ }, !0);
858
+ } finally {
859
+ P.set(L, !1);
860
+ }
861
+ }
862
+ async function Me(e) {
863
+ if (P.set(K, e, !0), P.get(q) && J && P.set(q, {
864
+ ...P.get(q),
865
+ serverTotals: T(J, e)
866
+ }, !0), !e.requiresStripe) Y++, P.set(V, void 0), P.set(z, null), P.set(B, "");
867
+ else if (P.get(O) && Object.keys(P.get(k)).length > 0) {
868
+ P.set(R, !0);
869
+ try {
870
+ await X();
871
+ } finally {
872
+ P.set(R, !1);
873
+ }
874
+ }
875
+ }
876
+ async function Le() {
877
+ if (P.set(K, null), P.get(q) && J && P.set(q, {
878
+ ...P.get(q),
879
+ serverTotals: J
880
+ }, !0), P.get(O) && Object.keys(P.get(k)).length > 0) {
881
+ P.set(R, !0);
882
+ try {
883
+ await X();
884
+ } finally {
885
+ P.set(R, !1);
886
+ }
887
+ }
888
+ }
889
+ function Re() {
890
+ a() ? a()() : window.history.back();
891
+ }
892
+ function ze() {
893
+ a() ? a()() : window.history.back();
894
+ }
895
+ function Be() {
896
+ P.set(W, null), Re();
897
+ }
898
+ async function Ve() {
899
+ if (!P.get(O)) return null;
900
+ try {
901
+ let e = await x(P.get(O));
902
+ return e.success ? {
903
+ newExpiryTime: e.newExpiryTime,
904
+ remainingExtensions: e.remainingExtensions
905
+ } : ($.error("Failed to extend session:", e.error), null);
906
+ } catch (e) {
907
+ return $.error("Error extending checkout session:", e), null;
908
+ }
909
+ }
910
+ var He = Ie(), Ue = P.first_child(He), We = (e) => {
911
+ {
912
+ let t = (e) => {
913
+ {
914
+ let t = P.derived(() => P.get(L) || P.get(R)), n = P.derived(() => P.get(q)?.serverTotals?.total ?? 0), r = P.derived(() => P.get(q)?.serverTotals?.giftCardAmount ?? null);
915
+ Ae(e, {
916
+ get cartId() {
917
+ return P.get(O);
918
+ },
919
+ onApplied: Me,
920
+ onRemoved: Le,
921
+ get disabled() {
922
+ return P.get(t);
923
+ },
924
+ get owedTotal() {
925
+ return P.get(n);
926
+ },
927
+ get serverGiftCardAmount() {
928
+ return P.get(r);
929
+ },
930
+ get labels() {
931
+ return u();
932
+ }
933
+ });
934
+ }
935
+ }, n = P.derived(() => P.get(H) ?? (P.get(U) ? { message: P.get(U) } : null));
936
+ me(e, {
937
+ get config() {
938
+ return P.get(q);
939
+ },
940
+ onPlaceOrder: Oe,
941
+ onBack: Re,
942
+ onRetryExpired: ze,
943
+ onExtendSession: Ve,
944
+ get stripe() {
945
+ return P.get(z);
946
+ },
947
+ get paymentIntent() {
948
+ return P.get(B);
949
+ },
950
+ get serverTotalsUnavailable() {
951
+ return P.get(xe);
952
+ },
953
+ get paymentError() {
954
+ return P.get(n);
955
+ },
956
+ get labels() {
957
+ return u();
958
+ },
959
+ get locale() {
960
+ return d();
961
+ },
962
+ get elements() {
963
+ return P.get(V);
964
+ },
965
+ set elements(e) {
966
+ P.set(V, e, !0);
967
+ },
968
+ get eventEnded() {
969
+ return P.get(ve);
970
+ },
971
+ set eventEnded(e) {
972
+ P.set(ve, e, !0);
973
+ },
974
+ giftCard: t,
975
+ $$slots: { giftCard: !0 }
976
+ });
977
+ }
978
+ }, Ge = (e) => {
979
+ var t = Pe(), n = P.child(t), r = P.child(n, !0);
980
+ P.reset(n), P.reset(t), P.template_effect(() => P.set_text(r, P.get(be))), P.append(e, t);
981
+ }, Ke = (e) => {
982
+ var t = Fe(), n = P.child(t), r = P.child(n, !0);
983
+ P.reset(n), P.reset(t), P.template_effect(() => P.set_text(r, u().loadingSecurePaymentForm || "Loading secure payment form...")), P.append(e, t);
984
+ };
985
+ P.if(Ue, (e) => {
986
+ P.get(q) ? e(We) : P.get(ye) ? e(Ge, 1) : e(Ke, -1);
987
+ });
988
+ var qe = P.sibling(Ue, 2), Je = (e) => {
989
+ Ne(e, {
990
+ open: !0,
991
+ get reason() {
992
+ return P.get(W);
993
+ },
994
+ onBackToEvents: Be,
995
+ get labels() {
996
+ return u();
997
+ }
998
+ });
999
+ };
1000
+ P.if(qe, (e) => {
1001
+ P.get(G) && e(Je);
1002
+ }), P.append(e, He), P.pop();
1003
+ }
1004
+ //#endregion
1005
+ export { Le as default };