@loczer/storefront-sdk 0.166.0 → 0.167.0

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.
@@ -1,154 +1,155 @@
1
1
  import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
- import { useState as _, useRef as H, useEffect as E, useMemo as K } from "react";
2
+ import { useState as f, useRef as j, useEffect as T, useMemo as K } from "react";
3
3
  import { toast as G } from "@rpcbase/client";
4
4
  import { useParams as J, useNavigate as Q, useSearchParams as V, Link as N } from "@rpcbase/router";
5
5
  import { loadStripe as W } from "@stripe/stripe-js";
6
6
  import { Elements as Z, useStripe as ee } from "@stripe/react-stripe-js";
7
- import { AlertTriangle as O, ShieldCheck as te, Loader2 as T, CheckCircle2 as re, XCircle as se, CircleDashed as ne, ArrowRight as ae } from "lucide-react";
8
- import { useTranslation as I } from "react-i18next";
9
- import { apiPost as ce } from "../lib/apiCall.js";
10
- import { ROUTE as ie, responseSchema as le } from "../lib/checkoutPaymentSession.js";
11
- import { pickBookingSearchParams as oe } from "../lib/booking.js";
7
+ import { AlertTriangle as O, ShieldCheck as te, CheckCircle2 as re, XCircle as se, CircleDashed as ne, ArrowRight as ae, Loader2 as ce } from "lucide-react";
8
+ import { useTranslation as E } from "react-i18next";
9
+ import { apiPost as ie } from "../lib/apiCall.js";
10
+ import { ROUTE as oe, responseSchema as le } from "../lib/checkoutPaymentSession.js";
11
+ import { pickBookingSearchParams as ue } from "../lib/booking.js";
12
12
  import { useStorefrontCart as me } from "../lib/cart.js";
13
13
  import { MollieCardFieldsForm as de } from "../components/payment/MollieCardFieldsForm.js";
14
- import { StripeCardFieldsForm as ue } from "../components/payment/StripeCardFieldsForm.js";
15
- import { Button as f } from "../ui/button.js";
14
+ import { StripeCardFieldsForm as pe } from "../components/payment/StripeCardFieldsForm.js";
15
+ import { Button as S } from "../ui/button.js";
16
16
  import { Card as y } from "../ui/card.js";
17
- const pe = {}, he = () => pe?.RB_PUBLIC_STRIPE_PUBLISHABLE_KEY?.trim() ?? "", _e = he(), fe = 20, ye = 2500, xe = (t, l, c) => {
17
+ const he = {}, _e = () => he?.RB_PUBLIC_STRIPE_PUBLISHABLE_KEY?.trim() ?? "", fe = _e(), ye = 20, xe = 2500, ge = (t, u, a) => {
18
18
  try {
19
- return new Intl.NumberFormat(c, {
19
+ return new Intl.NumberFormat(a, {
20
20
  style: "currency",
21
- currency: l.toUpperCase()
21
+ currency: u.toUpperCase()
22
22
  }).format(t / 100);
23
23
  } catch {
24
- return `${(t / 100).toFixed(2)} ${l.toUpperCase()}`;
24
+ return `${(t / 100).toFixed(2)} ${u.toUpperCase()}`;
25
25
  }
26
26
  };
27
- function ge({
27
+ function ke({
28
28
  clientSecret: t,
29
- onSuccess: l
29
+ onSuccess: u
30
30
  }) {
31
- const { t: c } = I(), u = ee();
31
+ const { t: a } = E(), _ = ee();
32
32
  return /* @__PURE__ */ e(
33
- ue,
33
+ pe,
34
34
  {
35
35
  requireEmail: !1,
36
- submitLabel: c("checkout_payment_authorize_button"),
37
- submittingLabel: c("checkout_payment_authorizing_button"),
36
+ submitLabel: a("checkout_payment_authorize_button"),
37
+ submittingLabel: a("checkout_payment_authorizing_button"),
38
38
  onSubmit: async ({ paymentMethodId: x }) => {
39
- if (!u)
40
- throw new Error(c("secure_payment_link.errors.stripe_not_ready"));
41
- const o = await u.confirmCardPayment(
39
+ if (!_)
40
+ throw new Error(a("secure_payment_link.errors.stripe_not_ready"));
41
+ const m = await _.confirmCardPayment(
42
42
  t,
43
43
  {
44
44
  payment_method: x
45
45
  }
46
46
  );
47
- if (o.error)
48
- throw new Error(o.error.message ?? c("secure_payment_link.errors.payment_failed"));
49
- const r = o.paymentIntent?.status;
47
+ if (m.error)
48
+ throw new Error(m.error.message ?? a("secure_payment_link.errors.payment_failed"));
49
+ const r = m.paymentIntent?.status;
50
50
  if (r !== "succeeded" && r !== "processing" && r !== "requires_capture")
51
- throw new Error(c("secure_payment_link.errors.payment_failed"));
52
- l();
51
+ throw new Error(a("secure_payment_link.errors.payment_failed"));
52
+ u();
53
53
  }
54
54
  }
55
55
  );
56
56
  }
57
- function q() {
58
- const { t } = I();
57
+ function be() {
58
+ const { t } = E();
59
59
  return /* @__PURE__ */ n("div", { className: "flex min-h-48 items-center justify-center gap-2 text-sm text-slate-600", children: [
60
- /* @__PURE__ */ e(T, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }),
60
+ /* @__PURE__ */ e(ce, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }),
61
61
  /* @__PURE__ */ e("span", { children: t("secure_payment_link.form.loading_session") })
62
62
  ] });
63
63
  }
64
- function Me() {
65
- const { t, i18n: l } = I(), { storeSlug: c } = J(), u = Q(), { clear: x } = me(), [o] = V(), [r, p] = _(null), [h, S] = _(!0), [A, g] = _(null), [D, U] = _(0), [$, R] = _(0), k = H(!1), m = o.get("checkout_session_id")?.trim() ?? "", M = new URLSearchParams(o.toString());
66
- M.delete("checkout_session_id");
67
- const d = oe(M).toString(), v = `/${c ?? ""}/checkout${d ? `?${d}` : ""}`, P = `/${c ?? ""}/checkout/success${d ? `?${d}` : ""}`, j = async (a) => {
68
- if (!c || !m)
64
+ function Be() {
65
+ const { t, i18n: u } = E(), { storeSlug: a } = J(), _ = Q(), { clear: x } = me(), [m] = V(), [r, d] = f(null), [q, g] = f(!0), [I, k] = f(null), [D, X] = f(0), [A, U] = f(0), b = j(!1), l = j(null), p = m.get("checkout_session_id")?.trim() ?? "", $ = new URLSearchParams(m.toString());
66
+ $.delete("checkout_session_id");
67
+ const h = ue($).toString(), v = `/${a ?? ""}/checkout${h ? `?${h}` : ""}`, P = `/${a ?? ""}/checkout/success${h ? `?${h}` : ""}`, R = async (c) => {
68
+ if (!a || !p)
69
69
  throw new Error(t("checkout_payment_return_missing_session"));
70
- const s = await ce(
71
- ie,
70
+ const s = await ie(
71
+ oe,
72
72
  {
73
- storeSlug: c,
74
- checkoutSessionId: m,
75
- returnSearch: d || void 0,
76
- cardToken: a
73
+ storeSlug: a,
74
+ checkoutSessionId: p,
75
+ returnSearch: h || void 0,
76
+ cardToken: c
77
77
  }
78
78
  );
79
79
  return le.parse(s);
80
80
  }, C = async () => {
81
- k.current || (k.current = !0, G.success(t("checkout_success_toast")), await u(P, { replace: !0 }), x());
81
+ b.current || (b.current = !0, G.success(t("checkout_success_toast")), await _(P, { replace: !0 }), x());
82
82
  };
83
- E(() => {
84
- k.current = !1, R(0);
85
- }, [m]), E(() => {
86
- if (!c || !m) {
87
- p(null), g(t("checkout_payment_return_missing_session")), S(!1);
83
+ T(() => {
84
+ b.current = !1, l.current = null, d(null), g(!0), U(0);
85
+ }, [p]), T(() => {
86
+ if (!a || !p) {
87
+ l.current = null, d(null), k(t("checkout_payment_return_missing_session")), g(!1);
88
88
  return;
89
89
  }
90
- let a = !1;
91
- return S(!0), g(null), (async () => {
90
+ let c = !1;
91
+ const s = l.current === null;
92
+ return g(s), k(null), (async () => {
92
93
  try {
93
- const s = await j();
94
- if (a) return;
95
- if (!s.success) {
96
- p(null), g(s.message || t("checkout_payment_return_status_error"));
94
+ const i = await R();
95
+ if (c) return;
96
+ if (!i.success) {
97
+ l.current = null, d(null), k(i.message || t("checkout_payment_return_status_error"));
97
98
  return;
98
99
  }
99
- p(s);
100
- const w = s.paymentStatus;
101
- (w === "authorized" || w === "succeeded") && !k.current && await C();
102
- } catch (s) {
103
- if (a) return;
104
- console.error("Failed to fetch checkout payment session", s), p(null), g(t("checkout_payment_return_status_error"));
100
+ l.current = i, d(i);
101
+ const F = i.paymentStatus;
102
+ (F === "authorized" || F === "succeeded") && !b.current && await C();
103
+ } catch (i) {
104
+ if (c) return;
105
+ console.error("Failed to fetch checkout payment session", i), l.current = null, d(null), k(t("checkout_payment_return_status_error"));
105
106
  } finally {
106
- a || S(!1);
107
+ !c && s && g(!1);
107
108
  }
108
109
  })(), () => {
109
- a = !0;
110
+ c = !0;
110
111
  };
111
- }, [m, x, u, d, D, c, P, t]);
112
- const i = r?.paymentStatus ?? "pending";
113
- E(() => {
114
- if (i !== "pending" || $ >= fe || !r?.payment?.id) return;
115
- const a = window.setTimeout(() => {
116
- R((s) => s + 1), U((s) => s + 1);
117
- }, ye);
112
+ }, [p, x, _, h, D, a, P, t]);
113
+ const o = r?.paymentStatus ?? "pending";
114
+ T(() => {
115
+ if (o !== "pending" || r?.providerType === "stripe_connect_oauth" || A >= ye || !r?.payment?.id) return;
116
+ const c = window.setTimeout(() => {
117
+ U((s) => s + 1), X((s) => s + 1);
118
+ }, xe);
118
119
  return () => {
119
- window.clearTimeout(a);
120
+ window.clearTimeout(c);
120
121
  };
121
- }, [i, $, r?.payment?.id]);
122
- const z = K(() => {
123
- const a = r?.stripePublishableKey?.trim() || _e;
124
- return !a || !r?.stripeAccountId ? null : W(a, {
122
+ }, [o, A, r?.payment?.id, r?.providerType]);
123
+ const M = K(() => {
124
+ const c = r?.stripePublishableKey?.trim() || fe;
125
+ return !c || !r?.stripeAccountId ? null : W(c, {
125
126
  stripeAccount: r.stripeAccountId
126
127
  });
127
- }, [r?.stripeAccountId, r?.stripePublishableKey]), F = K(() => {
128
+ }, [r?.stripeAccountId, r?.stripePublishableKey]), z = K(() => {
128
129
  if (r?.clientSecret)
129
130
  return {
130
131
  clientSecret: r.clientSecret
131
132
  };
132
133
  }, [r?.clientSecret]);
133
- if (!m)
134
+ if (!p)
134
135
  return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-destructive/25 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
135
136
  /* @__PURE__ */ n("div", { className: "flex items-start gap-3", children: [
136
137
  /* @__PURE__ */ e(O, { className: "mt-0.5 h-5 w-5 text-destructive", "aria-hidden": "true" }),
137
138
  /* @__PURE__ */ e("p", { className: "text-sm text-slate-700", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_missing_session") }) })
138
139
  ] }),
139
- /* @__PURE__ */ e(N, { to: v, children: /* @__PURE__ */ e(f, { variant: "outline", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_back_to_checkout") }) }) })
140
+ /* @__PURE__ */ e(N, { to: v, children: /* @__PURE__ */ e(S, { variant: "outline", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_back_to_checkout") }) }) })
140
141
  ] }) }) });
141
- if (h && !r)
142
- return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ e(q, {}) }) });
143
- if (A || !r)
142
+ if (q && !r)
143
+ return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ e(be, {}) }) });
144
+ if (I || !r)
144
145
  return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-destructive/25 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
145
146
  /* @__PURE__ */ n("div", { className: "flex items-start gap-3", children: [
146
147
  /* @__PURE__ */ e(O, { className: "mt-0.5 h-5 w-5 text-destructive", "aria-hidden": "true" }),
147
- /* @__PURE__ */ e("p", { className: "text-sm text-slate-700", children: /* @__PURE__ */ e("span", { children: A ?? t("checkout_payment_return_status_error") }) })
148
+ /* @__PURE__ */ e("p", { className: "text-sm text-slate-700", children: /* @__PURE__ */ e("span", { children: I ?? t("checkout_payment_return_status_error") }) })
148
149
  ] }),
149
- /* @__PURE__ */ e(N, { to: v, children: /* @__PURE__ */ e(f, { variant: "outline", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_back_to_checkout") }) }) })
150
+ /* @__PURE__ */ e(N, { to: v, children: /* @__PURE__ */ e(S, { variant: "outline", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_back_to_checkout") }) }) })
150
151
  ] }) }) });
151
- const B = typeof r.amountMinor == "number" && r.currency ? xe(r.amountMinor, r.currency, l.language) : null, b = i === "authorized" || i === "succeeded", L = i === "failed" || i === "cancelled", X = b ? re : L ? se : ne, Y = b ? "text-emerald-600" : L ? "text-destructive" : "text-amber-600";
152
+ const B = typeof r.amountMinor == "number" && r.currency ? ge(r.amountMinor, r.currency, u.language) : null, w = o === "authorized" || o === "succeeded", L = o === "failed" || o === "cancelled", Y = w ? re : L ? se : ne, H = w ? "text-emerald-600" : L ? "text-destructive" : "text-amber-600";
152
153
  return /* @__PURE__ */ e("div", { className: "mx-auto max-w-5xl px-4 py-10 sm:px-6", children: /* @__PURE__ */ n("div", { className: "grid gap-6 lg:grid-cols-[1fr_1fr]", children: [
153
154
  /* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-5 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-5", children: [
154
155
  /* @__PURE__ */ n("div", { className: "inline-flex items-center gap-2 rounded-full border border-emerald-200 bg-emerald-50 px-3 py-1 text-xs font-medium text-emerald-700", children: [
@@ -168,76 +169,54 @@ function Me() {
168
169
  /* @__PURE__ */ e("dt", { className: "text-slate-600", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_provider") }) }),
169
170
  /* @__PURE__ */ e("dd", { className: "font-medium text-slate-950", children: /* @__PURE__ */ e("span", { children: t(`secure_payment_link.providers.${r.providerType}`) }) })
170
171
  ] }) : null
171
- ] }),
172
- h ? /* @__PURE__ */ n("p", { className: "inline-flex items-center gap-2 text-sm text-slate-500", children: [
173
- /* @__PURE__ */ e(T, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }),
174
- /* @__PURE__ */ e("span", { children: t("checkout_payment_return_loading") })
175
- ] }) : null
172
+ ] })
176
173
  ] }) }),
177
- /* @__PURE__ */ n(y, { className: "border-slate-200 bg-white p-5 shadow-sm", children: [
178
- b || L ? /* @__PURE__ */ n("div", { className: "space-y-6 text-center", children: [
179
- /* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-slate-100", children: /* @__PURE__ */ e(X, { className: `h-6 w-6 ${Y}`, "aria-hidden": "true" }) }),
180
- /* @__PURE__ */ n("div", { className: "space-y-2", children: [
181
- /* @__PURE__ */ e("h2", { className: "text-xl font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: t(`secure_payment_link.success_titles.${i}`) }) }),
182
- /* @__PURE__ */ e("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t(`secure_payment_link.statuses.${i}`) }) })
183
- ] }),
184
- b ? /* @__PURE__ */ e(N, { to: P, children: /* @__PURE__ */ n(f, { className: "gap-2", children: [
185
- /* @__PURE__ */ e("span", { children: t("checkout_payment_return_go_to_success") }),
186
- /* @__PURE__ */ e(ae, { className: "h-4 w-4", "aria-hidden": "true" })
187
- ] }) }) : /* @__PURE__ */ e(N, { to: v, children: /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_retry_checkout") }) }) })
188
- ] }) : r.providerType === "mollie_connect_oauth" ? /* @__PURE__ */ n("div", { className: "space-y-4", children: [
189
- /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.mollie.form_title") }) }),
190
- /* @__PURE__ */ e("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_hold_form_description") }) }),
191
- r.profileId ? /* @__PURE__ */ e(
192
- de,
193
- {
194
- profileId: r.profileId,
195
- testmode: r.testmode === !0,
196
- submitLabel: t("checkout_payment_authorize_button"),
197
- submittingLabel: t("checkout_payment_authorizing_button"),
198
- onSubmit: async (a) => {
199
- const s = await j(a);
200
- if (!s.success)
201
- throw new Error(s.message || t("secure_payment_link.errors.payment_failed"));
202
- if (p(s), s.paymentStatus === "authorized" || s.paymentStatus === "succeeded") {
203
- await C();
204
- return;
205
- }
206
- if (!s.checkoutUrl)
207
- throw new Error(s.message || t("secure_payment_link.errors.mollie_missing_url"));
208
- const w = new URL(s.checkoutUrl, window.location.origin).toString();
209
- window.location.assign(w);
210
- }
211
- }
212
- ) : /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.errors.session_failed") }) })
213
- ] }) : r.providerType === "stripe_connect_oauth" ? h ? /* @__PURE__ */ e(q, {}) : !r.clientSecret || !z || !F ? /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.errors.missing_publishable_key") }) }) : /* @__PURE__ */ e(Z, { stripe: z, options: F, children: /* @__PURE__ */ e(
214
- ge,
174
+ /* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-5 shadow-sm", children: w || L ? /* @__PURE__ */ n("div", { className: "space-y-6 text-center", children: [
175
+ /* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-slate-100", children: /* @__PURE__ */ e(Y, { className: `h-6 w-6 ${H}`, "aria-hidden": "true" }) }),
176
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: [
177
+ /* @__PURE__ */ e("h2", { className: "text-xl font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: t(`secure_payment_link.success_titles.${o}`) }) }),
178
+ /* @__PURE__ */ e("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t(`secure_payment_link.statuses.${o}`) }) })
179
+ ] }),
180
+ w ? /* @__PURE__ */ e(N, { to: P, children: /* @__PURE__ */ n(S, { className: "gap-2", children: [
181
+ /* @__PURE__ */ e("span", { children: t("checkout_payment_return_go_to_success") }),
182
+ /* @__PURE__ */ e(ae, { className: "h-4 w-4", "aria-hidden": "true" })
183
+ ] }) }) : /* @__PURE__ */ e(N, { to: v, children: /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_retry_checkout") }) }) })
184
+ ] }) : r.providerType === "mollie_connect_oauth" ? /* @__PURE__ */ n("div", { className: "space-y-4", children: [
185
+ /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.mollie.form_title") }) }),
186
+ /* @__PURE__ */ e("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_hold_form_description") }) }),
187
+ r.profileId ? /* @__PURE__ */ e(
188
+ de,
215
189
  {
216
- clientSecret: r.clientSecret,
217
- onSuccess: () => {
218
- C();
190
+ profileId: r.profileId,
191
+ testmode: r.testmode === !0,
192
+ submitLabel: t("checkout_payment_authorize_button"),
193
+ submittingLabel: t("checkout_payment_authorizing_button"),
194
+ onSubmit: async (c) => {
195
+ const s = await R(c);
196
+ if (!s.success)
197
+ throw new Error(s.message || t("secure_payment_link.errors.payment_failed"));
198
+ if (l.current = s, d(s), s.paymentStatus === "authorized" || s.paymentStatus === "succeeded") {
199
+ await C();
200
+ return;
201
+ }
202
+ if (!s.checkoutUrl)
203
+ throw new Error(s.message || t("secure_payment_link.errors.mollie_missing_url"));
204
+ const i = new URL(s.checkoutUrl, window.location.origin).toString();
205
+ window.location.assign(i);
219
206
  }
220
207
  }
221
- ) }, r.clientSecret) : /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.errors.session_failed") }) }),
222
- i === "pending" && r.payment?.id ? /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col justify-center gap-3 sm:flex-row", children: /* @__PURE__ */ n(
223
- f,
224
- {
225
- type: "button",
226
- variant: "outline",
227
- onClick: () => {
228
- U((a) => a + 1);
229
- },
230
- disabled: h,
231
- className: "gap-2",
232
- children: [
233
- h ? /* @__PURE__ */ e(T, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }) : null,
234
- /* @__PURE__ */ e("span", { children: t("checkout_payment_return_refresh_status") })
235
- ]
208
+ ) : /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.errors.session_failed") }) })
209
+ ] }) : r.providerType === "stripe_connect_oauth" ? !r.clientSecret || !M || !z ? /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.errors.missing_publishable_key") }) }) : /* @__PURE__ */ e(Z, { stripe: M, options: z, children: /* @__PURE__ */ e(
210
+ ke,
211
+ {
212
+ clientSecret: r.clientSecret,
213
+ onSuccess: () => {
214
+ C();
236
215
  }
237
- ) }) : null
238
- ] })
216
+ }
217
+ ) }, r.clientSecret) : /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: t("secure_payment_link.errors.session_failed") }) }) })
239
218
  ] }) });
240
219
  }
241
220
  export {
242
- Me as default
221
+ Be as default
243
222
  };
@@ -1 +1 @@
1
- {"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA6GA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAgqB/B"}
1
+ {"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA6GA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAyqB/B"}