@alfadocs/ui-kit-debug 1.46.0 → 1.47.1
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/_chunks/booking-C4MwImkS.js +3362 -0
- package/dist/_chunks/booking-C4MwImkS.js.map +1 -0
- package/dist/_chunks/calendar-workspace-BmscntRR.js +12528 -0
- package/dist/_chunks/calendar-workspace-BmscntRR.js.map +1 -0
- package/dist/_chunks/control-room-rail-CdBOXIqX.js +366 -0
- package/dist/_chunks/control-room-rail-CdBOXIqX.js.map +1 -0
- package/dist/_chunks/{freemium-paywall-Cz-O9lQD.js → freemium-paywall-BaW5ODc9.js} +2 -2
- package/dist/_chunks/{freemium-paywall-Cz-O9lQD.js.map → freemium-paywall-BaW5ODc9.js.map} +1 -1
- package/dist/_chunks/{patient-details-DUj1htsH.js → patient-details-yrgkSeEY.js} +2 -2
- package/dist/_chunks/{patient-details-DUj1htsH.js.map → patient-details-yrgkSeEY.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-CO0WR7yA.js → patient-field-row-DCMkFGqI.js} +2 -2
- package/dist/_chunks/{patient-field-row-CO0WR7yA.js.map → patient-field-row-DCMkFGqI.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-DNzdYjxE.js → patient-summary-card-CmEFflGS.js} +2 -2
- package/dist/_chunks/{patient-summary-card-DNzdYjxE.js.map → patient-summary-card-CmEFflGS.js.map} +1 -1
- package/dist/_chunks/payment-form-DqJFiplX.js +881 -0
- package/dist/_chunks/payment-form-DqJFiplX.js.map +1 -0
- package/dist/_chunks/{phone-input-BsZIoE36.js → phone-input-IWrGOCwm.js} +40 -39
- package/dist/_chunks/{phone-input-BsZIoE36.js.map → phone-input-IWrGOCwm.js.map} +1 -1
- package/dist/_chunks/{stepper-accordion-DmVykr5F.js → stepper-accordion-jMR8NaOB.js} +2 -1
- package/dist/_chunks/{stepper-accordion-DmVykr5F.js.map → stepper-accordion-jMR8NaOB.js.map} +1 -1
- package/dist/agent-catalog.json +5 -4
- package/dist/agent-i18n/en.json +2 -2
- package/dist/components/booking/booking-types.d.ts +60 -1
- package/dist/components/booking/booking-types.d.ts.map +1 -1
- package/dist/components/booking/booking.agent.d.ts.map +1 -1
- package/dist/components/booking/booking.d.ts +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/details-form.d.ts +5 -1
- package/dist/components/booking/details-form.d.ts.map +1 -1
- package/dist/components/booking/index.d.ts +1 -1
- package/dist/components/booking/index.d.ts.map +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/booking/payment.d.ts +9 -0
- package/dist/components/booking/payment.d.ts.map +1 -0
- package/dist/components/booking/use-booking-payment.d.ts +14 -0
- package/dist/components/booking/use-booking-payment.d.ts.map +1 -0
- package/dist/components/control-room-rail/control-room-rail.d.ts +9 -2
- package/dist/components/control-room-rail/control-room-rail.d.ts.map +1 -1
- package/dist/components/control-room-rail/index.d.ts +1 -1
- package/dist/components/control-room-rail/index.d.ts.map +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/payment-form/index.d.ts +1 -1
- package/dist/components/payment-form/index.d.ts.map +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/payment-form/payment-form.d.ts +35 -3
- package/dist/components/payment-form/payment-form.d.ts.map +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/stepper-accordion/index.js +1 -1
- package/dist/components/stepper-accordion/stepper-accordion.d.ts.map +1 -1
- package/dist/i18n/locales/ar.d.ts +36 -1
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +36 -1
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +36 -1
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +36 -1
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +36 -1
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +36 -1
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +36 -1
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +36 -1
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +36 -1
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +36 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +36 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +36 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +36 -1
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +36 -1
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +36 -1
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +36 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +36 -1
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +36 -1
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +36 -1
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +36 -1
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +36 -1
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +36 -1
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +36 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +36 -1
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +36 -1
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +36 -1
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +36 -1
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +36 -1
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +36 -1
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +36 -1
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +36 -1
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +36 -1
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +36 -1
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +36 -1
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +36 -1
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +36 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/locales/ar.json +36 -1
- package/dist/locales/de.json +36 -1
- package/dist/locales/el.json +36 -1
- package/dist/locales/en.json +36 -1
- package/dist/locales/es.json +36 -1
- package/dist/locales/fr.json +36 -1
- package/dist/locales/hi.json +36 -1
- package/dist/locales/it.json +36 -1
- package/dist/locales/ja.json +36 -1
- package/dist/locales/nl.json +36 -1
- package/dist/locales/pl.json +36 -1
- package/dist/locales/pt.json +36 -1
- package/dist/locales/ro.json +36 -1
- package/dist/locales/ru.json +36 -1
- package/dist/locales/sq.json +36 -1
- package/dist/locales/sv.json +36 -1
- package/dist/locales/tr.json +36 -1
- package/dist/locales/zh.json +36 -1
- package/dist/patterns/calendar/calendar-bookings-panel.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-editor-fields.d.ts +33 -0
- package/dist/patterns/calendar/calendar-editor-fields.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-sticky-offset.d.ts +20 -0
- package/dist/patterns/calendar/calendar-sticky-offset.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-task-editor.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-workspace.d.ts +88 -0
- package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.data.d.ts +17 -0
- package/dist/patterns/calendar/calendar.data.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.journey.d.ts +2 -0
- package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.sheets.d.ts +2 -0
- package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.surface.d.ts +6 -1
- package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.types.d.ts +24 -10
- package/dist/patterns/calendar/calendar.types.d.ts.map +1 -1
- package/dist/patterns/calendar/index.d.ts +1 -1
- package/dist/patterns/calendar/index.d.ts.map +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/booking-B7gA9gFB.js +0 -3017
- package/dist/_chunks/booking-B7gA9gFB.js.map +0 -1
- package/dist/_chunks/calendar-workspace-BB-BZT7W.js +0 -12251
- package/dist/_chunks/calendar-workspace-BB-BZT7W.js.map +0 -1
- package/dist/_chunks/control-room-rail-Cv7GpMqX.js +0 -354
- package/dist/_chunks/control-room-rail-Cv7GpMqX.js.map +0 -1
- package/dist/_chunks/payment-form-BHMDqW9C.js +0 -767
- package/dist/_chunks/payment-form-BHMDqW9C.js.map +0 -1
|
@@ -1,767 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as g, Fragment as me } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as pe, useState as z, useEffect as L, useRef as j, useMemo as X, useImperativeHandle as fe, useId as ye, useCallback as $ } from "react";
|
|
3
|
-
import { c as D } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as Y } from "react-i18next";
|
|
5
|
-
import { S as oe } from "./spinner-hbwuKwMf.js";
|
|
6
|
-
import { A as se } from "./alert-CiQ5Pa3Q.js";
|
|
7
|
-
import { loadStripe as ge } from "@stripe/stripe-js";
|
|
8
|
-
import { Elements as be, useStripe as ve, useElements as he, PaymentElement as Ie, AddressElement as we } from "@stripe/react-stripe-js";
|
|
9
|
-
import { u as xe } from "./registry-DvAUVLHh.js";
|
|
10
|
-
function ie() {
|
|
11
|
-
return typeof document < "u" && typeof window < "u";
|
|
12
|
-
}
|
|
13
|
-
function Z(r) {
|
|
14
|
-
if (!ie())
|
|
15
|
-
return { theme: "stripe" };
|
|
16
|
-
const n = r ?? document.documentElement, a = getComputedStyle(n), e = (o) => a.getPropertyValue(o).trim();
|
|
17
|
-
return {
|
|
18
|
-
theme: n.classList.contains("theme-dark") ? "night" : "stripe",
|
|
19
|
-
variables: {
|
|
20
|
-
colorPrimary: e("--primary"),
|
|
21
|
-
colorBackground: e("--background"),
|
|
22
|
-
colorText: e("--foreground"),
|
|
23
|
-
colorDanger: e("--destructive"),
|
|
24
|
-
colorTextSecondary: e("--muted-foreground"),
|
|
25
|
-
colorTextPlaceholder: e("--muted-foreground"),
|
|
26
|
-
borderRadius: e("--radius-md"),
|
|
27
|
-
fontFamily: e("--font-sans"),
|
|
28
|
-
fontSizeBase: e("--font-size-base"),
|
|
29
|
-
// Stripe multiplies spacingUnit throughout every Element; --spacing-sm
|
|
30
|
-
// gives readable density. Keep this in sync with the JSDoc above.
|
|
31
|
-
spacingUnit: e("--spacing-sm")
|
|
32
|
-
},
|
|
33
|
-
rules: {
|
|
34
|
-
".Input": {
|
|
35
|
-
backgroundColor: e("--background"),
|
|
36
|
-
border: `1px solid ${e("--border")}`,
|
|
37
|
-
color: e("--foreground"),
|
|
38
|
-
padding: e("--spacing-sm"),
|
|
39
|
-
transition: `border-color ${e("--animation-duration")} ease-out`
|
|
40
|
-
},
|
|
41
|
-
".Input:focus": {
|
|
42
|
-
borderColor: e("--primary"),
|
|
43
|
-
boxShadow: `0 0 0 ${e("--focus-ring-width")} ${e("--ring")}`,
|
|
44
|
-
outline: "none"
|
|
45
|
-
},
|
|
46
|
-
".Input--invalid": {
|
|
47
|
-
borderColor: e("--destructive"),
|
|
48
|
-
color: e("--foreground")
|
|
49
|
-
},
|
|
50
|
-
".Label": {
|
|
51
|
-
color: e("--foreground"),
|
|
52
|
-
fontWeight: e("--font-weight-medium"),
|
|
53
|
-
fontSize: e("--font-size-sm")
|
|
54
|
-
},
|
|
55
|
-
".Error": {
|
|
56
|
-
color: e("--destructive"),
|
|
57
|
-
fontSize: e("--font-size-sm")
|
|
58
|
-
},
|
|
59
|
-
".Tab": {
|
|
60
|
-
border: `1px solid ${e("--border")}`,
|
|
61
|
-
backgroundColor: e("--background"),
|
|
62
|
-
color: e("--foreground")
|
|
63
|
-
},
|
|
64
|
-
".Tab--selected": {
|
|
65
|
-
borderColor: e("--primary"),
|
|
66
|
-
backgroundColor: e("--background"),
|
|
67
|
-
color: e("--primary")
|
|
68
|
-
},
|
|
69
|
-
// Accordion method rows (the `accordion` layout): keep Stripe's native
|
|
70
|
-
// per-method card structure, restyled with our tokens — our border +
|
|
71
|
-
// radius, our background, `--primary` on the selected row, no extra shadow.
|
|
72
|
-
".AccordionItem": {
|
|
73
|
-
backgroundColor: e("--background"),
|
|
74
|
-
border: `1px solid ${e("--border")}`,
|
|
75
|
-
borderRadius: e("--radius-md"),
|
|
76
|
-
boxShadow: "none"
|
|
77
|
-
},
|
|
78
|
-
".AccordionItem--selected": {
|
|
79
|
-
borderColor: e("--primary"),
|
|
80
|
-
backgroundColor: e("--background")
|
|
81
|
-
},
|
|
82
|
-
// Stripe's in-method notice blocks (e.g. PayPal's "you'll be redirected")
|
|
83
|
-
// otherwise render in their own bordered box — a card nested inside the
|
|
84
|
-
// selected method card. Flatten to inline icon + text, no inner box.
|
|
85
|
-
".Block": {
|
|
86
|
-
border: "none",
|
|
87
|
-
borderRadius: "0",
|
|
88
|
-
boxShadow: "none",
|
|
89
|
-
backgroundColor: "transparent"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function Se(r, n) {
|
|
95
|
-
if (!ie()) return () => {
|
|
96
|
-
};
|
|
97
|
-
const a = document.documentElement, e = () => r(Z(n)), d = new MutationObserver(e);
|
|
98
|
-
d.observe(a, {
|
|
99
|
-
attributes: !0,
|
|
100
|
-
attributeFilter: ["class", "dir", "lang"]
|
|
101
|
-
});
|
|
102
|
-
const o = window.matchMedia("(prefers-color-scheme: dark)"), m = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
103
|
-
return o.addEventListener("change", e), m.addEventListener("change", e), () => {
|
|
104
|
-
d.disconnect(), o.removeEventListener("change", e), m.removeEventListener("change", e);
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
const ke = {
|
|
108
|
-
id: "payment-form",
|
|
109
|
-
capabilities: ["submit"],
|
|
110
|
-
// The kit's only destructive + openWorld action that moves real money,
|
|
111
|
-
// so it is also the one that most needs to be verifiable. `submit`
|
|
112
|
-
// resolves once the charge attempt has settled; these four slots are
|
|
113
|
-
// how an agent then tells success from decline from never-fired, and
|
|
114
|
-
// how it recovers the receipt.
|
|
115
|
-
//
|
|
116
|
-
// A9: the PaymentIntent id and the i18n error KEY only. Never card
|
|
117
|
-
// fields (they live in Stripe's cross-origin iframes and never reach
|
|
118
|
-
// this origin), never the translated Stripe message, never
|
|
119
|
-
// `clientSecret`.
|
|
120
|
-
state: {
|
|
121
|
-
status: {
|
|
122
|
-
type: "'idle' | 'processing' | 'succeeded' | 'failed'",
|
|
123
|
-
descriptionKey: "ui.agent.paymentForm.state.status",
|
|
124
|
-
description: "Lifecycle of the current payment attempt. `succeeded` is only reached once Stripe confirmed the PaymentIntent; `failed` covers validation, decline and processor errors alike. Still `idle` after `submit` means the attempt never fired — Stripe had not mounted.",
|
|
125
|
-
read: (r) => r.getStatus()
|
|
126
|
-
},
|
|
127
|
-
complete: {
|
|
128
|
-
type: "boolean",
|
|
129
|
-
descriptionKey: "ui.agent.paymentForm.state.complete",
|
|
130
|
-
description: "True when Stripe reports the payment fields as complete. Read this before `submit` — outside preview mode the submit control is disabled while it is false, so the call will not be accepted.",
|
|
131
|
-
read: (r) => r.isComplete()
|
|
132
|
-
},
|
|
133
|
-
errorKey: {
|
|
134
|
-
type: "string | null",
|
|
135
|
-
descriptionKey: "ui.agent.paymentForm.state.errorKey",
|
|
136
|
-
description: "i18n key of the current error (e.g. `payment.error.cardDeclined`), or null. The key is the structural datum — the translated message is free text and is never exposed.",
|
|
137
|
-
read: (r) => r.getErrorKey()
|
|
138
|
-
},
|
|
139
|
-
paymentIntentId: {
|
|
140
|
-
type: "string | null",
|
|
141
|
-
descriptionKey: "ui.agent.paymentForm.state.paymentIntentId",
|
|
142
|
-
description: "Opaque Stripe PaymentIntent id once a charge succeeded, else null. The receipt — the attribution handle for the money that moved. Never the client secret.",
|
|
143
|
-
read: (r) => r.getPaymentIntentId()
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
actions: {
|
|
147
|
-
submit: {
|
|
148
|
-
safety: "destructive",
|
|
149
|
-
// Charges an external payment processor — irreversible, hits a system
|
|
150
|
-
// outside this UI.
|
|
151
|
-
openWorld: !0,
|
|
152
|
-
returns: "Promise<void>",
|
|
153
|
-
errors: [
|
|
154
|
-
'Validation failed (incomplete or invalid card details) — `status` is "failed", `errorKey` names which.',
|
|
155
|
-
'Payment was declined by the processor — `status` is "failed", `errorKey` is `payment.error.cardDeclined`.',
|
|
156
|
-
'Network or processor error during the charge — `status` is "failed".',
|
|
157
|
-
'Stripe had not mounted, so nothing was attempted — `status` is still "idle".'
|
|
158
|
-
],
|
|
159
|
-
descriptionKey: "ui.agent.paymentForm.actions.submit",
|
|
160
|
-
description: "Submit the payment. Charges the configured payment method — irreversible. Resolves once the attempt has settled; the outcome is never in the resolved value, so read `status`, then `errorKey` on failure or `paymentIntentId` on success.",
|
|
161
|
-
invoke: (r) => r.submit()
|
|
162
|
-
},
|
|
163
|
-
reset: {
|
|
164
|
-
safety: "destructive",
|
|
165
|
-
idempotent: !0,
|
|
166
|
-
descriptionKey: "ui.agent.paymentForm.actions.reset",
|
|
167
|
-
description: 'Reset the form to its initial state. Loses any in-progress input, and discards the previous attempt — `status` returns to "idle" and `errorKey` / `paymentIntentId` to null.',
|
|
168
|
-
invoke: (r) => {
|
|
169
|
-
r.reset();
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
domHooks: {
|
|
174
|
-
root: { attr: "data-component", value: "payment-form" },
|
|
175
|
-
instanceId: {
|
|
176
|
-
attr: "data-component-id",
|
|
177
|
-
sourceProp: "id",
|
|
178
|
-
description: "Sourced from the id prop."
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}, Ce = /* @__PURE__ */ new Set([
|
|
182
|
-
"BIF",
|
|
183
|
-
"CLP",
|
|
184
|
-
"DJF",
|
|
185
|
-
"GNF",
|
|
186
|
-
"IDR",
|
|
187
|
-
"JPY",
|
|
188
|
-
"KMF",
|
|
189
|
-
"KRW",
|
|
190
|
-
"MGA",
|
|
191
|
-
"PYG",
|
|
192
|
-
"RWF",
|
|
193
|
-
"UGX",
|
|
194
|
-
"VND",
|
|
195
|
-
"VUV",
|
|
196
|
-
"XAF",
|
|
197
|
-
"XOF",
|
|
198
|
-
"XPF"
|
|
199
|
-
]);
|
|
200
|
-
function J(r, n, a) {
|
|
201
|
-
const e = n.toUpperCase(), d = Ce.has(e) ? r : r / 100;
|
|
202
|
-
try {
|
|
203
|
-
return new Intl.NumberFormat(a, {
|
|
204
|
-
style: "currency",
|
|
205
|
-
currency: e
|
|
206
|
-
}).format(d);
|
|
207
|
-
} catch {
|
|
208
|
-
return new Intl.NumberFormat("en", {
|
|
209
|
-
style: "currency",
|
|
210
|
-
currency: e
|
|
211
|
-
}).format(d);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
function Ee(r) {
|
|
215
|
-
if (r === void 0) return null;
|
|
216
|
-
const n = r.trim();
|
|
217
|
-
if (n === "" || typeof window > "u") return null;
|
|
218
|
-
try {
|
|
219
|
-
const a = new URL(n, window.location.href);
|
|
220
|
-
return !(/* @__PURE__ */ new Set(["http:", "https:"])).has(a.protocol) || a.origin !== window.location.origin ? null : a.toString();
|
|
221
|
-
} catch {
|
|
222
|
-
return null;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
function Ne(r) {
|
|
226
|
-
return r && r.replace(/\d{4,}/g, "****");
|
|
227
|
-
}
|
|
228
|
-
function Fe(r) {
|
|
229
|
-
switch (r) {
|
|
230
|
-
case "incorrect_number":
|
|
231
|
-
case "invalid_number":
|
|
232
|
-
return "payment.error.cardNumber";
|
|
233
|
-
case "invalid_expiry_month":
|
|
234
|
-
case "invalid_expiry_year":
|
|
235
|
-
case "expired_card":
|
|
236
|
-
return "payment.error.expiry";
|
|
237
|
-
case "invalid_cvc":
|
|
238
|
-
case "incorrect_cvc":
|
|
239
|
-
return "payment.error.cvc";
|
|
240
|
-
case "incorrect_zip":
|
|
241
|
-
case "invalid_zip":
|
|
242
|
-
return "payment.error.postalCode";
|
|
243
|
-
case "card_declined":
|
|
244
|
-
case "do_not_honor":
|
|
245
|
-
case "generic_decline":
|
|
246
|
-
return "payment.error.declined";
|
|
247
|
-
case "network_error":
|
|
248
|
-
case "api_connection_error":
|
|
249
|
-
return "payment.error.network";
|
|
250
|
-
default:
|
|
251
|
-
return "payment.error.generic";
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
const Pe = D(
|
|
255
|
-
[
|
|
256
|
-
"ds:payment-form-alfadocs ds:flex ds:flex-col",
|
|
257
|
-
"ds:gap-[var(--spacing-md)]",
|
|
258
|
-
// Transparent, padding-less container — the consuming surface (a Card, the
|
|
259
|
-
// check-in step, a checkout column) owns the card chrome + padding, so the
|
|
260
|
-
// Stripe method boxes never read as cards nested inside another card.
|
|
261
|
-
"ds:text-[var(--foreground)]",
|
|
262
|
-
"ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed"
|
|
263
|
-
].join(" ")
|
|
264
|
-
), q = D(
|
|
265
|
-
["ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]"].join(" ")
|
|
266
|
-
), A = D(
|
|
267
|
-
["type-label", "ds:text-[var(--foreground)]"].join(" ")
|
|
268
|
-
), de = D(
|
|
269
|
-
[
|
|
270
|
-
"ds:flex ds:items-baseline ds:justify-between",
|
|
271
|
-
"ds:gap-[var(--spacing-sm)]",
|
|
272
|
-
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
|
|
273
|
-
"ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]",
|
|
274
|
-
"ds:bg-[var(--muted)]",
|
|
275
|
-
"ds:rounded-[var(--radius-sm)]",
|
|
276
|
-
"ds:text-[var(--foreground)]"
|
|
277
|
-
].join(" ")
|
|
278
|
-
), ce = D(
|
|
279
|
-
[
|
|
280
|
-
"ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)]",
|
|
281
|
-
"ds:[min-block-size:var(--min-target-size)]",
|
|
282
|
-
"ds:[min-inline-size:var(--min-target-size)]",
|
|
283
|
-
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
284
|
-
"ds:rounded-[var(--radius-sm)]",
|
|
285
|
-
"ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)]",
|
|
286
|
-
"ds:text-[length:var(--font-size-base)] ds:font-medium",
|
|
287
|
-
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
288
|
-
"ds:hover:bg-[var(--primary-hover)]",
|
|
289
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
290
|
-
"ds:focus-visible:outline-solid",
|
|
291
|
-
"ds:focus-visible:outline-[var(--ring)]",
|
|
292
|
-
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
293
|
-
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
294
|
-
"ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed",
|
|
295
|
-
"ds:aria-busy:cursor-wait"
|
|
296
|
-
].join(" ")
|
|
297
|
-
);
|
|
298
|
-
function _e(r) {
|
|
299
|
-
const {
|
|
300
|
-
amount: n,
|
|
301
|
-
currency: a,
|
|
302
|
-
locale: e,
|
|
303
|
-
billingAddress: d,
|
|
304
|
-
returnUrl: o,
|
|
305
|
-
clientSecret: m,
|
|
306
|
-
onCreatePaymentIntent: N,
|
|
307
|
-
onSuccess: K,
|
|
308
|
-
onError: F,
|
|
309
|
-
layout: O,
|
|
310
|
-
agentBridge: i
|
|
311
|
-
} = r, { t: c } = Y(), p = ve(), h = he(), B = ye(), I = X(
|
|
312
|
-
() => `pay-${B.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
313
|
-
[B]
|
|
314
|
-
), U = `${I}-payment`, w = `${I}-address`, R = `${I}-error`, [f, S] = z(!1), [V, T] = z(!1), [b, G] = z(null), [H, u] = z(""), l = $(
|
|
315
|
-
(s) => {
|
|
316
|
-
i.current.status = s;
|
|
317
|
-
},
|
|
318
|
-
[i]
|
|
319
|
-
), P = $(
|
|
320
|
-
(s) => {
|
|
321
|
-
i.current.errorKey = s, G(s);
|
|
322
|
-
},
|
|
323
|
-
[i]
|
|
324
|
-
), le = $(
|
|
325
|
-
(s) => {
|
|
326
|
-
i.current.complete = s, T(s);
|
|
327
|
-
},
|
|
328
|
-
[i]
|
|
329
|
-
), k = j(K), C = j(F);
|
|
330
|
-
L(() => {
|
|
331
|
-
k.current = K, C.current = F;
|
|
332
|
-
}, [K, F]);
|
|
333
|
-
const _ = $(
|
|
334
|
-
async (s) => {
|
|
335
|
-
var ee, re, te;
|
|
336
|
-
if (s && s.preventDefault(), !p || !h || f) return;
|
|
337
|
-
S(!0), l("processing"), i.current.paymentIntentId = null, P(null), u("");
|
|
338
|
-
const E = (v, M) => {
|
|
339
|
-
var ne;
|
|
340
|
-
const y = Fe(v), x = Ne(M ?? "");
|
|
341
|
-
P(y), u(c(y)), l("failed"), (ne = C.current) == null || ne.call(C, {
|
|
342
|
-
code: v,
|
|
343
|
-
translatedMessage: x || c(y)
|
|
344
|
-
});
|
|
345
|
-
}, W = Ee(o);
|
|
346
|
-
if (o !== void 0 && W === null) {
|
|
347
|
-
P("payment.error.invalidReturnUrl"), u(c("payment.error.invalidReturnUrl")), l("failed"), (ee = C.current) == null || ee.call(C, {
|
|
348
|
-
code: "invalid_return_url",
|
|
349
|
-
translatedMessage: c("payment.error.invalidReturnUrl")
|
|
350
|
-
}), S(!1);
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
const Q = W ? { return_url: W } : {};
|
|
354
|
-
try {
|
|
355
|
-
if (m !== void 0) {
|
|
356
|
-
const x = await p.confirmPayment({
|
|
357
|
-
elements: h,
|
|
358
|
-
confirmParams: Q,
|
|
359
|
-
redirect: "if_required"
|
|
360
|
-
});
|
|
361
|
-
if (x.error) {
|
|
362
|
-
E(x.error.code ?? "generic", x.error.message);
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
x.paymentIntent && (i.current.paymentIntentId = x.paymentIntent.id, l("succeeded"), (re = k.current) == null || re.call(k, x.paymentIntent.id));
|
|
366
|
-
return;
|
|
367
|
-
}
|
|
368
|
-
const { error: v } = await h.submit();
|
|
369
|
-
if (v) {
|
|
370
|
-
E(v.code ?? "generic", v.message);
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
if (!N) {
|
|
374
|
-
l("idle");
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
const M = await N(), y = await p.confirmPayment({
|
|
378
|
-
elements: h,
|
|
379
|
-
clientSecret: M,
|
|
380
|
-
confirmParams: Q,
|
|
381
|
-
redirect: "if_required"
|
|
382
|
-
});
|
|
383
|
-
if (y.error) {
|
|
384
|
-
E(y.error.code ?? "generic", y.error.message);
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
y.paymentIntent && (i.current.paymentIntentId = y.paymentIntent.id, l("succeeded"), (te = k.current) == null || te.call(k, y.paymentIntent.id));
|
|
388
|
-
} catch (v) {
|
|
389
|
-
const M = v instanceof Error ? v.message : "";
|
|
390
|
-
E("unexpected", M);
|
|
391
|
-
} finally {
|
|
392
|
-
S(!1), i.current.status === "processing" && l("idle");
|
|
393
|
-
}
|
|
394
|
-
},
|
|
395
|
-
[
|
|
396
|
-
p,
|
|
397
|
-
h,
|
|
398
|
-
f,
|
|
399
|
-
o,
|
|
400
|
-
m,
|
|
401
|
-
N,
|
|
402
|
-
c,
|
|
403
|
-
i,
|
|
404
|
-
P,
|
|
405
|
-
l
|
|
406
|
-
]
|
|
407
|
-
);
|
|
408
|
-
L(() => {
|
|
409
|
-
const s = document.getElementById(I);
|
|
410
|
-
if (!s) return;
|
|
411
|
-
const E = () => {
|
|
412
|
-
_();
|
|
413
|
-
};
|
|
414
|
-
return s.addEventListener("payment-form:submit", E), () => s.removeEventListener("payment-form:submit", E);
|
|
415
|
-
}, [I, _]), L(() => {
|
|
416
|
-
const s = i.current;
|
|
417
|
-
return s.submit = _, () => {
|
|
418
|
-
s.submit === _ && (s.submit = void 0);
|
|
419
|
-
};
|
|
420
|
-
}, [i, _]), L(() => {
|
|
421
|
-
const s = i.current;
|
|
422
|
-
return () => {
|
|
423
|
-
s.complete = !1;
|
|
424
|
-
};
|
|
425
|
-
}, [i]);
|
|
426
|
-
const ue = !p || !h || f || !(m === void 0 && !N) && !V;
|
|
427
|
-
return /* @__PURE__ */ t(
|
|
428
|
-
"form",
|
|
429
|
-
{
|
|
430
|
-
id: I,
|
|
431
|
-
onSubmit: _,
|
|
432
|
-
onReset: () => {
|
|
433
|
-
P(null), u(""), l("idle"), i.current.paymentIntentId = null;
|
|
434
|
-
},
|
|
435
|
-
"aria-label": c("payment.ariaLabel"),
|
|
436
|
-
"aria-busy": f || void 0,
|
|
437
|
-
noValidate: !0,
|
|
438
|
-
children: /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
439
|
-
/* @__PURE__ */ g("div", { className: de(), children: [
|
|
440
|
-
/* @__PURE__ */ t("span", { className: A(), children: c("payment.amountLabel") }),
|
|
441
|
-
/* @__PURE__ */ t("span", { className: "type-title-card", "data-testid": "payment-amount", children: J(n, a, e) })
|
|
442
|
-
] }),
|
|
443
|
-
/* @__PURE__ */ g(
|
|
444
|
-
"label",
|
|
445
|
-
{
|
|
446
|
-
htmlFor: U,
|
|
447
|
-
className: q(),
|
|
448
|
-
"data-testid": "payment-field",
|
|
449
|
-
children: [
|
|
450
|
-
/* @__PURE__ */ t("span", { className: A(), children: c("payment.fields.card") }),
|
|
451
|
-
/* @__PURE__ */ t(
|
|
452
|
-
Ie,
|
|
453
|
-
{
|
|
454
|
-
id: U,
|
|
455
|
-
options: {
|
|
456
|
-
// `tabs` = method tiles (Card selected by default); `accordion`
|
|
457
|
-
// = full-width stacked rows for narrow columns where the tab row
|
|
458
|
-
// clips. Stripe owns overflow + tab alignment either way.
|
|
459
|
-
layout: O === "accordion" ? { type: "accordion", defaultCollapsed: !0 } : { type: "tabs" }
|
|
460
|
-
},
|
|
461
|
-
onChange: (s) => {
|
|
462
|
-
le(s.complete === !0), s.complete && (P(null), u(""), i.current.status === "failed" && l("idle"));
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
)
|
|
466
|
-
]
|
|
467
|
-
}
|
|
468
|
-
),
|
|
469
|
-
d ? /* @__PURE__ */ g(
|
|
470
|
-
"label",
|
|
471
|
-
{
|
|
472
|
-
htmlFor: w,
|
|
473
|
-
className: q(),
|
|
474
|
-
"data-testid": "payment-address",
|
|
475
|
-
children: [
|
|
476
|
-
/* @__PURE__ */ t("span", { className: A(), children: c("payment.billingAddress") }),
|
|
477
|
-
/* @__PURE__ */ t(we, { id: w, options: { mode: "billing" } })
|
|
478
|
-
]
|
|
479
|
-
}
|
|
480
|
-
) : null,
|
|
481
|
-
b ? /* @__PURE__ */ t(
|
|
482
|
-
se,
|
|
483
|
-
{
|
|
484
|
-
id: R,
|
|
485
|
-
variant: "error",
|
|
486
|
-
live: "polite",
|
|
487
|
-
"data-testid": "payment-error",
|
|
488
|
-
children: /* @__PURE__ */ t(se.Description, { children: H })
|
|
489
|
-
}
|
|
490
|
-
) : null,
|
|
491
|
-
/* @__PURE__ */ t(
|
|
492
|
-
"button",
|
|
493
|
-
{
|
|
494
|
-
type: "submit",
|
|
495
|
-
"aria-disabled": ue || void 0,
|
|
496
|
-
"aria-busy": f || void 0,
|
|
497
|
-
"aria-describedby": b ? R : void 0,
|
|
498
|
-
className: ce(),
|
|
499
|
-
"data-testid": "payment-submit",
|
|
500
|
-
children: f ? /* @__PURE__ */ g(me, { children: [
|
|
501
|
-
/* @__PURE__ */ t(
|
|
502
|
-
oe,
|
|
503
|
-
{
|
|
504
|
-
variant: "pulse",
|
|
505
|
-
size: "sm",
|
|
506
|
-
label: c("payment.processing")
|
|
507
|
-
}
|
|
508
|
-
),
|
|
509
|
-
/* @__PURE__ */ t("span", { children: c("payment.processing") })
|
|
510
|
-
] }) : /* @__PURE__ */ t("span", { children: c("payment.submit", {
|
|
511
|
-
amount: J(n, a, e)
|
|
512
|
-
}) })
|
|
513
|
-
}
|
|
514
|
-
)
|
|
515
|
-
] })
|
|
516
|
-
}
|
|
517
|
-
);
|
|
518
|
-
}
|
|
519
|
-
const ae = /* @__PURE__ */ new Set([
|
|
520
|
-
"auto",
|
|
521
|
-
"ar",
|
|
522
|
-
"bg",
|
|
523
|
-
"cs",
|
|
524
|
-
"da",
|
|
525
|
-
"de",
|
|
526
|
-
"el",
|
|
527
|
-
"en",
|
|
528
|
-
"en-AU",
|
|
529
|
-
"en-CA",
|
|
530
|
-
"en-NZ",
|
|
531
|
-
"en-GB",
|
|
532
|
-
"es",
|
|
533
|
-
"es-ES",
|
|
534
|
-
"es-419",
|
|
535
|
-
"et",
|
|
536
|
-
"fi",
|
|
537
|
-
"fil",
|
|
538
|
-
"fr",
|
|
539
|
-
"fr-CA",
|
|
540
|
-
"fr-FR",
|
|
541
|
-
"he",
|
|
542
|
-
"hu",
|
|
543
|
-
"hr",
|
|
544
|
-
"id",
|
|
545
|
-
"it",
|
|
546
|
-
"it-IT",
|
|
547
|
-
"ja",
|
|
548
|
-
"ko",
|
|
549
|
-
"lt",
|
|
550
|
-
"lv",
|
|
551
|
-
"ms",
|
|
552
|
-
"mt",
|
|
553
|
-
"nb",
|
|
554
|
-
"nl",
|
|
555
|
-
"no",
|
|
556
|
-
"pl",
|
|
557
|
-
"pt",
|
|
558
|
-
"pt-BR",
|
|
559
|
-
"ro",
|
|
560
|
-
"ru",
|
|
561
|
-
"sk",
|
|
562
|
-
"sl",
|
|
563
|
-
"sv",
|
|
564
|
-
"th",
|
|
565
|
-
"tr",
|
|
566
|
-
"vi",
|
|
567
|
-
"zh",
|
|
568
|
-
"zh-HK",
|
|
569
|
-
"zh-TW"
|
|
570
|
-
]);
|
|
571
|
-
function ze(r) {
|
|
572
|
-
if (!r) return "auto";
|
|
573
|
-
const n = r === "cn" ? "zh" : r;
|
|
574
|
-
if (ae.has(n))
|
|
575
|
-
return n;
|
|
576
|
-
const a = n.split("-")[0];
|
|
577
|
-
return ae.has(a) ? a : "auto";
|
|
578
|
-
}
|
|
579
|
-
const Le = pe(
|
|
580
|
-
({
|
|
581
|
-
id: r,
|
|
582
|
-
clientSecret: n,
|
|
583
|
-
mode: a = "payment",
|
|
584
|
-
onCreatePaymentIntent: e,
|
|
585
|
-
publishableKey: d,
|
|
586
|
-
currency: o,
|
|
587
|
-
amount: m,
|
|
588
|
-
onSuccess: N,
|
|
589
|
-
onError: K,
|
|
590
|
-
billingAddress: F = !1,
|
|
591
|
-
locale: O,
|
|
592
|
-
ariaLabel: i,
|
|
593
|
-
returnUrl: c,
|
|
594
|
-
stripePromise: p,
|
|
595
|
-
layout: h = "tabs",
|
|
596
|
-
className: B
|
|
597
|
-
}, I) => {
|
|
598
|
-
const { i18n: U } = Y(), w = ze(O ?? U.language ?? "en"), [R, f] = z(p ?? null);
|
|
599
|
-
L(() => {
|
|
600
|
-
if (p !== void 0) {
|
|
601
|
-
f(p);
|
|
602
|
-
return;
|
|
603
|
-
}
|
|
604
|
-
if (!d) {
|
|
605
|
-
f(null);
|
|
606
|
-
return;
|
|
607
|
-
}
|
|
608
|
-
f(ge(d));
|
|
609
|
-
}, [p, d]);
|
|
610
|
-
const [S, V] = z(
|
|
611
|
-
() => Z()
|
|
612
|
-
);
|
|
613
|
-
L(() => (V(Z()), Se(V)), []);
|
|
614
|
-
const T = j(null), b = j({
|
|
615
|
-
status: "idle",
|
|
616
|
-
complete: !1,
|
|
617
|
-
errorKey: null,
|
|
618
|
-
paymentIntentId: null
|
|
619
|
-
}), G = X(
|
|
620
|
-
() => ({
|
|
621
|
-
submit: async () => {
|
|
622
|
-
const u = b.current.submit;
|
|
623
|
-
u && await u();
|
|
624
|
-
},
|
|
625
|
-
reset: () => {
|
|
626
|
-
var l;
|
|
627
|
-
const u = (l = T.current) == null ? void 0 : l.querySelector("form");
|
|
628
|
-
u instanceof HTMLFormElement && u.reset();
|
|
629
|
-
},
|
|
630
|
-
getStatus: () => b.current.status,
|
|
631
|
-
isComplete: () => b.current.complete,
|
|
632
|
-
getErrorKey: () => b.current.errorKey,
|
|
633
|
-
getPaymentIntentId: () => b.current.paymentIntentId
|
|
634
|
-
}),
|
|
635
|
-
[]
|
|
636
|
-
);
|
|
637
|
-
fe(I, () => T.current, []), xe(ke, G, r);
|
|
638
|
-
const H = X(
|
|
639
|
-
() => n !== void 0 ? (
|
|
640
|
-
// Immediate mode — the consumer already created the intent.
|
|
641
|
-
{ clientSecret: n, appearance: S, locale: w }
|
|
642
|
-
) : (
|
|
643
|
-
// Deferred-intent mode — no secret yet; Stripe needs the intent
|
|
644
|
-
// shape (mode + amount + currency) to render the Payment Element.
|
|
645
|
-
// Stripe expects a lowercase ISO-4217 currency here.
|
|
646
|
-
{
|
|
647
|
-
mode: a,
|
|
648
|
-
amount: m,
|
|
649
|
-
currency: o.toLowerCase(),
|
|
650
|
-
appearance: S,
|
|
651
|
-
locale: w
|
|
652
|
-
}
|
|
653
|
-
),
|
|
654
|
-
[n, a, m, o, S, w]
|
|
655
|
-
);
|
|
656
|
-
return /* @__PURE__ */ t(
|
|
657
|
-
"div",
|
|
658
|
-
{
|
|
659
|
-
ref: T,
|
|
660
|
-
"aria-label": i,
|
|
661
|
-
className: [Pe(), B].filter(Boolean).join(" "),
|
|
662
|
-
"data-component": "payment-form",
|
|
663
|
-
"data-component-id": r,
|
|
664
|
-
"data-testid": "payment-form-root",
|
|
665
|
-
children: R ? (
|
|
666
|
-
// Render the real Payment Element whenever a Stripe instance is
|
|
667
|
-
// available — in immediate mode (clientSecret present) AND in
|
|
668
|
-
// deferred mode (no secret). The skeleton is reserved for the
|
|
669
|
-
// no-Stripe case (missing publishableKey / injected null).
|
|
670
|
-
/* @__PURE__ */ t(
|
|
671
|
-
be,
|
|
672
|
-
{
|
|
673
|
-
stripe: R,
|
|
674
|
-
options: H,
|
|
675
|
-
children: /* @__PURE__ */ t(
|
|
676
|
-
_e,
|
|
677
|
-
{
|
|
678
|
-
amount: m,
|
|
679
|
-
currency: o,
|
|
680
|
-
locale: w,
|
|
681
|
-
billingAddress: F,
|
|
682
|
-
returnUrl: c,
|
|
683
|
-
clientSecret: n,
|
|
684
|
-
onCreatePaymentIntent: e,
|
|
685
|
-
onSuccess: N,
|
|
686
|
-
onError: K,
|
|
687
|
-
layout: h,
|
|
688
|
-
agentBridge: b
|
|
689
|
-
}
|
|
690
|
-
)
|
|
691
|
-
},
|
|
692
|
-
n ?? "deferred"
|
|
693
|
-
)
|
|
694
|
-
) : /* @__PURE__ */ t(
|
|
695
|
-
Ae,
|
|
696
|
-
{
|
|
697
|
-
amount: m,
|
|
698
|
-
currency: o,
|
|
699
|
-
locale: w,
|
|
700
|
-
billingAddress: F
|
|
701
|
-
}
|
|
702
|
-
)
|
|
703
|
-
}
|
|
704
|
-
);
|
|
705
|
-
}
|
|
706
|
-
);
|
|
707
|
-
Le.displayName = "PaymentForm";
|
|
708
|
-
function Ae(r) {
|
|
709
|
-
const { amount: n, currency: a, locale: e, billingAddress: d } = r, { t: o } = Y();
|
|
710
|
-
return /* @__PURE__ */ g(
|
|
711
|
-
"div",
|
|
712
|
-
{
|
|
713
|
-
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
714
|
-
"data-testid": "payment-skeleton",
|
|
715
|
-
"aria-busy": "true",
|
|
716
|
-
children: [
|
|
717
|
-
/* @__PURE__ */ g("div", { className: de(), children: [
|
|
718
|
-
/* @__PURE__ */ t("span", { className: A(), children: o("payment.amountLabel") }),
|
|
719
|
-
/* @__PURE__ */ t("span", { className: "type-title-card", children: J(n, a, e) })
|
|
720
|
-
] }),
|
|
721
|
-
/* @__PURE__ */ g("div", { className: q(), children: [
|
|
722
|
-
/* @__PURE__ */ t("span", { className: A(), children: o("payment.fields.card") }),
|
|
723
|
-
/* @__PURE__ */ t(
|
|
724
|
-
"div",
|
|
725
|
-
{
|
|
726
|
-
className: "ds:[min-block-size:var(--min-target-size)] ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--muted)]",
|
|
727
|
-
"aria-hidden": "true"
|
|
728
|
-
}
|
|
729
|
-
)
|
|
730
|
-
] }),
|
|
731
|
-
d ? /* @__PURE__ */ g("div", { className: q(), "data-testid": "payment-address", children: [
|
|
732
|
-
/* @__PURE__ */ t("span", { className: A(), children: o("payment.billingAddress") }),
|
|
733
|
-
/* @__PURE__ */ t(
|
|
734
|
-
"div",
|
|
735
|
-
{
|
|
736
|
-
className: "ds:[min-block-size:calc(var(--min-target-size)*2)] ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--muted)]",
|
|
737
|
-
"aria-hidden": "true"
|
|
738
|
-
}
|
|
739
|
-
)
|
|
740
|
-
] }) : null,
|
|
741
|
-
/* @__PURE__ */ g(
|
|
742
|
-
"button",
|
|
743
|
-
{
|
|
744
|
-
type: "button",
|
|
745
|
-
"aria-disabled": "true",
|
|
746
|
-
className: ce(),
|
|
747
|
-
disabled: !0,
|
|
748
|
-
children: [
|
|
749
|
-
/* @__PURE__ */ t(oe, { variant: "pulse", size: "sm", label: o("payment.processing") }),
|
|
750
|
-
/* @__PURE__ */ t("span", { children: o("payment.processing") })
|
|
751
|
-
]
|
|
752
|
-
}
|
|
753
|
-
)
|
|
754
|
-
]
|
|
755
|
-
}
|
|
756
|
-
);
|
|
757
|
-
}
|
|
758
|
-
export {
|
|
759
|
-
Le as P,
|
|
760
|
-
Pe as a,
|
|
761
|
-
Ne as b,
|
|
762
|
-
Fe as c,
|
|
763
|
-
J as f,
|
|
764
|
-
ke as p,
|
|
765
|
-
ce as s
|
|
766
|
-
};
|
|
767
|
-
//# sourceMappingURL=payment-form-BHMDqW9C.js.map
|