@fanfare-io/fanfare-sdk-react 0.8.0 → 0.9.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.
- package/dist/index.js +158 -161
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -40,13 +40,13 @@ function Rr(e, a, r, n) {
|
|
|
40
40
|
const i = e ?? o.locale, f = e && e !== o.locale ? ur(e) : o.messages, c = aa(
|
|
41
41
|
f,
|
|
42
42
|
r ?? o.experienceTranslations ?? void 0
|
|
43
|
-
), g = aa(c, a), d = ba(g, i),
|
|
43
|
+
), g = aa(c, a), d = ba(g, i), b = pr(i) ? "rtl" : "ltr";
|
|
44
44
|
return {
|
|
45
45
|
locale: i,
|
|
46
46
|
messages: g,
|
|
47
47
|
isRoot: !1,
|
|
48
48
|
t: d,
|
|
49
|
-
dir:
|
|
49
|
+
dir: b,
|
|
50
50
|
experienceTranslations: r ?? o.experienceTranslations,
|
|
51
51
|
setExperienceTranslations: n ?? o.setExperienceTranslations
|
|
52
52
|
};
|
|
@@ -77,7 +77,7 @@ function $o({
|
|
|
77
77
|
publishableKey: c,
|
|
78
78
|
environment: g,
|
|
79
79
|
apiUrl: d,
|
|
80
|
-
credentials:
|
|
80
|
+
credentials: b,
|
|
81
81
|
debug: m,
|
|
82
82
|
auth: v,
|
|
83
83
|
logging: w,
|
|
@@ -85,13 +85,13 @@ function $o({
|
|
|
85
85
|
features: C,
|
|
86
86
|
beacon: l
|
|
87
87
|
}) {
|
|
88
|
-
const [h, p] = ve(null), [D, V] = ve(!0), T = bt(null),
|
|
88
|
+
const [h, p] = ve(null), [D, V] = ve(!0), T = bt(null), x = X(
|
|
89
89
|
() => ({
|
|
90
90
|
organizationId: f,
|
|
91
91
|
publishableKey: c,
|
|
92
92
|
environment: g,
|
|
93
93
|
apiUrl: d,
|
|
94
|
-
credentials:
|
|
94
|
+
credentials: b,
|
|
95
95
|
debug: m,
|
|
96
96
|
auth: v,
|
|
97
97
|
logging: w,
|
|
@@ -99,7 +99,7 @@ function $o({
|
|
|
99
99
|
features: C,
|
|
100
100
|
beacon: l
|
|
101
101
|
}),
|
|
102
|
-
[f, c, g, d,
|
|
102
|
+
[f, c, g, d, b, m, v, w, y, C, l]
|
|
103
103
|
);
|
|
104
104
|
return $e(() => {
|
|
105
105
|
let N = !0;
|
|
@@ -107,7 +107,7 @@ function $o({
|
|
|
107
107
|
async function S() {
|
|
108
108
|
if (N)
|
|
109
109
|
try {
|
|
110
|
-
const M = await lr({ ...
|
|
110
|
+
const M = await lr({ ...x, autoResume: a && r });
|
|
111
111
|
if (!N) {
|
|
112
112
|
await M.destroy();
|
|
113
113
|
return;
|
|
@@ -122,7 +122,7 @@ function $o({
|
|
|
122
122
|
const M = T.current;
|
|
123
123
|
T.current = null, M && oa(() => M.destroy());
|
|
124
124
|
};
|
|
125
|
-
}, [
|
|
125
|
+
}, [x, a, r]), D ? /* @__PURE__ */ t(Me, { children: n }) : h ? /* @__PURE__ */ t(ya.Provider, { value: h, children: /* @__PURE__ */ t(Na, { locale: o, translations: i, children: e }) }) : (console.error("Fanfare SDK failed to initialize"), null);
|
|
126
126
|
}
|
|
127
127
|
function Nt() {
|
|
128
128
|
const e = jt(ya);
|
|
@@ -165,18 +165,18 @@ function qo() {
|
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
function Sa(e, a) {
|
|
168
|
-
const r = Nt(), { locale: n, setExperienceTranslations: o } = Ft(), i = bt(null), f = bt(a), [c, g] = ve(null), [d,
|
|
168
|
+
const r = Nt(), { locale: n, setExperienceTranslations: o } = Ft(), i = bt(null), f = bt(a), [c, g] = ve(null), [d, b] = ve(null), [m, v] = ve(null), [w, y] = ve(null), [C, l] = ve(null);
|
|
169
169
|
$e(() => {
|
|
170
170
|
f.current = a;
|
|
171
171
|
}, [a]), $e(() => {
|
|
172
172
|
if (!e) {
|
|
173
|
-
i.current = null, g(null),
|
|
173
|
+
i.current = null, g(null), b(null), v(null), y(null), l(null);
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
176
|
const p = r.journeys.get(e);
|
|
177
|
-
i.current = p, g(p),
|
|
177
|
+
i.current = p, g(p), b(p.snapshot$.get()), v(p.view$.get());
|
|
178
178
|
const D = p.snapshot$.listen((T) => {
|
|
179
|
-
|
|
179
|
+
b(T);
|
|
180
180
|
}), V = p.view$.listen((T) => {
|
|
181
181
|
v(T);
|
|
182
182
|
});
|
|
@@ -209,18 +209,18 @@ function Sa(e, a) {
|
|
|
209
209
|
autoEnterWaitlist: p?.autoEnterWaitlist ?? V?.autoEnterWaitlist
|
|
210
210
|
};
|
|
211
211
|
try {
|
|
212
|
-
const
|
|
213
|
-
if (
|
|
212
|
+
const x = D.view$.get();
|
|
213
|
+
if (x.journeyStage === "ready") {
|
|
214
214
|
const N = T.accessCode ? { accessCode: T.accessCode } : void 0;
|
|
215
|
-
await
|
|
215
|
+
await x.start(N);
|
|
216
216
|
}
|
|
217
217
|
if (T.autoEnterWaitlist) {
|
|
218
218
|
const N = D.view$.get();
|
|
219
219
|
N.journeyStage === "routed" && N.sequence.phase === "scheduled" && N.sequence.waitlist?.status === "not_waitlisted" && await N.sequence.waitlist.join();
|
|
220
220
|
}
|
|
221
221
|
return D.view$.get();
|
|
222
|
-
} catch (
|
|
223
|
-
throw y(
|
|
222
|
+
} catch (x) {
|
|
223
|
+
throw y(x instanceof Error ? x.message : "Unknown error"), l(mt(x)), x;
|
|
224
224
|
}
|
|
225
225
|
},
|
|
226
226
|
[e, r]
|
|
@@ -257,7 +257,7 @@ function Uo({ experienceId: e, autoStart: a, renderHeader: r }) {
|
|
|
257
257
|
const v = o.sequence;
|
|
258
258
|
v.phase === "scheduled" && v.waitlist?.status === "not_waitlisted" && d.push("joinAttachment"), v.phase === "scheduled" && v.waitlist && v.waitlist.status !== "not_waitlisted" && d.push("leaveAttachment"), v.phase === "enterable" && d.push("enter"), v.phase === "participating" && "leave" in v && d.push("leave"), v.phase === "participating" && "complete" in v && d.push("complete"), "bid" in v && d.push("bid"), "book" in v && d.push("book"), "cancel" in v && d.push("cancel"), "reschedule" in v && d.push("reschedule"), "claim" in v && d.push("claim");
|
|
259
259
|
}
|
|
260
|
-
const
|
|
260
|
+
const b = i ? {
|
|
261
261
|
experienceId: i.experienceId,
|
|
262
262
|
accessCode: i.accessCode,
|
|
263
263
|
sequenceId: xr(i),
|
|
@@ -374,7 +374,7 @@ function Uo({ experienceId: e, autoStart: a, renderHeader: r }) {
|
|
|
374
374
|
d.includes("reschedule") && /* @__PURE__ */ t("button", { type: "button", onClick: () => m("reschedule"), children: "Reschedule" }),
|
|
375
375
|
d.includes("claim") && /* @__PURE__ */ t("button", { type: "button", onClick: () => m("claim"), children: "Claim" })
|
|
376
376
|
] }),
|
|
377
|
-
/* @__PURE__ */ t("pre", { children: JSON.stringify(
|
|
377
|
+
/* @__PURE__ */ t("pre", { children: JSON.stringify(b, null, 2) })
|
|
378
378
|
] })
|
|
379
379
|
] });
|
|
380
380
|
} });
|
|
@@ -458,8 +458,8 @@ function Br(e) {
|
|
|
458
458
|
Ca(i) && typeof xt == "function" && (i = xt(i._payload));
|
|
459
459
|
const c = s.Children.toArray(i), g = c.find(Wr);
|
|
460
460
|
if (g) {
|
|
461
|
-
const d = g.props.children,
|
|
462
|
-
return /* @__PURE__ */ t(a, { ...f, ref: o, children: s.isValidElement(d) ? s.cloneElement(d, void 0,
|
|
461
|
+
const d = g.props.children, b = c.map((m) => m === g ? s.Children.count(d) > 1 ? s.Children.only(null) : s.isValidElement(d) ? d.props.children : null : m);
|
|
462
|
+
return /* @__PURE__ */ t(a, { ...f, ref: o, children: s.isValidElement(d) ? s.cloneElement(d, void 0, b) : null });
|
|
463
463
|
}
|
|
464
464
|
return /* @__PURE__ */ t(a, { ...f, ref: o, children: i });
|
|
465
465
|
});
|
|
@@ -802,7 +802,7 @@ const an = te(
|
|
|
802
802
|
disabled: c,
|
|
803
803
|
children: g,
|
|
804
804
|
...d
|
|
805
|
-
},
|
|
805
|
+
}, b) => {
|
|
806
806
|
const m = o ? Or : "button", v = ge(), [w, y] = s.useState(void 0);
|
|
807
807
|
s.useImperativeHandle(i, () => ({
|
|
808
808
|
success: () => y("success"),
|
|
@@ -817,7 +817,7 @@ const an = te(
|
|
|
817
817
|
return /* @__PURE__ */ u(
|
|
818
818
|
m,
|
|
819
819
|
{
|
|
820
|
-
ref:
|
|
820
|
+
ref: b,
|
|
821
821
|
"data-slot": "button",
|
|
822
822
|
"data-variant": a,
|
|
823
823
|
"data-size": r,
|
|
@@ -920,8 +920,8 @@ const sa = ["default", "rounded"], rn = te(
|
|
|
920
920
|
}
|
|
921
921
|
}), yt = s.forwardRef(
|
|
922
922
|
({ className: e, type: a = "text", label: r, error: n, hasError: o, inlineLabel: i, inlineError: f, ...c }, g) => {
|
|
923
|
-
const { variant: d } = ft(),
|
|
924
|
-
rn({ styleVariant:
|
|
923
|
+
const { variant: d } = ft(), b = ge(), m = c.id || c.name, v = i ?? sa.includes(d), w = f ?? sa.includes(d), y = o || !!n, C = !!n && !o, l = v && r, h = !v && r, p = w && C, D = !w && C, V = E(
|
|
924
|
+
rn({ styleVariant: b }),
|
|
925
925
|
y && "ff:border-danger ff:focus:border-danger ff:focus:ring-danger",
|
|
926
926
|
// Extra padding for floating label
|
|
927
927
|
l && "ff:pt-5 ff:pb-1",
|
|
@@ -974,7 +974,7 @@ const sa = ["default", "rounded"], rn = te(
|
|
|
974
974
|
// Error state
|
|
975
975
|
y && "ff:text-danger ff:peer-focus:text-danger",
|
|
976
976
|
// Style variant
|
|
977
|
-
la({ styleVariant:
|
|
977
|
+
la({ styleVariant: b })
|
|
978
978
|
),
|
|
979
979
|
children: r
|
|
980
980
|
}
|
|
@@ -1009,7 +1009,7 @@ const sa = ["default", "rounded"], rn = te(
|
|
|
1009
1009
|
"data-slot": "input-label",
|
|
1010
1010
|
className: E(
|
|
1011
1011
|
"ff:text-foreground ff:mb-1.5 ff:block ff:text-sm ff:font-medium",
|
|
1012
|
-
la({ styleVariant:
|
|
1012
|
+
la({ styleVariant: b })
|
|
1013
1013
|
),
|
|
1014
1014
|
children: r
|
|
1015
1015
|
}
|
|
@@ -1062,15 +1062,15 @@ const Ea = s.forwardRef(
|
|
|
1062
1062
|
hasError: c,
|
|
1063
1063
|
label: g,
|
|
1064
1064
|
disabled: d,
|
|
1065
|
-
...
|
|
1065
|
+
...b
|
|
1066
1066
|
}, m) => {
|
|
1067
|
-
const { t: v } = K(), [w, y] = s.useState(() => i === "auto" ? Va(a) : i), [C, l] = s.useState(!1), [h, p] = s.useState(null), [D, V] = s.useState(!1), [T,
|
|
1067
|
+
const { t: v } = K(), [w, y] = s.useState(() => i === "auto" ? Va(a) : i), [C, l] = s.useState(!1), [h, p] = s.useState(null), [D, V] = s.useState(!1), [T, x] = s.useState(
|
|
1068
1068
|
() => w === "phone" ? Dt(a) : a
|
|
1069
1069
|
), N = i === "auto";
|
|
1070
1070
|
s.useEffect(() => {
|
|
1071
1071
|
N || y(i);
|
|
1072
1072
|
}, [i, N]), s.useEffect(() => {
|
|
1073
|
-
|
|
1073
|
+
x(w === "phone" ? Dt(a) : a);
|
|
1074
1074
|
}, [a, w]);
|
|
1075
1075
|
const S = s.useCallback(
|
|
1076
1076
|
(L, J) => {
|
|
@@ -1089,19 +1089,19 @@ const Ea = s.forwardRef(
|
|
|
1089
1089
|
const J = L.target.value;
|
|
1090
1090
|
if (w === "phone") {
|
|
1091
1091
|
const ne = Dt(J);
|
|
1092
|
-
|
|
1092
|
+
x(ne);
|
|
1093
1093
|
const se = Ar(J);
|
|
1094
1094
|
r(se || J, w);
|
|
1095
1095
|
} else
|
|
1096
|
-
|
|
1096
|
+
x(J), r(J, w);
|
|
1097
1097
|
}, A = (L) => {
|
|
1098
|
-
l(!0),
|
|
1098
|
+
l(!0), b.onBlur?.(L);
|
|
1099
1099
|
}, I = (L) => {
|
|
1100
|
-
L.key === "Enter" && o && (L.preventDefault(), o()),
|
|
1100
|
+
L.key === "Enter" && o && (L.preventDefault(), o()), b.onKeyDown?.(L);
|
|
1101
1101
|
}, O = () => {
|
|
1102
1102
|
const L = w === "email" ? "phone" : "email";
|
|
1103
|
-
y(L),
|
|
1104
|
-
}, $ = f || (C && !D ? h : null), fe =
|
|
1103
|
+
y(L), x(""), p(null), l(!1), V(!1), r("", L), n?.(!1);
|
|
1104
|
+
}, $ = f || (C && !D ? h : null), fe = b.placeholder || v(w === "email" ? "auth.emailPlaceholder" : "auth.phonePlaceholder"), ce = N && /* @__PURE__ */ t(
|
|
1105
1105
|
j,
|
|
1106
1106
|
{
|
|
1107
1107
|
type: "button",
|
|
@@ -1143,7 +1143,7 @@ const Ea = s.forwardRef(
|
|
|
1143
1143
|
inlineLabel: !1,
|
|
1144
1144
|
inlineError: !1,
|
|
1145
1145
|
"data-slot": "auth-input-field",
|
|
1146
|
-
...
|
|
1146
|
+
...b
|
|
1147
1147
|
}
|
|
1148
1148
|
)
|
|
1149
1149
|
]
|
|
@@ -1168,7 +1168,7 @@ const Ea = s.forwardRef(
|
|
|
1168
1168
|
"data-slot": "auth-input",
|
|
1169
1169
|
"data-mode": w,
|
|
1170
1170
|
"data-valid": D || void 0,
|
|
1171
|
-
...
|
|
1171
|
+
...b
|
|
1172
1172
|
}
|
|
1173
1173
|
);
|
|
1174
1174
|
}
|
|
@@ -1243,18 +1243,18 @@ const on = te(
|
|
|
1243
1243
|
}
|
|
1244
1244
|
}
|
|
1245
1245
|
), Ma = s.forwardRef(
|
|
1246
|
-
({ value: e = "", onChange: a, onComplete: r, length: n = 6, error: o, hasError: i, disabled: f, autoFocus: c, ariaDescribedBy: g, className: d },
|
|
1246
|
+
({ value: e = "", onChange: a, onComplete: r, length: n = 6, error: o, hasError: i, disabled: f, autoFocus: c, ariaDescribedBy: g, className: d }, b) => {
|
|
1247
1247
|
const m = ge(), v = s.useRef([]), [w, y] = s.useState(() => {
|
|
1248
|
-
const
|
|
1249
|
-
return [...
|
|
1248
|
+
const x = e.split("").slice(0, n);
|
|
1249
|
+
return [...x, ...Array(n - x.length).fill("")];
|
|
1250
1250
|
});
|
|
1251
1251
|
s.useEffect(() => {
|
|
1252
|
-
const
|
|
1253
|
-
y([...
|
|
1252
|
+
const x = e.split("").slice(0, n);
|
|
1253
|
+
y([...x, ...Array(n - x.length).fill("")]);
|
|
1254
1254
|
}, [e, n]);
|
|
1255
|
-
const C = (
|
|
1256
|
-
|
|
1257
|
-
}, l = (
|
|
1255
|
+
const C = (x) => {
|
|
1256
|
+
x >= 0 && x < n && v.current[x]?.focus();
|
|
1257
|
+
}, l = (x, N) => {
|
|
1258
1258
|
const S = N.replace(/\D/g, "");
|
|
1259
1259
|
if (S.length > 1) {
|
|
1260
1260
|
const O = S.slice(0, n).split(""), $ = [...O, ...Array(n - O.length).fill("")];
|
|
@@ -1264,40 +1264,40 @@ const on = te(
|
|
|
1264
1264
|
return;
|
|
1265
1265
|
}
|
|
1266
1266
|
const M = S.slice(-1), A = [...w];
|
|
1267
|
-
A[
|
|
1267
|
+
A[x] = M, y(A);
|
|
1268
1268
|
const I = A.join("");
|
|
1269
|
-
a?.(I), M &&
|
|
1270
|
-
}, h = (
|
|
1269
|
+
a?.(I), M && x < n - 1 && C(x + 1), I.length === n && !I.includes("") && r?.(I);
|
|
1270
|
+
}, h = (x, N) => {
|
|
1271
1271
|
switch (N.key) {
|
|
1272
1272
|
case "Backspace":
|
|
1273
|
-
N.preventDefault(), w[
|
|
1273
|
+
N.preventDefault(), w[x] ? l(x, "") : x > 0 && (C(x - 1), l(x - 1, ""));
|
|
1274
1274
|
break;
|
|
1275
1275
|
case "ArrowLeft":
|
|
1276
|
-
N.preventDefault(), C(
|
|
1276
|
+
N.preventDefault(), C(x - 1);
|
|
1277
1277
|
break;
|
|
1278
1278
|
case "ArrowRight":
|
|
1279
|
-
N.preventDefault(), C(
|
|
1279
|
+
N.preventDefault(), C(x + 1);
|
|
1280
1280
|
break;
|
|
1281
1281
|
case "Delete":
|
|
1282
|
-
N.preventDefault(), l(
|
|
1282
|
+
N.preventDefault(), l(x, "");
|
|
1283
1283
|
break;
|
|
1284
1284
|
}
|
|
1285
|
-
}, p = (
|
|
1286
|
-
|
|
1287
|
-
const N =
|
|
1285
|
+
}, p = (x) => {
|
|
1286
|
+
x.preventDefault();
|
|
1287
|
+
const N = x.clipboardData.getData("text").replace(/\D/g, "").slice(0, n);
|
|
1288
1288
|
if (N) {
|
|
1289
1289
|
const S = N.split(""), M = [...S, ...Array(n - S.length).fill("")];
|
|
1290
1290
|
y(M);
|
|
1291
1291
|
const A = M.join("");
|
|
1292
1292
|
a?.(A), A.length === n ? (r?.(A), C(n - 1)) : C(S.length);
|
|
1293
1293
|
}
|
|
1294
|
-
}, D = (
|
|
1295
|
-
|
|
1294
|
+
}, D = (x) => {
|
|
1295
|
+
x.target.select();
|
|
1296
1296
|
}, V = i || !!o, T = !!o && !i;
|
|
1297
1297
|
return /* @__PURE__ */ u(
|
|
1298
1298
|
"div",
|
|
1299
1299
|
{
|
|
1300
|
-
ref:
|
|
1300
|
+
ref: b,
|
|
1301
1301
|
className: E("fanfare-otp-input", "ff:space-y-1.5", d),
|
|
1302
1302
|
"data-slot": "otp-input",
|
|
1303
1303
|
"data-error": V || void 0,
|
|
@@ -1309,7 +1309,7 @@ const on = te(
|
|
|
1309
1309
|
className: "ff:grid ff:gap-2",
|
|
1310
1310
|
style: { gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` },
|
|
1311
1311
|
onPaste: p,
|
|
1312
|
-
children: Array.from({ length: n }).map((
|
|
1312
|
+
children: Array.from({ length: n }).map((x, N) => /* @__PURE__ */ t(
|
|
1313
1313
|
"input",
|
|
1314
1314
|
{
|
|
1315
1315
|
ref: (S) => {
|
|
@@ -1734,7 +1734,7 @@ const pn = ["clean"], gn = te(["ff:inline-flex ff:items-center", "ff:text-xs ff:
|
|
|
1734
1734
|
outline: "ff:bg-foreground/40"
|
|
1735
1735
|
}, La = s.forwardRef(
|
|
1736
1736
|
({ className: e, variant: a = "default", solidBackground: r, children: n, ...o }, i) => {
|
|
1737
|
-
const { variant: f } = ft(), c = ge(), g = a ?? "default", d = r ?? !pn.includes(f),
|
|
1737
|
+
const { variant: f } = ft(), c = ge(), g = a ?? "default", d = r ?? !pn.includes(f), b = !d && ca[g];
|
|
1738
1738
|
return /* @__PURE__ */ u(
|
|
1739
1739
|
"span",
|
|
1740
1740
|
{
|
|
@@ -1745,7 +1745,7 @@ const pn = ["clean"], gn = te(["ff:inline-flex ff:items-center", "ff:text-xs ff:
|
|
|
1745
1745
|
className: E(gn({ variant: g, solid: d, styleVariant: c, className: e })),
|
|
1746
1746
|
...o,
|
|
1747
1747
|
children: [
|
|
1748
|
-
|
|
1748
|
+
b && /* @__PURE__ */ t(
|
|
1749
1749
|
"span",
|
|
1750
1750
|
{
|
|
1751
1751
|
className: E("ff:size-1.5 ff:shrink-0 ff:rounded-full", ca[g]),
|
|
@@ -2114,7 +2114,7 @@ function pe({
|
|
|
2114
2114
|
showSeconds: c = !0,
|
|
2115
2115
|
layout: g = "swiss",
|
|
2116
2116
|
size: d = "default",
|
|
2117
|
-
tone:
|
|
2117
|
+
tone: b = "calm"
|
|
2118
2118
|
}) {
|
|
2119
2119
|
const { t: m } = K(), { timeRemaining: v, isClient: w, isPast: y } = Tn(e, a), C = ge();
|
|
2120
2120
|
if (!w)
|
|
@@ -2153,10 +2153,10 @@ function pe({
|
|
|
2153
2153
|
"data-past": y || void 0,
|
|
2154
2154
|
role: "timer",
|
|
2155
2155
|
"aria-live": y ? "off" : "polite",
|
|
2156
|
-
children: D.map((T,
|
|
2156
|
+
children: D.map((T, x) => /* @__PURE__ */ u(s.Fragment, { children: [
|
|
2157
2157
|
V(T.value),
|
|
2158
2158
|
T.shortLabel,
|
|
2159
|
-
|
|
2159
|
+
x < D.length - 1 && " "
|
|
2160
2160
|
] }, T.label))
|
|
2161
2161
|
}
|
|
2162
2162
|
);
|
|
@@ -2168,12 +2168,12 @@ function pe({
|
|
|
2168
2168
|
"data-slot": "countdown",
|
|
2169
2169
|
"data-layout": "swiss",
|
|
2170
2170
|
"data-size": d,
|
|
2171
|
-
"data-tone":
|
|
2171
|
+
"data-tone": b,
|
|
2172
2172
|
"data-past": y || void 0,
|
|
2173
2173
|
role: "timer",
|
|
2174
2174
|
"aria-live": y ? "off" : "polite",
|
|
2175
2175
|
children: D.map((V, T) => /* @__PURE__ */ u(s.Fragment, { children: [
|
|
2176
|
-
/* @__PURE__ */ t(En, { value: V.value, label: V.label, styleVariant: C, size: d, tone:
|
|
2176
|
+
/* @__PURE__ */ t(En, { value: V.value, label: V.label, styleVariant: C, size: d, tone: b }),
|
|
2177
2177
|
T < D.length - 1 && /* @__PURE__ */ t(Mn, { styleVariant: C, size: d })
|
|
2178
2178
|
] }, V.label))
|
|
2179
2179
|
}
|
|
@@ -2280,7 +2280,7 @@ function Aa({
|
|
|
2280
2280
|
description: c,
|
|
2281
2281
|
countdownTo: g,
|
|
2282
2282
|
submitLabel: d,
|
|
2283
|
-
verifyLabel:
|
|
2283
|
+
verifyLabel: b,
|
|
2284
2284
|
allowSkip: m = !1,
|
|
2285
2285
|
showBranding: v = !0,
|
|
2286
2286
|
defaultStep: w = "credential",
|
|
@@ -2289,7 +2289,7 @@ function Aa({
|
|
|
2289
2289
|
defaultError: l,
|
|
2290
2290
|
className: h
|
|
2291
2291
|
}) {
|
|
2292
|
-
const { t: p } = K(), D = s.useId(), V = i ?? p("auth.badgeLabel"), T = f ?? p("auth.title"),
|
|
2292
|
+
const { t: p } = K(), D = s.useId(), V = i ?? p("auth.badgeLabel"), T = f ?? p("auth.title"), x = c ?? p("auth.description"), N = d ?? p("auth.submit"), S = b ?? p("auth.verify"), [M, A] = s.useState(w), [I, O] = s.useState(y ?? ""), [$, fe] = s.useState(
|
|
2293
2293
|
C ?? Va(y ?? "")
|
|
2294
2294
|
), [ce, L] = s.useState(!1), [J, ne] = s.useState(""), [se, de] = s.useState(!1), [ee, P] = s.useState(l ?? null), [ae, me] = s.useState(
|
|
2295
2295
|
w === "verify" && (y ?? "").length > 0 ? Date.now() + Et : null
|
|
@@ -2377,7 +2377,7 @@ function Aa({
|
|
|
2377
2377
|
] }) : null,
|
|
2378
2378
|
/* @__PURE__ */ t("div", { "data-slot": "auth-form-heading", children: /* @__PURE__ */ t(rt, { transitionKey: M, mode: "fade", children: M === "credential" ? /* @__PURE__ */ u(Me, { children: [
|
|
2379
2379
|
/* @__PURE__ */ t("h2", { className: "ff:text-foreground ff:text-xl ff:font-semibold", children: Ke }),
|
|
2380
|
-
/* @__PURE__ */ t("p", { className: "ff:text-muted-foreground ff:text-xs", children:
|
|
2380
|
+
/* @__PURE__ */ t("p", { className: "ff:text-muted-foreground ff:text-xs", children: x })
|
|
2381
2381
|
] }) : /* @__PURE__ */ u(Me, { children: [
|
|
2382
2382
|
/* @__PURE__ */ t("h2", { className: "ff:text-foreground ff:text-xl ff:font-semibold", children: Ke }),
|
|
2383
2383
|
I ? /* @__PURE__ */ u("p", { className: "ff:text-muted-foreground ff:text-xxs", children: [
|
|
@@ -2507,16 +2507,16 @@ function za({
|
|
|
2507
2507
|
submitLabel: c,
|
|
2508
2508
|
allowSkip: g = !1,
|
|
2509
2509
|
autoUppercase: d = !0,
|
|
2510
|
-
defaultError:
|
|
2510
|
+
defaultError: b,
|
|
2511
2511
|
className: m
|
|
2512
2512
|
}) {
|
|
2513
|
-
const { t: v } = K(), w = n ?? v("accessCode.badgeLabel"), y = o ?? v("accessCode.title"), C = i ?? v("accessCode.description"), l = c ?? v("accessCode.submit"), [h, p] = s.useState(""), [D, V] = s.useState(!1), [T,
|
|
2513
|
+
const { t: v } = K(), w = n ?? v("accessCode.badgeLabel"), y = o ?? v("accessCode.title"), C = i ?? v("accessCode.description"), l = c ?? v("accessCode.submit"), [h, p] = s.useState(""), [D, V] = s.useState(!1), [T, x] = s.useState(b ?? null), N = async (S) => {
|
|
2514
2514
|
if (S?.preventDefault(), !!h.trim()) {
|
|
2515
|
-
V(!0),
|
|
2515
|
+
V(!0), x(null);
|
|
2516
2516
|
try {
|
|
2517
2517
|
await e?.(h.trim());
|
|
2518
2518
|
} catch (M) {
|
|
2519
|
-
|
|
2519
|
+
x(M instanceof Error ? M.message : v("accessCode.invalid"));
|
|
2520
2520
|
} finally {
|
|
2521
2521
|
V(!1);
|
|
2522
2522
|
}
|
|
@@ -2541,7 +2541,7 @@ function za({
|
|
|
2541
2541
|
{
|
|
2542
2542
|
value: h,
|
|
2543
2543
|
onValueChange: (S) => {
|
|
2544
|
-
p(S),
|
|
2544
|
+
p(S), x(null);
|
|
2545
2545
|
},
|
|
2546
2546
|
onSubmit: () => {
|
|
2547
2547
|
N();
|
|
@@ -2594,9 +2594,9 @@ function ja({
|
|
|
2594
2594
|
description: c,
|
|
2595
2595
|
countdownTo: g,
|
|
2596
2596
|
retryLabel: d,
|
|
2597
|
-
className:
|
|
2597
|
+
className: b
|
|
2598
2598
|
}) {
|
|
2599
|
-
const { t: m, locale: v } = K(), [w, y] = s.useState(0), [C, l] = s.useState(!1), [h, p] = s.useState(!1), [D, V] = s.useState(null), [T,
|
|
2599
|
+
const { t: m, locale: v } = K(), [w, y] = s.useState(0), [C, l] = s.useState(!1), [h, p] = s.useState(!1), [D, V] = s.useState(null), [T, x] = s.useState(!1), [N, S] = s.useState("reload"), [M, A] = s.useState(() => Date.now()), I = X(() => {
|
|
2600
2600
|
if (!e?.iframeUrl) return null;
|
|
2601
2601
|
try {
|
|
2602
2602
|
return new URL(e.iframeUrl).origin;
|
|
@@ -2627,7 +2627,7 @@ function ja({
|
|
|
2627
2627
|
[a, M]
|
|
2628
2628
|
), ce = typeof a?.attemptsRemaining == "number" ? a.attemptsRemaining : void 0;
|
|
2629
2629
|
s.useEffect(() => {
|
|
2630
|
-
y(0), l(!1), p(!1), V(null),
|
|
2630
|
+
y(0), l(!1), p(!1), V(null), x(!1), S("reload");
|
|
2631
2631
|
}, [e?.id]), s.useEffect(() => {
|
|
2632
2632
|
T && a?.message && V(a.message);
|
|
2633
2633
|
}, [T, a?.message]), s.useEffect(() => {
|
|
@@ -2636,7 +2636,7 @@ function ja({
|
|
|
2636
2636
|
if (P.origin !== I || !In(P.data) || P.data.challengeId !== e.id) return;
|
|
2637
2637
|
if (P.data.kind === "fanfare:challenge:turnstile") {
|
|
2638
2638
|
const ke = P.data.token;
|
|
2639
|
-
|
|
2639
|
+
x(!0), p(!0), V(null), (async () => {
|
|
2640
2640
|
try {
|
|
2641
2641
|
await r(ke);
|
|
2642
2642
|
} catch (Re) {
|
|
@@ -2647,7 +2647,7 @@ function ja({
|
|
|
2647
2647
|
})();
|
|
2648
2648
|
return;
|
|
2649
2649
|
}
|
|
2650
|
-
|
|
2650
|
+
x(!0);
|
|
2651
2651
|
const ae = typeof P.data.reason == "string" ? P.data.reason : void 0, me = typeof P.data.message == "string" ? P.data.message : void 0;
|
|
2652
2652
|
if (ae === "challenge_expired" || ae === "challenge_not_found") {
|
|
2653
2653
|
S("reroute"), V(
|
|
@@ -2667,13 +2667,13 @@ function ja({
|
|
|
2667
2667
|
}, [e?.id, I, r, m]);
|
|
2668
2668
|
const L = f ?? m("challenge.title"), J = c ?? m("challenge.description"), ne = d ?? m("challenge.retry"), se = i ?? m("challenge.badgeLabel"), de = () => {
|
|
2669
2669
|
const ee = N;
|
|
2670
|
-
if (V(null),
|
|
2670
|
+
if (V(null), x(!1), n && (ee === "reroute" || !O || typeof ce == "number" && ce <= 0)) {
|
|
2671
2671
|
S("reload"), n();
|
|
2672
2672
|
return;
|
|
2673
2673
|
}
|
|
2674
2674
|
S("reload"), y((P) => P + 1), l(!1);
|
|
2675
2675
|
};
|
|
2676
|
-
return /* @__PURE__ */ u(Y, { className: E("fanfare-challenge-gate",
|
|
2676
|
+
return /* @__PURE__ */ u(Y, { className: E("fanfare-challenge-gate", b), "data-slot": "challenge-gate", children: [
|
|
2677
2677
|
/* @__PURE__ */ t(G, { variant: o, label: se }),
|
|
2678
2678
|
/* @__PURE__ */ u(Z, { children: [
|
|
2679
2679
|
g ? /* @__PURE__ */ u("div", { "data-slot": "challenge-gate-countdown", className: "ff:flex ff:flex-col ff:items-start ff:gap-1", children: [
|
|
@@ -2723,7 +2723,7 @@ function ja({
|
|
|
2723
2723
|
}
|
|
2724
2724
|
ja.displayName = "ChallengeGate";
|
|
2725
2725
|
function Fa({ title: e, message: a, endedAt: r, ctaLabel: n, onCtaClick: o, className: i }) {
|
|
2726
|
-
const { t: f, locale: c } = K(), g = e ?? f("ended.title"), d = a ?? f("ended.message"),
|
|
2726
|
+
const { t: f, locale: c } = K(), g = e ?? f("ended.title"), d = a ?? f("ended.message"), b = s.useMemo(() => r ? (r instanceof Date ? r : new Date(r)).toLocaleDateString(c, {
|
|
2727
2727
|
month: "long",
|
|
2728
2728
|
day: "numeric",
|
|
2729
2729
|
year: "numeric"
|
|
@@ -2733,7 +2733,7 @@ function Fa({ title: e, message: a, endedAt: r, ctaLabel: n, onCtaClick: o, clas
|
|
|
2733
2733
|
/* @__PURE__ */ u(Z, { children: [
|
|
2734
2734
|
/* @__PURE__ */ u(ie, { children: [
|
|
2735
2735
|
/* @__PURE__ */ t("p", { className: "ff:text-foreground/80", children: d }),
|
|
2736
|
-
|
|
2736
|
+
b && /* @__PURE__ */ t("p", { className: "ff:text-xs ff:text-muted", children: f("ended.endedOn", { values: { date: b } }) })
|
|
2737
2737
|
] }),
|
|
2738
2738
|
n && o && /* @__PURE__ */ t(j, { className: "ff:mt-auto ff:w-full", variant: "outline", onClick: o, children: n })
|
|
2739
2739
|
] }),
|
|
@@ -2742,7 +2742,7 @@ function Fa({ title: e, message: a, endedAt: r, ctaLabel: n, onCtaClick: o, clas
|
|
|
2742
2742
|
}
|
|
2743
2743
|
Fa.displayName = "EndedModule";
|
|
2744
2744
|
function et({ error: e, title: a, label: r, info: n, ctaLabel: o, onRetry: i, className: f }) {
|
|
2745
|
-
const { t: c } = K(), [g, d] = s.useState(!1),
|
|
2745
|
+
const { t: c } = K(), [g, d] = s.useState(!1), b = r ?? c("error.label"), m = a ?? c("error.title"), w = (e instanceof Error ? e.message : e) ?? c("error.description"), y = o ?? c("error.retry"), C = async () => {
|
|
2746
2746
|
if (i) {
|
|
2747
2747
|
d(!0);
|
|
2748
2748
|
try {
|
|
@@ -2753,7 +2753,7 @@ function et({ error: e, title: a, label: r, info: n, ctaLabel: o, onRetry: i, cl
|
|
|
2753
2753
|
}
|
|
2754
2754
|
}, l = we();
|
|
2755
2755
|
return /* @__PURE__ */ t(U.div, { ...l, children: /* @__PURE__ */ u(Y, { className: E("ff:w-full ff:max-w-sm", f), "data-slot": "error-view", role: "alert", children: [
|
|
2756
|
-
/* @__PURE__ */ t(G, { variant: "danger", label:
|
|
2756
|
+
/* @__PURE__ */ t(G, { variant: "danger", label: b }),
|
|
2757
2757
|
/* @__PURE__ */ u(Z, { children: [
|
|
2758
2758
|
/* @__PURE__ */ t(be, { tone: "danger", title: m, description: w }),
|
|
2759
2759
|
n ? /* @__PURE__ */ t(ie, { children: n }) : null,
|
|
@@ -2879,8 +2879,8 @@ function We({
|
|
|
2879
2879
|
isReentering: n,
|
|
2880
2880
|
className: o
|
|
2881
2881
|
}) {
|
|
2882
|
-
const { t: i } = K(), f = e === "expired", c = pa[e] ?? pa.ended, g = f && typeof r == "function", d = i(a ? On[a] : "expired.reenter"),
|
|
2883
|
-
return /* @__PURE__ */ t(U.div, { ...
|
|
2882
|
+
const { t: i } = K(), f = e === "expired", c = pa[e] ?? pa.ended, g = f && typeof r == "function", d = i(a ? On[a] : "expired.reenter"), b = we();
|
|
2883
|
+
return /* @__PURE__ */ t(U.div, { ...b, children: /* @__PURE__ */ u(
|
|
2884
2884
|
Y,
|
|
2885
2885
|
{
|
|
2886
2886
|
className: E("ff:w-full ff:max-w-sm", o),
|
|
@@ -2910,7 +2910,7 @@ function Pa({
|
|
|
2910
2910
|
allowAuthSkip: c = !1,
|
|
2911
2911
|
allowAccessCodeSkip: g = !1,
|
|
2912
2912
|
authTitle: d,
|
|
2913
|
-
authDescription:
|
|
2913
|
+
authDescription: b,
|
|
2914
2914
|
accessCodeTitle: m,
|
|
2915
2915
|
accessCodeDescription: v,
|
|
2916
2916
|
startsAt: w,
|
|
@@ -2935,7 +2935,7 @@ function Pa({
|
|
|
2935
2935
|
Aa,
|
|
2936
2936
|
{
|
|
2937
2937
|
title: d,
|
|
2938
|
-
description:
|
|
2938
|
+
description: b,
|
|
2939
2939
|
countdownTo: w,
|
|
2940
2940
|
onSubmit: a,
|
|
2941
2941
|
onVerify: r,
|
|
@@ -3066,7 +3066,7 @@ function Wa({
|
|
|
3066
3066
|
isCancelling: c,
|
|
3067
3067
|
cancelError: g
|
|
3068
3068
|
}) {
|
|
3069
|
-
const { t: d } = K(), [
|
|
3069
|
+
const { t: d } = K(), [b, m] = s.useState(!1), v = $n(e.startTime, a), w = qn(e.startTime, a), y = Bt(e.startTime, a), C = Ba(e.startTime, e.endTime), l = !e.locationName, h = l ? d("appointment.online") : e.locationName, p = l ? {
|
|
3070
3070
|
label: d("appointment.joinCall"),
|
|
3071
3071
|
onClick: () => {
|
|
3072
3072
|
f ? f() : e.joinUrl && window.open(e.joinUrl, "_blank", "noopener,noreferrer");
|
|
@@ -3104,7 +3104,7 @@ function Wa({
|
|
|
3104
3104
|
p.label
|
|
3105
3105
|
] }) }),
|
|
3106
3106
|
/* @__PURE__ */ t(nt, { show: !!g, children: g && /* @__PURE__ */ t(be, { tone: "danger", description: g }) }),
|
|
3107
|
-
/* @__PURE__ */ t(nt, { show: !r &&
|
|
3107
|
+
/* @__PURE__ */ t(nt, { show: !r && b, children: !r && b && /* @__PURE__ */ u("div", { className: "ff:flex ff:flex-col ff:gap-2", children: [
|
|
3108
3108
|
/* @__PURE__ */ t(be, { tone: "danger", title: d("appointment.cancelConfirm") }),
|
|
3109
3109
|
/* @__PURE__ */ u("div", { className: "ff:flex ff:gap-2", children: [
|
|
3110
3110
|
/* @__PURE__ */ t(
|
|
@@ -3132,7 +3132,7 @@ function Wa({
|
|
|
3132
3132
|
)
|
|
3133
3133
|
] })
|
|
3134
3134
|
] }) }),
|
|
3135
|
-
!r && !
|
|
3135
|
+
!r && !b && /* @__PURE__ */ u("div", { className: "ff:flex ff:items-center ff:justify-center ff:gap-3 ff:text-xs", children: [
|
|
3136
3136
|
/* @__PURE__ */ t(j, { variant: "link", size: "xs", onClick: o, children: d("appointment.reschedule") }),
|
|
3137
3137
|
/* @__PURE__ */ t("span", { "aria-hidden": "true", className: "ff:text-muted", children: "·" }),
|
|
3138
3138
|
/* @__PURE__ */ t(j, { variant: "link", size: "xs", onClick: () => m(!0), disabled: c, children: d("appointment.cancel") })
|
|
@@ -3194,7 +3194,7 @@ function ma(e, a, r, n) {
|
|
|
3194
3194
|
return `${e}:${a}:${r}:${n ?? ""}`;
|
|
3195
3195
|
}
|
|
3196
3196
|
function Qn(e, a) {
|
|
3197
|
-
const r = Nt(), [n, o] = s.useState([]), [i, f] = s.useState(!1), [c, g] = s.useState(null), [d,
|
|
3197
|
+
const r = Nt(), [n, o] = s.useState([]), [i, f] = s.useState(!1), [c, g] = s.useState(null), [d, b] = s.useState(0), { startDate: m, endDate: v, timezone: w } = a;
|
|
3198
3198
|
s.useEffect(() => {
|
|
3199
3199
|
if (!e || !m || !v) {
|
|
3200
3200
|
o([]), g(null), f(!1);
|
|
@@ -3217,7 +3217,7 @@ function Qn(e, a) {
|
|
|
3217
3217
|
};
|
|
3218
3218
|
}, [r, e, m, v, w, d]);
|
|
3219
3219
|
const y = s.useCallback(() => {
|
|
3220
|
-
e && m && v && Mt.delete(ma(e, m, v, w)),
|
|
3220
|
+
e && m && v && Mt.delete(ma(e, m, v, w)), b((C) => C + 1);
|
|
3221
3221
|
}, [e, m, v, w]);
|
|
3222
3222
|
return { slots: n, isLoading: i, error: c, refresh: y };
|
|
3223
3223
|
}
|
|
@@ -3325,13 +3325,13 @@ function Za({
|
|
|
3325
3325
|
className: "ff:grid ff:grid-cols-3 ff:gap-1 ff:overflow-y-auto ff:max-h-44",
|
|
3326
3326
|
"data-slot": "appointment-slot-grid",
|
|
3327
3327
|
children: e.map((f) => {
|
|
3328
|
-
const c = f.available <= 0, g = r === f.id, d = Oa(f),
|
|
3328
|
+
const c = f.available <= 0, g = r === f.id, d = Oa(f), b = c ? i("appointment.slotFullAriaLabel", { values: { time: d } }) : d;
|
|
3329
3329
|
return /* @__PURE__ */ t(
|
|
3330
3330
|
Ka,
|
|
3331
3331
|
{
|
|
3332
3332
|
slotId: f.id,
|
|
3333
3333
|
timeLabel: d,
|
|
3334
|
-
ariaLabel:
|
|
3334
|
+
ariaLabel: b,
|
|
3335
3335
|
isFull: c,
|
|
3336
3336
|
isSelected: g,
|
|
3337
3337
|
onSelect: n
|
|
@@ -3358,10 +3358,10 @@ function Ya({
|
|
|
3358
3358
|
), g = s.useMemo(
|
|
3359
3359
|
() => r ? gt(new Date(r), n) : void 0,
|
|
3360
3360
|
[r, n]
|
|
3361
|
-
), { startDate: d, endDate:
|
|
3361
|
+
), { startDate: d, endDate: b } = s.useMemo(() => {
|
|
3362
3362
|
const N = gt(/* @__PURE__ */ new Date(), n), S = c && c > N ? c : N, M = ga(S, ha - 1), A = g && g < M ? g : M;
|
|
3363
3363
|
return { startDate: S, endDate: A };
|
|
3364
|
-
}, [c, g, n]), { slots: m, isLoading: v, error: w } = Qn(e, { startDate: d, endDate:
|
|
3364
|
+
}, [c, g, n]), { slots: m, isLoading: v, error: w } = Qn(e, { startDate: d, endDate: b, timezone: n }), y = s.useMemo(() => {
|
|
3365
3365
|
const N = /* @__PURE__ */ new Map();
|
|
3366
3366
|
for (const S of m) {
|
|
3367
3367
|
const M = S.startTime ? gt(new Date(S.startTime), S.timezone ?? n) : S.id.slice(0, 10), A = N.get(M);
|
|
@@ -3397,7 +3397,7 @@ function Ya({
|
|
|
3397
3397
|
}, [V, p, o]);
|
|
3398
3398
|
const T = s.useCallback((N) => {
|
|
3399
3399
|
h(N), D(null);
|
|
3400
|
-
}, []),
|
|
3400
|
+
}, []), x = s.useCallback((N) => {
|
|
3401
3401
|
D((S) => S === N ? null : N);
|
|
3402
3402
|
}, []);
|
|
3403
3403
|
return /* @__PURE__ */ u("div", { className: "ff:flex ff:flex-col ff:gap-2", children: [
|
|
@@ -3408,7 +3408,7 @@ function Ya({
|
|
|
3408
3408
|
slots: V,
|
|
3409
3409
|
isLoading: v,
|
|
3410
3410
|
selectedSlotId: p,
|
|
3411
|
-
onSelect:
|
|
3411
|
+
onSelect: x
|
|
3412
3412
|
}
|
|
3413
3413
|
),
|
|
3414
3414
|
(i || w) && /* @__PURE__ */ t(be, { tone: "danger", description: i ?? w?.message ?? f("appointment.bookingFailed") })
|
|
@@ -3427,7 +3427,7 @@ function At({
|
|
|
3427
3427
|
onBook: c,
|
|
3428
3428
|
onCancel: g,
|
|
3429
3429
|
onReschedule: d,
|
|
3430
|
-
isBooking:
|
|
3430
|
+
isBooking: b,
|
|
3431
3431
|
isCancelling: m,
|
|
3432
3432
|
isRescheduling: v,
|
|
3433
3433
|
bookError: w,
|
|
@@ -3437,7 +3437,7 @@ function At({
|
|
|
3437
3437
|
isReentering: h,
|
|
3438
3438
|
className: p
|
|
3439
3439
|
}) {
|
|
3440
|
-
const { t: D } = K(), V = ze(a ?? eo), [T,
|
|
3440
|
+
const { t: D } = K(), V = ze(a ?? eo), [T, x] = s.useState(!1), N = we();
|
|
3441
3441
|
if (r === "ended")
|
|
3442
3442
|
return /* @__PURE__ */ t(We, { outcomeReason: C ?? "ended", participationType: "appointment", className: p });
|
|
3443
3443
|
if (r === "participating" && T)
|
|
@@ -3456,7 +3456,7 @@ function At({
|
|
|
3456
3456
|
isPending: v,
|
|
3457
3457
|
error: w,
|
|
3458
3458
|
onConfirm: async (S, M) => {
|
|
3459
|
-
await d(S, M),
|
|
3459
|
+
await d(S, M), x(!1);
|
|
3460
3460
|
},
|
|
3461
3461
|
className: p,
|
|
3462
3462
|
motionProps: N,
|
|
@@ -3482,7 +3482,7 @@ function At({
|
|
|
3482
3482
|
timezone: i,
|
|
3483
3483
|
readOnly: I,
|
|
3484
3484
|
onCancel: () => g(),
|
|
3485
|
-
onStartReschedule: () =>
|
|
3485
|
+
onStartReschedule: () => x(!0),
|
|
3486
3486
|
isCancelling: m,
|
|
3487
3487
|
cancelError: y
|
|
3488
3488
|
}
|
|
@@ -3503,7 +3503,7 @@ function At({
|
|
|
3503
3503
|
headingVariant: "default",
|
|
3504
3504
|
confirmLabelKey: "appointment.continueWithTime",
|
|
3505
3505
|
idleLabelKey: "appointment.selectATime",
|
|
3506
|
-
isPending:
|
|
3506
|
+
isPending: b,
|
|
3507
3507
|
error: w,
|
|
3508
3508
|
onConfirm: c,
|
|
3509
3509
|
className: p,
|
|
@@ -3524,7 +3524,7 @@ function wa({
|
|
|
3524
3524
|
confirmLabelKey: c,
|
|
3525
3525
|
idleLabelKey: g,
|
|
3526
3526
|
isPending: d,
|
|
3527
|
-
error:
|
|
3527
|
+
error: b,
|
|
3528
3528
|
onConfirm: m,
|
|
3529
3529
|
className: v,
|
|
3530
3530
|
motionProps: w,
|
|
@@ -3553,7 +3553,7 @@ function wa({
|
|
|
3553
3553
|
bookingWindowCloseAt: r,
|
|
3554
3554
|
timezone: n,
|
|
3555
3555
|
onSlotChange: p,
|
|
3556
|
-
bookError:
|
|
3556
|
+
bookError: b
|
|
3557
3557
|
}
|
|
3558
3558
|
) }),
|
|
3559
3559
|
/* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(
|
|
@@ -3621,7 +3621,7 @@ function tt({
|
|
|
3621
3621
|
onBid: c,
|
|
3622
3622
|
isEntering: g,
|
|
3623
3623
|
isLeaving: d,
|
|
3624
|
-
countdownTo:
|
|
3624
|
+
countdownTo: b,
|
|
3625
3625
|
defaultBidAmount: m,
|
|
3626
3626
|
currencyCode: v,
|
|
3627
3627
|
locale: w,
|
|
@@ -3634,13 +3634,10 @@ function tt({
|
|
|
3634
3634
|
isReentering: V,
|
|
3635
3635
|
className: T
|
|
3636
3636
|
}) {
|
|
3637
|
-
const { t:
|
|
3637
|
+
const { t: x } = K(), N = ze(e ?? ro), S = s.useMemo(
|
|
3638
3638
|
() => no(a, N),
|
|
3639
3639
|
[a, N]
|
|
3640
|
-
), M = s.useMemo(
|
|
3641
|
-
() => x ?? (S.closeAt ? new Date(S.closeAt) : void 0),
|
|
3642
|
-
[x, S.closeAt]
|
|
3643
|
-
), A = s.useMemo(() => {
|
|
3640
|
+
), M = s.useMemo(() => S.settleAt ? new Date(S.settleAt) : b || (S.closeAt ? new Date(S.closeAt) : void 0), [b, S.settleAt, S.closeAt]), A = s.useMemo(() => {
|
|
3644
3641
|
if (C)
|
|
3645
3642
|
return C instanceof Date ? C : new Date(C);
|
|
3646
3643
|
}, [C]), I = S.currencyCode ?? v, O = s.useCallback(
|
|
@@ -3668,21 +3665,21 @@ function tt({
|
|
|
3668
3665
|
"data-slot": "auction-module",
|
|
3669
3666
|
"data-stage": "enterable",
|
|
3670
3667
|
children: [
|
|
3671
|
-
/* @__PURE__ */ t(G, { variant: "default", label:
|
|
3668
|
+
/* @__PURE__ */ t(G, { variant: "default", label: x("auction.title") }),
|
|
3672
3669
|
/* @__PURE__ */ u(Z, { children: [
|
|
3673
3670
|
M && /* @__PURE__ */ u("div", { className: "ff:flex ff:flex-col ff:items-start ff:gap-1", children: [
|
|
3674
|
-
/* @__PURE__ */ t("span", { className: "ff:text-xxs ff:font-medium ff:uppercase ff:tracking-widest ff:text-muted", children:
|
|
3671
|
+
/* @__PURE__ */ t("span", { className: "ff:text-xxs ff:font-medium ff:uppercase ff:tracking-widest ff:text-muted", children: x("auction.endsIn") }),
|
|
3675
3672
|
/* @__PURE__ */ t(pe, { targetDate: M, showDays: !1 })
|
|
3676
3673
|
] }),
|
|
3677
|
-
/* @__PURE__ */ t(ie, { children: /* @__PURE__ */ t("p", { className: "ff:text-foreground/80", children:
|
|
3678
|
-
c ? /* @__PURE__ */ t(j, { className: "ff:mt-auto ff:w-full", onClick: ce, children:
|
|
3674
|
+
/* @__PURE__ */ t(ie, { children: /* @__PURE__ */ t("p", { className: "ff:text-foreground/80", children: x("auction.description") }) }),
|
|
3675
|
+
c ? /* @__PURE__ */ t(j, { className: "ff:mt-auto ff:w-full", onClick: ce, children: x("auction.bidAction") }) : n && /* @__PURE__ */ t(j, { className: "ff:mt-auto ff:w-full", onClick: i, disabled: g, loading: g, children: x("auction.enter") })
|
|
3679
3676
|
] }),
|
|
3680
3677
|
/* @__PURE__ */ t(H, {})
|
|
3681
3678
|
]
|
|
3682
3679
|
}
|
|
3683
3680
|
) });
|
|
3684
3681
|
if (r === "participating") {
|
|
3685
|
-
const L = S.status === "winning", J = L ? "default" : "success", ne =
|
|
3682
|
+
const L = S.status === "winning", J = L ? "default" : "success", ne = x(L ? "auction.winningTitle" : "auction.title"), se = O(S.highestBid), de = O(S.currentBid);
|
|
3686
3683
|
return /* @__PURE__ */ t(U.div, { ...$, children: /* @__PURE__ */ u(
|
|
3687
3684
|
Y,
|
|
3688
3685
|
{
|
|
@@ -3693,21 +3690,21 @@ function tt({
|
|
|
3693
3690
|
/* @__PURE__ */ t(G, { variant: J, label: ne }),
|
|
3694
3691
|
/* @__PURE__ */ u(Z, { children: [
|
|
3695
3692
|
M && /* @__PURE__ */ u("div", { className: "ff:flex ff:flex-col ff:items-start ff:gap-1", children: [
|
|
3696
|
-
/* @__PURE__ */ t("span", { className: "ff:text-xxs ff:font-medium ff:uppercase ff:tracking-widest ff:text-muted", children:
|
|
3693
|
+
/* @__PURE__ */ t("span", { className: "ff:text-xxs ff:font-medium ff:uppercase ff:tracking-widest ff:text-muted", children: x("auction.endsIn") }),
|
|
3697
3694
|
/* @__PURE__ */ t(pe, { targetDate: M, showDays: !1 })
|
|
3698
3695
|
] }),
|
|
3699
3696
|
/* @__PURE__ */ u(ie, { children: [
|
|
3700
3697
|
se !== void 0 && /* @__PURE__ */ u("div", { className: "ff:flex ff:items-center ff:justify-between", children: [
|
|
3701
|
-
/* @__PURE__ */ t("span", { className: "ff:text-muted", children:
|
|
3698
|
+
/* @__PURE__ */ t("span", { className: "ff:text-muted", children: x("auction.currentBid") }),
|
|
3702
3699
|
/* @__PURE__ */ t("span", { className: "ff:font-medium ff:tabular-nums", children: se })
|
|
3703
3700
|
] }),
|
|
3704
3701
|
de !== void 0 && /* @__PURE__ */ u("div", { className: "ff:flex ff:items-center ff:justify-between", children: [
|
|
3705
|
-
/* @__PURE__ */ t("span", { className: "ff:text-muted", children:
|
|
3702
|
+
/* @__PURE__ */ t("span", { className: "ff:text-muted", children: x(L ? "auction.yourWinningBid" : "auction.yourBidLabel") }),
|
|
3706
3703
|
/* @__PURE__ */ t("span", { className: "ff:font-medium ff:tabular-nums", children: de })
|
|
3707
3704
|
] })
|
|
3708
3705
|
] }),
|
|
3709
3706
|
/* @__PURE__ */ u("div", { className: "ff:mt-auto ff:flex ff:flex-col ff:gap-2", children: [
|
|
3710
|
-
c && /* @__PURE__ */ t(j, { className: "ff:w-full", onClick: ce, children:
|
|
3707
|
+
c && /* @__PURE__ */ t(j, { className: "ff:w-full", onClick: ce, children: x("auction.bidAction") }),
|
|
3711
3708
|
o && /* @__PURE__ */ t(
|
|
3712
3709
|
j,
|
|
3713
3710
|
{
|
|
@@ -3716,7 +3713,7 @@ function tt({
|
|
|
3716
3713
|
onClick: f,
|
|
3717
3714
|
disabled: d,
|
|
3718
3715
|
loading: d,
|
|
3719
|
-
children:
|
|
3716
|
+
children: x("common.leave")
|
|
3720
3717
|
}
|
|
3721
3718
|
)
|
|
3722
3719
|
] })
|
|
@@ -3735,11 +3732,11 @@ function tt({
|
|
|
3735
3732
|
"data-slot": "auction-module",
|
|
3736
3733
|
"data-stage": "settling",
|
|
3737
3734
|
children: [
|
|
3738
|
-
/* @__PURE__ */ t(G, { variant: "default", label:
|
|
3735
|
+
/* @__PURE__ */ t(G, { variant: "default", label: x("auction.settlingTitle") }),
|
|
3739
3736
|
/* @__PURE__ */ t(Z, { children: /* @__PURE__ */ u(ie, { children: [
|
|
3740
|
-
/* @__PURE__ */ t("p", { className: "ff:text-foreground/80", children:
|
|
3737
|
+
/* @__PURE__ */ t("p", { className: "ff:text-foreground/80", children: x("auction.settlingDescription") }),
|
|
3741
3738
|
L !== void 0 && /* @__PURE__ */ u("div", { className: "ff:mt-3 ff:flex ff:items-center ff:justify-between", children: [
|
|
3742
|
-
/* @__PURE__ */ t("span", { className: "ff:text-muted", children:
|
|
3739
|
+
/* @__PURE__ */ t("span", { className: "ff:text-muted", children: x("auction.currentBid") }),
|
|
3743
3740
|
/* @__PURE__ */ t("span", { className: "ff:font-medium ff:tabular-nums", children: L })
|
|
3744
3741
|
] })
|
|
3745
3742
|
] }) }),
|
|
@@ -3751,9 +3748,9 @@ function tt({
|
|
|
3751
3748
|
return r === "granted" ? /* @__PURE__ */ t(
|
|
3752
3749
|
it,
|
|
3753
3750
|
{
|
|
3754
|
-
label:
|
|
3755
|
-
fallbackMessage:
|
|
3756
|
-
ctaLabel:
|
|
3751
|
+
label: x("auction.wonTitle"),
|
|
3752
|
+
fallbackMessage: x("auction.wonDescription"),
|
|
3753
|
+
ctaLabel: x("auction.proceedToCheckout"),
|
|
3757
3754
|
expiresAt: A,
|
|
3758
3755
|
onCtaClick: fe,
|
|
3759
3756
|
className: T
|
|
@@ -3782,7 +3779,7 @@ function at({
|
|
|
3782
3779
|
isLeaving: c,
|
|
3783
3780
|
countdownTo: g,
|
|
3784
3781
|
grant: d,
|
|
3785
|
-
expiresAt:
|
|
3782
|
+
expiresAt: b,
|
|
3786
3783
|
checkoutUrl: m,
|
|
3787
3784
|
onCheckoutClick: v,
|
|
3788
3785
|
outcomeReason: w,
|
|
@@ -3794,9 +3791,9 @@ function at({
|
|
|
3794
3791
|
() => g ?? (p.drawTime ? new Date(p.drawTime) : void 0),
|
|
3795
3792
|
[g, p.drawTime]
|
|
3796
3793
|
), V = s.useMemo(() => {
|
|
3797
|
-
if (
|
|
3798
|
-
return
|
|
3799
|
-
}, [
|
|
3794
|
+
if (b)
|
|
3795
|
+
return b instanceof Date ? b : new Date(b);
|
|
3796
|
+
}, [b]), T = we(), x = () => {
|
|
3800
3797
|
v ? v() : m && window.open(m, "_blank", "noopener,noreferrer");
|
|
3801
3798
|
};
|
|
3802
3799
|
return a === "enterable" ? /* @__PURE__ */ t(U.div, { ...T, children: /* @__PURE__ */ u(Y, { className: E("ff:w-full ff:max-w-sm", l), "data-slot": "draw-module", "data-stage": "enterable", children: [
|
|
@@ -3850,7 +3847,7 @@ function at({
|
|
|
3850
3847
|
fallbackMessage: h("granted.description"),
|
|
3851
3848
|
ctaLabel: h("granted.cta"),
|
|
3852
3849
|
expiresAt: V,
|
|
3853
|
-
onCtaClick:
|
|
3850
|
+
onCtaClick: x,
|
|
3854
3851
|
className: l
|
|
3855
3852
|
}
|
|
3856
3853
|
) : a === "ended" ? /* @__PURE__ */ t(
|
|
@@ -3877,7 +3874,7 @@ function wt({
|
|
|
3877
3874
|
isLeaving: c,
|
|
3878
3875
|
closeAt: g,
|
|
3879
3876
|
grant: d,
|
|
3880
|
-
expiresAt:
|
|
3877
|
+
expiresAt: b,
|
|
3881
3878
|
checkoutUrl: m,
|
|
3882
3879
|
onCheckoutClick: v,
|
|
3883
3880
|
outcomeReason: w,
|
|
@@ -3886,9 +3883,9 @@ function wt({
|
|
|
3886
3883
|
className: l
|
|
3887
3884
|
}) {
|
|
3888
3885
|
const { t: h } = K(), p = ze(e ?? fo), D = s.useMemo(() => {
|
|
3889
|
-
if (
|
|
3890
|
-
return
|
|
3891
|
-
}, [
|
|
3886
|
+
if (b)
|
|
3887
|
+
return b instanceof Date ? b : new Date(b);
|
|
3888
|
+
}, [b]), V = we(), T = () => {
|
|
3892
3889
|
v ? v() : m && window.open(m, "_blank", "noopener,noreferrer");
|
|
3893
3890
|
};
|
|
3894
3891
|
if (a === "enterable")
|
|
@@ -3904,7 +3901,7 @@ function wt({
|
|
|
3904
3901
|
/* @__PURE__ */ t(H, {})
|
|
3905
3902
|
] }) });
|
|
3906
3903
|
if (a === "participating") {
|
|
3907
|
-
const
|
|
3904
|
+
const x = p.estimatedWaitTime, N = x != null ? Math.ceil(x / 60) : null, S = (O) => O < 1 ? h("queue.waitLessThanMinute") : O === 1 ? h("queue.waitOneMinute") : h("queue.waitMinutes", { values: { count: O } }), M = x != null ? Dr(x) : null, A = M ? h(Vr(M)) : null, I = N !== null ? S(N) : "...";
|
|
3908
3905
|
return /* @__PURE__ */ t(U.div, { ...V, children: /* @__PURE__ */ u(
|
|
3909
3906
|
Y,
|
|
3910
3907
|
{
|
|
@@ -3971,7 +3968,7 @@ function vt({
|
|
|
3971
3968
|
isEntering: c,
|
|
3972
3969
|
isLeaving: g,
|
|
3973
3970
|
countdownTo: d,
|
|
3974
|
-
checkoutUrl:
|
|
3971
|
+
checkoutUrl: b,
|
|
3975
3972
|
onCheckoutClick: m,
|
|
3976
3973
|
grant: v,
|
|
3977
3974
|
expiresAt: w,
|
|
@@ -3983,10 +3980,10 @@ function vt({
|
|
|
3983
3980
|
const { t: p } = K(), D = ze(e ?? io), V = s.useMemo(() => {
|
|
3984
3981
|
if (w)
|
|
3985
3982
|
return w instanceof Date ? w : new Date(w);
|
|
3986
|
-
}, [w]), T =
|
|
3983
|
+
}, [w]), T = b ?? D.checkoutUrl, x = we(), N = () => {
|
|
3987
3984
|
m ? m() : T && window.open(T, "_blank", "noopener,noreferrer");
|
|
3988
3985
|
};
|
|
3989
|
-
return a === "enterable" ? /* @__PURE__ */ t(U.div, { ...
|
|
3986
|
+
return a === "enterable" ? /* @__PURE__ */ t(U.div, { ...x, children: /* @__PURE__ */ u(
|
|
3990
3987
|
Y,
|
|
3991
3988
|
{
|
|
3992
3989
|
className: E("ff:w-full ff:max-w-sm", h),
|
|
@@ -4005,7 +4002,7 @@ function vt({
|
|
|
4005
4002
|
/* @__PURE__ */ t(H, {})
|
|
4006
4003
|
]
|
|
4007
4004
|
}
|
|
4008
|
-
) }) : a === "participating" ? /* @__PURE__ */ t(U.div, { ...
|
|
4005
|
+
) }) : a === "participating" ? /* @__PURE__ */ t(U.div, { ...x, children: /* @__PURE__ */ u(
|
|
4009
4006
|
Y,
|
|
4010
4007
|
{
|
|
4011
4008
|
className: E("ff:w-full ff:max-w-sm", h),
|
|
@@ -4079,9 +4076,9 @@ function Ga({
|
|
|
4079
4076
|
isEntering: c = !1,
|
|
4080
4077
|
className: g
|
|
4081
4078
|
}) {
|
|
4082
|
-
const { t: d } = K(),
|
|
4079
|
+
const { t: d } = K(), b = e ?? d("upcoming.title"), m = a ?? d("upcoming.description"), v = s.useMemo(() => r ? r instanceof Date ? r : new Date(r) : null, [r]), w = we();
|
|
4083
4080
|
return /* @__PURE__ */ t(U.div, { ...w, children: /* @__PURE__ */ u(Y, { className: E("ff:w-full ff:max-w-sm", g), "data-slot": "upcoming-module", children: [
|
|
4084
|
-
/* @__PURE__ */ t(G, { variant: "secondary", label:
|
|
4081
|
+
/* @__PURE__ */ t(G, { variant: "secondary", label: b }),
|
|
4085
4082
|
/* @__PURE__ */ u(Z, { children: [
|
|
4086
4083
|
v && /* @__PURE__ */ u("div", { className: "ff:flex ff:flex-col ff:items-start ff:gap-1", children: [
|
|
4087
4084
|
/* @__PURE__ */ t("span", { className: "ff:text-xxs ff:font-medium ff:uppercase ff:tracking-widest ff:text-muted", children: d("countdown.startingSoon") }),
|
|
@@ -4182,24 +4179,24 @@ function Ja({
|
|
|
4182
4179
|
isLoading: g = !1,
|
|
4183
4180
|
className: d
|
|
4184
4181
|
}) {
|
|
4185
|
-
const { t:
|
|
4182
|
+
const { t: b } = K(), m = we();
|
|
4186
4183
|
return /* @__PURE__ */ t(U.div, { ...m, children: /* @__PURE__ */ u(Y, { className: E("fanfare-start-view", d), "data-slot": "start-view", children: [
|
|
4187
4184
|
/* @__PURE__ */ t(
|
|
4188
4185
|
G,
|
|
4189
4186
|
{
|
|
4190
4187
|
variant: e,
|
|
4191
4188
|
label: a,
|
|
4192
|
-
title: r ??
|
|
4193
|
-
description: n ??
|
|
4189
|
+
title: r ?? b("start.title"),
|
|
4190
|
+
description: n ?? b("start.description")
|
|
4194
4191
|
}
|
|
4195
4192
|
),
|
|
4196
4193
|
/* @__PURE__ */ u(Z, { children: [
|
|
4197
4194
|
o ? /* @__PURE__ */ u("div", { className: "ff:flex ff:flex-col ff:items-start ff:gap-1", children: [
|
|
4198
|
-
/* @__PURE__ */ t("span", { className: "ff:text-xxs ff:font-medium ff:uppercase ff:tracking-widest ff:text-muted", children:
|
|
4195
|
+
/* @__PURE__ */ t("span", { className: "ff:text-xxs ff:font-medium ff:uppercase ff:tracking-widest ff:text-muted", children: b("time.opensIn") }),
|
|
4199
4196
|
/* @__PURE__ */ t(pe, { targetDate: o, showDays: !1 })
|
|
4200
4197
|
] }) : null,
|
|
4201
4198
|
i ? /* @__PURE__ */ t(ie, { children: i }) : null,
|
|
4202
|
-
/* @__PURE__ */ t(j, { className: "ff:mt-auto ff:w-full", onClick: c, disabled: g, loading: g, children: f ??
|
|
4199
|
+
/* @__PURE__ */ t(j, { className: "ff:mt-auto ff:w-full", onClick: c, disabled: g, loading: g, children: f ?? b("start.cta") })
|
|
4203
4200
|
] }),
|
|
4204
4201
|
/* @__PURE__ */ t(H, {})
|
|
4205
4202
|
] }) });
|
|
@@ -4214,12 +4211,12 @@ function Qa({
|
|
|
4214
4211
|
isLeaving: i = !1,
|
|
4215
4212
|
className: f
|
|
4216
4213
|
}) {
|
|
4217
|
-
const { t: c } = K(), g = e ?? c("waitlist.enteredTitle"), d = a ?? c("waitlist.enteredDescription"),
|
|
4214
|
+
const { t: c } = K(), g = e ?? c("waitlist.enteredTitle"), d = a ?? c("waitlist.enteredDescription"), b = c("time.opensIn"), m = s.useMemo(() => r ? r instanceof Date ? r : new Date(r) : null, [r]), v = we();
|
|
4218
4215
|
return /* @__PURE__ */ t(U.div, { ...v, children: /* @__PURE__ */ u(Y, { className: E("fanfare-waitlist-view", f), "data-slot": "waitlist-view", children: [
|
|
4219
4216
|
/* @__PURE__ */ t(G, { variant: "success", title: g, description: d }),
|
|
4220
4217
|
/* @__PURE__ */ u(Z, { children: [
|
|
4221
4218
|
m && /* @__PURE__ */ u(ie, { children: [
|
|
4222
|
-
/* @__PURE__ */ t("p", { className: "ff:text-muted ff:text-xxs ff:font-heading ff:uppercase ff:tracking-widest", children:
|
|
4219
|
+
/* @__PURE__ */ t("p", { className: "ff:text-muted ff:text-xxs ff:font-heading ff:uppercase ff:tracking-widest", children: b }),
|
|
4223
4220
|
/* @__PURE__ */ t(
|
|
4224
4221
|
pe,
|
|
4225
4222
|
{
|
|
@@ -4322,7 +4319,7 @@ function ko({
|
|
|
4322
4319
|
children: c,
|
|
4323
4320
|
checkoutUrl: g,
|
|
4324
4321
|
onJourneyChange: d,
|
|
4325
|
-
onGranted:
|
|
4322
|
+
onGranted: b,
|
|
4326
4323
|
onError: m,
|
|
4327
4324
|
className: v
|
|
4328
4325
|
}) {
|
|
@@ -4330,7 +4327,7 @@ function ko({
|
|
|
4330
4327
|
autoStart: a,
|
|
4331
4328
|
accessCode: r,
|
|
4332
4329
|
autoEnterWaitlist: n
|
|
4333
|
-
}), [T,
|
|
4330
|
+
}), [T, x] = s.useState(!1), [N, S] = s.useState(!1), [M, A] = s.useState(!1), [I, O] = s.useState(!1), [$, fe] = s.useState(!1), [ce, L] = s.useState(null), [J, ne] = s.useState(!1), [se, de] = s.useState(!1), [ee, P] = s.useState(!1), ae = h?.journeyStage ?? null, me = h?.journeyStage === "routed" ? h : void 0, ke = me?.offers.some((k) => k.gates.some((_) => _.type === "access_code")) ?? !1, Re = h?.journeyStage === "routed" ? ke || J : h?.journeyStage === "routing" && J, ue = St(p), q = ue?.phase ?? me?.sequence.phase ?? null, _e = ce, Ne = _e ? ra(_e, C) : null, st = p?.experience?.experience?.theme, Ue = o ?? st, lt = i ?? o?.variant ?? st?.variant, xe = X(() => p ? xa(p) : [], [p]);
|
|
4334
4331
|
s.useEffect(() => {
|
|
4335
4332
|
p && d && d(p);
|
|
4336
4333
|
}, [p, d]), s.useEffect(() => {
|
|
@@ -4361,12 +4358,12 @@ function ko({
|
|
|
4361
4358
|
D !== Fe.current && (Fe.current = D, F(D));
|
|
4362
4359
|
}, [D, F]);
|
|
4363
4360
|
const Le = B(async () => {
|
|
4364
|
-
|
|
4361
|
+
x(!0), L(null);
|
|
4365
4362
|
try {
|
|
4366
4363
|
await V();
|
|
4367
4364
|
} catch {
|
|
4368
4365
|
} finally {
|
|
4369
|
-
|
|
4366
|
+
x(!1);
|
|
4370
4367
|
}
|
|
4371
4368
|
}, [V]), [Ae, He] = s.useState(null), ct = B(
|
|
4372
4369
|
async (k, _) => {
|
|
@@ -4577,8 +4574,8 @@ function ko({
|
|
|
4577
4574
|
k.journeyStage === "gated" && k.retry().catch(F);
|
|
4578
4575
|
}, [F, l]), z = X(() => h?.journeyStage === "routed" && "sequence" in h ? h.sequence : void 0, [h]), Ge = X(() => z?.phase === "scheduled" ? z.waitlist : void 0, [z]), Ce = vo(p, z), oe = bo(p), nr = xo(p), Jt = yo(nr, oe?.id), Ie = ue && "grant" in ue && ue.grant ? ue.grant : void 0, Je = ue && "outcome" in ue && ue.outcome ? ue.outcome : void 0;
|
|
4579
4576
|
s.useEffect(() => {
|
|
4580
|
-
Ie?.token &&
|
|
4581
|
-
}, [Ie?.token,
|
|
4577
|
+
Ie?.token && b && b(Ie.token);
|
|
4578
|
+
}, [Ie?.token, b]);
|
|
4582
4579
|
const or = X(() => Ee(Ce) ? Ce : Ee(oe?.type) ? oe.type : null, [oe?.type, Ce]), Ct = X(() => Ee(Ce) ? Ce : null, [Ce]), Qt = X(() => Ee(Ce) ? Ce : Ee(oe?.type) ? oe.type : null, [oe?.type, Ce]), Xt = X(() => Ge?.status === "not_waitlisted" && typeof Ge.join == "function", [Ge]), Qe = X(() => {
|
|
4583
4580
|
if (ae === "routing") return "loading";
|
|
4584
4581
|
if (ae === "gated" && xe.length > 0) {
|
|
@@ -4976,14 +4973,14 @@ function So({
|
|
|
4976
4973
|
d(m);
|
|
4977
4974
|
}
|
|
4978
4975
|
}, []);
|
|
4979
|
-
const
|
|
4976
|
+
const b = X(() => a ? Da(a) : {}, [a]);
|
|
4980
4977
|
return /* @__PURE__ */ t("div", { ref: c, className: i, style: f, children: g && Er(
|
|
4981
4978
|
/* @__PURE__ */ u(Me, { children: [
|
|
4982
4979
|
/* @__PURE__ */ u("style", { "data-fanfare-styles": !0, children: [
|
|
4983
4980
|
_o,
|
|
4984
4981
|
No
|
|
4985
4982
|
] }),
|
|
4986
|
-
/* @__PURE__ */ t(Na, { locale: n, translations: o, children: /* @__PURE__ */ t(Rt, { theme: a, variant: r, className: "ff:h-full ff:w-full", children: /* @__PURE__ */ t("div", { className: "fanfare-root ff:h-full ff:w-full", style:
|
|
4983
|
+
/* @__PURE__ */ t(Na, { locale: n, translations: o, children: /* @__PURE__ */ t(Rt, { theme: a, variant: r, className: "ff:h-full ff:w-full", children: /* @__PURE__ */ t("div", { className: "fanfare-root ff:h-full ff:w-full", style: b, children: e }) }) })
|
|
4987
4984
|
] }),
|
|
4988
4985
|
g
|
|
4989
4986
|
) });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fanfare-io/fanfare-sdk-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "React adapter for Fanfare SDK",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"nanostores": "^1.1.0",
|
|
44
44
|
"tailwind-merge": "^2.6.0",
|
|
45
45
|
"valibot": "^1.1.0",
|
|
46
|
-
"@fanfare-io/fanfare-sdk-core": "0.
|
|
47
|
-
"@fanfare-io/fanfare-sdk-i18n": "0.
|
|
46
|
+
"@fanfare-io/fanfare-sdk-core": "0.9.0",
|
|
47
|
+
"@fanfare-io/fanfare-sdk-i18n": "0.9.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@iconify-json/heroicons": "^1.2.3",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"vite-plugin-dts": "^4.5.4",
|
|
89
89
|
"vite-tsconfig-paths": "^5.1.4",
|
|
90
90
|
"vitest": "^3.2.4",
|
|
91
|
-
"@fanfare-io/fanfare-sdk-core": "0.
|
|
92
|
-
"@fanfare-io/fanfare-sdk-solid": "0.
|
|
91
|
+
"@fanfare-io/fanfare-sdk-core": "0.9.0",
|
|
92
|
+
"@fanfare-io/fanfare-sdk-solid": "0.9.0"
|
|
93
93
|
},
|
|
94
94
|
"sideEffects": [
|
|
95
95
|
"**/*.css"
|