@cedros/pay-react 1.1.15 → 1.1.16
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/components/admin/configApi.d.ts.map +1 -1
- package/dist/crypto-only.js +1 -1
- package/dist/crypto-only.mjs +2 -2
- package/dist/{index-DW6XWuRP.js → index-BU0vgA-7.js} +17 -17
- package/dist/{index-BjxGupjw.mjs → index-DWXEBUbu.mjs} +586 -567
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{sections-DG4Ws13b.js → sections-CL3lbNui.js} +1 -1
- package/dist/{sections-Dl8qjlql.mjs → sections-DnmB0qdx.mjs} +1 -1
- package/dist/stripe-only.js +1 -1
- package/dist/stripe-only.mjs +1 -1
- package/package.json +1 -1
|
@@ -311,12 +311,12 @@ function Co(e) {
|
|
|
311
311
|
technicalHint: `Unknown error code: ${e}`
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
|
-
const Al = /* @__PURE__ */ new Map(), ss = /* @__PURE__ */ new Map(), is = /* @__PURE__ */ new Map(),
|
|
314
|
+
const Al = /* @__PURE__ */ new Map(), ss = /* @__PURE__ */ new Map(), is = /* @__PURE__ */ new Map(), Tl = 200, Os = 2e3;
|
|
315
315
|
function Xp(e) {
|
|
316
316
|
const t = is.get(e);
|
|
317
317
|
return t ? Date.now() < t ? !0 : (is.delete(e), !1) : !1;
|
|
318
318
|
}
|
|
319
|
-
function Jp(e, t =
|
|
319
|
+
function Jp(e, t = Tl) {
|
|
320
320
|
const n = Date.now() + t;
|
|
321
321
|
is.set(e, n);
|
|
322
322
|
}
|
|
@@ -353,7 +353,7 @@ async function of(e, t, n = {}) {
|
|
|
353
353
|
return rf(e, i);
|
|
354
354
|
}
|
|
355
355
|
function lr(e, t, n = {}) {
|
|
356
|
-
const { cooldownMs: r =
|
|
356
|
+
const { cooldownMs: r = Tl, deduplicationWindowMs: a = Os } = n;
|
|
357
357
|
return async () => {
|
|
358
358
|
if (Xp(e)) {
|
|
359
359
|
fe().debug(`[Deduplication] Button in cooldown: ${e}`);
|
|
@@ -376,7 +376,7 @@ function lr(e, t, n = {}) {
|
|
|
376
376
|
}
|
|
377
377
|
};
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function El(e) {
|
|
380
380
|
return {
|
|
381
381
|
background: "none",
|
|
382
382
|
border: "none",
|
|
@@ -859,14 +859,14 @@ const mf = (e, t, n) => {
|
|
|
859
859
|
return r ? typeof r == "function" ? r() : Promise.resolve(r) : new Promise((a, s) => {
|
|
860
860
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(s.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + t + (t.split("/").length !== n ? ". Note that variables only represent file names one level deep." : ""))));
|
|
861
861
|
});
|
|
862
|
-
},
|
|
862
|
+
}, Ta = /* @__PURE__ */ new Map();
|
|
863
863
|
let Jr = null;
|
|
864
864
|
async function Ji(e) {
|
|
865
|
-
if (
|
|
866
|
-
return
|
|
865
|
+
if (Ta.has(e))
|
|
866
|
+
return Ta.get(e);
|
|
867
867
|
try {
|
|
868
868
|
const t = await mf(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-w27mU-4x.mjs"), "./translations/bn.json": () => import("./bn-Ba_k3Kex.mjs"), "./translations/de.json": () => import("./de-CoZiPFN7.mjs"), "./translations/en.json": () => import("./en-BXheDBal.mjs"), "./translations/es.json": () => import("./es-BWGIBp2f.mjs"), "./translations/fil.json": () => import("./fil-Czo27xmj.mjs"), "./translations/fr.json": () => import("./fr-DQ-2ThBv.mjs"), "./translations/he.json": () => import("./he-DpV1WnBQ.mjs"), "./translations/id.json": () => import("./id-BJMqsu19.mjs"), "./translations/in.json": () => import("./in-BxgxKLQH.mjs"), "./translations/it.json": () => import("./it-DZFFPALf.mjs"), "./translations/jp.json": () => import("./jp-ZExTrlHK.mjs"), "./translations/kr.json": () => import("./kr-DHX3i4Ht.mjs"), "./translations/ms.json": () => import("./ms-Cv1fdIi2.mjs"), "./translations/nl.json": () => import("./nl-BmGonsKb.mjs"), "./translations/pa.json": () => import("./pa-BfwcJIar.mjs"), "./translations/pl.json": () => import("./pl-DE5IB9xv.mjs"), "./translations/pt.json": () => import("./pt-CLzkqDzf.mjs"), "./translations/ru.json": () => import("./ru-DM6-oUR0.mjs"), "./translations/ta.json": () => import("./ta-A5HnrGb5.mjs"), "./translations/th.json": () => import("./th-3fbB3Ytp.mjs"), "./translations/tr.json": () => import("./tr-BrgfFFdq.mjs"), "./translations/uk.json": () => import("./uk-0hFun_g_.mjs"), "./translations/ur.json": () => import("./ur-CaOjJXai.mjs"), "./translations/vn.json": () => import("./vn-0nlIZFLP.mjs"), "./translations/zh.json": () => import("./zh-B4Endr1F.mjs") }), `./translations/${e}.json`, 3), n = t.default || t;
|
|
869
|
-
return
|
|
869
|
+
return Ta.set(e, n), n;
|
|
870
870
|
} catch {
|
|
871
871
|
return null;
|
|
872
872
|
}
|
|
@@ -975,20 +975,20 @@ function Il({
|
|
|
975
975
|
onError: m,
|
|
976
976
|
className: f = ""
|
|
977
977
|
}) {
|
|
978
|
-
const { status: g, error: x, transactionId: y, processPayment: h, processCartCheckout: _ } = Ms(), k = pn(), { isCartMode: w, effectiveResource: b } = Gr(e, t), { t: S, translations: O } = Vn(), P = c || S("ui.pay_with_card"), N = k.unstyled ? f : `${k.className} cedros-theme__stripe-button ${f}`.trim(), I = x && typeof x != "string" ? x?.code ?? null : null, z = x ? typeof x == "string" ? x : ((
|
|
979
|
-
if (!
|
|
980
|
-
const A = O.errors[
|
|
978
|
+
const { status: g, error: x, transactionId: y, processPayment: h, processCartCheckout: _ } = Ms(), k = pn(), { isCartMode: w, effectiveResource: b } = Gr(e, t), { t: S, translations: O } = Vn(), P = c || S("ui.pay_with_card"), N = k.unstyled ? f : `${k.className} cedros-theme__stripe-button ${f}`.trim(), I = x && typeof x != "string" ? x?.code ?? null : null, z = x ? typeof x == "string" ? x : ((E) => {
|
|
979
|
+
if (!E || !O) return "";
|
|
980
|
+
const A = O.errors[E];
|
|
981
981
|
return A ? A.action ? `${A.message} ${A.action}` : A.message : "";
|
|
982
982
|
})(I) : null, C = J(async () => {
|
|
983
983
|
fe().debug("[StripeButton] executePayment with couponCode:", i);
|
|
984
|
-
const
|
|
985
|
-
if (dr("stripe", b,
|
|
984
|
+
const E = w && t ? vn(t) : void 0;
|
|
985
|
+
if (dr("stripe", b, E), u && u("stripe"), !w && !b) {
|
|
986
986
|
const F = "Invalid payment configuration: missing resource or items";
|
|
987
|
-
fe().error("[StripeButton]", F), Ft("stripe", F, b,
|
|
987
|
+
fe().error("[StripeButton]", F), Ft("stripe", F, b, E), m && m(F);
|
|
988
988
|
return;
|
|
989
989
|
}
|
|
990
990
|
let A;
|
|
991
|
-
Dn("stripe", b,
|
|
991
|
+
Dn("stripe", b, E), w && t ? (fe().debug("[StripeButton] Processing cart checkout with coupon:", i), A = await _(
|
|
992
992
|
t,
|
|
993
993
|
n,
|
|
994
994
|
r,
|
|
@@ -1002,10 +1002,10 @@ function Il({
|
|
|
1002
1002
|
a,
|
|
1003
1003
|
s,
|
|
1004
1004
|
i
|
|
1005
|
-
)), A && A.success && A.transactionId ? (ur("stripe", A.transactionId, b,
|
|
1006
|
-
}, [i, w, b, t, n, r, a, s, _, h, u, p, m]),
|
|
1007
|
-
() => lr(
|
|
1008
|
-
[
|
|
1005
|
+
)), A && A.success && A.transactionId ? (ur("stripe", A.transactionId, b, E), p && p(A.transactionId)) : A && !A.success && A.error && (Ft("stripe", A.error, b, E), m && m(A.error));
|
|
1006
|
+
}, [i, w, b, t, n, r, a, s, _, h, u, p, m]), T = Se(() => w && t ? `stripe-cart-${t.map((E) => E.resource).join("-")}` : `stripe-${b || "unknown"}`, [w, t, b]), R = Se(
|
|
1007
|
+
() => lr(T, C),
|
|
1008
|
+
[T, C]
|
|
1009
1009
|
), j = g === "loading", L = l || j;
|
|
1010
1010
|
return /* @__PURE__ */ d("div", { className: N, style: k.unstyled ? {} : k.style, children: [
|
|
1011
1011
|
/* @__PURE__ */ o(
|
|
@@ -1200,13 +1200,13 @@ function Rl({
|
|
|
1200
1200
|
fe().debug("[CreditsButton] executePayment");
|
|
1201
1201
|
const j = _ && t ? vn(t) : void 0;
|
|
1202
1202
|
if (dr("credits", k, j), c && c("credits"), !n) {
|
|
1203
|
-
const
|
|
1204
|
-
fe().error("[CreditsButton]",
|
|
1203
|
+
const E = "Authentication required: please log in to pay with credits";
|
|
1204
|
+
fe().error("[CreditsButton]", E), Ft("credits", E, k, j), u && u(E);
|
|
1205
1205
|
return;
|
|
1206
1206
|
}
|
|
1207
1207
|
if (!_ && !k) {
|
|
1208
|
-
const
|
|
1209
|
-
fe().error("[CreditsButton]",
|
|
1208
|
+
const E = "Invalid payment configuration: missing resource";
|
|
1209
|
+
fe().error("[CreditsButton]", E), Ft("credits", E, k, j), u && u(E);
|
|
1210
1210
|
return;
|
|
1211
1211
|
}
|
|
1212
1212
|
let L;
|
|
@@ -1226,7 +1226,7 @@ function Rl({
|
|
|
1226
1226
|
]), z = Se(() => _ && t ? `credits-cart-${t.map((j) => j.resource).join("-")}` : `credits-${k || "unknown"}`, [_, t, k]), C = Se(
|
|
1227
1227
|
() => lr(z, M),
|
|
1228
1228
|
[z, M]
|
|
1229
|
-
),
|
|
1229
|
+
), T = m === "loading", R = i || T;
|
|
1230
1230
|
return /* @__PURE__ */ d("div", { className: O, style: h.unstyled ? {} : h.style, children: [
|
|
1231
1231
|
/* @__PURE__ */ o(
|
|
1232
1232
|
"button",
|
|
@@ -1235,7 +1235,7 @@ function Rl({
|
|
|
1235
1235
|
disabled: R,
|
|
1236
1236
|
className: h.unstyled ? p : "cedros-theme__button cedros-theme__credits",
|
|
1237
1237
|
type: "button",
|
|
1238
|
-
children:
|
|
1238
|
+
children: T ? w("ui.processing") : S
|
|
1239
1239
|
}
|
|
1240
1240
|
),
|
|
1241
1241
|
I && /* @__PURE__ */ o("div", { className: h.unstyled ? "" : "cedros-theme__error", children: I }),
|
|
@@ -1437,11 +1437,11 @@ function Ol({
|
|
|
1437
1437
|
metadata: p,
|
|
1438
1438
|
couponCode: m
|
|
1439
1439
|
}) {
|
|
1440
|
-
const { connected: f, connecting: g, connect: x, disconnect: y, select: h, wallets: _, wallet: k, publicKey: w } = Rs(), { status: b, error: S, transactionId: O, processPayment: P, processCartPayment: N } = yf(), I = pn(), { solanaError: M } = kn(), { isCartMode: z, effectiveResource: C } = Gr(e, t), { t:
|
|
1440
|
+
const { connected: f, connecting: g, connect: x, disconnect: y, select: h, wallets: _, wallet: k, publicKey: w } = Rs(), { status: b, error: S, transactionId: O, processPayment: P, processCartPayment: N } = yf(), I = pn(), { solanaError: M } = kn(), { isCartMode: z, effectiveResource: C } = Gr(e, t), { t: T, translations: R } = Vn(), j = n || T("ui.pay_with_crypto"), L = S && typeof S != "string" ? S?.code ?? null : null, E = M && typeof M != "string" ? M?.code ?? null : null, A = (re) => {
|
|
1441
1441
|
if (!re || !R) return "";
|
|
1442
1442
|
const _e = R.errors[re];
|
|
1443
1443
|
return _e ? _e.action ? `${_e.message} ${_e.action}` : _e.message : "";
|
|
1444
|
-
}, F = S ? typeof S == "string" ? S : A(L) : null, Q = M ? typeof M == "string" ? M : A(
|
|
1444
|
+
}, F = S ? typeof S == "string" ? S : A(L) : null, Q = M ? typeof M == "string" ? M : A(E) : null, ee = tt(P), $ = tt(N);
|
|
1445
1445
|
ve(() => {
|
|
1446
1446
|
ee.current = P, $.current = N;
|
|
1447
1447
|
}, [P, N]);
|
|
@@ -1560,7 +1560,7 @@ function Ol({
|
|
|
1560
1560
|
// MUST be 0 for crypto - each payment needs fresh transaction
|
|
1561
1561
|
}),
|
|
1562
1562
|
[Me, ye]
|
|
1563
|
-
), Ke = b === "loading", Xe = r || Ke || g || !!ue, St = Ke ?
|
|
1563
|
+
), Ke = b === "loading", Xe = r || Ke || g || !!ue, St = Ke ? T("ui.processing") : j, et = J(async () => {
|
|
1564
1564
|
try {
|
|
1565
1565
|
ge(!1), f && await y(), h(null), B(!0);
|
|
1566
1566
|
} catch (re) {
|
|
@@ -1643,14 +1643,14 @@ function Ol({
|
|
|
1643
1643
|
fontWeight: 600,
|
|
1644
1644
|
color: I.tokens.surfaceText
|
|
1645
1645
|
},
|
|
1646
|
-
children:
|
|
1646
|
+
children: T("wallet.select_wallet")
|
|
1647
1647
|
}
|
|
1648
1648
|
),
|
|
1649
1649
|
/* @__PURE__ */ o(
|
|
1650
1650
|
"button",
|
|
1651
1651
|
{
|
|
1652
1652
|
onClick: () => B(!1),
|
|
1653
|
-
style:
|
|
1653
|
+
style: El(I.tokens.surfaceText),
|
|
1654
1654
|
"aria-label": "Close modal",
|
|
1655
1655
|
type: "button",
|
|
1656
1656
|
children: "×"
|
|
@@ -1736,13 +1736,13 @@ function Ol({
|
|
|
1736
1736
|
fontSize: "inherit"
|
|
1737
1737
|
},
|
|
1738
1738
|
type: "button",
|
|
1739
|
-
children:
|
|
1739
|
+
children: T("ui.disconnect")
|
|
1740
1740
|
}
|
|
1741
1741
|
)
|
|
1742
1742
|
] }),
|
|
1743
1743
|
!u && Q && /* @__PURE__ */ o("div", { className: I.unstyled ? "" : "cedros-theme__error", children: Q }),
|
|
1744
1744
|
!u && F && /* @__PURE__ */ o("div", { className: I.unstyled ? "" : "cedros-theme__error", children: F }),
|
|
1745
|
-
!u && O && /* @__PURE__ */ o("div", { className: I.unstyled ? "" : "cedros-theme__success", children:
|
|
1745
|
+
!u && O && /* @__PURE__ */ o("div", { className: I.unstyled ? "" : "cedros-theme__success", children: T("ui.payment_successful") })
|
|
1746
1746
|
] });
|
|
1747
1747
|
}
|
|
1748
1748
|
const vf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -1779,16 +1779,16 @@ const vf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1779
1779
|
}) => {
|
|
1780
1780
|
const { tokens: z } = pn();
|
|
1781
1781
|
return ve(() => {
|
|
1782
|
-
const C = (
|
|
1783
|
-
|
|
1782
|
+
const C = (T) => {
|
|
1783
|
+
T.key === "Escape" && e && t();
|
|
1784
1784
|
};
|
|
1785
1785
|
return window.addEventListener("keydown", C), () => window.removeEventListener("keydown", C);
|
|
1786
1786
|
}, [e, t]), ve(() => {
|
|
1787
1787
|
if (e) {
|
|
1788
1788
|
const C = window.scrollY;
|
|
1789
1789
|
return document.body.style.position = "fixed", document.body.style.top = `-${C}px`, document.body.style.width = "100%", document.body.style.overflowY = "scroll", () => {
|
|
1790
|
-
const
|
|
1791
|
-
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", document.body.style.overflowY = "", window.scrollTo(0,
|
|
1790
|
+
const T = document.body.style.top ? Math.abs(parseInt(document.body.style.top.replace("px", ""), 10)) : 0;
|
|
1791
|
+
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", document.body.style.overflowY = "", window.scrollTo(0, T);
|
|
1792
1792
|
};
|
|
1793
1793
|
}
|
|
1794
1794
|
}, [e]), e ? /* @__PURE__ */ o(
|
|
@@ -1850,7 +1850,7 @@ const vf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1850
1850
|
"button",
|
|
1851
1851
|
{
|
|
1852
1852
|
onClick: t,
|
|
1853
|
-
style:
|
|
1853
|
+
style: El(z.surfaceText),
|
|
1854
1854
|
"aria-label": "Close modal",
|
|
1855
1855
|
children: "×"
|
|
1856
1856
|
}
|
|
@@ -1940,14 +1940,14 @@ const vf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1940
1940
|
hideMessages: M = !1,
|
|
1941
1941
|
renderModal: z
|
|
1942
1942
|
}) => {
|
|
1943
|
-
const C = pn(), [
|
|
1943
|
+
const C = pn(), [T, R] = H(!1), { status: j, processPayment: L, processCartCheckout: E } = Ms(), { isCartMode: A, effectiveResource: F } = Gr(e, t), { t: Q } = Vn(), ee = n || Q("ui.purchase"), $ = r || Q("ui.card"), W = a || Q("ui.usdc_solana"), X = s || Q("ui.pay_with_credits") || "Pay with Credits", q = J(async () => {
|
|
1944
1944
|
if (N && i) {
|
|
1945
1945
|
const { detectSolanaWallets: Z } = await Promise.resolve().then(() => xN);
|
|
1946
1946
|
if (!Z()) {
|
|
1947
1947
|
const oe = A ? void 0 : F, ue = A && t ? vn(t) : void 0;
|
|
1948
1948
|
dr("stripe", oe, ue), u && u("stripe"), Dn("stripe", oe, ue);
|
|
1949
1949
|
let ye;
|
|
1950
|
-
A && t ? ye = await
|
|
1950
|
+
A && t ? ye = await E(
|
|
1951
1951
|
t,
|
|
1952
1952
|
w,
|
|
1953
1953
|
b,
|
|
@@ -1966,11 +1966,11 @@ const vf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
1968
|
R(!0);
|
|
1969
|
-
}, [N, i, A, t, F,
|
|
1969
|
+
}, [N, i, A, t, F, E, L, w, b, S, k, O, p, m, f, y, u]), de = Se(() => A && t ? `purchase-cart-${t.map((Z) => Z.resource).join("-")}` : `purchase-${F || "unknown"}`, [A, t, F]), B = Se(
|
|
1970
1970
|
() => lr(de, q),
|
|
1971
1971
|
[de, q]
|
|
1972
1972
|
), ne = j === "loading", ge = {
|
|
1973
|
-
isOpen:
|
|
1973
|
+
isOpen: T,
|
|
1974
1974
|
onClose: () => R(!1),
|
|
1975
1975
|
resource: A ? void 0 : F,
|
|
1976
1976
|
items: A ? t : void 0,
|
|
@@ -2098,7 +2098,7 @@ function g1(e) {
|
|
|
2098
2098
|
), O = m ? c.solanaEndpoint ?? _f[c.solanaCluster] : "";
|
|
2099
2099
|
if (!t && (!n || n.length === 0))
|
|
2100
2100
|
return fe().error('CedrosPay: Must provide either "resource" or "items" prop'), /* @__PURE__ */ o("div", { className: a.className, style: { color: u.tokens.errorText }, children: "Configuration error: No resource or items provided" });
|
|
2101
|
-
const P = a.showCard ?? !0, N = a.showCredits ?? !1, I = a.showPurchaseButton ?? !1, M = a.layout ?? "vertical", z = a.hideMessages ?? !1, C = i.autoDetectWallets ?? !0,
|
|
2101
|
+
const P = a.showCard ?? !0, N = a.showCredits ?? !1, I = a.showPurchaseButton ?? !1, M = a.layout ?? "vertical", z = a.hideMessages ?? !1, C = i.autoDetectWallets ?? !0, T = /* @__PURE__ */ o("div", { className: u.unstyled ? a.className : `cedros-theme__pay ${a.className || ""}`, children: /* @__PURE__ */ d("div", { className: u.unstyled ? "" : `cedros-theme__pay-content cedros-theme__pay-content--${M}`, children: [
|
|
2102
2102
|
I ? /* @__PURE__ */ o(
|
|
2103
2103
|
wf,
|
|
2104
2104
|
{
|
|
@@ -2179,7 +2179,7 @@ function g1(e) {
|
|
|
2179
2179
|
" items"
|
|
2180
2180
|
] })
|
|
2181
2181
|
] }) });
|
|
2182
|
-
return /* @__PURE__ */ o("div", { className: u.unstyled ? a.className : u.className, style: u.unstyled ? {} : u.style, children: m ? /* @__PURE__ */ o(kf, { endpoint: O, wallets: g, children:
|
|
2182
|
+
return /* @__PURE__ */ o("div", { className: u.unstyled ? a.className : u.className, style: u.unstyled ? {} : u.style, children: m ? /* @__PURE__ */ o(kf, { endpoint: O, wallets: g, children: T }) : T });
|
|
2183
2183
|
}
|
|
2184
2184
|
const K = {
|
|
2185
2185
|
products: /* @__PURE__ */ d("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -2878,7 +2878,7 @@ function Pf(e) {
|
|
|
2878
2878
|
function Af(e) {
|
|
2879
2879
|
return e.optionValueIds?.length ? [...e.optionValueIds].sort().join("|") : Object.entries(e.options).sort(([t], [n]) => t.localeCompare(n)).map(([t, n]) => `${t}:${n}`).join("|");
|
|
2880
2880
|
}
|
|
2881
|
-
function
|
|
2881
|
+
function Tf({
|
|
2882
2882
|
variationConfig: e,
|
|
2883
2883
|
variants: t,
|
|
2884
2884
|
onChange: n,
|
|
@@ -3093,7 +3093,7 @@ function Ef({
|
|
|
3093
3093
|
] }) })
|
|
3094
3094
|
] });
|
|
3095
3095
|
}
|
|
3096
|
-
function
|
|
3096
|
+
function Ef({
|
|
3097
3097
|
serverUrl: e,
|
|
3098
3098
|
productId: t,
|
|
3099
3099
|
productTitle: n,
|
|
@@ -3198,7 +3198,7 @@ function Tf({
|
|
|
3198
3198
|
}
|
|
3199
3199
|
) }),
|
|
3200
3200
|
x.variationTypes.length > 0 && /* @__PURE__ */ o("div", { className: "cedros-admin__variations-editor-section", children: /* @__PURE__ */ o(
|
|
3201
|
-
|
|
3201
|
+
Tf,
|
|
3202
3202
|
{
|
|
3203
3203
|
variationConfig: x,
|
|
3204
3204
|
variants: h,
|
|
@@ -3235,40 +3235,40 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3235
3235
|
fulfillmentNotes: "",
|
|
3236
3236
|
shippingCountriesCsv: "",
|
|
3237
3237
|
inventoryQuantity: ""
|
|
3238
|
-
}), O = (
|
|
3239
|
-
const A =
|
|
3240
|
-
email:
|
|
3241
|
-
name:
|
|
3242
|
-
phone:
|
|
3243
|
-
shippingAddress:
|
|
3244
|
-
billingAddress:
|
|
3245
|
-
}, ee =
|
|
3246
|
-
title:
|
|
3247
|
-
slug:
|
|
3238
|
+
}), O = (E) => {
|
|
3239
|
+
const A = E.tagsCsv.split(",").map((q) => q.trim()).filter(Boolean), F = E.categoryIdsCsv.split(",").map((q) => q.trim()).filter(Boolean), Q = {
|
|
3240
|
+
email: E.checkoutEmail,
|
|
3241
|
+
name: E.checkoutName,
|
|
3242
|
+
phone: E.checkoutPhone,
|
|
3243
|
+
shippingAddress: E.checkoutShippingAddress,
|
|
3244
|
+
billingAddress: E.checkoutBillingAddress
|
|
3245
|
+
}, ee = E.fulfillmentType === "shipping" ? "physical" : "digital", $ = {
|
|
3246
|
+
title: E.title,
|
|
3247
|
+
slug: E.slug || E.id,
|
|
3248
3248
|
shipping_profile: ee,
|
|
3249
|
-
inventory_status:
|
|
3249
|
+
inventory_status: E.inventoryStatus,
|
|
3250
3250
|
checkout_requirements: JSON.stringify(Q),
|
|
3251
|
-
fulfillment_type:
|
|
3251
|
+
fulfillment_type: E.fulfillmentType
|
|
3252
3252
|
};
|
|
3253
|
-
|
|
3254
|
-
const W =
|
|
3255
|
-
W && ($.compare_at_amount_cents = String(W)), A.length && ($.tags = JSON.stringify(A)), F.length && ($.category_ids = JSON.stringify(F)),
|
|
3256
|
-
const X =
|
|
3253
|
+
E.imageUrl && ($.image_url = E.imageUrl);
|
|
3254
|
+
const W = E.compareAtUsd ? Math.round(Number(E.compareAtUsd) * 100) : 0;
|
|
3255
|
+
W && ($.compare_at_amount_cents = String(W)), A.length && ($.tags = JSON.stringify(A)), F.length && ($.category_ids = JSON.stringify(F)), E.fulfillmentNotes && ($.fulfillment_notes = E.fulfillmentNotes);
|
|
3256
|
+
const X = E.shippingCountriesCsv.split(",").map((q) => q.trim().toUpperCase()).filter(Boolean);
|
|
3257
3257
|
return X.length && ($.shippingCountries = X.join(","), $.shipping_countries = X.join(",")), $;
|
|
3258
|
-
}, P = (
|
|
3258
|
+
}, P = (E) => E.metadata?.title || E.description || E.id, N = (E) => E.metadata?.image_url, I = J(async () => {
|
|
3259
3259
|
try {
|
|
3260
3260
|
w(null);
|
|
3261
|
-
let
|
|
3261
|
+
let E;
|
|
3262
3262
|
if (r?.isAuthenticated())
|
|
3263
|
-
|
|
3263
|
+
E = await r.fetchWithAuth(`/admin/products?limit=${n}`);
|
|
3264
3264
|
else {
|
|
3265
3265
|
const A = { "Content-Type": "application/json" };
|
|
3266
3266
|
t && (A["X-API-Key"] = t);
|
|
3267
3267
|
const F = await fetch(`${e}/admin/products?limit=${n}`, { headers: A });
|
|
3268
3268
|
if (!F.ok) throw new Error(`Failed to fetch products: ${F.status}`);
|
|
3269
|
-
|
|
3269
|
+
E = await F.json();
|
|
3270
3270
|
}
|
|
3271
|
-
s(
|
|
3271
|
+
s(E.products || []);
|
|
3272
3272
|
} catch {
|
|
3273
3273
|
s([]), w("Failed to load products");
|
|
3274
3274
|
} finally {
|
|
@@ -3278,8 +3278,8 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3278
3278
|
ve(() => {
|
|
3279
3279
|
I();
|
|
3280
3280
|
}, [I]);
|
|
3281
|
-
const M = async (
|
|
3282
|
-
if (
|
|
3281
|
+
const M = async (E) => {
|
|
3282
|
+
if (E.preventDefault(), !(!b.id || !b.description)) {
|
|
3283
3283
|
if (g(null), b.fulfillmentType === "shipping" && b.checkoutShippingAddress && !b.shippingCountriesCsv.split(",").map((F) => F.trim()).filter(Boolean).length) {
|
|
3284
3284
|
g("Shipping countries are required when collecting shipping address. Example: US,CA");
|
|
3285
3285
|
return;
|
|
@@ -3344,8 +3344,8 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3344
3344
|
m(!1);
|
|
3345
3345
|
}
|
|
3346
3346
|
}
|
|
3347
|
-
}, z = (
|
|
3348
|
-
switch (
|
|
3347
|
+
}, z = (E) => `$${(E / 100).toFixed(2)}`, C = (E) => {
|
|
3348
|
+
switch (E) {
|
|
3349
3349
|
case "subscription":
|
|
3350
3350
|
return "Subscription";
|
|
3351
3351
|
case "pay_per_access":
|
|
@@ -3355,17 +3355,17 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3355
3355
|
default:
|
|
3356
3356
|
return "One-time purchase";
|
|
3357
3357
|
}
|
|
3358
|
-
},
|
|
3359
|
-
const
|
|
3358
|
+
}, T = Se(() => {
|
|
3359
|
+
const E = a.filter((F) => F.active).length, A = a.reduce((F, Q) => {
|
|
3360
3360
|
const ee = Q.variations?.length ?? 0;
|
|
3361
3361
|
return F + (ee > 0 ? ee : 1);
|
|
3362
3362
|
}, 0);
|
|
3363
|
-
return { activeCount:
|
|
3364
|
-
}, [a]), R = (
|
|
3365
|
-
_((A) => !A || A.key !==
|
|
3366
|
-
}, j = (
|
|
3363
|
+
return { activeCount: E, totalSkus: A };
|
|
3364
|
+
}, [a]), R = (E) => {
|
|
3365
|
+
_((A) => !A || A.key !== E ? { key: E, direction: "asc" } : { key: E, direction: A.direction === "asc" ? "desc" : "asc" });
|
|
3366
|
+
}, j = (E) => !h || h.key !== E ? /* @__PURE__ */ o("span", { className: "cedros-admin__sort-icon cedros-admin__sort-icon--idle", children: K.chevronUp }) : /* @__PURE__ */ o("span", { className: "cedros-admin__sort-icon", children: h.direction === "asc" ? K.chevronUp : K.chevronDown }), L = Se(() => {
|
|
3367
3367
|
if (!h) return a;
|
|
3368
|
-
const
|
|
3368
|
+
const E = h.direction === "asc" ? 1 : -1, A = (F) => {
|
|
3369
3369
|
switch (h.key) {
|
|
3370
3370
|
case "product":
|
|
3371
3371
|
return P(F);
|
|
@@ -3382,7 +3382,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3382
3382
|
};
|
|
3383
3383
|
return [...a].sort((F, Q) => {
|
|
3384
3384
|
const ee = A(F), $ = A(Q);
|
|
3385
|
-
return typeof ee == "number" && typeof $ == "number" ? (ee - $) *
|
|
3385
|
+
return typeof ee == "number" && typeof $ == "number" ? (ee - $) * E : String(ee).localeCompare(String($), void 0, { sensitivity: "base" }) * E;
|
|
3386
3386
|
});
|
|
3387
3387
|
}, [a, h]);
|
|
3388
3388
|
return /* @__PURE__ */ d("div", { className: "cedros-admin__page", children: [
|
|
@@ -3392,8 +3392,8 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3392
3392
|
{
|
|
3393
3393
|
stats: [
|
|
3394
3394
|
{ label: "Total Products", value: a.length },
|
|
3395
|
-
{ label: "Active", value:
|
|
3396
|
-
{ label: "Total SKUs", value:
|
|
3395
|
+
{ label: "Active", value: T.activeCount, variant: T.activeCount > 0 ? "success" : "muted" },
|
|
3396
|
+
{ label: "Total SKUs", value: T.totalSkus }
|
|
3397
3397
|
],
|
|
3398
3398
|
isLoading: i
|
|
3399
3399
|
}
|
|
@@ -3425,7 +3425,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3425
3425
|
type: "text",
|
|
3426
3426
|
className: "cedros-admin__input",
|
|
3427
3427
|
value: b.id,
|
|
3428
|
-
onChange: (
|
|
3428
|
+
onChange: (E) => S((A) => ({ ...A, id: E.target.value })),
|
|
3429
3429
|
placeholder: "e.g., premium-article",
|
|
3430
3430
|
required: !0
|
|
3431
3431
|
}
|
|
@@ -3439,7 +3439,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3439
3439
|
type: "text",
|
|
3440
3440
|
className: "cedros-admin__input",
|
|
3441
3441
|
value: b.title,
|
|
3442
|
-
onChange: (
|
|
3442
|
+
onChange: (E) => S((A) => ({ ...A, title: E.target.value })),
|
|
3443
3443
|
placeholder: "e.g., Cedros Hoodie"
|
|
3444
3444
|
}
|
|
3445
3445
|
)
|
|
@@ -3454,7 +3454,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3454
3454
|
type: "text",
|
|
3455
3455
|
className: "cedros-admin__input",
|
|
3456
3456
|
value: b.slug,
|
|
3457
|
-
onChange: (
|
|
3457
|
+
onChange: (E) => S((A) => ({ ...A, slug: E.target.value })),
|
|
3458
3458
|
placeholder: "e.g., cedros-hoodie (defaults to ID)"
|
|
3459
3459
|
}
|
|
3460
3460
|
)
|
|
@@ -3467,7 +3467,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3467
3467
|
type: "url",
|
|
3468
3468
|
className: "cedros-admin__input",
|
|
3469
3469
|
value: b.imageUrl,
|
|
3470
|
-
onChange: (
|
|
3470
|
+
onChange: (E) => S((A) => ({ ...A, imageUrl: E.target.value })),
|
|
3471
3471
|
placeholder: "https://..."
|
|
3472
3472
|
}
|
|
3473
3473
|
)
|
|
@@ -3481,7 +3481,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3481
3481
|
type: "text",
|
|
3482
3482
|
className: "cedros-admin__input",
|
|
3483
3483
|
value: b.description,
|
|
3484
|
-
onChange: (
|
|
3484
|
+
onChange: (E) => S((A) => ({ ...A, description: E.target.value })),
|
|
3485
3485
|
placeholder: "e.g., Midweight fleece with relaxed fit",
|
|
3486
3486
|
required: !0
|
|
3487
3487
|
}
|
|
@@ -3492,7 +3492,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3492
3492
|
mt,
|
|
3493
3493
|
{
|
|
3494
3494
|
value: b.productType,
|
|
3495
|
-
onChange: (
|
|
3495
|
+
onChange: (E) => S((A) => ({ ...A, productType: E })),
|
|
3496
3496
|
options: [
|
|
3497
3497
|
{ value: "one_time", label: "One-time purchase" },
|
|
3498
3498
|
{ value: "pay_per_access", label: "Pay per access" },
|
|
@@ -3505,8 +3505,8 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3505
3505
|
mt,
|
|
3506
3506
|
{
|
|
3507
3507
|
value: b.fulfillmentType,
|
|
3508
|
-
onChange: (
|
|
3509
|
-
const A =
|
|
3508
|
+
onChange: (E) => {
|
|
3509
|
+
const A = E;
|
|
3510
3510
|
S((F) => ({
|
|
3511
3511
|
...F,
|
|
3512
3512
|
fulfillmentType: A,
|
|
@@ -3527,9 +3527,9 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3527
3527
|
mt,
|
|
3528
3528
|
{
|
|
3529
3529
|
value: b.inventoryStatus,
|
|
3530
|
-
onChange: (
|
|
3530
|
+
onChange: (E) => S((A) => ({
|
|
3531
3531
|
...A,
|
|
3532
|
-
inventoryStatus:
|
|
3532
|
+
inventoryStatus: E
|
|
3533
3533
|
})),
|
|
3534
3534
|
options: [
|
|
3535
3535
|
{ value: "in_stock", label: "In stock" },
|
|
@@ -3548,9 +3548,9 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3548
3548
|
type: "number",
|
|
3549
3549
|
className: "cedros-admin__input",
|
|
3550
3550
|
value: b.inventoryQuantity,
|
|
3551
|
-
onChange: (
|
|
3551
|
+
onChange: (E) => S((A) => ({
|
|
3552
3552
|
...A,
|
|
3553
|
-
inventoryQuantity:
|
|
3553
|
+
inventoryQuantity: E.target.value === "" ? "" : parseInt(E.target.value) || 0
|
|
3554
3554
|
})),
|
|
3555
3555
|
placeholder: "Leave blank for untracked",
|
|
3556
3556
|
min: "0"
|
|
@@ -3565,7 +3565,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3565
3565
|
type: "number",
|
|
3566
3566
|
className: "cedros-admin__input",
|
|
3567
3567
|
value: b.compareAtUsd === "" ? "" : b.compareAtUsd,
|
|
3568
|
-
onChange: (
|
|
3568
|
+
onChange: (E) => S((A) => ({ ...A, compareAtUsd: E.target.value === "" ? "" : parseFloat(E.target.value) || 0 })),
|
|
3569
3569
|
placeholder: "e.g., 78.00",
|
|
3570
3570
|
min: "0",
|
|
3571
3571
|
step: "0.01"
|
|
@@ -3581,7 +3581,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3581
3581
|
type: "number",
|
|
3582
3582
|
className: "cedros-admin__input",
|
|
3583
3583
|
value: b.priceUsd === "" ? "" : b.priceUsd,
|
|
3584
|
-
onChange: (
|
|
3584
|
+
onChange: (E) => S((A) => ({ ...A, priceUsd: E.target.value === "" ? "" : parseFloat(E.target.value) || 0 })),
|
|
3585
3585
|
placeholder: "e.g., 5.00",
|
|
3586
3586
|
min: "0",
|
|
3587
3587
|
step: "0.01",
|
|
@@ -3598,7 +3598,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3598
3598
|
type: "text",
|
|
3599
3599
|
className: "cedros-admin__input",
|
|
3600
3600
|
value: b.tagsCsv,
|
|
3601
|
-
onChange: (
|
|
3601
|
+
onChange: (E) => S((A) => ({ ...A, tagsCsv: E.target.value })),
|
|
3602
3602
|
placeholder: "e.g., core, new, gift"
|
|
3603
3603
|
}
|
|
3604
3604
|
)
|
|
@@ -3611,7 +3611,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3611
3611
|
type: "text",
|
|
3612
3612
|
className: "cedros-admin__input",
|
|
3613
3613
|
value: b.categoryIdsCsv,
|
|
3614
|
-
onChange: (
|
|
3614
|
+
onChange: (E) => S((A) => ({ ...A, categoryIdsCsv: E.target.value })),
|
|
3615
3615
|
placeholder: "e.g., cat_apparel, cat_accessories"
|
|
3616
3616
|
}
|
|
3617
3617
|
)
|
|
@@ -3622,7 +3622,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3622
3622
|
mt,
|
|
3623
3623
|
{
|
|
3624
3624
|
value: b.checkoutEmail,
|
|
3625
|
-
onChange: (
|
|
3625
|
+
onChange: (E) => S((A) => ({ ...A, checkoutEmail: E })),
|
|
3626
3626
|
options: [
|
|
3627
3627
|
{ value: "none", label: "None" },
|
|
3628
3628
|
{ value: "optional", label: "Optional" },
|
|
@@ -3635,7 +3635,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3635
3635
|
mt,
|
|
3636
3636
|
{
|
|
3637
3637
|
value: b.checkoutName,
|
|
3638
|
-
onChange: (
|
|
3638
|
+
onChange: (E) => S((A) => ({ ...A, checkoutName: E })),
|
|
3639
3639
|
options: [
|
|
3640
3640
|
{ value: "none", label: "None" },
|
|
3641
3641
|
{ value: "optional", label: "Optional" },
|
|
@@ -3648,7 +3648,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3648
3648
|
mt,
|
|
3649
3649
|
{
|
|
3650
3650
|
value: b.checkoutPhone,
|
|
3651
|
-
onChange: (
|
|
3651
|
+
onChange: (E) => S((A) => ({ ...A, checkoutPhone: E })),
|
|
3652
3652
|
options: [
|
|
3653
3653
|
{ value: "none", label: "None" },
|
|
3654
3654
|
{ value: "optional", label: "Optional" },
|
|
@@ -3667,7 +3667,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3667
3667
|
{
|
|
3668
3668
|
type: "checkbox",
|
|
3669
3669
|
checked: b.checkoutShippingAddress,
|
|
3670
|
-
onChange: (
|
|
3670
|
+
onChange: (E) => S((A) => ({ ...A, checkoutShippingAddress: E.target.checked }))
|
|
3671
3671
|
}
|
|
3672
3672
|
),
|
|
3673
3673
|
"Collect shipping address"
|
|
@@ -3681,7 +3681,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3681
3681
|
{
|
|
3682
3682
|
type: "checkbox",
|
|
3683
3683
|
checked: b.checkoutBillingAddress,
|
|
3684
|
-
onChange: (
|
|
3684
|
+
onChange: (E) => S((A) => ({ ...A, checkoutBillingAddress: E.target.checked }))
|
|
3685
3685
|
}
|
|
3686
3686
|
),
|
|
3687
3687
|
"Collect billing address"
|
|
@@ -3696,7 +3696,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3696
3696
|
type: "text",
|
|
3697
3697
|
className: "cedros-admin__input",
|
|
3698
3698
|
value: b.fulfillmentNotes,
|
|
3699
|
-
onChange: (
|
|
3699
|
+
onChange: (E) => S((A) => ({ ...A, fulfillmentNotes: E.target.value })),
|
|
3700
3700
|
placeholder: b.fulfillmentType === "shipping" ? "e.g., Ships within 3-5 business days" : "e.g., Downloadable from your account after purchase"
|
|
3701
3701
|
}
|
|
3702
3702
|
)
|
|
@@ -3709,7 +3709,7 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3709
3709
|
type: "text",
|
|
3710
3710
|
className: "cedros-admin__input",
|
|
3711
3711
|
value: b.shippingCountriesCsv,
|
|
3712
|
-
onChange: (
|
|
3712
|
+
onChange: (E) => S((A) => ({ ...A, shippingCountriesCsv: E.target.value })),
|
|
3713
3713
|
placeholder: "e.g., US,CA"
|
|
3714
3714
|
}
|
|
3715
3715
|
),
|
|
@@ -3744,45 +3744,45 @@ function If({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3744
3744
|
] }) }),
|
|
3745
3745
|
/* @__PURE__ */ o("th", { children: "Actions" })
|
|
3746
3746
|
] }) }),
|
|
3747
|
-
/* @__PURE__ */ o("tbody", { children: L.map((
|
|
3748
|
-
/* @__PURE__ */ o("td", { children: /* @__PURE__ */ o("code", { children:
|
|
3747
|
+
/* @__PURE__ */ o("tbody", { children: L.map((E) => /* @__PURE__ */ d("tr", { children: [
|
|
3748
|
+
/* @__PURE__ */ o("td", { children: /* @__PURE__ */ o("code", { children: E.id }) }),
|
|
3749
3749
|
/* @__PURE__ */ o("td", { children: /* @__PURE__ */ d("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem" }, children: [
|
|
3750
|
-
N(
|
|
3750
|
+
N(E) ? /* @__PURE__ */ o(
|
|
3751
3751
|
"img",
|
|
3752
3752
|
{
|
|
3753
|
-
src: N(
|
|
3753
|
+
src: N(E),
|
|
3754
3754
|
alt: "",
|
|
3755
3755
|
style: { width: 28, height: 28, borderRadius: 6, objectFit: "cover" }
|
|
3756
3756
|
}
|
|
3757
3757
|
) : /* @__PURE__ */ o("div", { style: { width: 28, height: 28, borderRadius: 6, background: "rgba(0,0,0,0.06)" } }),
|
|
3758
3758
|
/* @__PURE__ */ d("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
3759
|
-
/* @__PURE__ */ o("span", { style: { fontWeight: 600 }, children: P(
|
|
3760
|
-
/* @__PURE__ */ o("span", { style: { opacity: 0.8 }, children:
|
|
3759
|
+
/* @__PURE__ */ o("span", { style: { fontWeight: 600 }, children: P(E) }),
|
|
3760
|
+
/* @__PURE__ */ o("span", { style: { opacity: 0.8 }, children: E.description })
|
|
3761
3761
|
] })
|
|
3762
3762
|
] }) }),
|
|
3763
|
-
/* @__PURE__ */ o("td", { children: C(
|
|
3764
|
-
/* @__PURE__ */ o("td", { children: z(
|
|
3765
|
-
/* @__PURE__ */ o("td", { children: /* @__PURE__ */ o("span", { className: `cedros-admin__badge ${
|
|
3763
|
+
/* @__PURE__ */ o("td", { children: C(E.metadata?.product_type) }),
|
|
3764
|
+
/* @__PURE__ */ o("td", { children: z(E.fiatAmountCents) }),
|
|
3765
|
+
/* @__PURE__ */ o("td", { children: /* @__PURE__ */ o("span", { className: `cedros-admin__badge ${E.active ? "cedros-admin__badge--success" : "cedros-admin__badge--muted"}`, children: E.active ? "Active" : "Inactive" }) }),
|
|
3766
3766
|
/* @__PURE__ */ o("td", { children: /* @__PURE__ */ d("div", { style: { display: "flex", gap: "0.25rem" }, children: [
|
|
3767
3767
|
/* @__PURE__ */ o("button", { className: "cedros-admin__button cedros-admin__button--ghost", children: "Edit" }),
|
|
3768
3768
|
/* @__PURE__ */ o(
|
|
3769
3769
|
"button",
|
|
3770
3770
|
{
|
|
3771
3771
|
className: "cedros-admin__button cedros-admin__button--ghost",
|
|
3772
|
-
onClick: () => y(
|
|
3772
|
+
onClick: () => y(E),
|
|
3773
3773
|
children: "Variations"
|
|
3774
3774
|
}
|
|
3775
3775
|
)
|
|
3776
3776
|
] }) })
|
|
3777
|
-
] },
|
|
3777
|
+
] }, E.id)) })
|
|
3778
3778
|
] }) }),
|
|
3779
3779
|
x && /* @__PURE__ */ o("div", { className: "cedros-admin__modal-overlay", onClick: () => y(null), children: /* @__PURE__ */ o(
|
|
3780
3780
|
"div",
|
|
3781
3781
|
{
|
|
3782
3782
|
className: "cedros-admin__modal cedros-admin__modal--lg",
|
|
3783
|
-
onClick: (
|
|
3783
|
+
onClick: (E) => E.stopPropagation(),
|
|
3784
3784
|
children: /* @__PURE__ */ o(
|
|
3785
|
-
|
|
3785
|
+
Ef,
|
|
3786
3786
|
{
|
|
3787
3787
|
serverUrl: e,
|
|
3788
3788
|
productId: x.id,
|
|
@@ -3870,8 +3870,8 @@ function Rf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
3870
3870
|
}
|
|
3871
3871
|
};
|
|
3872
3872
|
return [...a].sort((M, z) => {
|
|
3873
|
-
const C = I(M),
|
|
3874
|
-
return typeof C == "number" && typeof
|
|
3873
|
+
const C = I(M), T = I(z);
|
|
3874
|
+
return typeof C == "number" && typeof T == "number" ? (C - T) * N : String(C).localeCompare(String(T), void 0, { sensitivity: "base" }) * N;
|
|
3875
3875
|
});
|
|
3876
3876
|
}, [a, h]);
|
|
3877
3877
|
return /* @__PURE__ */ d("div", { className: "cedros-admin__page", children: [
|
|
@@ -4005,7 +4005,7 @@ function Of({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4005
4005
|
if (I.preventDefault(), !(!h.code || h.discountValue <= 0)) {
|
|
4006
4006
|
m(!0);
|
|
4007
4007
|
try {
|
|
4008
|
-
const M = h.minimumAmountUsd ? Math.round(Number(h.minimumAmountUsd) * 100) : void 0, z = h.productIdsCsv.split(",").map((R) => R.trim()).filter(Boolean), C = h.categoryIdsCsv.split(",").map((R) => R.trim()).filter(Boolean),
|
|
4008
|
+
const M = h.minimumAmountUsd ? Math.round(Number(h.minimumAmountUsd) * 100) : void 0, z = h.productIdsCsv.split(",").map((R) => R.trim()).filter(Boolean), C = h.categoryIdsCsv.split(",").map((R) => R.trim()).filter(Boolean), T = {
|
|
4009
4009
|
code: h.code,
|
|
4010
4010
|
discountType: h.discountType,
|
|
4011
4011
|
discountValue: h.discountValue,
|
|
@@ -4030,7 +4030,7 @@ function Of({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4030
4030
|
if (r?.isAuthenticated())
|
|
4031
4031
|
await r.fetchWithAuth("/admin/coupons", {
|
|
4032
4032
|
method: "POST",
|
|
4033
|
-
body: JSON.stringify(
|
|
4033
|
+
body: JSON.stringify(T)
|
|
4034
4034
|
});
|
|
4035
4035
|
else {
|
|
4036
4036
|
const R = { "Content-Type": "application/json" };
|
|
@@ -4038,7 +4038,7 @@ function Of({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4038
4038
|
const j = await fetch(`${e}/admin/coupons`, {
|
|
4039
4039
|
method: "POST",
|
|
4040
4040
|
headers: R,
|
|
4041
|
-
body: JSON.stringify(
|
|
4041
|
+
body: JSON.stringify(T)
|
|
4042
4042
|
});
|
|
4043
4043
|
if (!j.ok) throw new Error(`Failed to create coupon: ${j.status}`);
|
|
4044
4044
|
}
|
|
@@ -4086,8 +4086,8 @@ function Of({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4086
4086
|
}
|
|
4087
4087
|
};
|
|
4088
4088
|
return [...a].sort((z, C) => {
|
|
4089
|
-
const
|
|
4090
|
-
return typeof
|
|
4089
|
+
const T = M(z), R = M(C);
|
|
4090
|
+
return typeof T == "number" && typeof R == "number" ? (T - R) * I : String(T).localeCompare(String(R), void 0, { sensitivity: "base" }) * I;
|
|
4091
4091
|
});
|
|
4092
4092
|
}, [a, f]);
|
|
4093
4093
|
return /* @__PURE__ */ d("div", { className: "cedros-admin__page", children: [
|
|
@@ -4375,7 +4375,7 @@ function Of({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4375
4375
|
] });
|
|
4376
4376
|
}
|
|
4377
4377
|
function Mf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
4378
|
-
const [a, s] = H([]), [i, c] = H(!0), [l, u] = H(null), [p, m] = H([]), [f, g] = H(!0), [x, y] = H(null), [h, _] = H(null), [k, w] = H([]), [b, S] = H(!0), [O, P] = H(null), [N, I] = H(null), [M, z] = H(null), [C,
|
|
4378
|
+
const [a, s] = H([]), [i, c] = H(!0), [l, u] = H(null), [p, m] = H([]), [f, g] = H(!0), [x, y] = H(null), [h, _] = H(null), [k, w] = H([]), [b, S] = H(!0), [O, P] = H(null), [N, I] = H(null), [M, z] = H(null), [C, T] = H(""), [R, j] = H(null), L = J(async () => {
|
|
4379
4379
|
try {
|
|
4380
4380
|
let U;
|
|
4381
4381
|
const ae = `/admin/refunds?limit=${n}`;
|
|
@@ -4384,9 +4384,9 @@ function Mf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4384
4384
|
else {
|
|
4385
4385
|
const me = { "Content-Type": "application/json" };
|
|
4386
4386
|
t && (me["X-API-Key"] = t);
|
|
4387
|
-
const
|
|
4388
|
-
if (!
|
|
4389
|
-
U = await
|
|
4387
|
+
const Te = await fetch(`${e}${ae}`, { headers: me });
|
|
4388
|
+
if (!Te.ok) throw new Error(`Failed to fetch x402 refunds: ${Te.status}`);
|
|
4389
|
+
U = await Te.json();
|
|
4390
4390
|
}
|
|
4391
4391
|
s(U.refunds || []);
|
|
4392
4392
|
} catch (U) {
|
|
@@ -4401,18 +4401,18 @@ function Mf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4401
4401
|
ve(() => {
|
|
4402
4402
|
L();
|
|
4403
4403
|
}, [L]);
|
|
4404
|
-
const
|
|
4404
|
+
const E = J(async () => {
|
|
4405
4405
|
try {
|
|
4406
4406
|
let U;
|
|
4407
4407
|
const ae = `/admin/credits/refund-requests?status=pending&limit=${n}&offset=0`;
|
|
4408
4408
|
if (r?.isAuthenticated())
|
|
4409
4409
|
U = await r.fetchWithAuth(ae);
|
|
4410
4410
|
else {
|
|
4411
|
-
const
|
|
4412
|
-
t && (
|
|
4413
|
-
const
|
|
4414
|
-
if (!
|
|
4415
|
-
U = await
|
|
4411
|
+
const Te = { "Content-Type": "application/json" };
|
|
4412
|
+
t && (Te["X-API-Key"] = t);
|
|
4413
|
+
const Ee = await fetch(`${e}${ae}`, { headers: Te });
|
|
4414
|
+
if (!Ee.ok) throw new Error(`Failed to fetch credits refund requests: ${Ee.status}`);
|
|
4415
|
+
U = await Ee.json();
|
|
4416
4416
|
}
|
|
4417
4417
|
const me = Array.isArray(U) ? U : "refundRequests" in U ? U.refundRequests : U.requests || [];
|
|
4418
4418
|
m(me);
|
|
@@ -4426,8 +4426,8 @@ function Mf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4426
4426
|
}
|
|
4427
4427
|
}, [e, t, n, r]);
|
|
4428
4428
|
ve(() => {
|
|
4429
|
-
|
|
4430
|
-
}, [
|
|
4429
|
+
E();
|
|
4430
|
+
}, [E]);
|
|
4431
4431
|
const A = async (U) => {
|
|
4432
4432
|
y(U.id);
|
|
4433
4433
|
try {
|
|
@@ -4435,12 +4435,12 @@ function Mf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4435
4435
|
if (r?.isAuthenticated())
|
|
4436
4436
|
await r.fetchWithAuth(ae, { method: "POST", body: me });
|
|
4437
4437
|
else {
|
|
4438
|
-
const
|
|
4439
|
-
t && (
|
|
4440
|
-
const
|
|
4441
|
-
if (!
|
|
4438
|
+
const Te = { "Content-Type": "application/json" };
|
|
4439
|
+
t && (Te["X-API-Key"] = t);
|
|
4440
|
+
const Ee = await fetch(`${e}${ae}`, { method: "POST", headers: Te, body: me });
|
|
4441
|
+
if (!Ee.ok) throw new Error(`Failed to process credits refund: ${Ee.status}`);
|
|
4442
4442
|
}
|
|
4443
|
-
await
|
|
4443
|
+
await E();
|
|
4444
4444
|
} catch (ae) {
|
|
4445
4445
|
fe().error("[RefundsSection] Failed to process credits refund:", ae, {
|
|
4446
4446
|
serverUrl: e.slice(0, 20) + "...",
|
|
@@ -4451,24 +4451,24 @@ function Mf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4451
4451
|
y(null);
|
|
4452
4452
|
}
|
|
4453
4453
|
}, F = (U) => {
|
|
4454
|
-
|
|
4454
|
+
T(U.reason ?? ""), z(U);
|
|
4455
4455
|
}, Q = () => {
|
|
4456
|
-
z(null),
|
|
4456
|
+
z(null), T("");
|
|
4457
4457
|
}, ee = async () => {
|
|
4458
4458
|
if (!M) return;
|
|
4459
4459
|
const U = M, ae = C;
|
|
4460
4460
|
Q(), y(U.id);
|
|
4461
4461
|
try {
|
|
4462
|
-
const me = `/admin/credits/refund-requests/${U.id}/reject`,
|
|
4462
|
+
const me = `/admin/credits/refund-requests/${U.id}/reject`, Te = JSON.stringify({ reason: ae });
|
|
4463
4463
|
if (r?.isAuthenticated())
|
|
4464
|
-
await r.fetchWithAuth(me, { method: "POST", body:
|
|
4464
|
+
await r.fetchWithAuth(me, { method: "POST", body: Te });
|
|
4465
4465
|
else {
|
|
4466
|
-
const
|
|
4467
|
-
t && (
|
|
4468
|
-
const je = await fetch(`${e}${me}`, { method: "POST", headers:
|
|
4466
|
+
const Ee = { "Content-Type": "application/json" };
|
|
4467
|
+
t && (Ee["X-API-Key"] = t);
|
|
4468
|
+
const je = await fetch(`${e}${me}`, { method: "POST", headers: Ee, body: Te });
|
|
4469
4469
|
if (!je.ok) throw new Error(`Failed to reject credits refund: ${je.status}`);
|
|
4470
4470
|
}
|
|
4471
|
-
await
|
|
4471
|
+
await E();
|
|
4472
4472
|
} catch (me) {
|
|
4473
4473
|
fe().error("[RefundsSection] Failed to reject credits refund:", me, {
|
|
4474
4474
|
serverUrl: e.slice(0, 20) + "...",
|
|
@@ -4487,9 +4487,9 @@ function Mf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4487
4487
|
else {
|
|
4488
4488
|
const me = { "Content-Type": "application/json" };
|
|
4489
4489
|
t && (me["X-API-Key"] = t);
|
|
4490
|
-
const
|
|
4491
|
-
if (!
|
|
4492
|
-
U = await
|
|
4490
|
+
const Te = await fetch(`${e}${ae}`, { headers: me });
|
|
4491
|
+
if (!Te.ok) throw new Error(`Failed to fetch Stripe refunds: ${Te.status}`);
|
|
4492
|
+
U = await Te.json();
|
|
4493
4493
|
}
|
|
4494
4494
|
w(U.refunds || []);
|
|
4495
4495
|
} catch (U) {
|
|
@@ -4513,8 +4513,8 @@ function Mf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4513
4513
|
else {
|
|
4514
4514
|
const me = { "Content-Type": "application/json" };
|
|
4515
4515
|
t && (me["X-API-Key"] = t);
|
|
4516
|
-
const
|
|
4517
|
-
if (!
|
|
4516
|
+
const Te = await fetch(`${e}${ae}`, { method: "POST", headers: me });
|
|
4517
|
+
if (!Te.ok) throw new Error(`Failed to process refund: ${Te.status}`);
|
|
4518
4518
|
}
|
|
4519
4519
|
await $();
|
|
4520
4520
|
} catch (ae) {
|
|
@@ -4576,9 +4576,9 @@ function Mf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4576
4576
|
return me.id;
|
|
4577
4577
|
}
|
|
4578
4578
|
};
|
|
4579
|
-
return [...k].sort((me,
|
|
4580
|
-
const
|
|
4581
|
-
return typeof
|
|
4579
|
+
return [...k].sort((me, Te) => {
|
|
4580
|
+
const Ee = ae(me), je = ae(Te);
|
|
4581
|
+
return typeof Ee == "number" && typeof je == "number" ? (Ee - je) * U : String(Ee).localeCompare(String(je), void 0, { sensitivity: "base" }) * U;
|
|
4582
4582
|
});
|
|
4583
4583
|
}, [k, N]), Ct = Se(() => {
|
|
4584
4584
|
if (!h) return p;
|
|
@@ -4601,9 +4601,9 @@ function Mf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4601
4601
|
return me.id;
|
|
4602
4602
|
}
|
|
4603
4603
|
};
|
|
4604
|
-
return [...p].sort((me,
|
|
4605
|
-
const
|
|
4606
|
-
return typeof
|
|
4604
|
+
return [...p].sort((me, Te) => {
|
|
4605
|
+
const Ee = ae(me), je = ae(Te);
|
|
4606
|
+
return typeof Ee == "number" && typeof je == "number" ? (Ee - je) * U : String(Ee).localeCompare(String(je), void 0, { sensitivity: "base" }) * U;
|
|
4607
4607
|
});
|
|
4608
4608
|
}, [p, h]), vt = Se(() => {
|
|
4609
4609
|
if (!l) return a;
|
|
@@ -4624,14 +4624,14 @@ function Mf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4624
4624
|
return me.id;
|
|
4625
4625
|
}
|
|
4626
4626
|
};
|
|
4627
|
-
return [...a].sort((me,
|
|
4628
|
-
const
|
|
4629
|
-
return typeof
|
|
4627
|
+
return [...a].sort((me, Te) => {
|
|
4628
|
+
const Ee = ae(me), je = ae(Te);
|
|
4629
|
+
return typeof Ee == "number" && typeof je == "number" ? (Ee - je) * U : String(Ee).localeCompare(String(je), void 0, { sensitivity: "base" }) * U;
|
|
4630
4630
|
});
|
|
4631
4631
|
}, [a, l]);
|
|
4632
4632
|
return /* @__PURE__ */ d("div", { className: "cedros-admin__page", children: [
|
|
4633
4633
|
/* @__PURE__ */ o(rn, { message: R, onRetry: () => {
|
|
4634
|
-
L(),
|
|
4634
|
+
L(), E(), $();
|
|
4635
4635
|
} }),
|
|
4636
4636
|
/* @__PURE__ */ o(
|
|
4637
4637
|
mr,
|
|
@@ -4846,7 +4846,7 @@ function Mf({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
4846
4846
|
{
|
|
4847
4847
|
className: "cedros-admin__input",
|
|
4848
4848
|
value: C,
|
|
4849
|
-
onChange: (U) =>
|
|
4849
|
+
onChange: (U) => T(U.target.value),
|
|
4850
4850
|
placeholder: "Enter rejection reason...",
|
|
4851
4851
|
rows: 3,
|
|
4852
4852
|
style: { resize: "vertical" }
|
|
@@ -5008,7 +5008,26 @@ const Ds = {
|
|
|
5008
5008
|
fields: {
|
|
5009
5009
|
enabled: { hidden: !0 },
|
|
5010
5010
|
// Shown in header toggle
|
|
5011
|
-
|
|
5011
|
+
secret_key: {
|
|
5012
|
+
description: "Stripe Dashboard → Developers → API keys → Secret key. Use the test key (sk_test_...) for testing, or the live key (sk_live_...) for production."
|
|
5013
|
+
},
|
|
5014
|
+
publishable_key: {
|
|
5015
|
+
description: "Stripe Dashboard → Developers → API keys → Publishable key. Starts with pk_test_... or pk_live_..."
|
|
5016
|
+
},
|
|
5017
|
+
mode: {
|
|
5018
|
+
type: "dropdown",
|
|
5019
|
+
options: ["test", "live"],
|
|
5020
|
+
description: 'Use "test" mode with test API keys during development, then switch to "live" with live keys for real payments.'
|
|
5021
|
+
},
|
|
5022
|
+
webhook_url: {
|
|
5023
|
+
description: "The full URL Stripe sends webhook events to. Default is your server URL + /webhook/stripe (e.g. https://example.com/webhook/stripe). Only change this if you've customized the route in your cedros-pay server."
|
|
5024
|
+
},
|
|
5025
|
+
webhook_secret: {
|
|
5026
|
+
description: 'Stripe Dashboard → Developers → Webhooks → "Create an event destination" → select events: checkout.session.completed, customer.subscription.created, customer.subscription.updated, customer.subscription.deleted, invoice.paid, invoice.payment_failed → Continue → choose "Webhook endpoint" → enter your webhook URL (shown above) → after creating, click the endpoint and "Click to reveal" the signing secret. Starts with whsec_...'
|
|
5027
|
+
},
|
|
5028
|
+
tax_rate_id: {
|
|
5029
|
+
description: `Stripe Dashboard → More → Product catalog → Tax rates → "+ New" → set the percentage, region, and whether tax is inclusive or exclusive → Save → copy the tax rate ID from the detail page (starts with txr_...). Leave empty if you don't collect tax.`
|
|
5030
|
+
},
|
|
5012
5031
|
success_url: { hidden: !0 },
|
|
5013
5032
|
// Library provides default pages
|
|
5014
5033
|
cancel_url: { hidden: !0 }
|
|
@@ -5286,7 +5305,7 @@ const Ds = {
|
|
|
5286
5305
|
function Dl(e, t) {
|
|
5287
5306
|
return Ds[e]?.secrets.includes(t) ?? !1;
|
|
5288
5307
|
}
|
|
5289
|
-
const
|
|
5308
|
+
const Er = "[REDACTED]";
|
|
5290
5309
|
function Ls({
|
|
5291
5310
|
data: e,
|
|
5292
5311
|
onSave: t,
|
|
@@ -5362,7 +5381,7 @@ function zf({
|
|
|
5362
5381
|
for (const w of Object.keys(k))
|
|
5363
5382
|
if (Dl(e, w)) {
|
|
5364
5383
|
const b = n[w], S = k[w];
|
|
5365
|
-
(S ===
|
|
5384
|
+
(S === Er || S === b) && (k[w] = Er);
|
|
5366
5385
|
}
|
|
5367
5386
|
return k;
|
|
5368
5387
|
}, [s, n, e]), { status: p, error: m } = Ls({
|
|
@@ -5588,7 +5607,7 @@ function zf({
|
|
|
5588
5607
|
),
|
|
5589
5608
|
x(b.description)
|
|
5590
5609
|
] });
|
|
5591
|
-
const S = c.has(k), O = b.isSecret && !S && w ===
|
|
5610
|
+
const S = c.has(k), O = b.isSecret && !S && w === Er ? Er : w;
|
|
5592
5611
|
return /* @__PURE__ */ d("div", { className: "cedros-admin__field", children: [
|
|
5593
5612
|
/* @__PURE__ */ d("label", { className: "cedros-admin__field-label", children: [
|
|
5594
5613
|
b.label,
|
|
@@ -5930,7 +5949,7 @@ function Bf({
|
|
|
5930
5949
|
borderRadius: "0.5rem"
|
|
5931
5950
|
}, children: 'No items. Click "Add" to create one.' }),
|
|
5932
5951
|
m.map((w, b) => {
|
|
5933
|
-
const S = s.has(b), O = c === b, P = w ===
|
|
5952
|
+
const S = s.has(b), O = c === b, P = w === Er;
|
|
5934
5953
|
return /* @__PURE__ */ o(
|
|
5935
5954
|
"div",
|
|
5936
5955
|
{
|
|
@@ -6139,7 +6158,7 @@ function Ll({
|
|
|
6139
6158
|
}, [g, z]);
|
|
6140
6159
|
const C = J(async (A) => {
|
|
6141
6160
|
await l.updateConfig(r, A, "Updated via admin dashboard"), await M();
|
|
6142
|
-
}, [l, r, M]),
|
|
6161
|
+
}, [l, r, M]), T = J(async (A) => l.validateConfig(r, A), [l, r]), [R, j] = H(!1), L = J(async () => {
|
|
6143
6162
|
if (!u || R) return;
|
|
6144
6163
|
const A = !!u.config[i], F = !A, Q = { ...u.config, [i]: F };
|
|
6145
6164
|
j(!0), p({ ...u, config: Q });
|
|
@@ -6150,7 +6169,7 @@ function Ll({
|
|
|
6150
6169
|
} finally {
|
|
6151
6170
|
j(!1);
|
|
6152
6171
|
}
|
|
6153
|
-
}, [u, l, r, i, R]),
|
|
6172
|
+
}, [u, l, r, i, R]), E = !!u?.config[i];
|
|
6154
6173
|
return y && !u ? /* @__PURE__ */ o("div", { className: "cedros-admin__section", children: /* @__PURE__ */ d("div", { className: "cedros-admin__loading", children: [
|
|
6155
6174
|
K.loading,
|
|
6156
6175
|
" Loading ",
|
|
@@ -6167,13 +6186,13 @@ function Ll({
|
|
|
6167
6186
|
I && /* @__PURE__ */ o("p", { className: "cedros-admin__text-muted", style: { marginTop: "0.25rem" }, children: I })
|
|
6168
6187
|
] }),
|
|
6169
6188
|
c && u && /* @__PURE__ */ d("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
6170
|
-
/* @__PURE__ */ o("span", { style: { fontSize: "0.875rem", color:
|
|
6189
|
+
/* @__PURE__ */ o("span", { style: { fontSize: "0.875rem", color: E ? "var(--cedros-admin-text, #171717)" : "var(--cedros-admin-muted, #737373)" }, children: E ? "Enabled" : "Disabled" }),
|
|
6171
6190
|
/* @__PURE__ */ o(
|
|
6172
6191
|
"button",
|
|
6173
6192
|
{
|
|
6174
6193
|
type: "button",
|
|
6175
6194
|
role: "switch",
|
|
6176
|
-
"aria-checked":
|
|
6195
|
+
"aria-checked": E,
|
|
6177
6196
|
onClick: L,
|
|
6178
6197
|
disabled: R,
|
|
6179
6198
|
style: {
|
|
@@ -6181,7 +6200,7 @@ function Ll({
|
|
|
6181
6200
|
height: 24,
|
|
6182
6201
|
borderRadius: 12,
|
|
6183
6202
|
border: "none",
|
|
6184
|
-
backgroundColor:
|
|
6203
|
+
backgroundColor: E ? "var(--cedros-admin-primary, #171717)" : "var(--cedros-admin-border, #d4d4d4)",
|
|
6185
6204
|
cursor: R ? "wait" : "pointer",
|
|
6186
6205
|
position: "relative",
|
|
6187
6206
|
transition: "background-color 0.2s",
|
|
@@ -6194,7 +6213,7 @@ function Ll({
|
|
|
6194
6213
|
style: {
|
|
6195
6214
|
position: "absolute",
|
|
6196
6215
|
top: 2,
|
|
6197
|
-
left:
|
|
6216
|
+
left: E ? 22 : 2,
|
|
6198
6217
|
width: 20,
|
|
6199
6218
|
height: 20,
|
|
6200
6219
|
borderRadius: "50%",
|
|
@@ -6214,11 +6233,11 @@ function Ll({
|
|
|
6214
6233
|
className: "cedros-admin__settings-editor",
|
|
6215
6234
|
style: {
|
|
6216
6235
|
marginTop: "1rem",
|
|
6217
|
-
opacity: c && !
|
|
6218
|
-
pointerEvents: c && !
|
|
6236
|
+
opacity: c && !E ? 0.6 : 1,
|
|
6237
|
+
pointerEvents: c && !E ? "none" : "auto"
|
|
6219
6238
|
},
|
|
6220
6239
|
children: [
|
|
6221
|
-
c && !
|
|
6240
|
+
c && !E && /* @__PURE__ */ o(
|
|
6222
6241
|
"div",
|
|
6223
6242
|
{
|
|
6224
6243
|
style: {
|
|
@@ -6241,7 +6260,7 @@ function Ll({
|
|
|
6241
6260
|
config: u.config,
|
|
6242
6261
|
originalConfig: u.config,
|
|
6243
6262
|
onSave: C,
|
|
6244
|
-
onValidate:
|
|
6263
|
+
onValidate: T,
|
|
6245
6264
|
onCancel: () => M()
|
|
6246
6265
|
}
|
|
6247
6266
|
)
|
|
@@ -6326,7 +6345,7 @@ function Ll({
|
|
|
6326
6345
|
if (u) {
|
|
6327
6346
|
O(!0), b(null);
|
|
6328
6347
|
try {
|
|
6329
|
-
const A = await
|
|
6348
|
+
const A = await T(u.config);
|
|
6330
6349
|
b(A);
|
|
6331
6350
|
} catch (A) {
|
|
6332
6351
|
b({
|
|
@@ -6540,7 +6559,7 @@ function zl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
6540
6559
|
...X,
|
|
6541
6560
|
plans: X.plans.map((q) => q.id === $ ? { ...q, ...W } : q)
|
|
6542
6561
|
}));
|
|
6543
|
-
},
|
|
6562
|
+
}, T = ($) => {
|
|
6544
6563
|
confirm("Delete this plan? This cannot be undone.") && (a((W) => ({
|
|
6545
6564
|
...W,
|
|
6546
6565
|
plans: W.plans.filter((X) => X.id !== $)
|
|
@@ -6559,7 +6578,7 @@ function zl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
6559
6578
|
if (!q) return;
|
|
6560
6579
|
const de = [...q.features];
|
|
6561
6580
|
de[W] = X, C($, { features: de });
|
|
6562
|
-
},
|
|
6581
|
+
}, E = ($, W) => {
|
|
6563
6582
|
const X = r.plans.find((de) => de.id === $);
|
|
6564
6583
|
if (!X) return;
|
|
6565
6584
|
const q = X.features.filter((de, B) => B !== W);
|
|
@@ -6799,7 +6818,7 @@ function zl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
6799
6818
|
"button",
|
|
6800
6819
|
{
|
|
6801
6820
|
className: "cedros-admin__button cedros-admin__button--ghost",
|
|
6802
|
-
onClick: () =>
|
|
6821
|
+
onClick: () => T($.id),
|
|
6803
6822
|
title: "Delete plan",
|
|
6804
6823
|
style: { padding: "4px 8px", color: "#dc2626" },
|
|
6805
6824
|
children: K.trash
|
|
@@ -6991,7 +7010,7 @@ function zl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
6991
7010
|
"button",
|
|
6992
7011
|
{
|
|
6993
7012
|
className: "cedros-admin__button cedros-admin__button--ghost",
|
|
6994
|
-
onClick: () =>
|
|
7013
|
+
onClick: () => E($.id, de),
|
|
6995
7014
|
style: { padding: "4px 8px", color: "#dc2626" },
|
|
6996
7015
|
title: "Remove feature",
|
|
6997
7016
|
children: K.trash
|
|
@@ -7012,7 +7031,7 @@ function zl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7012
7031
|
const Hf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7013
7032
|
__proto__: null,
|
|
7014
7033
|
SubscriptionsSection: zl
|
|
7015
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
7034
|
+
}, Symbol.toStringTag, { value: "Module" })), Ea = {
|
|
7016
7035
|
enabled: !0,
|
|
7017
7036
|
relatedProducts: {
|
|
7018
7037
|
mode: "most_recent",
|
|
@@ -7111,23 +7130,23 @@ const Hf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7111
7130
|
{ id: "checkout", label: "Checkout" }
|
|
7112
7131
|
];
|
|
7113
7132
|
function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
7114
|
-
const [r, a] = H("shop-page"), [s, i] = H(
|
|
7133
|
+
const [r, a] = H("shop-page"), [s, i] = H(Ea), [c, l] = H(!0), [u, p] = H(!0), [m, f] = H(null), g = J(async () => {
|
|
7115
7134
|
try {
|
|
7116
7135
|
f(null);
|
|
7117
7136
|
let C;
|
|
7118
|
-
const
|
|
7137
|
+
const T = "/admin/config/shop";
|
|
7119
7138
|
if (n?.isAuthenticated())
|
|
7120
|
-
C = await n.fetchWithAuth(
|
|
7139
|
+
C = await n.fetchWithAuth(T);
|
|
7121
7140
|
else {
|
|
7122
7141
|
const R = { "Content-Type": "application/json" };
|
|
7123
7142
|
t && (R["X-API-Key"] = t);
|
|
7124
|
-
const j = await fetch(`${e}${
|
|
7143
|
+
const j = await fetch(`${e}${T}`, { headers: R });
|
|
7125
7144
|
if (!j.ok) throw new Error(`Failed to fetch settings: ${j.status}`);
|
|
7126
7145
|
C = await j.json();
|
|
7127
7146
|
}
|
|
7128
|
-
i({ ...
|
|
7147
|
+
i({ ...Ea, ...C.config });
|
|
7129
7148
|
} catch {
|
|
7130
|
-
i(
|
|
7149
|
+
i(Ea), f("Could not load saved settings. Showing defaults.");
|
|
7131
7150
|
} finally {
|
|
7132
7151
|
l(!1), setTimeout(() => p(!1), 100);
|
|
7133
7152
|
}
|
|
@@ -7136,14 +7155,14 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7136
7155
|
g();
|
|
7137
7156
|
}, [g]);
|
|
7138
7157
|
const x = J(async (C) => {
|
|
7139
|
-
const
|
|
7158
|
+
const T = "/admin/config/shop", R = JSON.stringify({ config: C });
|
|
7140
7159
|
try {
|
|
7141
7160
|
if (n?.isAuthenticated())
|
|
7142
|
-
await n.fetchWithAuth(
|
|
7161
|
+
await n.fetchWithAuth(T, { method: "PUT", body: R });
|
|
7143
7162
|
else {
|
|
7144
7163
|
const j = { "Content-Type": "application/json" };
|
|
7145
7164
|
t && (j["X-API-Key"] = t);
|
|
7146
|
-
const L = await fetch(`${e}${
|
|
7165
|
+
const L = await fetch(`${e}${T}`, { method: "PUT", headers: j, body: R });
|
|
7147
7166
|
if (!L.ok) throw new Error(`Failed to save settings: ${L.status}`);
|
|
7148
7167
|
}
|
|
7149
7168
|
} catch {
|
|
@@ -7155,69 +7174,69 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7155
7174
|
debounceMs: 1500,
|
|
7156
7175
|
enabled: !u
|
|
7157
7176
|
}), _ = (C) => {
|
|
7158
|
-
i((
|
|
7159
|
-
...
|
|
7160
|
-
relatedProducts: { ...
|
|
7177
|
+
i((T) => ({
|
|
7178
|
+
...T,
|
|
7179
|
+
relatedProducts: { ...T.relatedProducts, mode: C }
|
|
7161
7180
|
}));
|
|
7162
7181
|
}, k = (C) => {
|
|
7163
|
-
i((
|
|
7164
|
-
...
|
|
7165
|
-
relatedProducts: { ...
|
|
7182
|
+
i((T) => ({
|
|
7183
|
+
...T,
|
|
7184
|
+
relatedProducts: { ...T.relatedProducts, maxItems: C }
|
|
7166
7185
|
}));
|
|
7167
|
-
}, w = (C,
|
|
7186
|
+
}, w = (C, T) => {
|
|
7168
7187
|
i((R) => ({
|
|
7169
7188
|
...R,
|
|
7170
7189
|
relatedProducts: {
|
|
7171
7190
|
...R.relatedProducts,
|
|
7172
|
-
layout: { ...R.relatedProducts.layout, [C]:
|
|
7191
|
+
layout: { ...R.relatedProducts.layout, [C]: T }
|
|
7173
7192
|
}
|
|
7174
7193
|
}));
|
|
7175
|
-
}, b = (C,
|
|
7194
|
+
}, b = (C, T) => {
|
|
7176
7195
|
i((R) => ({
|
|
7177
7196
|
...R,
|
|
7178
7197
|
catalog: {
|
|
7179
7198
|
...R.catalog,
|
|
7180
|
-
filters: { ...R.catalog.filters, [C]:
|
|
7199
|
+
filters: { ...R.catalog.filters, [C]: T }
|
|
7181
7200
|
}
|
|
7182
7201
|
}));
|
|
7183
|
-
}, S = (C,
|
|
7202
|
+
}, S = (C, T) => {
|
|
7184
7203
|
const R = s.catalog.sort, j = Object.values(R).filter(Boolean).length;
|
|
7185
|
-
!
|
|
7204
|
+
!T && j <= 1 || i((L) => ({
|
|
7186
7205
|
...L,
|
|
7187
7206
|
catalog: {
|
|
7188
7207
|
...L.catalog,
|
|
7189
|
-
sort: { ...L.catalog.sort, [C]:
|
|
7208
|
+
sort: { ...L.catalog.sort, [C]: T }
|
|
7190
7209
|
}
|
|
7191
7210
|
}));
|
|
7192
|
-
}, O = (C,
|
|
7211
|
+
}, O = (C, T) => {
|
|
7193
7212
|
i((R) => ({
|
|
7194
7213
|
...R,
|
|
7195
|
-
checkout: { ...R.checkout, [C]:
|
|
7214
|
+
checkout: { ...R.checkout, [C]: T }
|
|
7196
7215
|
}));
|
|
7197
|
-
}, P = (C,
|
|
7216
|
+
}, P = (C, T) => {
|
|
7198
7217
|
i((R) => ({
|
|
7199
7218
|
...R,
|
|
7200
|
-
shopLayout: { ...R.shopLayout, [C]:
|
|
7219
|
+
shopLayout: { ...R.shopLayout, [C]: T }
|
|
7201
7220
|
}));
|
|
7202
|
-
}, N = (C,
|
|
7221
|
+
}, N = (C, T) => {
|
|
7203
7222
|
i((R) => ({
|
|
7204
7223
|
...R,
|
|
7205
|
-
categoryLayout: { ...R.categoryLayout, [C]:
|
|
7224
|
+
categoryLayout: { ...R.categoryLayout, [C]: T }
|
|
7206
7225
|
}));
|
|
7207
|
-
}, I = (C,
|
|
7226
|
+
}, I = (C, T) => {
|
|
7208
7227
|
i((R) => ({
|
|
7209
7228
|
...R,
|
|
7210
|
-
sections: { ...R.sections, [C]:
|
|
7229
|
+
sections: { ...R.sections, [C]: T }
|
|
7211
7230
|
}));
|
|
7212
|
-
}, M = (C,
|
|
7231
|
+
}, M = (C, T) => {
|
|
7213
7232
|
i((R) => ({
|
|
7214
7233
|
...R,
|
|
7215
|
-
inventory: { ...R.inventory, [C]:
|
|
7234
|
+
inventory: { ...R.inventory, [C]: T }
|
|
7216
7235
|
}));
|
|
7217
|
-
}, z = (C,
|
|
7236
|
+
}, z = (C, T) => {
|
|
7218
7237
|
i((R) => ({
|
|
7219
7238
|
...R,
|
|
7220
|
-
shopPage: { ...R.shopPage, [C]:
|
|
7239
|
+
shopPage: { ...R.shopPage, [C]: T }
|
|
7221
7240
|
}));
|
|
7222
7241
|
};
|
|
7223
7242
|
return c ? /* @__PURE__ */ o("div", { className: "cedros-admin__section", children: /* @__PURE__ */ d("div", { className: "cedros-admin__loading", children: [
|
|
@@ -7231,7 +7250,7 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7231
7250
|
] }),
|
|
7232
7251
|
/* @__PURE__ */ d("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem", flexShrink: 0 }, children: [
|
|
7233
7252
|
/* @__PURE__ */ o("span", { style: { fontSize: "0.875rem", color: s.enabled ? "var(--cedros-admin-text, #171717)" : "var(--cedros-admin-muted, #737373)" }, children: s.enabled ? "Enabled" : "Disabled" }),
|
|
7234
|
-
/* @__PURE__ */ o(_t, { checked: s.enabled, onChange: (C) => i((
|
|
7253
|
+
/* @__PURE__ */ o(_t, { checked: s.enabled, onChange: (C) => i((T) => ({ ...T, enabled: C })) })
|
|
7235
7254
|
] })
|
|
7236
7255
|
] }),
|
|
7237
7256
|
!s.enabled && /* @__PURE__ */ o(
|
|
@@ -7395,7 +7414,7 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7395
7414
|
/* @__PURE__ */ d("div", { style: { marginBottom: "2rem" }, children: [
|
|
7396
7415
|
/* @__PURE__ */ o("div", { style: { fontWeight: 500, marginBottom: "0.75rem" }, children: "Shop Page" }),
|
|
7397
7416
|
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem", marginBottom: "1rem" }, children: Ia.map((C) => {
|
|
7398
|
-
const
|
|
7417
|
+
const T = s.shopLayout.layout === C.value;
|
|
7399
7418
|
return /* @__PURE__ */ d(
|
|
7400
7419
|
"label",
|
|
7401
7420
|
{
|
|
@@ -7404,10 +7423,10 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7404
7423
|
alignItems: "flex-start",
|
|
7405
7424
|
gap: "0.75rem",
|
|
7406
7425
|
padding: "0.75rem",
|
|
7407
|
-
border: `2px solid ${
|
|
7426
|
+
border: `2px solid ${T ? "var(--cedros-admin-primary, #171717)" : "var(--cedros-admin-border, #e5e5e5)"}`,
|
|
7408
7427
|
borderRadius: 6,
|
|
7409
7428
|
cursor: "pointer",
|
|
7410
|
-
background:
|
|
7429
|
+
background: T ? "var(--cedros-admin-bg-accent, #f5f5f5)" : void 0,
|
|
7411
7430
|
transition: "border-color 0.15s, background 0.15s"
|
|
7412
7431
|
},
|
|
7413
7432
|
children: [
|
|
@@ -7417,7 +7436,7 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7417
7436
|
type: "radio",
|
|
7418
7437
|
name: "shopLayout",
|
|
7419
7438
|
value: C.value,
|
|
7420
|
-
checked:
|
|
7439
|
+
checked: T,
|
|
7421
7440
|
onChange: () => P("layout", C.value),
|
|
7422
7441
|
style: { marginTop: 2 }
|
|
7423
7442
|
}
|
|
@@ -7445,7 +7464,7 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7445
7464
|
/* @__PURE__ */ d("div", { style: { paddingTop: "1.5rem", borderTop: "1px solid var(--cedros-admin-border, #e5e5e5)" }, children: [
|
|
7446
7465
|
/* @__PURE__ */ o("div", { style: { fontWeight: 500, marginBottom: "0.75rem" }, children: "Category Pages" }),
|
|
7447
7466
|
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem", marginBottom: "1rem" }, children: Ia.map((C) => {
|
|
7448
|
-
const
|
|
7467
|
+
const T = s.categoryLayout.layout === C.value;
|
|
7449
7468
|
return /* @__PURE__ */ d(
|
|
7450
7469
|
"label",
|
|
7451
7470
|
{
|
|
@@ -7454,10 +7473,10 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7454
7473
|
alignItems: "flex-start",
|
|
7455
7474
|
gap: "0.75rem",
|
|
7456
7475
|
padding: "0.75rem",
|
|
7457
|
-
border: `2px solid ${
|
|
7476
|
+
border: `2px solid ${T ? "var(--cedros-admin-primary, #171717)" : "var(--cedros-admin-border, #e5e5e5)"}`,
|
|
7458
7477
|
borderRadius: 6,
|
|
7459
7478
|
cursor: "pointer",
|
|
7460
|
-
background:
|
|
7479
|
+
background: T ? "var(--cedros-admin-bg-accent, #f5f5f5)" : void 0,
|
|
7461
7480
|
transition: "border-color 0.15s, background 0.15s"
|
|
7462
7481
|
},
|
|
7463
7482
|
children: [
|
|
@@ -7467,7 +7486,7 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7467
7486
|
type: "radio",
|
|
7468
7487
|
name: "categoryLayout",
|
|
7469
7488
|
value: C.value,
|
|
7470
|
-
checked:
|
|
7489
|
+
checked: T,
|
|
7471
7490
|
onChange: () => N("layout", C.value),
|
|
7472
7491
|
style: { marginTop: 2 }
|
|
7473
7492
|
}
|
|
@@ -7498,7 +7517,7 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7498
7517
|
/* @__PURE__ */ o("h4", { style: { marginBottom: "0.5rem", fontWeight: 600 }, children: "Related Products" }),
|
|
7499
7518
|
/* @__PURE__ */ o("p", { style: { marginBottom: "1rem", fontSize: 14, opacity: 0.7 }, children: "Configure how related products are displayed on product detail pages." }),
|
|
7500
7519
|
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem", marginBottom: "1.5rem" }, children: qf.map((C) => {
|
|
7501
|
-
const
|
|
7520
|
+
const T = s.relatedProducts.mode === C.value, R = C.badge === "Coming Soon";
|
|
7502
7521
|
return /* @__PURE__ */ d(
|
|
7503
7522
|
"label",
|
|
7504
7523
|
{
|
|
@@ -7507,11 +7526,11 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7507
7526
|
alignItems: "flex-start",
|
|
7508
7527
|
gap: "0.75rem",
|
|
7509
7528
|
padding: "1rem",
|
|
7510
|
-
border: `2px solid ${
|
|
7529
|
+
border: `2px solid ${T ? "var(--cedros-admin-primary, #171717)" : "var(--cedros-admin-border, #e5e5e5)"}`,
|
|
7511
7530
|
borderRadius: 8,
|
|
7512
7531
|
cursor: R ? "not-allowed" : "pointer",
|
|
7513
7532
|
opacity: R ? 0.6 : 1,
|
|
7514
|
-
background:
|
|
7533
|
+
background: T ? "var(--cedros-admin-bg-accent, #f5f5f5)" : void 0,
|
|
7515
7534
|
transition: "border-color 0.15s, background 0.15s"
|
|
7516
7535
|
},
|
|
7517
7536
|
children: [
|
|
@@ -7521,7 +7540,7 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7521
7540
|
type: "radio",
|
|
7522
7541
|
name: "relatedProductsMode",
|
|
7523
7542
|
value: C.value,
|
|
7524
|
-
checked:
|
|
7543
|
+
checked: T,
|
|
7525
7544
|
onChange: () => !R && _(C.value),
|
|
7526
7545
|
disabled: R,
|
|
7527
7546
|
style: { marginTop: 2 }
|
|
@@ -7593,7 +7612,7 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7593
7612
|
/* @__PURE__ */ d("div", { style: { marginTop: "1.5rem" }, children: [
|
|
7594
7613
|
/* @__PURE__ */ o("div", { style: { fontWeight: 500, marginBottom: "0.75rem" }, children: "Display Layout" }),
|
|
7595
7614
|
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem", marginBottom: "1rem" }, children: Ia.map((C) => {
|
|
7596
|
-
const
|
|
7615
|
+
const T = s.relatedProducts.layout.layout === C.value;
|
|
7597
7616
|
return /* @__PURE__ */ d(
|
|
7598
7617
|
"label",
|
|
7599
7618
|
{
|
|
@@ -7602,10 +7621,10 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7602
7621
|
alignItems: "flex-start",
|
|
7603
7622
|
gap: "0.75rem",
|
|
7604
7623
|
padding: "0.75rem",
|
|
7605
|
-
border: `2px solid ${
|
|
7624
|
+
border: `2px solid ${T ? "var(--cedros-admin-primary, #171717)" : "var(--cedros-admin-border, #e5e5e5)"}`,
|
|
7606
7625
|
borderRadius: 6,
|
|
7607
7626
|
cursor: "pointer",
|
|
7608
|
-
background:
|
|
7627
|
+
background: T ? "var(--cedros-admin-bg-accent, #f5f5f5)" : void 0,
|
|
7609
7628
|
transition: "border-color 0.15s, background 0.15s"
|
|
7610
7629
|
},
|
|
7611
7630
|
children: [
|
|
@@ -7615,7 +7634,7 @@ function Fl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7615
7634
|
type: "radio",
|
|
7616
7635
|
name: "relatedLayout",
|
|
7617
7636
|
value: C.value,
|
|
7618
|
-
checked:
|
|
7637
|
+
checked: T,
|
|
7619
7638
|
onChange: () => w("layout", C.value),
|
|
7620
7639
|
style: { marginTop: 2 }
|
|
7621
7640
|
}
|
|
@@ -7951,17 +7970,17 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7951
7970
|
openai: !1
|
|
7952
7971
|
}), O = J(async () => {
|
|
7953
7972
|
try {
|
|
7954
|
-
let
|
|
7973
|
+
let T;
|
|
7955
7974
|
if (n?.isAuthenticated())
|
|
7956
|
-
|
|
7975
|
+
T = await n.fetchWithAuth("/admin/config/ai");
|
|
7957
7976
|
else {
|
|
7958
7977
|
const R = { "Content-Type": "application/json" };
|
|
7959
7978
|
t && (R["X-API-Key"] = t);
|
|
7960
7979
|
const j = await fetch(`${e}/admin/config/ai`, { headers: R });
|
|
7961
7980
|
if (!j.ok) throw new Error(`Failed to fetch: ${j.status}`);
|
|
7962
|
-
|
|
7981
|
+
T = await j.json();
|
|
7963
7982
|
}
|
|
7964
|
-
|
|
7983
|
+
T.settings && i(T.settings);
|
|
7965
7984
|
} catch {
|
|
7966
7985
|
i(oc), h("Could not load saved AI settings. Showing defaults.");
|
|
7967
7986
|
} finally {
|
|
@@ -7972,12 +7991,12 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7972
7991
|
O();
|
|
7973
7992
|
}, [O]);
|
|
7974
7993
|
const P = J(
|
|
7975
|
-
async (
|
|
7976
|
-
const R = k[
|
|
7994
|
+
async (T) => {
|
|
7995
|
+
const R = k[T];
|
|
7977
7996
|
if (R.trim()) {
|
|
7978
7997
|
p(!0), f(null);
|
|
7979
7998
|
try {
|
|
7980
|
-
const j = { provider:
|
|
7999
|
+
const j = { provider: T, apiKey: R };
|
|
7981
8000
|
if (n?.isAuthenticated())
|
|
7982
8001
|
await n.fetchWithAuth("/admin/config/ai/api-key", {
|
|
7983
8002
|
method: "PUT",
|
|
@@ -7986,24 +8005,24 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
7986
8005
|
else {
|
|
7987
8006
|
const L = { "Content-Type": "application/json" };
|
|
7988
8007
|
t && (L["X-API-Key"] = t);
|
|
7989
|
-
const
|
|
8008
|
+
const E = await fetch(`${e}/admin/config/ai/api-key`, {
|
|
7990
8009
|
method: "PUT",
|
|
7991
8010
|
headers: L,
|
|
7992
8011
|
body: JSON.stringify(j)
|
|
7993
8012
|
});
|
|
7994
|
-
if (!
|
|
8013
|
+
if (!E.ok) throw new Error(`Failed to save: ${E.status}`);
|
|
7995
8014
|
}
|
|
7996
8015
|
i((L) => ({
|
|
7997
8016
|
...L,
|
|
7998
8017
|
apiKeys: L.apiKeys.map(
|
|
7999
|
-
(
|
|
8000
|
-
...
|
|
8018
|
+
(E) => E.provider === T ? {
|
|
8019
|
+
...E,
|
|
8001
8020
|
isConfigured: !0,
|
|
8002
8021
|
maskedKey: `${R.slice(0, 4)}...${R.slice(-4)}`,
|
|
8003
8022
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
8004
|
-
} :
|
|
8023
|
+
} : E
|
|
8005
8024
|
)
|
|
8006
|
-
})), w((L) => ({ ...L, [
|
|
8025
|
+
})), w((L) => ({ ...L, [T]: "" })), x(!0), _.current && clearTimeout(_.current), _.current = setTimeout(() => x(!1), 3e3);
|
|
8007
8026
|
} catch (j) {
|
|
8008
8027
|
f(j instanceof Error ? j.message : "Failed to save API key");
|
|
8009
8028
|
} finally {
|
|
@@ -8013,18 +8032,18 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8013
8032
|
},
|
|
8014
8033
|
[k, e, t, n]
|
|
8015
8034
|
), N = J(
|
|
8016
|
-
async (
|
|
8017
|
-
if (confirm(`Are you sure you want to delete the ${
|
|
8035
|
+
async (T) => {
|
|
8036
|
+
if (confirm(`Are you sure you want to delete the ${T === "gemini" ? "Google Gemini" : "OpenAI"} API key?`)) {
|
|
8018
8037
|
p(!0), f(null);
|
|
8019
8038
|
try {
|
|
8020
8039
|
if (n?.isAuthenticated())
|
|
8021
|
-
await n.fetchWithAuth(`/admin/config/ai/api-key/${
|
|
8040
|
+
await n.fetchWithAuth(`/admin/config/ai/api-key/${T}`, {
|
|
8022
8041
|
method: "DELETE"
|
|
8023
8042
|
});
|
|
8024
8043
|
else {
|
|
8025
8044
|
const R = { "Content-Type": "application/json" };
|
|
8026
8045
|
t && (R["X-API-Key"] = t);
|
|
8027
|
-
const j = await fetch(`${e}/admin/config/ai/api-key/${
|
|
8046
|
+
const j = await fetch(`${e}/admin/config/ai/api-key/${T}`, {
|
|
8028
8047
|
method: "DELETE",
|
|
8029
8048
|
headers: R
|
|
8030
8049
|
});
|
|
@@ -8033,7 +8052,7 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8033
8052
|
i((R) => ({
|
|
8034
8053
|
...R,
|
|
8035
8054
|
apiKeys: R.apiKeys.map(
|
|
8036
|
-
(j) => j.provider ===
|
|
8055
|
+
(j) => j.provider === T ? { provider: T, isConfigured: !1 } : j
|
|
8037
8056
|
)
|
|
8038
8057
|
}));
|
|
8039
8058
|
} catch (R) {
|
|
@@ -8045,10 +8064,10 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8045
8064
|
},
|
|
8046
8065
|
[e, t, n]
|
|
8047
8066
|
), I = J(
|
|
8048
|
-
async (
|
|
8067
|
+
async (T, R) => {
|
|
8049
8068
|
p(!0), f(null);
|
|
8050
8069
|
try {
|
|
8051
|
-
const j = { task:
|
|
8070
|
+
const j = { task: T, model: R };
|
|
8052
8071
|
if (n?.isAuthenticated())
|
|
8053
8072
|
await n.fetchWithAuth("/admin/config/ai/assignment", {
|
|
8054
8073
|
method: "PUT",
|
|
@@ -8057,17 +8076,17 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8057
8076
|
else {
|
|
8058
8077
|
const L = { "Content-Type": "application/json" };
|
|
8059
8078
|
t && (L["X-API-Key"] = t);
|
|
8060
|
-
const
|
|
8079
|
+
const E = await fetch(`${e}/admin/config/ai/assignment`, {
|
|
8061
8080
|
method: "PUT",
|
|
8062
8081
|
headers: L,
|
|
8063
8082
|
body: JSON.stringify(j)
|
|
8064
8083
|
});
|
|
8065
|
-
if (!
|
|
8084
|
+
if (!E.ok) throw new Error(`Failed to save: ${E.status}`);
|
|
8066
8085
|
}
|
|
8067
8086
|
i((L) => ({
|
|
8068
8087
|
...L,
|
|
8069
8088
|
taskAssignments: L.taskAssignments.map(
|
|
8070
|
-
(
|
|
8089
|
+
(E) => E.task === T ? { ...E, assignedModel: R } : E
|
|
8071
8090
|
)
|
|
8072
8091
|
})), x(!0), _.current && clearTimeout(_.current), _.current = setTimeout(() => x(!1), 3e3);
|
|
8073
8092
|
} catch (j) {
|
|
@@ -8078,24 +8097,24 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8078
8097
|
},
|
|
8079
8098
|
[e, t, n]
|
|
8080
8099
|
), M = J(
|
|
8081
|
-
(
|
|
8082
|
-
if (
|
|
8083
|
-
const R = Oa.find((L) => L.id ===
|
|
8100
|
+
(T) => {
|
|
8101
|
+
if (T === "not_set") return !0;
|
|
8102
|
+
const R = Oa.find((L) => L.id === T);
|
|
8084
8103
|
return R?.provider ? s.apiKeys.find((L) => L.provider === R.provider)?.isConfigured ?? !1 : !0;
|
|
8085
8104
|
},
|
|
8086
8105
|
[s.apiKeys]
|
|
8087
|
-
), z = Se(() => Oa.map((
|
|
8088
|
-
const R = M(
|
|
8106
|
+
), z = Se(() => Oa.map((T) => {
|
|
8107
|
+
const R = M(T.id);
|
|
8089
8108
|
return {
|
|
8090
|
-
value:
|
|
8091
|
-
label: R ?
|
|
8109
|
+
value: T.id,
|
|
8110
|
+
label: R ? T.label : `${T.label} (API key required)`,
|
|
8092
8111
|
disabled: !R
|
|
8093
8112
|
};
|
|
8094
8113
|
}), [M]), C = J(
|
|
8095
|
-
async (
|
|
8114
|
+
async (T, R) => {
|
|
8096
8115
|
p(!0), f(null);
|
|
8097
8116
|
try {
|
|
8098
|
-
const j = { task:
|
|
8117
|
+
const j = { task: T, systemPrompt: R };
|
|
8099
8118
|
if (n?.isAuthenticated())
|
|
8100
8119
|
await n.fetchWithAuth("/admin/config/ai/prompt", {
|
|
8101
8120
|
method: "PUT",
|
|
@@ -8104,17 +8123,17 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8104
8123
|
else {
|
|
8105
8124
|
const L = { "Content-Type": "application/json" };
|
|
8106
8125
|
t && (L["X-API-Key"] = t);
|
|
8107
|
-
const
|
|
8126
|
+
const E = await fetch(`${e}/admin/config/ai/prompt`, {
|
|
8108
8127
|
method: "PUT",
|
|
8109
8128
|
headers: L,
|
|
8110
8129
|
body: JSON.stringify(j)
|
|
8111
8130
|
});
|
|
8112
|
-
if (!
|
|
8131
|
+
if (!E.ok) throw new Error(`Failed to save: ${E.status}`);
|
|
8113
8132
|
}
|
|
8114
8133
|
i((L) => ({
|
|
8115
8134
|
...L,
|
|
8116
8135
|
taskAssignments: L.taskAssignments.map(
|
|
8117
|
-
(
|
|
8136
|
+
(E) => E.task === T ? { ...E, systemPrompt: R } : E
|
|
8118
8137
|
)
|
|
8119
8138
|
})), x(!0), _.current && clearTimeout(_.current), _.current = setTimeout(() => x(!1), 3e3);
|
|
8120
8139
|
} catch (j) {
|
|
@@ -8173,8 +8192,8 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8173
8192
|
r === "api-keys" && /* @__PURE__ */ d("div", { className: "cedros-admin__section", style: { marginTop: "1rem" }, children: [
|
|
8174
8193
|
/* @__PURE__ */ o("div", { className: "cedros-admin__section-header", children: /* @__PURE__ */ o("h3", { className: "cedros-admin__section-title", children: "API Keys" }) }),
|
|
8175
8194
|
/* @__PURE__ */ o("p", { style: { marginBottom: "1.5rem", opacity: 0.7, fontSize: 14 }, children: "Configure API keys for AI providers. Keys are stored securely and never exposed." }),
|
|
8176
|
-
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "1.5rem" }, children: Yf.map((
|
|
8177
|
-
const R = s.apiKeys.find((L) => L.provider ===
|
|
8195
|
+
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "1.5rem" }, children: Yf.map((T) => {
|
|
8196
|
+
const R = s.apiKeys.find((L) => L.provider === T.id), j = R?.isConfigured ?? !1;
|
|
8178
8197
|
return /* @__PURE__ */ d(
|
|
8179
8198
|
"div",
|
|
8180
8199
|
{
|
|
@@ -8187,7 +8206,7 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8187
8206
|
children: [
|
|
8188
8207
|
/* @__PURE__ */ d("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "0.75rem" }, children: [
|
|
8189
8208
|
/* @__PURE__ */ d("div", { children: [
|
|
8190
|
-
/* @__PURE__ */ o("div", { style: { fontWeight: 600 }, children:
|
|
8209
|
+
/* @__PURE__ */ o("div", { style: { fontWeight: 600 }, children: T.label }),
|
|
8191
8210
|
j && R?.maskedKey && /* @__PURE__ */ d("div", { style: { fontSize: 12, opacity: 0.6, marginTop: 2 }, children: [
|
|
8192
8211
|
"Current key: ",
|
|
8193
8212
|
R.maskedKey,
|
|
@@ -8210,13 +8229,13 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8210
8229
|
/* @__PURE__ */ o(
|
|
8211
8230
|
"input",
|
|
8212
8231
|
{
|
|
8213
|
-
type: b[
|
|
8232
|
+
type: b[T.id] ? "text" : "password",
|
|
8214
8233
|
className: "cedros-admin__input",
|
|
8215
|
-
placeholder: j ? "Enter new key to replace" :
|
|
8216
|
-
value: k[
|
|
8217
|
-
onChange: (L) => w((
|
|
8234
|
+
placeholder: j ? "Enter new key to replace" : T.placeholder,
|
|
8235
|
+
value: k[T.id],
|
|
8236
|
+
onChange: (L) => w((E) => ({ ...E, [T.id]: L.target.value })),
|
|
8218
8237
|
onBlur: () => {
|
|
8219
|
-
k[
|
|
8238
|
+
k[T.id].trim() && P(T.id);
|
|
8220
8239
|
},
|
|
8221
8240
|
style: { flex: 1 }
|
|
8222
8241
|
}
|
|
@@ -8226,10 +8245,10 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8226
8245
|
{
|
|
8227
8246
|
type: "button",
|
|
8228
8247
|
className: "cedros-admin__button cedros-admin__button--ghost",
|
|
8229
|
-
onClick: () => S((L) => ({ ...L, [
|
|
8230
|
-
title: b[
|
|
8248
|
+
onClick: () => S((L) => ({ ...L, [T.id]: !L[T.id] })),
|
|
8249
|
+
title: b[T.id] ? "Hide key" : "Show key",
|
|
8231
8250
|
style: { padding: "0.5rem" },
|
|
8232
|
-
children: b[
|
|
8251
|
+
children: b[T.id] ? K.eyeOff : K.eye
|
|
8233
8252
|
}
|
|
8234
8253
|
),
|
|
8235
8254
|
j && /* @__PURE__ */ o(
|
|
@@ -8237,7 +8256,7 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8237
8256
|
{
|
|
8238
8257
|
type: "button",
|
|
8239
8258
|
className: "cedros-admin__button cedros-admin__button--ghost cedros-admin__button--danger",
|
|
8240
|
-
onClick: () => N(
|
|
8259
|
+
onClick: () => N(T.id),
|
|
8241
8260
|
disabled: u,
|
|
8242
8261
|
title: "Remove API key",
|
|
8243
8262
|
style: { padding: "0.5rem" },
|
|
@@ -8247,15 +8266,15 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8247
8266
|
] }) })
|
|
8248
8267
|
]
|
|
8249
8268
|
},
|
|
8250
|
-
|
|
8269
|
+
T.id
|
|
8251
8270
|
);
|
|
8252
8271
|
}) })
|
|
8253
8272
|
] }),
|
|
8254
8273
|
r === "assignments" && /* @__PURE__ */ d("div", { className: "cedros-admin__section", style: { marginTop: "1rem" }, children: [
|
|
8255
8274
|
/* @__PURE__ */ o("div", { className: "cedros-admin__section-header", children: /* @__PURE__ */ o("h3", { className: "cedros-admin__section-title", children: "Model Assignments" }) }),
|
|
8256
8275
|
/* @__PURE__ */ o("p", { style: { marginBottom: "1.5rem", opacity: 0.7, fontSize: 14 }, children: "Assign AI models to specific tasks. Models require their provider's API key to be configured." }),
|
|
8257
|
-
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "1rem" }, children: s.taskAssignments.map((
|
|
8258
|
-
const R = cs.find((L) => L.task ===
|
|
8276
|
+
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "1rem" }, children: s.taskAssignments.map((T) => {
|
|
8277
|
+
const R = cs.find((L) => L.task === T.task), j = Oa.find((L) => L.id === T.assignedModel);
|
|
8259
8278
|
return /* @__PURE__ */ d(
|
|
8260
8279
|
"div",
|
|
8261
8280
|
{
|
|
@@ -8266,15 +8285,15 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8266
8285
|
},
|
|
8267
8286
|
children: [
|
|
8268
8287
|
/* @__PURE__ */ d("div", { style: { marginBottom: "0.75rem" }, children: [
|
|
8269
|
-
/* @__PURE__ */ o("div", { style: { fontWeight: 600 }, children: R?.label ??
|
|
8288
|
+
/* @__PURE__ */ o("div", { style: { fontWeight: 600 }, children: R?.label ?? T.task }),
|
|
8270
8289
|
/* @__PURE__ */ o("div", { style: { fontSize: 13, opacity: 0.7, marginTop: 2 }, children: R?.description })
|
|
8271
8290
|
] }),
|
|
8272
8291
|
/* @__PURE__ */ d("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
8273
8292
|
/* @__PURE__ */ o(
|
|
8274
8293
|
mt,
|
|
8275
8294
|
{
|
|
8276
|
-
value:
|
|
8277
|
-
onChange: (L) => I(
|
|
8295
|
+
value: T.assignedModel,
|
|
8296
|
+
onChange: (L) => I(T.task, L),
|
|
8278
8297
|
options: z,
|
|
8279
8298
|
label: "",
|
|
8280
8299
|
disabled: u,
|
|
@@ -8291,25 +8310,25 @@ function Bl({ serverUrl: e, apiKey: t, authManager: n }) {
|
|
|
8291
8310
|
] })
|
|
8292
8311
|
]
|
|
8293
8312
|
},
|
|
8294
|
-
|
|
8313
|
+
T.task
|
|
8295
8314
|
);
|
|
8296
8315
|
}) })
|
|
8297
8316
|
] }),
|
|
8298
8317
|
r === "prompts" && /* @__PURE__ */ d("div", { className: "cedros-admin__section", style: { marginTop: "1rem" }, children: [
|
|
8299
8318
|
/* @__PURE__ */ o("div", { className: "cedros-admin__section-header", children: /* @__PURE__ */ o("h3", { className: "cedros-admin__section-title", children: "System Prompts" }) }),
|
|
8300
8319
|
/* @__PURE__ */ o("p", { style: { marginBottom: "1.5rem", opacity: 0.7, fontSize: 14 }, children: "Configure the default system prompts for each AI task. These prompts guide the AI's behavior and responses." }),
|
|
8301
|
-
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "1.5rem" }, children: s.taskAssignments.map((
|
|
8302
|
-
const R = cs.find((j) => j.task ===
|
|
8320
|
+
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "1.5rem" }, children: s.taskAssignments.map((T) => {
|
|
8321
|
+
const R = cs.find((j) => j.task === T.task);
|
|
8303
8322
|
return /* @__PURE__ */ o(
|
|
8304
8323
|
Kf,
|
|
8305
8324
|
{
|
|
8306
|
-
task:
|
|
8307
|
-
label: R?.label ??
|
|
8325
|
+
task: T.task,
|
|
8326
|
+
label: R?.label ?? T.task,
|
|
8308
8327
|
description: R?.description ?? "",
|
|
8309
|
-
initialPrompt:
|
|
8328
|
+
initialPrompt: T.systemPrompt ?? "",
|
|
8310
8329
|
onSave: C
|
|
8311
8330
|
},
|
|
8312
|
-
|
|
8331
|
+
T.task
|
|
8313
8332
|
);
|
|
8314
8333
|
}) })
|
|
8315
8334
|
] })
|
|
@@ -9015,7 +9034,7 @@ function Wl({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
9015
9034
|
}
|
|
9016
9035
|
}, C = () => {
|
|
9017
9036
|
P({ question: "", answer: "", keywordsCsv: "", active: !0, useInChat: !0, displayOnPage: !0 }), m(null), u(!1);
|
|
9018
|
-
},
|
|
9037
|
+
}, T = (F) => {
|
|
9019
9038
|
P({
|
|
9020
9039
|
question: F.question,
|
|
9021
9040
|
answer: F.answer,
|
|
@@ -9024,7 +9043,7 @@ function Wl({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
9024
9043
|
useInChat: F.useInChat ?? !0,
|
|
9025
9044
|
displayOnPage: F.displayOnPage ?? !0
|
|
9026
9045
|
}), m(F), u(!0);
|
|
9027
|
-
}, R = a.length, j = a.filter((F) => F.active).length, L = a.filter((F) => F.active && F.useInChat).length,
|
|
9046
|
+
}, R = a.length, j = a.filter((F) => F.active).length, L = a.filter((F) => F.active && F.useInChat).length, E = a.filter((F) => F.active && F.displayOnPage).length, A = Se(() => a.filter((F) => {
|
|
9028
9047
|
if (h === "active" && !F.active || h === "inactive" && F.active) return !1;
|
|
9029
9048
|
if (x) {
|
|
9030
9049
|
const Q = x.toLowerCase();
|
|
@@ -9041,7 +9060,7 @@ function Wl({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
9041
9060
|
{ label: "Total FAQs", value: R },
|
|
9042
9061
|
{ label: "Active", value: j, variant: "success" },
|
|
9043
9062
|
{ label: "In Chat", value: L },
|
|
9044
|
-
{ label: "On Page", value:
|
|
9063
|
+
{ label: "On Page", value: E }
|
|
9045
9064
|
]
|
|
9046
9065
|
}
|
|
9047
9066
|
),
|
|
@@ -9236,7 +9255,7 @@ function Wl({ serverUrl: e, apiKey: t, pageSize: n = 20, authManager: r }) {
|
|
|
9236
9255
|
"button",
|
|
9237
9256
|
{
|
|
9238
9257
|
className: "cedros-admin__button--icon",
|
|
9239
|
-
onClick: () =>
|
|
9258
|
+
onClick: () => T(F),
|
|
9240
9259
|
title: "Edit",
|
|
9241
9260
|
children: K.edit
|
|
9242
9261
|
}
|
|
@@ -9469,8 +9488,8 @@ function y1({
|
|
|
9469
9488
|
}) {
|
|
9470
9489
|
const [f, g] = H(a), [x, y] = H(!0), [h, _] = H(/* @__PURE__ */ new Set()), k = J((z) => {
|
|
9471
9490
|
_((C) => {
|
|
9472
|
-
const
|
|
9473
|
-
return
|
|
9491
|
+
const T = new Set(C);
|
|
9492
|
+
return T.has(z) ? T.delete(z) : T.add(z), T;
|
|
9474
9493
|
});
|
|
9475
9494
|
}, []), w = qp(), b = sh(), O = ih(m, w?.mode ?? null, b) === "dark" ? "cedros-admin--dark" : "", { authManager: P } = oh({
|
|
9476
9495
|
serverUrl: e,
|
|
@@ -9497,7 +9516,7 @@ function y1({
|
|
|
9497
9516
|
/* @__PURE__ */ o("nav", { className: "cedros-admin__nav", children: Hl.map((z) => {
|
|
9498
9517
|
const C = z.sections.filter((R) => r.includes(R.id));
|
|
9499
9518
|
if (C.length === 0) return null;
|
|
9500
|
-
const
|
|
9519
|
+
const T = z.collapsible && h.has(z.label);
|
|
9501
9520
|
return /* @__PURE__ */ d("div", { className: "cedros-admin__nav-group", children: [
|
|
9502
9521
|
z.collapsible ? /* @__PURE__ */ d(
|
|
9503
9522
|
"button",
|
|
@@ -9505,14 +9524,14 @@ function y1({
|
|
|
9505
9524
|
type: "button",
|
|
9506
9525
|
className: "cedros-admin__nav-label cedros-admin__nav-label--collapsible",
|
|
9507
9526
|
onClick: () => k(z.label),
|
|
9508
|
-
"aria-expanded": !
|
|
9527
|
+
"aria-expanded": !T,
|
|
9509
9528
|
children: [
|
|
9510
9529
|
z.label,
|
|
9511
|
-
/* @__PURE__ */ o("span", { className: `cedros-admin__nav-label-icon ${
|
|
9530
|
+
/* @__PURE__ */ o("span", { className: `cedros-admin__nav-label-icon ${T ? "" : "cedros-admin__nav-label-icon--expanded"}`, children: K.chevronRight })
|
|
9512
9531
|
]
|
|
9513
9532
|
}
|
|
9514
9533
|
) : /* @__PURE__ */ o("span", { className: "cedros-admin__nav-label", children: z.label }),
|
|
9515
|
-
!
|
|
9534
|
+
!T && C.map((R) => /* @__PURE__ */ d(
|
|
9516
9535
|
"button",
|
|
9517
9536
|
{
|
|
9518
9537
|
type: "button",
|
|
@@ -9669,11 +9688,11 @@ const Mt = (e) => Vp(async () => {
|
|
|
9669
9688
|
{ id: "Configuration", label: "Configuration", order: 2, defaultCollapsed: !0 }
|
|
9670
9689
|
],
|
|
9671
9690
|
components: {
|
|
9672
|
-
products: Mt(() => import("./sections-
|
|
9691
|
+
products: Mt(() => import("./sections-DnmB0qdx.mjs").then((e) => ({ default: e.ProductsSection }))),
|
|
9673
9692
|
subscriptions: Mt(() => Promise.resolve().then(() => Hf).then((e) => ({ default: e.SubscriptionsSection }))),
|
|
9674
|
-
transactions: Mt(() => import("./sections-
|
|
9675
|
-
coupons: Mt(() => import("./sections-
|
|
9676
|
-
refunds: Mt(() => import("./sections-
|
|
9693
|
+
transactions: Mt(() => import("./sections-DnmB0qdx.mjs").then((e) => ({ default: e.TransactionsSection }))),
|
|
9694
|
+
coupons: Mt(() => import("./sections-DnmB0qdx.mjs").then((e) => ({ default: e.CouponsSection }))),
|
|
9695
|
+
refunds: Mt(() => import("./sections-DnmB0qdx.mjs").then((e) => ({ default: e.RefundsSection }))),
|
|
9677
9696
|
storefront: Mt(() => Promise.resolve().then(() => Qf).then((e) => ({ default: e.StorefrontSection }))),
|
|
9678
9697
|
"ai-settings": Mt(() => Promise.resolve().then(() => Jf).then((e) => ({ default: e.AISettingsSection }))),
|
|
9679
9698
|
faqs: Mt(() => Promise.resolve().then(() => rh).then((e) => ({ default: e.FAQSection }))),
|
|
@@ -9907,8 +9926,8 @@ function _1({
|
|
|
9907
9926
|
}) {
|
|
9908
9927
|
const { status: y, error: h, sessionId: _, processSubscription: k } = ch(), w = pn(), { t: b, translations: S } = Vn(), O = u || b("ui.subscribe"), P = w.unstyled ? x : `${w.className} cedros-theme__stripe-button ${x}`.trim(), N = h && typeof h != "string" ? h?.code ?? null : null, M = h ? typeof h == "string" ? h : ((L) => {
|
|
9909
9928
|
if (!L || !S) return "";
|
|
9910
|
-
const
|
|
9911
|
-
return
|
|
9929
|
+
const E = S.errors[L];
|
|
9930
|
+
return E ? E.action ? `${E.message} ${E.action}` : E.message : "";
|
|
9912
9931
|
})(N) : null, z = J(async () => {
|
|
9913
9932
|
fe().debug("[SubscribeButton] executeSubscription:", {
|
|
9914
9933
|
resource: e,
|
|
@@ -9943,7 +9962,7 @@ function _1({
|
|
|
9943
9962
|
m,
|
|
9944
9963
|
f,
|
|
9945
9964
|
g
|
|
9946
|
-
]), C = Se(() => `subscribe-${e}-${t}`, [e, t]),
|
|
9965
|
+
]), C = Se(() => `subscribe-${e}-${t}`, [e, t]), T = Se(
|
|
9947
9966
|
() => lr(C, z),
|
|
9948
9967
|
[C, z]
|
|
9949
9968
|
), R = y === "loading", j = p || R;
|
|
@@ -9951,7 +9970,7 @@ function _1({
|
|
|
9951
9970
|
/* @__PURE__ */ o(
|
|
9952
9971
|
"button",
|
|
9953
9972
|
{
|
|
9954
|
-
onClick:
|
|
9973
|
+
onClick: T,
|
|
9955
9974
|
disabled: j,
|
|
9956
9975
|
className: w.unstyled ? x : "cedros-theme__button cedros-theme__stripe",
|
|
9957
9976
|
type: "button",
|
|
@@ -10147,13 +10166,13 @@ function x1({
|
|
|
10147
10166
|
l,
|
|
10148
10167
|
u,
|
|
10149
10168
|
p
|
|
10150
|
-
]),
|
|
10151
|
-
() => lr(
|
|
10169
|
+
]), T = Se(() => `credits-subscribe-${e}-${t}`, [e, t]), R = Se(
|
|
10170
|
+
() => lr(T, C, {
|
|
10152
10171
|
cooldownMs: 200,
|
|
10153
10172
|
deduplicationWindowMs: 0
|
|
10154
10173
|
}),
|
|
10155
|
-
[
|
|
10156
|
-
), j = x === "loading" || x === "checking", L = h === "active" || h === "trialing",
|
|
10174
|
+
[T, C]
|
|
10175
|
+
), j = x === "loading" || x === "checking", L = h === "active" || h === "trialing", E = c || j || L;
|
|
10157
10176
|
let A = N;
|
|
10158
10177
|
if (j)
|
|
10159
10178
|
A = S("ui.processing");
|
|
@@ -10167,7 +10186,7 @@ function x1({
|
|
|
10167
10186
|
"button",
|
|
10168
10187
|
{
|
|
10169
10188
|
onClick: R,
|
|
10170
|
-
disabled:
|
|
10189
|
+
disabled: E,
|
|
10171
10190
|
className: b.unstyled ? m : "cedros-theme__button cedros-theme__credits",
|
|
10172
10191
|
type: "button",
|
|
10173
10192
|
children: A
|
|
@@ -11401,11 +11420,11 @@ function Ah(e) {
|
|
|
11401
11420
|
if (e && (e === "in_stock" || e === "low" || e === "out_of_stock" || e === "backorder"))
|
|
11402
11421
|
return e;
|
|
11403
11422
|
}
|
|
11404
|
-
function
|
|
11423
|
+
function Th(e) {
|
|
11405
11424
|
if (e && (e === "physical" || e === "digital"))
|
|
11406
11425
|
return e;
|
|
11407
11426
|
}
|
|
11408
|
-
function
|
|
11427
|
+
function Eh(e) {
|
|
11409
11428
|
const t = [];
|
|
11410
11429
|
if (Array.isArray(e))
|
|
11411
11430
|
for (const n of e)
|
|
@@ -11429,7 +11448,7 @@ function Th(e) {
|
|
|
11429
11448
|
return t.flatMap((n) => n.split(",")).map((n) => n.trim().toUpperCase()).filter(Boolean);
|
|
11430
11449
|
}
|
|
11431
11450
|
function to(e) {
|
|
11432
|
-
const t = Ph(e.fiatCurrency), n = e.images && e.images.length ? e.images : e.imageUrl ? [{ url: e.imageUrl, alt: e.title }] : [], r = e.effectiveFiatAmountCents ?? e.fiatAmountCents ?? 0, a = e.compareAtAmountCents, s = e.metadata?.shippingCountries ?? e.metadata?.shipping_countries, i =
|
|
11451
|
+
const t = Ph(e.fiatCurrency), n = e.images && e.images.length ? e.images : e.imageUrl ? [{ url: e.imageUrl, alt: e.title }] : [], r = e.effectiveFiatAmountCents ?? e.fiatAmountCents ?? 0, a = e.compareAtAmountCents, s = e.metadata?.shippingCountries ?? e.metadata?.shipping_countries, i = Eh(s);
|
|
11433
11452
|
return {
|
|
11434
11453
|
id: e.id,
|
|
11435
11454
|
slug: e.slug ?? e.id,
|
|
@@ -11443,7 +11462,7 @@ function to(e) {
|
|
|
11443
11462
|
inventoryStatus: Ah(e.inventoryStatus),
|
|
11444
11463
|
inventoryQuantity: typeof e.inventoryQuantity == "number" ? e.inventoryQuantity : void 0,
|
|
11445
11464
|
compareAtPrice: typeof a == "number" ? a / 100 : void 0,
|
|
11446
|
-
shippingProfile:
|
|
11465
|
+
shippingProfile: Th(e.shippingProfile),
|
|
11447
11466
|
checkoutRequirements: e.checkoutRequirements,
|
|
11448
11467
|
fulfillment: e.fulfillment,
|
|
11449
11468
|
attributes: i.length ? {
|
|
@@ -12152,10 +12171,10 @@ function id(e) {
|
|
|
12152
12171
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
12153
12172
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
12154
12173
|
}
|
|
12155
|
-
function
|
|
12174
|
+
function Tg(e) {
|
|
12156
12175
|
return new RegExp(`^${id(e)}$`);
|
|
12157
12176
|
}
|
|
12158
|
-
function
|
|
12177
|
+
function Eg(e) {
|
|
12159
12178
|
const t = id({ precision: e.precision }), n = ["Z"];
|
|
12160
12179
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
12161
12180
|
const r = `${t}(?:${n.join("|")})`;
|
|
@@ -12626,11 +12645,11 @@ const Qg = {
|
|
|
12626
12645
|
}), sy = /* @__PURE__ */ Y("$ZodKSUID", (e, t) => {
|
|
12627
12646
|
t.pattern ?? (t.pattern = hg), $e.init(e, t);
|
|
12628
12647
|
}), iy = /* @__PURE__ */ Y("$ZodISODateTime", (e, t) => {
|
|
12629
|
-
t.pattern ?? (t.pattern =
|
|
12648
|
+
t.pattern ?? (t.pattern = Eg(t)), $e.init(e, t);
|
|
12630
12649
|
}), cy = /* @__PURE__ */ Y("$ZodISODate", (e, t) => {
|
|
12631
12650
|
t.pattern ?? (t.pattern = Ag), $e.init(e, t);
|
|
12632
12651
|
}), ly = /* @__PURE__ */ Y("$ZodISOTime", (e, t) => {
|
|
12633
|
-
t.pattern ?? (t.pattern =
|
|
12652
|
+
t.pattern ?? (t.pattern = Tg(t)), $e.init(e, t);
|
|
12634
12653
|
}), dy = /* @__PURE__ */ Y("$ZodISODuration", (e, t) => {
|
|
12635
12654
|
t.pattern ?? (t.pattern = yg), $e.init(e, t);
|
|
12636
12655
|
}), uy = /* @__PURE__ */ Y("$ZodIPv4", (e, t) => {
|
|
@@ -13061,7 +13080,7 @@ function pc(e, t, n) {
|
|
|
13061
13080
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
|
|
13062
13081
|
return e.value = i.data, e;
|
|
13063
13082
|
}
|
|
13064
|
-
const
|
|
13083
|
+
const Ty = /* @__PURE__ */ Y("$ZodEnum", (e, t) => {
|
|
13065
13084
|
Ge.init(e, t);
|
|
13066
13085
|
const n = Xl(t.entries), r = new Set(n);
|
|
13067
13086
|
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((a) => Wh.has(typeof a)).map((a) => typeof a == "string" ? Vo(a) : a.toString()).join("|")})$`), e._zod.parse = (a, s) => {
|
|
@@ -13073,7 +13092,7 @@ const Ey = /* @__PURE__ */ Y("$ZodEnum", (e, t) => {
|
|
|
13073
13092
|
inst: e
|
|
13074
13093
|
}), a;
|
|
13075
13094
|
};
|
|
13076
|
-
}),
|
|
13095
|
+
}), Ey = /* @__PURE__ */ Y("$ZodTransform", (e, t) => {
|
|
13077
13096
|
Ge.init(e, t), e._zod.parse = (n, r) => {
|
|
13078
13097
|
if (r.direction === "backward")
|
|
13079
13098
|
throw new Yl(e.constructor.name);
|
|
@@ -13593,7 +13612,7 @@ function gd(e, t) {
|
|
|
13593
13612
|
});
|
|
13594
13613
|
}
|
|
13595
13614
|
// @__NO_SIDE_EFFECTS__
|
|
13596
|
-
function
|
|
13615
|
+
function To(e, t) {
|
|
13597
13616
|
return new Fg({
|
|
13598
13617
|
check: "min_length",
|
|
13599
13618
|
...he(t),
|
|
@@ -13688,7 +13707,7 @@ function Av() {
|
|
|
13688
13707
|
return /* @__PURE__ */ pr((e) => jh(e));
|
|
13689
13708
|
}
|
|
13690
13709
|
// @__NO_SIDE_EFFECTS__
|
|
13691
|
-
function
|
|
13710
|
+
function Tv(e, t, n) {
|
|
13692
13711
|
return new e({
|
|
13693
13712
|
type: "array",
|
|
13694
13713
|
element: t,
|
|
@@ -13699,7 +13718,7 @@ function Ev(e, t, n) {
|
|
|
13699
13718
|
});
|
|
13700
13719
|
}
|
|
13701
13720
|
// @__NO_SIDE_EFFECTS__
|
|
13702
|
-
function
|
|
13721
|
+
function Ev(e, t, n) {
|
|
13703
13722
|
return new e({
|
|
13704
13723
|
type: "custom",
|
|
13705
13724
|
check: "custom",
|
|
@@ -13901,8 +13920,8 @@ function wd(e, t) {
|
|
|
13901
13920
|
value: {
|
|
13902
13921
|
...t["~standard"],
|
|
13903
13922
|
jsonSchema: {
|
|
13904
|
-
input:
|
|
13905
|
-
output:
|
|
13923
|
+
input: Eo(t, "input", e.processors),
|
|
13924
|
+
output: Eo(t, "output", e.processors)
|
|
13906
13925
|
}
|
|
13907
13926
|
},
|
|
13908
13927
|
enumerable: !1,
|
|
@@ -13957,7 +13976,7 @@ function dt(e, t) {
|
|
|
13957
13976
|
const Ov = (e, t = {}) => (n) => {
|
|
13958
13977
|
const r = vd({ ...n, processors: t });
|
|
13959
13978
|
return ot(e, r), bd(r, e), wd(r, e);
|
|
13960
|
-
},
|
|
13979
|
+
}, Eo = (e, t, n = {}) => (r) => {
|
|
13961
13980
|
const { libraryOptions: a, target: s } = r ?? {}, i = vd({ ...a ?? {}, target: s, io: t, processors: n });
|
|
13962
13981
|
return ot(e, i), bd(i, e), wd(i, e);
|
|
13963
13982
|
}, Mv = {
|
|
@@ -14135,8 +14154,8 @@ const ib = (e, t) => {
|
|
|
14135
14154
|
Parent: Error
|
|
14136
14155
|
}), cb = /* @__PURE__ */ Ws(Ot), lb = /* @__PURE__ */ Vs(Ot), db = /* @__PURE__ */ Ho(Ot), ub = /* @__PURE__ */ qo(Ot), mb = /* @__PURE__ */ rg(Ot), pb = /* @__PURE__ */ og(Ot), fb = /* @__PURE__ */ ag(Ot), hb = /* @__PURE__ */ sg(Ot), gb = /* @__PURE__ */ ig(Ot), yb = /* @__PURE__ */ cg(Ot), vb = /* @__PURE__ */ lg(Ot), bb = /* @__PURE__ */ dg(Ot), Qe = /* @__PURE__ */ Y("ZodType", (e, t) => (Ge.init(e, t), Object.assign(e["~standard"], {
|
|
14137
14156
|
jsonSchema: {
|
|
14138
|
-
input:
|
|
14139
|
-
output:
|
|
14157
|
+
input: Eo(e, "input"),
|
|
14158
|
+
output: Eo(e, "output")
|
|
14140
14159
|
}
|
|
14141
14160
|
}), e.toJSONSchema = Ov(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(Sn(t, {
|
|
14142
14161
|
checks: [
|
|
@@ -14145,7 +14164,7 @@ const ib = (e, t) => {
|
|
|
14145
14164
|
]
|
|
14146
14165
|
}), {
|
|
14147
14166
|
parent: !0
|
|
14148
|
-
}), e.with = e.check, e.clone = (n, r) => Cn(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => cb(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => db(e, n, r), e.parseAsync = async (n, r) => lb(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => ub(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => mb(e, n, r), e.decode = (n, r) => pb(e, n, r), e.encodeAsync = async (n, r) => fb(e, n, r), e.decodeAsync = async (n, r) => hb(e, n, r), e.safeEncode = (n, r) => gb(e, n, r), e.safeDecode = (n, r) => yb(e, n, r), e.safeEncodeAsync = async (n, r) => vb(e, n, r), e.safeDecodeAsync = async (n, r) => bb(e, n, r), e.refine = (n, r) => e.check(p0(n, r)), e.superRefine = (n) => e.check(f0(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ pr(n)), e.optional = () => Pc(e), e.exactOptional = () => e0(e), e.nullable = () => Ac(e), e.nullish = () => Pc(Ac(e)), e.nonoptional = (n) => s0(e, n), e.array = () => Vb(e), e.or = (n) => Zb([e, n]), e.and = (n) => Qb(e, n), e.transform = (n) =>
|
|
14167
|
+
}), e.with = e.check, e.clone = (n, r) => Cn(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => cb(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => db(e, n, r), e.parseAsync = async (n, r) => lb(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => ub(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => mb(e, n, r), e.decode = (n, r) => pb(e, n, r), e.encodeAsync = async (n, r) => fb(e, n, r), e.decodeAsync = async (n, r) => hb(e, n, r), e.safeEncode = (n, r) => gb(e, n, r), e.safeDecode = (n, r) => yb(e, n, r), e.safeEncodeAsync = async (n, r) => vb(e, n, r), e.safeDecodeAsync = async (n, r) => bb(e, n, r), e.refine = (n, r) => e.check(p0(n, r)), e.superRefine = (n) => e.check(f0(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ pr(n)), e.optional = () => Pc(e), e.exactOptional = () => e0(e), e.nullable = () => Ac(e), e.nullish = () => Pc(Ac(e)), e.nonoptional = (n) => s0(e, n), e.array = () => Vb(e), e.or = (n) => Zb([e, n]), e.and = (n) => Qb(e, n), e.transform = (n) => Tc(e, Xb(n)), e.default = (n) => r0(e, n), e.prefault = (n) => a0(e, n), e.catch = (n) => c0(e, n), e.pipe = (n) => Tc(e, n), e.readonly = () => u0(e), e.describe = (n) => {
|
|
14149
14168
|
const r = e.clone();
|
|
14150
14169
|
return Ir.add(r, { description: n }), r;
|
|
14151
14170
|
}, Object.defineProperty(e, "description", {
|
|
@@ -14161,9 +14180,9 @@ const ib = (e, t) => {
|
|
|
14161
14180
|
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), xd = /* @__PURE__ */ Y("_ZodString", (e, t) => {
|
|
14162
14181
|
Hs.init(e, t), Qe.init(e, t), e._zod.processJSONSchema = (r, a, s) => Dv(e, r, a);
|
|
14163
14182
|
const n = e._zod.bag;
|
|
14164
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ vv(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ _v(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ xv(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ kv(...r)), e.min = (...r) => e.check(/* @__PURE__ */
|
|
14183
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ vv(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ _v(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ xv(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ kv(...r)), e.min = (...r) => e.check(/* @__PURE__ */ To(...r)), e.max = (...r) => e.check(/* @__PURE__ */ gd(...r)), e.length = (...r) => e.check(/* @__PURE__ */ yd(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ To(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ bv(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ wv(r)), e.trim = () => e.check(/* @__PURE__ */ Cv()), e.normalize = (...r) => e.check(/* @__PURE__ */ Sv(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ Nv()), e.toUpperCase = () => e.check(/* @__PURE__ */ Pv()), e.slugify = () => e.check(/* @__PURE__ */ Av());
|
|
14165
14184
|
}), wb = /* @__PURE__ */ Y("ZodString", (e, t) => {
|
|
14166
|
-
Hs.init(e, t), xd.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ Wy(_b, n)), e.url = (n) => e.check(/* @__PURE__ */ Gy(xb, n)), e.jwt = (n) => e.check(/* @__PURE__ */ lv($b, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Qy(kb, n)), e.guid = (n) => e.check(/* @__PURE__ */ wc(Sc, n)), e.uuid = (n) => e.check(/* @__PURE__ */ Vy(oo, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ Hy(oo, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ qy(oo, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Zy(oo, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Yy(Sb, n)), e.guid = (n) => e.check(/* @__PURE__ */ wc(Sc, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Ky(Cb, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Xy(Nb, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Jy(Pb, n)), e.base64 = (n) => e.check(/* @__PURE__ */ sv(Mb, n)), e.base64url = (n) => e.check(/* @__PURE__ */ iv(Db, n)), e.xid = (n) => e.check(/* @__PURE__ */ ev(Ab, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ tv(
|
|
14185
|
+
Hs.init(e, t), xd.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ Wy(_b, n)), e.url = (n) => e.check(/* @__PURE__ */ Gy(xb, n)), e.jwt = (n) => e.check(/* @__PURE__ */ lv($b, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Qy(kb, n)), e.guid = (n) => e.check(/* @__PURE__ */ wc(Sc, n)), e.uuid = (n) => e.check(/* @__PURE__ */ Vy(oo, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ Hy(oo, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ qy(oo, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Zy(oo, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Yy(Sb, n)), e.guid = (n) => e.check(/* @__PURE__ */ wc(Sc, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Ky(Cb, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Xy(Nb, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Jy(Pb, n)), e.base64 = (n) => e.check(/* @__PURE__ */ sv(Mb, n)), e.base64url = (n) => e.check(/* @__PURE__ */ iv(Db, n)), e.xid = (n) => e.check(/* @__PURE__ */ ev(Ab, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ tv(Tb, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ nv(Eb, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ rv(Ib, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ ov(Rb, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ av(Ob, n)), e.e164 = (n) => e.check(/* @__PURE__ */ cv(Lb, n)), e.datetime = (n) => e.check(eb(n)), e.date = (n) => e.check(nb(n)), e.time = (n) => e.check(ob(n)), e.duration = (n) => e.check(sb(n));
|
|
14167
14186
|
});
|
|
14168
14187
|
function ut(e) {
|
|
14169
14188
|
return /* @__PURE__ */ Uy(wb, e);
|
|
@@ -14190,9 +14209,9 @@ const Be = /* @__PURE__ */ Y("ZodStringFormat", (e, t) => {
|
|
|
14190
14209
|
oy.init(e, t), Be.init(e, t);
|
|
14191
14210
|
}), Ab = /* @__PURE__ */ Y("ZodXID", (e, t) => {
|
|
14192
14211
|
ay.init(e, t), Be.init(e, t);
|
|
14193
|
-
}),
|
|
14212
|
+
}), Tb = /* @__PURE__ */ Y("ZodKSUID", (e, t) => {
|
|
14194
14213
|
sy.init(e, t), Be.init(e, t);
|
|
14195
|
-
}),
|
|
14214
|
+
}), Eb = /* @__PURE__ */ Y("ZodIPv4", (e, t) => {
|
|
14196
14215
|
uy.init(e, t), Be.init(e, t);
|
|
14197
14216
|
}), Ib = /* @__PURE__ */ Y("ZodIPv6", (e, t) => {
|
|
14198
14217
|
my.init(e, t), Be.init(e, t);
|
|
@@ -14235,10 +14254,10 @@ function Ub(e) {
|
|
|
14235
14254
|
return /* @__PURE__ */ yv(jb, e);
|
|
14236
14255
|
}
|
|
14237
14256
|
const Wb = /* @__PURE__ */ Y("ZodArray", (e, t) => {
|
|
14238
|
-
Sy.init(e, t), Qe.init(e, t), e._zod.processJSONSchema = (n, r, a) => Uv(e, n, r, a), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */
|
|
14257
|
+
Sy.init(e, t), Qe.init(e, t), e._zod.processJSONSchema = (n, r, a) => Uv(e, n, r, a), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ To(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ To(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ gd(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ yd(n, r)), e.unwrap = () => e.element;
|
|
14239
14258
|
});
|
|
14240
14259
|
function Vb(e, t) {
|
|
14241
|
-
return /* @__PURE__ */
|
|
14260
|
+
return /* @__PURE__ */ Tv(Wb, e, t);
|
|
14242
14261
|
}
|
|
14243
14262
|
const Hb = /* @__PURE__ */ Y("ZodObject", (e, t) => {
|
|
14244
14263
|
Ny.init(e, t), Qe.init(e, t), e._zod.processJSONSchema = (n, r, a) => Wv(e, n, r, a), Ie(e, "shape", () => t.shape), e.keyof = () => Yb(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Nc() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Nc() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Ub() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Gh(e, n), e.safeExtend = (n) => Qh(e, n), e.merge = (n) => Yh(e, n), e.pick = (n) => qh(e, n), e.omit = (n) => Zh(e, n), e.partial = (...n) => Kh(Cd, e, n[0]), e.required = (...n) => Xh(Nd, e, n[0]);
|
|
@@ -14272,7 +14291,7 @@ function Qb(e, t) {
|
|
|
14272
14291
|
});
|
|
14273
14292
|
}
|
|
14274
14293
|
const us = /* @__PURE__ */ Y("ZodEnum", (e, t) => {
|
|
14275
|
-
|
|
14294
|
+
Ty.init(e, t), Qe.init(e, t), e._zod.processJSONSchema = (r, a, s) => Fv(e, r, a), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
14276
14295
|
const n = new Set(Object.keys(t.entries));
|
|
14277
14296
|
e.extract = (r, a) => {
|
|
14278
14297
|
const s = {};
|
|
@@ -14311,7 +14330,7 @@ function Yb(e, t) {
|
|
|
14311
14330
|
});
|
|
14312
14331
|
}
|
|
14313
14332
|
const Kb = /* @__PURE__ */ Y("ZodTransform", (e, t) => {
|
|
14314
|
-
|
|
14333
|
+
Ey.init(e, t), Qe.init(e, t), e._zod.processJSONSchema = (n, r, a) => jv(e, n), e._zod.parse = (n, r) => {
|
|
14315
14334
|
if (r.direction === "backward")
|
|
14316
14335
|
throw new Yl(e.constructor.name);
|
|
14317
14336
|
n.addIssue = (s) => {
|
|
@@ -14406,7 +14425,7 @@ function c0(e, t) {
|
|
|
14406
14425
|
const l0 = /* @__PURE__ */ Y("ZodPipe", (e, t) => {
|
|
14407
14426
|
$y.init(e, t), Qe.init(e, t), e._zod.processJSONSchema = (n, r, a) => Kv(e, n, r, a), e.in = t.in, e.out = t.out;
|
|
14408
14427
|
});
|
|
14409
|
-
function
|
|
14428
|
+
function Tc(e, t) {
|
|
14410
14429
|
return new l0({
|
|
14411
14430
|
type: "pipe",
|
|
14412
14431
|
in: e,
|
|
@@ -14427,7 +14446,7 @@ const m0 = /* @__PURE__ */ Y("ZodCustom", (e, t) => {
|
|
|
14427
14446
|
Fy.init(e, t), Qe.init(e, t), e._zod.processJSONSchema = (n, r, a) => Bv(e, n);
|
|
14428
14447
|
});
|
|
14429
14448
|
function p0(e, t = {}) {
|
|
14430
|
-
return /* @__PURE__ */
|
|
14449
|
+
return /* @__PURE__ */ Ev(m0, e, t);
|
|
14431
14450
|
}
|
|
14432
14451
|
function f0(e) {
|
|
14433
14452
|
return /* @__PURE__ */ Iv(e);
|
|
@@ -14453,9 +14472,9 @@ function h0(e) {
|
|
|
14453
14472
|
shippingMethodId: ut().optional()
|
|
14454
14473
|
});
|
|
14455
14474
|
}
|
|
14456
|
-
const
|
|
14475
|
+
const Ec = { none: 0, optional: 1, required: 2 };
|
|
14457
14476
|
function Fa(e, t) {
|
|
14458
|
-
return
|
|
14477
|
+
return Ec[e] >= Ec[t] ? e : t;
|
|
14459
14478
|
}
|
|
14460
14479
|
function g0(e) {
|
|
14461
14480
|
if (!e) return null;
|
|
@@ -14624,7 +14643,7 @@ function Ad() {
|
|
|
14624
14643
|
createCheckoutSession: _
|
|
14625
14644
|
};
|
|
14626
14645
|
}
|
|
14627
|
-
function
|
|
14646
|
+
function Td({ children: e }) {
|
|
14628
14647
|
const t = Ad();
|
|
14629
14648
|
return /* @__PURE__ */ o(Pd.Provider, { value: t, children: e });
|
|
14630
14649
|
}
|
|
@@ -14667,7 +14686,7 @@ function Qo(e) {
|
|
|
14667
14686
|
};
|
|
14668
14687
|
}, [t.adapter, e.category, e.search, e.sort, e.page, e.pageSize, l]), { data: n, isLoading: a, error: i };
|
|
14669
14688
|
}
|
|
14670
|
-
function
|
|
14689
|
+
function Ed(e) {
|
|
14671
14690
|
const { config: t } = Fe(), [n, r] = v.useState(null), [a, s] = v.useState(!0), [i, c] = v.useState(null);
|
|
14672
14691
|
return v.useEffect(() => {
|
|
14673
14692
|
let l = !1;
|
|
@@ -15257,7 +15276,7 @@ function Dd() {
|
|
|
15257
15276
|
}, [t]), { config: n, isLoading: a };
|
|
15258
15277
|
}
|
|
15259
15278
|
const Rc = /* @__PURE__ */ new Map();
|
|
15260
|
-
function
|
|
15279
|
+
function T0(e) {
|
|
15261
15280
|
return e.productId ? `id:${e.productId}` : e.name ? `name:${e.name}` : "";
|
|
15262
15281
|
}
|
|
15263
15282
|
function Ld(e = {}) {
|
|
@@ -15274,7 +15293,7 @@ function Ld(e = {}) {
|
|
|
15274
15293
|
g("AI recommendations not available");
|
|
15275
15294
|
return;
|
|
15276
15295
|
}
|
|
15277
|
-
const _ =
|
|
15296
|
+
const _ = T0(h), k = Rc.get(_);
|
|
15278
15297
|
if (k) {
|
|
15279
15298
|
c(k.relatedProductIds), u(k.reasoning), g(null);
|
|
15280
15299
|
return;
|
|
@@ -15309,7 +15328,7 @@ function ze(e, t) {
|
|
|
15309
15328
|
function Lt(e) {
|
|
15310
15329
|
return typeof e == "string" && e.trim().length > 0;
|
|
15311
15330
|
}
|
|
15312
|
-
async function
|
|
15331
|
+
async function E0(e, t = {}) {
|
|
15313
15332
|
const n = t.pageSize ?? 10, r = await e.listCategories();
|
|
15314
15333
|
ze(Array.isArray(r), "listCategories() must return an array");
|
|
15315
15334
|
for (const i of r)
|
|
@@ -15751,7 +15770,7 @@ const Mc = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Dc = Bd, X
|
|
|
15751
15770
|
"left-bottom"
|
|
15752
15771
|
], S = () => [...b(), ie, se], O = () => ["auto", "hidden", "clip", "visible", "scroll"], P = () => ["auto", "contain", "none"], N = () => [ie, se, l], I = () => [Xn, "full", "auto", ...N()], M = () => [hn, "none", "subgrid", ie, se], z = () => ["auto", {
|
|
15753
15772
|
span: ["full", hn, ie, se]
|
|
15754
|
-
}, hn, ie, se], C = () => [hn, "auto", ie, se],
|
|
15773
|
+
}, hn, ie, se], C = () => [hn, "auto", ie, se], T = () => ["auto", "min", "max", "fr", ie, se], R = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], j = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], L = () => ["auto", ...N()], E = () => [Xn, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...N()], A = () => [e, ie, se], F = () => [...b(), Bc, Fc, {
|
|
15755
15774
|
position: [ie, se]
|
|
15756
15775
|
}], Q = () => ["no-repeat", {
|
|
15757
15776
|
repeat: ["", "x", "y", "space", "round"]
|
|
@@ -16140,14 +16159,14 @@ const Mc = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Dc = Bd, X
|
|
|
16140
16159
|
* @see https://tailwindcss.com/docs/grid-auto-columns
|
|
16141
16160
|
*/
|
|
16142
16161
|
"auto-cols": [{
|
|
16143
|
-
"auto-cols":
|
|
16162
|
+
"auto-cols": T()
|
|
16144
16163
|
}],
|
|
16145
16164
|
/**
|
|
16146
16165
|
* Grid Auto Rows
|
|
16147
16166
|
* @see https://tailwindcss.com/docs/grid-auto-rows
|
|
16148
16167
|
*/
|
|
16149
16168
|
"auto-rows": [{
|
|
16150
|
-
"auto-rows":
|
|
16169
|
+
"auto-rows": T()
|
|
16151
16170
|
}],
|
|
16152
16171
|
/**
|
|
16153
16172
|
* Gap
|
|
@@ -16396,14 +16415,14 @@ const Mc = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Dc = Bd, X
|
|
|
16396
16415
|
* @see https://tailwindcss.com/docs/width#setting-both-width-and-height
|
|
16397
16416
|
*/
|
|
16398
16417
|
size: [{
|
|
16399
|
-
size:
|
|
16418
|
+
size: E()
|
|
16400
16419
|
}],
|
|
16401
16420
|
/**
|
|
16402
16421
|
* Width
|
|
16403
16422
|
* @see https://tailwindcss.com/docs/width
|
|
16404
16423
|
*/
|
|
16405
16424
|
w: [{
|
|
16406
|
-
w: [c, "screen", ...
|
|
16425
|
+
w: [c, "screen", ...E()]
|
|
16407
16426
|
}],
|
|
16408
16427
|
/**
|
|
16409
16428
|
* Min-Width
|
|
@@ -16415,7 +16434,7 @@ const Mc = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Dc = Bd, X
|
|
|
16415
16434
|
"screen",
|
|
16416
16435
|
/** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
|
|
16417
16436
|
"none",
|
|
16418
|
-
...
|
|
16437
|
+
...E()
|
|
16419
16438
|
]
|
|
16420
16439
|
}],
|
|
16421
16440
|
/**
|
|
@@ -16433,7 +16452,7 @@ const Mc = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Dc = Bd, X
|
|
|
16433
16452
|
{
|
|
16434
16453
|
screen: [i]
|
|
16435
16454
|
},
|
|
16436
|
-
...
|
|
16455
|
+
...E()
|
|
16437
16456
|
]
|
|
16438
16457
|
}],
|
|
16439
16458
|
/**
|
|
@@ -16441,21 +16460,21 @@ const Mc = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Dc = Bd, X
|
|
|
16441
16460
|
* @see https://tailwindcss.com/docs/height
|
|
16442
16461
|
*/
|
|
16443
16462
|
h: [{
|
|
16444
|
-
h: ["screen", "lh", ...
|
|
16463
|
+
h: ["screen", "lh", ...E()]
|
|
16445
16464
|
}],
|
|
16446
16465
|
/**
|
|
16447
16466
|
* Min-Height
|
|
16448
16467
|
* @see https://tailwindcss.com/docs/min-height
|
|
16449
16468
|
*/
|
|
16450
16469
|
"min-h": [{
|
|
16451
|
-
"min-h": ["screen", "lh", "none", ...
|
|
16470
|
+
"min-h": ["screen", "lh", "none", ...E()]
|
|
16452
16471
|
}],
|
|
16453
16472
|
/**
|
|
16454
16473
|
* Max-Height
|
|
16455
16474
|
* @see https://tailwindcss.com/docs/max-height
|
|
16456
16475
|
*/
|
|
16457
16476
|
"max-h": [{
|
|
16458
|
-
"max-h": ["screen", "lh", ...
|
|
16477
|
+
"max-h": ["screen", "lh", ...E()]
|
|
16459
16478
|
}],
|
|
16460
16479
|
// ------------------
|
|
16461
16480
|
// --- Typography ---
|
|
@@ -18326,7 +18345,7 @@ const pt = v.forwardRef(
|
|
|
18326
18345
|
)
|
|
18327
18346
|
);
|
|
18328
18347
|
pt.displayName = "Label";
|
|
18329
|
-
var
|
|
18348
|
+
var Tw = [
|
|
18330
18349
|
"a",
|
|
18331
18350
|
"button",
|
|
18332
18351
|
"div",
|
|
@@ -18344,7 +18363,7 @@ var Ew = [
|
|
|
18344
18363
|
"span",
|
|
18345
18364
|
"svg",
|
|
18346
18365
|
"ul"
|
|
18347
|
-
],
|
|
18366
|
+
], Ew = Tw.reduce((e, t) => {
|
|
18348
18367
|
const n = /* @__PURE__ */ zd(`Primitive.${t}`), r = v.forwardRef((a, s) => {
|
|
18349
18368
|
const { asChild: i, ...c } = a, l = i ? n : t;
|
|
18350
18369
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ o(l, { ...c, ref: s });
|
|
@@ -18353,7 +18372,7 @@ var Ew = [
|
|
|
18353
18372
|
}, {}), Iw = "Separator", jc = "horizontal", Rw = ["horizontal", "vertical"], tu = v.forwardRef((e, t) => {
|
|
18354
18373
|
const { decorative: n, orientation: r = jc, ...a } = e, s = Ow(r) ? r : jc, c = n ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
|
|
18355
18374
|
return /* @__PURE__ */ o(
|
|
18356
|
-
|
|
18375
|
+
Ew.div,
|
|
18357
18376
|
{
|
|
18358
18377
|
"data-orientation": s,
|
|
18359
18378
|
...c,
|
|
@@ -19186,14 +19205,14 @@ const C_ = (e) => ({
|
|
|
19186
19205
|
}, g = ai(a), x = oi(g), y = await i.getDimensions(u), h = g === "y", _ = h ? "top" : "left", k = h ? "bottom" : "right", w = h ? "clientHeight" : "clientWidth", b = s.reference[x] + s.reference[g] - f[g] - s.floating[x], S = f[g] - s.reference[g], O = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
|
|
19187
19206
|
let P = O ? O[w] : 0;
|
|
19188
19207
|
(!P || !await (i.isElement == null ? void 0 : i.isElement(O))) && (P = c.floating[w] || s.floating[x]);
|
|
19189
|
-
const N = b / 2 - S / 2, I = P / 2 - y[x] / 2 - 1, M = wn(m[_], I), z = wn(m[k], I), C = M,
|
|
19208
|
+
const N = b / 2 - S / 2, I = P / 2 - y[x] / 2 - 1, M = wn(m[_], I), z = wn(m[k], I), C = M, T = P - y[x] - z, R = P / 2 - y[x] / 2 + N, j = hs(C, R, T), L = !l.arrow && vr(a) != null && R !== j && s.reference[x] / 2 - (R < C ? M : z) - y[x] / 2 < 0, E = L ? R < C ? R - C : R - T : 0;
|
|
19190
19209
|
return {
|
|
19191
|
-
[g]: f[g] +
|
|
19210
|
+
[g]: f[g] + E,
|
|
19192
19211
|
data: {
|
|
19193
19212
|
[g]: j,
|
|
19194
|
-
centerOffset: R - j -
|
|
19213
|
+
centerOffset: R - j - E,
|
|
19195
19214
|
...L && {
|
|
19196
|
-
alignmentOffset:
|
|
19215
|
+
alignmentOffset: E
|
|
19197
19216
|
}
|
|
19198
19217
|
},
|
|
19199
19218
|
reset: L
|
|
@@ -19249,12 +19268,12 @@ const C_ = (e) => ({
|
|
|
19249
19268
|
placement: j
|
|
19250
19269
|
}
|
|
19251
19270
|
};
|
|
19252
|
-
let L = (C = M.filter((
|
|
19271
|
+
let L = (C = M.filter((E) => E.overflows[0] <= 0).sort((E, A) => E.overflows[1] - A.overflows[1])[0]) == null ? void 0 : C.placement;
|
|
19253
19272
|
if (!L)
|
|
19254
19273
|
switch (g) {
|
|
19255
19274
|
case "bestFit": {
|
|
19256
|
-
var
|
|
19257
|
-
const
|
|
19275
|
+
var T;
|
|
19276
|
+
const E = (T = M.filter((A) => {
|
|
19258
19277
|
if (O) {
|
|
19259
19278
|
const F = Kt(A.placement);
|
|
19260
19279
|
return F === k || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -19262,8 +19281,8 @@ const C_ = (e) => ({
|
|
|
19262
19281
|
F === "y";
|
|
19263
19282
|
}
|
|
19264
19283
|
return !0;
|
|
19265
|
-
}).map((A) => [A.placement, A.overflows.filter((F) => F > 0).reduce((F, Q) => F + Q, 0)]).sort((A, F) => A[1] - F[1])[0]) == null ? void 0 :
|
|
19266
|
-
|
|
19284
|
+
}).map((A) => [A.placement, A.overflows.filter((F) => F > 0).reduce((F, Q) => F + Q, 0)]).sort((A, F) => A[1] - F[1])[0]) == null ? void 0 : T[0];
|
|
19285
|
+
E && (L = E);
|
|
19267
19286
|
break;
|
|
19268
19287
|
}
|
|
19269
19288
|
case "initialPlacement":
|
|
@@ -19361,7 +19380,7 @@ async function A_(e, t) {
|
|
|
19361
19380
|
y: g * p
|
|
19362
19381
|
};
|
|
19363
19382
|
}
|
|
19364
|
-
const
|
|
19383
|
+
const T_ = function(e) {
|
|
19365
19384
|
return e === void 0 && (e = 0), {
|
|
19366
19385
|
name: "offset",
|
|
19367
19386
|
options: e,
|
|
@@ -19383,7 +19402,7 @@ const E_ = function(e) {
|
|
|
19383
19402
|
};
|
|
19384
19403
|
}
|
|
19385
19404
|
};
|
|
19386
|
-
},
|
|
19405
|
+
}, E_ = function(e) {
|
|
19387
19406
|
return e === void 0 && (e = {}), {
|
|
19388
19407
|
name: "shift",
|
|
19389
19408
|
options: e,
|
|
@@ -19505,8 +19524,8 @@ const E_ = function(e) {
|
|
|
19505
19524
|
const k = y - p.top - p.bottom, w = x - p.left - p.right, b = wn(y - p[h], k), S = wn(x - p[_], w), O = !t.middlewareData.shift;
|
|
19506
19525
|
let P = b, N = S;
|
|
19507
19526
|
if ((n = t.middlewareData.shift) != null && n.enabled.x && (N = w), (r = t.middlewareData.shift) != null && r.enabled.y && (P = k), O && !f) {
|
|
19508
|
-
const M = At(p.left, 0), z = At(p.right, 0), C = At(p.top, 0),
|
|
19509
|
-
g ? N = x - 2 * (M !== 0 || z !== 0 ? M + z : At(p.left, p.right)) : P = y - 2 * (C !== 0 ||
|
|
19527
|
+
const M = At(p.left, 0), z = At(p.right, 0), C = At(p.top, 0), T = At(p.bottom, 0);
|
|
19528
|
+
g ? N = x - 2 * (M !== 0 || z !== 0 ? M + z : At(p.left, p.right)) : P = y - 2 * (C !== 0 || T !== 0 ? C + T : At(p.top, p.bottom));
|
|
19510
19529
|
}
|
|
19511
19530
|
await l({
|
|
19512
19531
|
...t,
|
|
@@ -19528,7 +19547,7 @@ function Ko() {
|
|
|
19528
19547
|
function br(e) {
|
|
19529
19548
|
return lu(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
19530
19549
|
}
|
|
19531
|
-
function
|
|
19550
|
+
function Tt(e) {
|
|
19532
19551
|
var t;
|
|
19533
19552
|
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
19534
19553
|
}
|
|
@@ -19537,16 +19556,16 @@ function on(e) {
|
|
|
19537
19556
|
return (t = (lu(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
19538
19557
|
}
|
|
19539
19558
|
function lu(e) {
|
|
19540
|
-
return Ko() ? e instanceof Node || e instanceof
|
|
19559
|
+
return Ko() ? e instanceof Node || e instanceof Tt(e).Node : !1;
|
|
19541
19560
|
}
|
|
19542
19561
|
function jt(e) {
|
|
19543
|
-
return Ko() ? e instanceof Element || e instanceof
|
|
19562
|
+
return Ko() ? e instanceof Element || e instanceof Tt(e).Element : !1;
|
|
19544
19563
|
}
|
|
19545
19564
|
function nn(e) {
|
|
19546
|
-
return Ko() ? e instanceof HTMLElement || e instanceof
|
|
19565
|
+
return Ko() ? e instanceof HTMLElement || e instanceof Tt(e).HTMLElement : !1;
|
|
19547
19566
|
}
|
|
19548
19567
|
function nl(e) {
|
|
19549
|
-
return !Ko() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof
|
|
19568
|
+
return !Ko() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Tt(e).ShadowRoot;
|
|
19550
19569
|
}
|
|
19551
19570
|
const O_ = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
19552
19571
|
function Qr(e) {
|
|
@@ -19596,7 +19615,7 @@ function ir(e) {
|
|
|
19596
19615
|
return j_.has(br(e));
|
|
19597
19616
|
}
|
|
19598
19617
|
function Ut(e) {
|
|
19599
|
-
return
|
|
19618
|
+
return Tt(e).getComputedStyle(e);
|
|
19600
19619
|
}
|
|
19601
19620
|
function Jo(e) {
|
|
19602
19621
|
return jt(e) ? {
|
|
@@ -19626,7 +19645,7 @@ function du(e) {
|
|
|
19626
19645
|
function Ur(e, t, n) {
|
|
19627
19646
|
var r;
|
|
19628
19647
|
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
19629
|
-
const a = du(e), s = a === ((r = e.ownerDocument) == null ? void 0 : r.body), i =
|
|
19648
|
+
const a = du(e), s = a === ((r = e.ownerDocument) == null ? void 0 : r.body), i = Tt(a);
|
|
19630
19649
|
if (s) {
|
|
19631
19650
|
const c = ys(i);
|
|
19632
19651
|
return t.concat(i, i.visualViewport || [], Qr(a) ? a : [], c && n ? Ur(c) : []);
|
|
@@ -19666,14 +19685,14 @@ function ar(e) {
|
|
|
19666
19685
|
}
|
|
19667
19686
|
const U_ = /* @__PURE__ */ Jt(0);
|
|
19668
19687
|
function mu(e) {
|
|
19669
|
-
const t =
|
|
19688
|
+
const t = Tt(e);
|
|
19670
19689
|
return !ii() || !t.visualViewport ? U_ : {
|
|
19671
19690
|
x: t.visualViewport.offsetLeft,
|
|
19672
19691
|
y: t.visualViewport.offsetTop
|
|
19673
19692
|
};
|
|
19674
19693
|
}
|
|
19675
19694
|
function W_(e, t, n) {
|
|
19676
|
-
return t === void 0 && (t = !1), !n || t && n !==
|
|
19695
|
+
return t === void 0 && (t = !1), !n || t && n !== Tt(e) ? !1 : t;
|
|
19677
19696
|
}
|
|
19678
19697
|
function zn(e, t, n, r) {
|
|
19679
19698
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
@@ -19683,11 +19702,11 @@ function zn(e, t, n, r) {
|
|
|
19683
19702
|
const c = W_(s, n, r) ? mu(s) : Jt(0);
|
|
19684
19703
|
let l = (a.left + c.x) / i.x, u = (a.top + c.y) / i.y, p = a.width / i.x, m = a.height / i.y;
|
|
19685
19704
|
if (s) {
|
|
19686
|
-
const f =
|
|
19705
|
+
const f = Tt(s), g = r && jt(r) ? Tt(r) : r;
|
|
19687
19706
|
let x = f, y = ys(x);
|
|
19688
19707
|
for (; y && r && g !== x; ) {
|
|
19689
19708
|
const h = ar(y), _ = y.getBoundingClientRect(), k = Ut(y), w = _.left + (y.clientLeft + parseFloat(k.paddingLeft)) * h.x, b = _.top + (y.clientTop + parseFloat(k.paddingTop)) * h.y;
|
|
19690
|
-
l *= h.x, u *= h.y, p *= h.x, m *= h.y, l += w, u += b, x =
|
|
19709
|
+
l *= h.x, u *= h.y, p *= h.x, m *= h.y, l += w, u += b, x = Tt(y), y = ys(x);
|
|
19691
19710
|
}
|
|
19692
19711
|
}
|
|
19693
19712
|
return Do({
|
|
@@ -19751,7 +19770,7 @@ function q_(e) {
|
|
|
19751
19770
|
}
|
|
19752
19771
|
const rl = 25;
|
|
19753
19772
|
function Z_(e, t) {
|
|
19754
|
-
const n =
|
|
19773
|
+
const n = Tt(e), r = on(e), a = n.visualViewport;
|
|
19755
19774
|
let s = r.clientWidth, i = r.clientHeight, c = 0, l = 0;
|
|
19756
19775
|
if (a) {
|
|
19757
19776
|
s = a.width, i = a.height;
|
|
@@ -19880,7 +19899,7 @@ function al(e, t) {
|
|
|
19880
19899
|
return on(e) === n && (n = n.ownerDocument.body), n;
|
|
19881
19900
|
}
|
|
19882
19901
|
function hu(e, t) {
|
|
19883
|
-
const n =
|
|
19902
|
+
const n = Tt(e);
|
|
19884
19903
|
if (Xo(e))
|
|
19885
19904
|
return n;
|
|
19886
19905
|
if (!nn(e)) {
|
|
@@ -20009,7 +20028,7 @@ function ox(e, t, n, r) {
|
|
|
20009
20028
|
}), m?.(), (_ = g) == null || _.disconnect(), g = null, l && cancelAnimationFrame(x);
|
|
20010
20029
|
};
|
|
20011
20030
|
}
|
|
20012
|
-
const ax =
|
|
20031
|
+
const ax = T_, sx = E_, ix = N_, cx = R_, lx = P_, sl = C_, dx = I_, ux = (e, t, n) => {
|
|
20013
20032
|
const r = /* @__PURE__ */ new Map(), a = {
|
|
20014
20033
|
platform: nx,
|
|
20015
20034
|
...n
|
|
@@ -20094,7 +20113,7 @@ function fx(e) {
|
|
|
20094
20113
|
A !== O.current && (O.current = A, y(A));
|
|
20095
20114
|
}, []), w = v.useCallback((A) => {
|
|
20096
20115
|
A !== P.current && (P.current = A, _(A));
|
|
20097
|
-
}, []), b = s || x, S = i || h, O = v.useRef(null), P = v.useRef(null), N = v.useRef(p), I = l != null, M = qa(l), z = qa(a), C = qa(u),
|
|
20116
|
+
}, []), b = s || x, S = i || h, O = v.useRef(null), P = v.useRef(null), N = v.useRef(p), I = l != null, M = qa(l), z = qa(a), C = qa(u), T = v.useCallback(() => {
|
|
20098
20117
|
if (!O.current || !P.current)
|
|
20099
20118
|
return;
|
|
20100
20119
|
const A = {
|
|
@@ -20128,10 +20147,10 @@ function fx(e) {
|
|
|
20128
20147
|
}), []), wo(() => {
|
|
20129
20148
|
if (b && (O.current = b), S && (P.current = S), b && S) {
|
|
20130
20149
|
if (M.current)
|
|
20131
|
-
return M.current(b, S,
|
|
20132
|
-
|
|
20150
|
+
return M.current(b, S, T);
|
|
20151
|
+
T();
|
|
20133
20152
|
}
|
|
20134
|
-
}, [b, S,
|
|
20153
|
+
}, [b, S, T, M, I]);
|
|
20135
20154
|
const j = v.useMemo(() => ({
|
|
20136
20155
|
reference: O,
|
|
20137
20156
|
floating: P,
|
|
@@ -20140,7 +20159,7 @@ function fx(e) {
|
|
|
20140
20159
|
}), [k, w]), L = v.useMemo(() => ({
|
|
20141
20160
|
reference: b,
|
|
20142
20161
|
floating: S
|
|
20143
|
-
}), [b, S]),
|
|
20162
|
+
}), [b, S]), E = v.useMemo(() => {
|
|
20144
20163
|
const A = {
|
|
20145
20164
|
position: n,
|
|
20146
20165
|
left: 0,
|
|
@@ -20163,11 +20182,11 @@ function fx(e) {
|
|
|
20163
20182
|
}, [n, c, L.floating, p.x, p.y]);
|
|
20164
20183
|
return v.useMemo(() => ({
|
|
20165
20184
|
...p,
|
|
20166
|
-
update:
|
|
20185
|
+
update: T,
|
|
20167
20186
|
refs: j,
|
|
20168
20187
|
elements: L,
|
|
20169
|
-
floatingStyles:
|
|
20170
|
-
}), [p,
|
|
20188
|
+
floatingStyles: E
|
|
20189
|
+
}), [p, T, j, L, E]);
|
|
20171
20190
|
}
|
|
20172
20191
|
const hx = (e) => {
|
|
20173
20192
|
function t(n) {
|
|
@@ -20283,12 +20302,12 @@ var di = "PopperContent", [Px, Ax] = bu(di), Cu = v.forwardRef(
|
|
|
20283
20302
|
updatePositionStrategy: g = "optimized",
|
|
20284
20303
|
onPlaced: x,
|
|
20285
20304
|
...y
|
|
20286
|
-
} = e, h = _u(di, n), [_, k] = v.useState(null), w = Le(t, (B) => k(B)), [b, S] = v.useState(null), O = Cx(b), P = O?.width ?? 0, N = O?.height ?? 0, I = r + (s !== "center" ? "-" + s : ""), M = typeof p == "number" ? p : { top: 0, right: 0, bottom: 0, left: 0, ...p }, z = Array.isArray(u) ? u : [u], C = z.length > 0,
|
|
20305
|
+
} = e, h = _u(di, n), [_, k] = v.useState(null), w = Le(t, (B) => k(B)), [b, S] = v.useState(null), O = Cx(b), P = O?.width ?? 0, N = O?.height ?? 0, I = r + (s !== "center" ? "-" + s : ""), M = typeof p == "number" ? p : { top: 0, right: 0, bottom: 0, left: 0, ...p }, z = Array.isArray(u) ? u : [u], C = z.length > 0, T = {
|
|
20287
20306
|
padding: M,
|
|
20288
|
-
boundary: z.filter(
|
|
20307
|
+
boundary: z.filter(Ex),
|
|
20289
20308
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
20290
20309
|
altBoundary: C
|
|
20291
|
-
}, { refs: R, floatingStyles: j, placement: L, isPositioned:
|
|
20310
|
+
}, { refs: R, floatingStyles: j, placement: L, isPositioned: E, middlewareData: A } = fx({
|
|
20292
20311
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
20293
20312
|
strategy: "fixed",
|
|
20294
20313
|
placement: I,
|
|
@@ -20304,11 +20323,11 @@ var di = "PopperContent", [Px, Ax] = bu(di), Cu = v.forwardRef(
|
|
|
20304
20323
|
mainAxis: !0,
|
|
20305
20324
|
crossAxis: !1,
|
|
20306
20325
|
limiter: m === "partial" ? vx() : void 0,
|
|
20307
|
-
...
|
|
20326
|
+
...T
|
|
20308
20327
|
}),
|
|
20309
|
-
l && bx({ ...
|
|
20328
|
+
l && bx({ ...T }),
|
|
20310
20329
|
wx({
|
|
20311
|
-
...
|
|
20330
|
+
...T,
|
|
20312
20331
|
apply: ({ elements: B, rects: ne, availableWidth: ge, availableHeight: Z }) => {
|
|
20313
20332
|
const { width: oe, height: ue } = ne.reference, ye = B.floating.style;
|
|
20314
20333
|
ye.setProperty("--radix-popper-available-width", `${ge}px`), ye.setProperty("--radix-popper-available-height", `${Z}px`), ye.setProperty("--radix-popper-anchor-width", `${oe}px`), ye.setProperty("--radix-popper-anchor-height", `${ue}px`);
|
|
@@ -20316,12 +20335,12 @@ var di = "PopperContent", [Px, Ax] = bu(di), Cu = v.forwardRef(
|
|
|
20316
20335
|
}),
|
|
20317
20336
|
b && xx({ element: b, padding: c }),
|
|
20318
20337
|
Ix({ arrowWidth: P, arrowHeight: N }),
|
|
20319
|
-
f && _x({ strategy: "referenceHidden", ...
|
|
20338
|
+
f && _x({ strategy: "referenceHidden", ...T })
|
|
20320
20339
|
]
|
|
20321
20340
|
}), [F, Q] = Au(L), ee = bn(x);
|
|
20322
20341
|
at(() => {
|
|
20323
|
-
|
|
20324
|
-
}, [
|
|
20342
|
+
E && ee?.();
|
|
20343
|
+
}, [E, ee]);
|
|
20325
20344
|
const $ = A.arrow?.x, W = A.arrow?.y, X = A.arrow?.centerOffset !== 0, [q, de] = v.useState();
|
|
20326
20345
|
return at(() => {
|
|
20327
20346
|
_ && de(window.getComputedStyle(_).zIndex);
|
|
@@ -20332,7 +20351,7 @@ var di = "PopperContent", [Px, Ax] = bu(di), Cu = v.forwardRef(
|
|
|
20332
20351
|
"data-radix-popper-content-wrapper": "",
|
|
20333
20352
|
style: {
|
|
20334
20353
|
...j,
|
|
20335
|
-
transform:
|
|
20354
|
+
transform: E ? j.transform : "translate(0, -200%)",
|
|
20336
20355
|
// keep off the page when measuring
|
|
20337
20356
|
minWidth: "max-content",
|
|
20338
20357
|
zIndex: q,
|
|
@@ -20369,7 +20388,7 @@ var di = "PopperContent", [Px, Ax] = bu(di), Cu = v.forwardRef(
|
|
|
20369
20388
|
...y.style,
|
|
20370
20389
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
20371
20390
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
20372
|
-
animation:
|
|
20391
|
+
animation: E ? void 0 : "none"
|
|
20373
20392
|
}
|
|
20374
20393
|
}
|
|
20375
20394
|
)
|
|
@@ -20380,13 +20399,13 @@ var di = "PopperContent", [Px, Ax] = bu(di), Cu = v.forwardRef(
|
|
|
20380
20399
|
}
|
|
20381
20400
|
);
|
|
20382
20401
|
Cu.displayName = di;
|
|
20383
|
-
var Nu = "PopperArrow",
|
|
20402
|
+
var Nu = "PopperArrow", Tx = {
|
|
20384
20403
|
top: "bottom",
|
|
20385
20404
|
right: "left",
|
|
20386
20405
|
bottom: "top",
|
|
20387
20406
|
left: "right"
|
|
20388
20407
|
}, Pu = v.forwardRef(function(t, n) {
|
|
20389
|
-
const { __scopePopper: r, ...a } = t, s = Ax(Nu, r), i =
|
|
20408
|
+
const { __scopePopper: r, ...a } = t, s = Ax(Nu, r), i = Tx[s.placedSide];
|
|
20390
20409
|
return (
|
|
20391
20410
|
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
20392
20411
|
// doesn't report size as we'd expect on SVG elements.
|
|
@@ -20431,7 +20450,7 @@ var Nu = "PopperArrow", Ex = {
|
|
|
20431
20450
|
);
|
|
20432
20451
|
});
|
|
20433
20452
|
Pu.displayName = Nu;
|
|
20434
|
-
function
|
|
20453
|
+
function Ex(e) {
|
|
20435
20454
|
return e !== null;
|
|
20436
20455
|
}
|
|
20437
20456
|
var Ix = (e) => ({
|
|
@@ -20548,7 +20567,7 @@ function qx(e) {
|
|
|
20548
20567
|
const t = v.useRef({ value: e, previous: e });
|
|
20549
20568
|
return v.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
20550
20569
|
}
|
|
20551
|
-
var
|
|
20570
|
+
var Tu = Object.freeze({
|
|
20552
20571
|
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
20553
20572
|
position: "absolute",
|
|
20554
20573
|
border: 0,
|
|
@@ -20566,7 +20585,7 @@ var Eu = Object.freeze({
|
|
|
20566
20585
|
{
|
|
20567
20586
|
...e,
|
|
20568
20587
|
ref: t,
|
|
20569
|
-
style: { ...
|
|
20588
|
+
style: { ...Tu, ...e.style }
|
|
20570
20589
|
}
|
|
20571
20590
|
)
|
|
20572
20591
|
);
|
|
@@ -20576,13 +20595,13 @@ var Qx = function(e) {
|
|
|
20576
20595
|
return null;
|
|
20577
20596
|
var t = Array.isArray(e) ? e[0] : e;
|
|
20578
20597
|
return t.ownerDocument.body;
|
|
20579
|
-
}, Jn = /* @__PURE__ */ new WeakMap(), lo = /* @__PURE__ */ new WeakMap(), uo = {}, Za = 0,
|
|
20580
|
-
return e && (e.host ||
|
|
20598
|
+
}, Jn = /* @__PURE__ */ new WeakMap(), lo = /* @__PURE__ */ new WeakMap(), uo = {}, Za = 0, Eu = function(e) {
|
|
20599
|
+
return e && (e.host || Eu(e.parentNode));
|
|
20581
20600
|
}, Yx = function(e, t) {
|
|
20582
20601
|
return t.map(function(n) {
|
|
20583
20602
|
if (e.contains(n))
|
|
20584
20603
|
return n;
|
|
20585
|
-
var r =
|
|
20604
|
+
var r = Eu(n);
|
|
20586
20605
|
return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
|
|
20587
20606
|
}).filter(function(n) {
|
|
20588
20607
|
return !!n;
|
|
@@ -20993,14 +21012,14 @@ var er = vs ? { passive: !1 } : !1, _k = function(e) {
|
|
|
20993
21012
|
return e && "current" in e ? e.current : e;
|
|
20994
21013
|
}, Ak = function(e, t) {
|
|
20995
21014
|
return e[0] === t[0] && e[1] === t[1];
|
|
20996
|
-
},
|
|
21015
|
+
}, Tk = function(e) {
|
|
20997
21016
|
return `
|
|
20998
21017
|
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
20999
21018
|
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
21000
21019
|
`);
|
|
21001
|
-
},
|
|
21020
|
+
}, Ek = 0, tr = [];
|
|
21002
21021
|
function Ik(e) {
|
|
21003
|
-
var t = v.useRef([]), n = v.useRef([0, 0]), r = v.useRef(), a = v.useState(
|
|
21022
|
+
var t = v.useRef([]), n = v.useRef([0, 0]), r = v.useRef(), a = v.useState(Ek++)[0], s = v.useState(Du)[0], i = v.useRef(e);
|
|
21004
21023
|
v.useEffect(function() {
|
|
21005
21024
|
i.current = e;
|
|
21006
21025
|
}, [e]), v.useEffect(function() {
|
|
@@ -21080,7 +21099,7 @@ function Ik(e) {
|
|
|
21080
21099
|
return v.createElement(
|
|
21081
21100
|
v.Fragment,
|
|
21082
21101
|
null,
|
|
21083
|
-
x ? v.createElement(s, { styles:
|
|
21102
|
+
x ? v.createElement(s, { styles: Tk(a) }) : null,
|
|
21084
21103
|
g ? v.createElement(wk, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
21085
21104
|
);
|
|
21086
21105
|
}
|
|
@@ -21123,7 +21142,7 @@ var Mk = [" ", "Enter", "ArrowUp", "ArrowDown"], Dk = [" ", "Enter"], Fn = "Sele
|
|
|
21123
21142
|
defaultProp: c,
|
|
21124
21143
|
onChange: l,
|
|
21125
21144
|
caller: Fn
|
|
21126
|
-
}), z = v.useRef(null), C = h ? x || !!h.closest("form") : !0, [
|
|
21145
|
+
}), z = v.useRef(null), C = h ? x || !!h.closest("form") : !0, [T, R] = v.useState(/* @__PURE__ */ new Set()), j = Array.from(T).map((L) => L.props.value).join(";");
|
|
21127
21146
|
return /* @__PURE__ */ o(Rx, { ...y, children: /* @__PURE__ */ d(
|
|
21128
21147
|
$k,
|
|
21129
21148
|
{
|
|
@@ -21149,11 +21168,11 @@ var Mk = [" ", "Enter", "ArrowUp", "ArrowDown"], Dk = [" ", "Enter"], Fn = "Sele
|
|
|
21149
21168
|
{
|
|
21150
21169
|
scope: e.__scopeSelect,
|
|
21151
21170
|
onNativeOptionAdd: v.useCallback((L) => {
|
|
21152
|
-
R((
|
|
21171
|
+
R((E) => new Set(E).add(L));
|
|
21153
21172
|
}, []),
|
|
21154
21173
|
onNativeOptionRemove: v.useCallback((L) => {
|
|
21155
|
-
R((
|
|
21156
|
-
const A = new Set(
|
|
21174
|
+
R((E) => {
|
|
21175
|
+
const A = new Set(E);
|
|
21157
21176
|
return A.delete(L), A;
|
|
21158
21177
|
});
|
|
21159
21178
|
}, []),
|
|
@@ -21174,7 +21193,7 @@ var Mk = [" ", "Enter", "ArrowUp", "ArrowDown"], Dk = [" ", "Enter"], Fn = "Sele
|
|
|
21174
21193
|
form: x,
|
|
21175
21194
|
children: [
|
|
21176
21195
|
I === void 0 ? /* @__PURE__ */ o("option", { value: "" }) : null,
|
|
21177
|
-
Array.from(
|
|
21196
|
+
Array.from(T)
|
|
21178
21197
|
]
|
|
21179
21198
|
},
|
|
21180
21199
|
j
|
|
@@ -21294,7 +21313,7 @@ var $t = 10, [Zu, An] = wr(Bn), Uk = "SelectContentImpl", Wk = /* @__PURE__ */ $
|
|
|
21294
21313
|
..._
|
|
21295
21314
|
} = e, k = Pn(Bn, n), [w, b] = v.useState(null), [S, O] = v.useState(null), P = Le(t, (B) => b(B)), [N, I] = v.useState(null), [M, z] = v.useState(
|
|
21296
21315
|
null
|
|
21297
|
-
), C = ra(n), [
|
|
21316
|
+
), C = ra(n), [T, R] = v.useState(!1), j = v.useRef(!1);
|
|
21298
21317
|
v.useEffect(() => {
|
|
21299
21318
|
if (w) return Iu(w);
|
|
21300
21319
|
}, [w]), au();
|
|
@@ -21305,13 +21324,13 @@ var $t = 10, [Zu, An] = wr(Bn), Uk = "SelectContentImpl", Wk = /* @__PURE__ */ $
|
|
|
21305
21324
|
if (ue === oe || (ue?.scrollIntoView({ block: "nearest" }), ue === ne && S && (S.scrollTop = 0), ue === Z && S && (S.scrollTop = S.scrollHeight), ue?.focus(), document.activeElement !== oe)) return;
|
|
21306
21325
|
},
|
|
21307
21326
|
[C, S]
|
|
21308
|
-
),
|
|
21327
|
+
), E = v.useCallback(
|
|
21309
21328
|
() => L([N, w]),
|
|
21310
21329
|
[L, N, w]
|
|
21311
21330
|
);
|
|
21312
21331
|
v.useEffect(() => {
|
|
21313
|
-
|
|
21314
|
-
}, [
|
|
21332
|
+
T && E();
|
|
21333
|
+
}, [T, E]);
|
|
21315
21334
|
const { onOpenChange: A, triggerPointerDownPosRef: F } = k;
|
|
21316
21335
|
v.useEffect(() => {
|
|
21317
21336
|
if (w) {
|
|
@@ -21372,10 +21391,10 @@ var $t = 10, [Zu, An] = wr(Bn), Uk = "SelectContentImpl", Wk = /* @__PURE__ */ $
|
|
|
21372
21391
|
selectedItem: N,
|
|
21373
21392
|
onItemLeave: W,
|
|
21374
21393
|
itemTextRefCallback: X,
|
|
21375
|
-
focusSelectedItem:
|
|
21394
|
+
focusSelectedItem: E,
|
|
21376
21395
|
selectedItemText: M,
|
|
21377
21396
|
position: r,
|
|
21378
|
-
isPositioned:
|
|
21397
|
+
isPositioned: T,
|
|
21379
21398
|
searchRef: Q,
|
|
21380
21399
|
children: /* @__PURE__ */ o(mi, { as: Wk, allowPinchZoom: !0, children: /* @__PURE__ */ o(
|
|
21381
21400
|
ni,
|
|
@@ -21461,14 +21480,14 @@ var Vk = "SelectItemAlignedPosition", Qu = v.forwardRef((e, t) => {
|
|
|
21461
21480
|
]);
|
|
21462
21481
|
c.style.minWidth = Me + "px", c.style.right = Xe + "px";
|
|
21463
21482
|
}
|
|
21464
|
-
const z = f(), C = window.innerHeight - $t * 2,
|
|
21483
|
+
const z = f(), C = window.innerHeight - $t * 2, T = y.scrollHeight, R = window.getComputedStyle(u), j = parseInt(R.borderTopWidth, 10), L = parseInt(R.paddingTop, 10), E = parseInt(R.borderBottomWidth, 10), A = parseInt(R.paddingBottom, 10), F = j + L + T + A + E, Q = Math.min(h.offsetHeight * 5, F), ee = window.getComputedStyle(y), $ = parseInt(ee.paddingTop, 10), W = parseInt(ee.paddingBottom, 10), X = P.top + P.height / 2 - $t, q = C - X, de = h.offsetHeight / 2, B = h.offsetTop + de, ne = j + L + B, ge = F - ne;
|
|
21465
21484
|
if (ne <= X) {
|
|
21466
21485
|
const oe = z.length > 0 && h === z[z.length - 1].ref.current;
|
|
21467
21486
|
c.style.bottom = "0px";
|
|
21468
21487
|
const ue = u.clientHeight - y.offsetTop - y.offsetHeight, ye = Math.max(
|
|
21469
21488
|
q,
|
|
21470
21489
|
de + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
21471
|
-
(oe ? W : 0) + ue +
|
|
21490
|
+
(oe ? W : 0) + ue + E
|
|
21472
21491
|
), Me = ne + ye;
|
|
21473
21492
|
c.style.height = Me + "px";
|
|
21474
21493
|
} else {
|
|
@@ -21847,7 +21866,7 @@ var rS = "SelectBubbleInput", am = v.forwardRef(
|
|
|
21847
21866
|
Ce.select,
|
|
21848
21867
|
{
|
|
21849
21868
|
...n,
|
|
21850
|
-
style: { ...
|
|
21869
|
+
style: { ...Tu, ...n.style },
|
|
21851
21870
|
ref: s,
|
|
21852
21871
|
defaultValue: t
|
|
21853
21872
|
}
|
|
@@ -22201,7 +22220,7 @@ var NS = v.forwardRef(
|
|
|
22201
22220
|
),
|
|
22202
22221
|
/* @__PURE__ */ d(Re, { children: [
|
|
22203
22222
|
/* @__PURE__ */ o(AS, { titleId: c.titleId }),
|
|
22204
|
-
/* @__PURE__ */ o(
|
|
22223
|
+
/* @__PURE__ */ o(ES, { contentRef: l, descriptionId: c.descriptionId })
|
|
22205
22224
|
] })
|
|
22206
22225
|
] });
|
|
22207
22226
|
}
|
|
@@ -22250,14 +22269,14 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
22250
22269
|
return v.useEffect(() => {
|
|
22251
22270
|
e && (document.getElementById(e) || console.error(n));
|
|
22252
22271
|
}, [n, e]), null;
|
|
22253
|
-
},
|
|
22254
|
-
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Pm(
|
|
22272
|
+
}, TS = "DialogDescriptionWarning", ES = ({ contentRef: e, descriptionId: t }) => {
|
|
22273
|
+
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Pm(TS).contentName}}.`;
|
|
22255
22274
|
return v.useEffect(() => {
|
|
22256
22275
|
const a = e.current?.getAttribute("aria-describedby");
|
|
22257
22276
|
t && a && (document.getElementById(t) || console.warn(r));
|
|
22258
22277
|
}, [r, e, t]), null;
|
|
22259
|
-
}, Am = pm,
|
|
22260
|
-
const yi = Am, IS =
|
|
22278
|
+
}, Am = pm, Tm = hm, Em = ym, sa = vm, ia = bm, ca = _m, la = km, Im = Cm;
|
|
22279
|
+
const yi = Am, IS = Tm, Rm = Em, RS = Im, vi = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
22261
22280
|
sa,
|
|
22262
22281
|
{
|
|
22263
22282
|
ref: n,
|
|
@@ -22310,7 +22329,7 @@ const wi = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
22310
22329
|
}
|
|
22311
22330
|
));
|
|
22312
22331
|
wi.displayName = la.displayName;
|
|
22313
|
-
const ma = Am, pa =
|
|
22332
|
+
const ma = Am, pa = Tm, Mm = Im, Dm = Em, _i = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
22314
22333
|
sa,
|
|
22315
22334
|
{
|
|
22316
22335
|
ref: n,
|
|
@@ -22785,7 +22804,7 @@ var nC = v.forwardRef((e, t) => {
|
|
|
22785
22804
|
if (N.target === N.currentTarget && I && !_) {
|
|
22786
22805
|
const M = new CustomEvent(Ka, KS);
|
|
22787
22806
|
if (N.currentTarget.dispatchEvent(M), !M.defaultPrevented) {
|
|
22788
|
-
const z = b().filter((L) => L.focusable), C = z.find((L) => L.active),
|
|
22807
|
+
const z = b().filter((L) => L.focusable), C = z.find((L) => L.active), T = z.find((L) => L.id === y), j = [C, T, ...z].filter(
|
|
22789
22808
|
Boolean
|
|
22790
22809
|
).map((L) => L.ref.current);
|
|
22791
22810
|
cp(j, p);
|
|
@@ -23026,7 +23045,7 @@ function vp(e, t) {
|
|
|
23026
23045
|
return `${e}-content-${t}`;
|
|
23027
23046
|
}
|
|
23028
23047
|
var uC = dp, bp = mp, wp = fp, _p = gp;
|
|
23029
|
-
const
|
|
23048
|
+
const Ti = uC, wa = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
23030
23049
|
bp,
|
|
23031
23050
|
{
|
|
23032
23051
|
ref: n,
|
|
@@ -23374,7 +23393,7 @@ const xt = new kC(), SC = (e, t) => {
|
|
|
23374
23393
|
...t,
|
|
23375
23394
|
id: n
|
|
23376
23395
|
}), n;
|
|
23377
|
-
}, CC = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", NC = SC, PC = () => xt.toasts, AC = () => xt.getActiveToasts(),
|
|
23396
|
+
}, CC = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", NC = SC, PC = () => xt.toasts, AC = () => xt.getActiveToasts(), TC = Object.assign(NC, {
|
|
23378
23397
|
success: xt.success,
|
|
23379
23398
|
info: xt.info,
|
|
23380
23399
|
warning: xt.warning,
|
|
@@ -23392,7 +23411,7 @@ pC("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;
|
|
|
23392
23411
|
function ho(e) {
|
|
23393
23412
|
return e.label !== void 0;
|
|
23394
23413
|
}
|
|
23395
|
-
const
|
|
23414
|
+
const EC = 3, IC = "24px", RC = "16px", pl = 4e3, OC = 356, MC = 14, DC = 45, LC = 200;
|
|
23396
23415
|
function Gt(...e) {
|
|
23397
23416
|
return e.filter(Boolean).join(" ");
|
|
23398
23417
|
}
|
|
@@ -23402,7 +23421,7 @@ function $C(e) {
|
|
|
23402
23421
|
}
|
|
23403
23422
|
const zC = (e) => {
|
|
23404
23423
|
var t, n, r, a, s, i, c, l, u;
|
|
23405
|
-
const { invert: p, toast: m, unstyled: f, interacting: g, setHeights: x, visibleToasts: y, heights: h, index: _, toasts: k, expanded: w, removeToast: b, defaultRichColors: S, closeButton: O, style: P, cancelButtonStyle: N, actionButtonStyle: I, className: M = "", descriptionClassName: z = "", duration: C, position:
|
|
23424
|
+
const { invert: p, toast: m, unstyled: f, interacting: g, setHeights: x, visibleToasts: y, heights: h, index: _, toasts: k, expanded: w, removeToast: b, defaultRichColors: S, closeButton: O, style: P, cancelButtonStyle: N, actionButtonStyle: I, className: M = "", descriptionClassName: z = "", duration: C, position: T, gap: R, expandByDefault: j, classNames: L, icons: E, closeButtonAriaLabel: A = "Close toast" } = e, [F, Q] = V.useState(null), [ee, $] = V.useState(null), [W, X] = V.useState(!1), [q, de] = V.useState(!1), [B, ne] = V.useState(!1), [ge, Z] = V.useState(!1), [oe, ue] = V.useState(!1), [ye, Me] = V.useState(0), [Ye, Ke] = V.useState(0), Xe = V.useRef(m.duration || C || pl), St = V.useRef(null), et = V.useRef(null), qt = _ === 0, gt = _ + 1 <= y, re = m.type, _e = m.dismissible !== !1, we = m.className || "", yt = m.descriptionClassName || "", Ct = V.useMemo(() => h.findIndex((be) => be.toastId === m.id) || 0, [
|
|
23406
23425
|
h,
|
|
23407
23426
|
m.id
|
|
23408
23427
|
]), vt = V.useMemo(() => {
|
|
@@ -23414,13 +23433,13 @@ const zC = (e) => {
|
|
|
23414
23433
|
]), U = V.useMemo(() => m.duration || C || pl, [
|
|
23415
23434
|
m.duration,
|
|
23416
23435
|
C
|
|
23417
|
-
]), ae = V.useRef(0), me = V.useRef(0),
|
|
23436
|
+
]), ae = V.useRef(0), me = V.useRef(0), Te = V.useRef(0), Ee = V.useRef(null), [je, qn] = T.split("-"), Et = V.useMemo(() => h.reduce((be, We, Ne) => Ne >= Ct ? be : be + We.height, 0), [
|
|
23418
23437
|
h,
|
|
23419
23438
|
Ct
|
|
23420
|
-
]), an = xC(), xr = m.invert || p,
|
|
23421
|
-
me.current = V.useMemo(() => Ct * R +
|
|
23439
|
+
]), an = xC(), xr = m.invert || p, Tn = re === "loading";
|
|
23440
|
+
me.current = V.useMemo(() => Ct * R + Et, [
|
|
23422
23441
|
Ct,
|
|
23423
|
-
|
|
23442
|
+
Et
|
|
23424
23443
|
]), V.useEffect(() => {
|
|
23425
23444
|
Xe.current = U;
|
|
23426
23445
|
}, [
|
|
@@ -23483,11 +23502,11 @@ const zC = (e) => {
|
|
|
23483
23502
|
if (m.promise && re === "loading" || m.duration === 1 / 0 || m.type === "loading") return;
|
|
23484
23503
|
let be;
|
|
23485
23504
|
return w || g || an ? (() => {
|
|
23486
|
-
if (
|
|
23505
|
+
if (Te.current < ae.current) {
|
|
23487
23506
|
const Ve = (/* @__PURE__ */ new Date()).getTime() - ae.current;
|
|
23488
23507
|
Xe.current = Xe.current - Ve;
|
|
23489
23508
|
}
|
|
23490
|
-
|
|
23509
|
+
Te.current = (/* @__PURE__ */ new Date()).getTime();
|
|
23491
23510
|
})() : (() => {
|
|
23492
23511
|
Xe.current !== 1 / 0 && (ae.current = (/* @__PURE__ */ new Date()).getTime(), be = setTimeout(() => {
|
|
23493
23512
|
m.onAutoClose == null || m.onAutoClose.call(m, m), Zt();
|
|
@@ -23508,19 +23527,19 @@ const zC = (e) => {
|
|
|
23508
23527
|
]);
|
|
23509
23528
|
function Zn() {
|
|
23510
23529
|
var be;
|
|
23511
|
-
if (
|
|
23530
|
+
if (E?.loading) {
|
|
23512
23531
|
var We;
|
|
23513
23532
|
return /* @__PURE__ */ V.createElement("div", {
|
|
23514
23533
|
className: Gt(L?.loader, m == null || (We = m.classNames) == null ? void 0 : We.loader, "sonner-loader"),
|
|
23515
23534
|
"data-visible": re === "loading"
|
|
23516
|
-
},
|
|
23535
|
+
}, E.loading);
|
|
23517
23536
|
}
|
|
23518
23537
|
return /* @__PURE__ */ V.createElement(gC, {
|
|
23519
23538
|
className: Gt(L?.loader, m == null || (be = m.classNames) == null ? void 0 : be.loader),
|
|
23520
23539
|
visible: re === "loading"
|
|
23521
23540
|
});
|
|
23522
23541
|
}
|
|
23523
|
-
const Gn = m.icon ||
|
|
23542
|
+
const Gn = m.icon || E?.[re] || fC(re);
|
|
23524
23543
|
var Xr, fn;
|
|
23525
23544
|
return /* @__PURE__ */ V.createElement("li", {
|
|
23526
23545
|
tabIndex: 0,
|
|
@@ -23556,10 +23575,10 @@ const zC = (e) => {
|
|
|
23556
23575
|
...m.style
|
|
23557
23576
|
},
|
|
23558
23577
|
onDragEnd: () => {
|
|
23559
|
-
ne(!1), Q(null),
|
|
23578
|
+
ne(!1), Q(null), Ee.current = null;
|
|
23560
23579
|
},
|
|
23561
23580
|
onPointerDown: (be) => {
|
|
23562
|
-
be.button !== 2 && (
|
|
23581
|
+
be.button !== 2 && (Tn || !_e || (St.current = /* @__PURE__ */ new Date(), Me(me.current), be.target.setPointerCapture(be.pointerId), be.target.tagName !== "BUTTON" && (ne(!0), Ee.current = {
|
|
23563
23582
|
x: be.clientX,
|
|
23564
23583
|
y: be.clientY
|
|
23565
23584
|
})));
|
|
@@ -23567,9 +23586,9 @@ const zC = (e) => {
|
|
|
23567
23586
|
onPointerUp: () => {
|
|
23568
23587
|
var be, We, Ne;
|
|
23569
23588
|
if (ge || !_e) return;
|
|
23570
|
-
|
|
23571
|
-
const Ve = Number(((be = et.current) == null ? void 0 : be.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), Qn = Number(((We = et.current) == null ? void 0 : We.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), He = (/* @__PURE__ */ new Date()).getTime() - ((Ne = St.current) == null ? void 0 : Ne.getTime()), st = F === "x" ? Ve : Qn,
|
|
23572
|
-
if (Math.abs(st) >= DC ||
|
|
23589
|
+
Ee.current = null;
|
|
23590
|
+
const Ve = Number(((be = et.current) == null ? void 0 : be.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), Qn = Number(((We = et.current) == null ? void 0 : We.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), He = (/* @__PURE__ */ new Date()).getTime() - ((Ne = St.current) == null ? void 0 : Ne.getTime()), st = F === "x" ? Ve : Qn, En = Math.abs(st) / He;
|
|
23591
|
+
if (Math.abs(st) >= DC || En > 0.11) {
|
|
23573
23592
|
Me(me.current), m.onDismiss == null || m.onDismiss.call(m, m), $(F === "x" ? Ve > 0 ? "right" : "left" : Qn > 0 ? "down" : "up"), Zt(), Z(!0);
|
|
23574
23593
|
return;
|
|
23575
23594
|
} else {
|
|
@@ -23580,10 +23599,10 @@ const zC = (e) => {
|
|
|
23580
23599
|
},
|
|
23581
23600
|
onPointerMove: (be) => {
|
|
23582
23601
|
var We, Ne, Ve;
|
|
23583
|
-
if (!
|
|
23584
|
-
const He = be.clientY -
|
|
23585
|
-
var
|
|
23586
|
-
const bt = (
|
|
23602
|
+
if (!Ee.current || !_e || ((We = window.getSelection()) == null ? void 0 : We.toString().length) > 0) return;
|
|
23603
|
+
const He = be.clientY - Ee.current.y, st = be.clientX - Ee.current.x;
|
|
23604
|
+
var En;
|
|
23605
|
+
const bt = (En = e.swipeDirections) != null ? En : $C(T);
|
|
23587
23606
|
!F && (Math.abs(st) > 1 || Math.abs(He) > 1) && Q(Math.abs(st) > Math.abs(He) ? "x" : "y");
|
|
23588
23607
|
let Nt = {
|
|
23589
23608
|
x: 0,
|
|
@@ -23609,14 +23628,14 @@ const zC = (e) => {
|
|
|
23609
23628
|
}
|
|
23610
23629
|
}, vt && !m.jsx && re !== "loading" ? /* @__PURE__ */ V.createElement("button", {
|
|
23611
23630
|
"aria-label": A,
|
|
23612
|
-
"data-disabled":
|
|
23631
|
+
"data-disabled": Tn,
|
|
23613
23632
|
"data-close-button": !0,
|
|
23614
|
-
onClick:
|
|
23633
|
+
onClick: Tn || !_e ? () => {
|
|
23615
23634
|
} : () => {
|
|
23616
23635
|
Zt(), m.onDismiss == null || m.onDismiss.call(m, m);
|
|
23617
23636
|
},
|
|
23618
23637
|
className: Gt(L?.closeButton, m == null || (r = m.classNames) == null ? void 0 : r.closeButton)
|
|
23619
|
-
}, (fn =
|
|
23638
|
+
}, (fn = E?.close) != null ? fn : _C) : null, (re || m.icon || m.promise) && m.icon !== null && (E?.[re] !== null || m.icon) ? /* @__PURE__ */ V.createElement("div", {
|
|
23620
23639
|
"data-icon": "",
|
|
23621
23640
|
className: Gt(L?.icon, m == null || (a = m.classNames) == null ? void 0 : a.icon)
|
|
23622
23641
|
}, m.promise || m.type === "loading" && !m.icon ? m.icon || Zn() : null, m.type !== "loading" ? Gn : null) : null, /* @__PURE__ */ V.createElement("div", {
|
|
@@ -23682,7 +23701,7 @@ const BC = /* @__PURE__ */ V.forwardRef(function(t, n) {
|
|
|
23682
23701
|
const { id: r, invert: a, position: s = "bottom-right", hotkey: i = [
|
|
23683
23702
|
"altKey",
|
|
23684
23703
|
"KeyT"
|
|
23685
|
-
], expand: c, closeButton: l, className: u, offset: p, mobileOffset: m, theme: f = "light", richColors: g, duration: x, style: y, visibleToasts: h =
|
|
23704
|
+
], expand: c, closeButton: l, className: u, offset: p, mobileOffset: m, theme: f = "light", richColors: g, duration: x, style: y, visibleToasts: h = EC, toastOptions: _, dir: k = fl(), gap: w = MC, icons: b, containerAriaLabel: S = "Notifications" } = t, [O, P] = V.useState([]), N = V.useMemo(() => r ? O.filter((W) => W.toasterId === r) : O.filter((W) => !W.toasterId), [
|
|
23686
23705
|
O,
|
|
23687
23706
|
r
|
|
23688
23707
|
]), I = V.useMemo(() => Array.from(new Set([
|
|
@@ -23690,7 +23709,7 @@ const BC = /* @__PURE__ */ V.forwardRef(function(t, n) {
|
|
|
23690
23709
|
].concat(N.filter((W) => W.position).map((W) => W.position)))), [
|
|
23691
23710
|
N,
|
|
23692
23711
|
s
|
|
23693
|
-
]), [M, z] = V.useState([]), [C,
|
|
23712
|
+
]), [M, z] = V.useState([]), [C, T] = V.useState(!1), [R, j] = V.useState(!1), [L, E] = V.useState(f !== "system" ? f : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), A = V.useRef(null), F = i.join("+").replace(/Key/g, "").replace(/Digit/g, ""), Q = V.useRef(null), ee = V.useRef(!1), $ = V.useCallback((W) => {
|
|
23694
23713
|
P((X) => {
|
|
23695
23714
|
var q;
|
|
23696
23715
|
return (q = X.find((de) => de.id === W.id)) != null && q.delete || xt.dismiss(W.id), X.filter(({ id: de }) => de !== W.id);
|
|
@@ -23728,19 +23747,19 @@ const BC = /* @__PURE__ */ V.forwardRef(function(t, n) {
|
|
|
23728
23747
|
O
|
|
23729
23748
|
]), V.useEffect(() => {
|
|
23730
23749
|
if (f !== "system") {
|
|
23731
|
-
|
|
23750
|
+
E(f);
|
|
23732
23751
|
return;
|
|
23733
23752
|
}
|
|
23734
|
-
if (f === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ?
|
|
23753
|
+
if (f === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? E("dark") : E("light")), typeof window > "u") return;
|
|
23735
23754
|
const W = window.matchMedia("(prefers-color-scheme: dark)");
|
|
23736
23755
|
try {
|
|
23737
23756
|
W.addEventListener("change", ({ matches: X }) => {
|
|
23738
|
-
|
|
23757
|
+
E(X ? "dark" : "light");
|
|
23739
23758
|
});
|
|
23740
23759
|
} catch {
|
|
23741
23760
|
W.addListener(({ matches: q }) => {
|
|
23742
23761
|
try {
|
|
23743
|
-
|
|
23762
|
+
E(q ? "dark" : "light");
|
|
23744
23763
|
} catch (de) {
|
|
23745
23764
|
console.error(de);
|
|
23746
23765
|
}
|
|
@@ -23749,7 +23768,7 @@ const BC = /* @__PURE__ */ V.forwardRef(function(t, n) {
|
|
|
23749
23768
|
}, [
|
|
23750
23769
|
f
|
|
23751
23770
|
]), V.useEffect(() => {
|
|
23752
|
-
O.length <= 1 &&
|
|
23771
|
+
O.length <= 1 && T(!1);
|
|
23753
23772
|
}, [
|
|
23754
23773
|
O
|
|
23755
23774
|
]), V.useEffect(() => {
|
|
@@ -23757,9 +23776,9 @@ const BC = /* @__PURE__ */ V.forwardRef(function(t, n) {
|
|
|
23757
23776
|
var q;
|
|
23758
23777
|
if (i.every((ne) => X[ne] || X.code === ne)) {
|
|
23759
23778
|
var B;
|
|
23760
|
-
|
|
23779
|
+
T(!0), (B = A.current) == null || B.focus();
|
|
23761
23780
|
}
|
|
23762
|
-
X.code === "Escape" && (document.activeElement === A.current || (q = A.current) != null && q.contains(document.activeElement)) &&
|
|
23781
|
+
X.code === "Escape" && (document.activeElement === A.current || (q = A.current) != null && q.contains(document.activeElement)) && T(!1);
|
|
23763
23782
|
};
|
|
23764
23783
|
return document.addEventListener("keydown", W), () => document.removeEventListener("keydown", W);
|
|
23765
23784
|
}, [
|
|
@@ -23810,12 +23829,12 @@ const BC = /* @__PURE__ */ V.forwardRef(function(t, n) {
|
|
|
23810
23829
|
onFocus: (ne) => {
|
|
23811
23830
|
ne.target instanceof HTMLElement && ne.target.dataset.dismissible === "false" || ee.current || (ee.current = !0, Q.current = ne.relatedTarget);
|
|
23812
23831
|
},
|
|
23813
|
-
onMouseEnter: () =>
|
|
23814
|
-
onMouseMove: () =>
|
|
23832
|
+
onMouseEnter: () => T(!0),
|
|
23833
|
+
onMouseMove: () => T(!0),
|
|
23815
23834
|
onMouseLeave: () => {
|
|
23816
|
-
R ||
|
|
23835
|
+
R || T(!1);
|
|
23817
23836
|
},
|
|
23818
|
-
onDragEnd: () =>
|
|
23837
|
+
onDragEnd: () => T(!1),
|
|
23819
23838
|
onPointerDown: (ne) => {
|
|
23820
23839
|
ne.target instanceof HTMLElement && ne.target.dataset.dismissible === "false" || j(!0);
|
|
23821
23840
|
},
|
|
@@ -23853,19 +23872,19 @@ const BC = /* @__PURE__ */ V.forwardRef(function(t, n) {
|
|
|
23853
23872
|
});
|
|
23854
23873
|
})) : null;
|
|
23855
23874
|
}));
|
|
23856
|
-
}),
|
|
23875
|
+
}), Ei = v.createContext(null);
|
|
23857
23876
|
function jC() {
|
|
23858
|
-
const e = v.useContext(
|
|
23877
|
+
const e = v.useContext(Ei);
|
|
23859
23878
|
if (!e) throw new Error("useToast must be used within ToastProvider");
|
|
23860
23879
|
return e;
|
|
23861
23880
|
}
|
|
23862
23881
|
function _a() {
|
|
23863
|
-
return v.useContext(
|
|
23882
|
+
return v.useContext(Ei);
|
|
23864
23883
|
}
|
|
23865
23884
|
function UC({ children: e }) {
|
|
23866
23885
|
const t = v.useCallback((n) => {
|
|
23867
23886
|
const r = n.title ?? "", a = n.description;
|
|
23868
|
-
|
|
23887
|
+
TC(r || a || "Notification", {
|
|
23869
23888
|
description: r ? a : void 0,
|
|
23870
23889
|
duration: n.durationMs ?? 5e3,
|
|
23871
23890
|
action: n.actionLabel && n.onAction ? {
|
|
@@ -23874,7 +23893,7 @@ function UC({ children: e }) {
|
|
|
23874
23893
|
} : void 0
|
|
23875
23894
|
});
|
|
23876
23895
|
}, []);
|
|
23877
|
-
return /* @__PURE__ */ d(
|
|
23896
|
+
return /* @__PURE__ */ d(Ei.Provider, { value: { toast: t }, children: [
|
|
23878
23897
|
e,
|
|
23879
23898
|
/* @__PURE__ */ o(
|
|
23880
23899
|
BC,
|
|
@@ -23910,7 +23929,7 @@ let {
|
|
|
23910
23929
|
create: Ps
|
|
23911
23930
|
} = Object, {
|
|
23912
23931
|
apply: As,
|
|
23913
|
-
construct:
|
|
23932
|
+
construct: Ts
|
|
23914
23933
|
} = typeof Reflect < "u" && Reflect;
|
|
23915
23934
|
ft || (ft = function(t) {
|
|
23916
23935
|
return t;
|
|
@@ -23923,7 +23942,7 @@ As || (As = function(t, n) {
|
|
|
23923
23942
|
a[s - 2] = arguments[s];
|
|
23924
23943
|
return t.apply(n, a);
|
|
23925
23944
|
});
|
|
23926
|
-
|
|
23945
|
+
Ts || (Ts = function(t) {
|
|
23927
23946
|
for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++)
|
|
23928
23947
|
r[a - 1] = arguments[a];
|
|
23929
23948
|
return new t(...r);
|
|
@@ -23941,7 +23960,7 @@ function YC(e) {
|
|
|
23941
23960
|
return function() {
|
|
23942
23961
|
for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
23943
23962
|
n[r] = arguments[r];
|
|
23944
|
-
return
|
|
23963
|
+
return Ts(e, n);
|
|
23945
23964
|
};
|
|
23946
23965
|
}
|
|
23947
23966
|
function ke(e, t) {
|
|
@@ -24005,7 +24024,7 @@ var _l = /* @__PURE__ */ Object.freeze({
|
|
|
24005
24024
|
MUSTACHE_EXPR: eN,
|
|
24006
24025
|
TMPLIT_EXPR: nN
|
|
24007
24026
|
});
|
|
24008
|
-
const
|
|
24027
|
+
const Tr = {
|
|
24009
24028
|
element: 1,
|
|
24010
24029
|
text: 3,
|
|
24011
24030
|
// Deprecated
|
|
@@ -24049,7 +24068,7 @@ const Er = {
|
|
|
24049
24068
|
function Np() {
|
|
24050
24069
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : cN();
|
|
24051
24070
|
const t = (pe) => Np(pe);
|
|
24052
|
-
if (t.version = "3.3.1", t.removed = [], !e || !e.document || e.document.nodeType !==
|
|
24071
|
+
if (t.version = "3.3.1", t.removed = [], !e || !e.document || e.document.nodeType !== Tr.document || !e.Element)
|
|
24053
24072
|
return t.isSupported = !1, t;
|
|
24054
24073
|
let {
|
|
24055
24074
|
document: n
|
|
@@ -24082,11 +24101,11 @@ function Np() {
|
|
|
24082
24101
|
t.isSupported = typeof kp == "function" && typeof w == "function" && O && O.createHTMLDocument !== void 0;
|
|
24083
24102
|
const {
|
|
24084
24103
|
MUSTACHE_EXPR: C,
|
|
24085
|
-
ERB_EXPR:
|
|
24104
|
+
ERB_EXPR: T,
|
|
24086
24105
|
TMPLIT_EXPR: R,
|
|
24087
24106
|
DATA_ATTR: j,
|
|
24088
24107
|
ARIA_ATTR: L,
|
|
24089
|
-
IS_SCRIPT_OR_DATA:
|
|
24108
|
+
IS_SCRIPT_OR_DATA: E,
|
|
24090
24109
|
ATTR_WHITESPACE: A,
|
|
24091
24110
|
CUSTOM_ELEMENT: F
|
|
24092
24111
|
} = _l;
|
|
@@ -24136,10 +24155,10 @@ function Np() {
|
|
|
24136
24155
|
const U = ke({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
24137
24156
|
let ae = null;
|
|
24138
24157
|
const me = ke({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
24139
|
-
let
|
|
24140
|
-
const
|
|
24141
|
-
let an =
|
|
24142
|
-
const Zt = ke({}, [je, qn,
|
|
24158
|
+
let Te = null;
|
|
24159
|
+
const Ee = ke({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), je = "http://www.w3.org/1998/Math/MathML", qn = "http://www.w3.org/2000/svg", Et = "http://www.w3.org/1999/xhtml";
|
|
24160
|
+
let an = Et, xr = !1, Tn = null;
|
|
24161
|
+
const Zt = ke({}, [je, qn, Et], Xa);
|
|
24143
24162
|
let Zn = ke({}, ["mi", "mo", "mn", "ms", "mtext"]), Gn = ke({}, ["annotation-xml"]);
|
|
24144
24163
|
const Xr = ke({}, ["title", "style", "font", "a", "script"]);
|
|
24145
24164
|
let fn = null;
|
|
@@ -24151,7 +24170,7 @@ function Np() {
|
|
|
24151
24170
|
let D = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
24152
24171
|
if (!(Ve && Ve === D)) {
|
|
24153
24172
|
if ((!D || typeof D != "object") && (D = {}), D = Qt(D), fn = // eslint-disable-next-line unicorn/prefer-includes
|
|
24154
|
-
be.indexOf(D.PARSER_MEDIA_TYPE) === -1 ? We : D.PARSER_MEDIA_TYPE, Ne = fn === "application/xhtml+xml" ? Xa : ko, ee = zt(D, "ALLOWED_TAGS") ? ke({}, D.ALLOWED_TAGS, Ne) : $, W = zt(D, "ALLOWED_ATTR") ? ke({}, D.ALLOWED_ATTR, Ne) : X,
|
|
24173
|
+
be.indexOf(D.PARSER_MEDIA_TYPE) === -1 ? We : D.PARSER_MEDIA_TYPE, Ne = fn === "application/xhtml+xml" ? Xa : ko, ee = zt(D, "ALLOWED_TAGS") ? ke({}, D.ALLOWED_TAGS, Ne) : $, W = zt(D, "ALLOWED_ATTR") ? ke({}, D.ALLOWED_ATTR, Ne) : X, Tn = zt(D, "ALLOWED_NAMESPACES") ? ke({}, D.ALLOWED_NAMESPACES, Xa) : Zt, Te = zt(D, "ADD_URI_SAFE_ATTR") ? ke(Qt(Ee), D.ADD_URI_SAFE_ATTR, Ne) : Ee, ae = zt(D, "ADD_DATA_URI_TAGS") ? ke(Qt(me), D.ADD_DATA_URI_TAGS, Ne) : me, vt = zt(D, "FORBID_CONTENTS") ? ke({}, D.FORBID_CONTENTS, Ne) : U, de = zt(D, "FORBID_TAGS") ? ke({}, D.FORBID_TAGS, Ne) : Qt({}), B = zt(D, "FORBID_ATTR") ? ke({}, D.FORBID_ATTR, Ne) : Qt({}), Ct = zt(D, "USE_PROFILES") ? D.USE_PROFILES : !1, ge = D.ALLOW_ARIA_ATTR !== !1, Z = D.ALLOW_DATA_ATTR !== !1, oe = D.ALLOW_UNKNOWN_PROTOCOLS || !1, ue = D.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ye = D.SAFE_FOR_TEMPLATES || !1, Me = D.SAFE_FOR_XML !== !1, Ye = D.WHOLE_DOCUMENT || !1, St = D.RETURN_DOM || !1, et = D.RETURN_DOM_FRAGMENT || !1, qt = D.RETURN_TRUSTED_TYPE || !1, Xe = D.FORCE_BODY || !1, gt = D.SANITIZE_DOM !== !1, re = D.SANITIZE_NAMED_PROPS || !1, we = D.KEEP_CONTENT !== !1, yt = D.IN_PLACE || !1, Q = D.ALLOWED_URI_REGEXP || Sp, an = D.NAMESPACE || Et, Zn = D.MATHML_TEXT_INTEGRATION_POINTS || Zn, Gn = D.HTML_INTEGRATION_POINTS || Gn, q = D.CUSTOM_ELEMENT_HANDLING || {}, D.CUSTOM_ELEMENT_HANDLING && He(D.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (q.tagNameCheck = D.CUSTOM_ELEMENT_HANDLING.tagNameCheck), D.CUSTOM_ELEMENT_HANDLING && He(D.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (q.attributeNameCheck = D.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), D.CUSTOM_ELEMENT_HANDLING && typeof D.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (q.allowCustomizedBuiltInElements = D.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), ye && (Z = !1), et && (St = !0), Ct && (ee = ke({}, vl), W = [], Ct.html === !0 && (ke(ee, yl), ke(W, bl)), Ct.svg === !0 && (ke(ee, es), ke(W, rs), ke(W, yo)), Ct.svgFilters === !0 && (ke(ee, ts), ke(W, rs), ke(W, yo)), Ct.mathMl === !0 && (ke(ee, ns), ke(W, wl), ke(W, yo))), D.ADD_TAGS && (typeof D.ADD_TAGS == "function" ? ne.tagCheck = D.ADD_TAGS : (ee === $ && (ee = Qt(ee)), ke(ee, D.ADD_TAGS, Ne))), D.ADD_ATTR && (typeof D.ADD_ATTR == "function" ? ne.attributeCheck = D.ADD_ATTR : (W === X && (W = Qt(W)), ke(W, D.ADD_ATTR, Ne))), D.ADD_URI_SAFE_ATTR && ke(Te, D.ADD_URI_SAFE_ATTR, Ne), D.FORBID_CONTENTS && (vt === U && (vt = Qt(vt)), ke(vt, D.FORBID_CONTENTS, Ne)), D.ADD_FORBID_CONTENTS && (vt === U && (vt = Qt(vt)), ke(vt, D.ADD_FORBID_CONTENTS, Ne)), we && (ee["#text"] = !0), Ye && ke(ee, ["html", "head", "body"]), ee.table && (ke(ee, ["tbody"]), delete de.tbody), D.TRUSTED_TYPES_POLICY) {
|
|
24155
24174
|
if (typeof D.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
24156
24175
|
throw Pr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
24157
24176
|
if (typeof D.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -24161,14 +24180,14 @@ function Np() {
|
|
|
24161
24180
|
b === void 0 && (b = lN(g, a)), b !== null && typeof S == "string" && (S = b.createHTML(""));
|
|
24162
24181
|
ft && ft(D), Ve = D;
|
|
24163
24182
|
}
|
|
24164
|
-
},
|
|
24183
|
+
}, En = ke({}, [...es, ...ts, ...XC]), bt = ke({}, [...ns, ...JC]), Nt = function(D) {
|
|
24165
24184
|
let te = w(D);
|
|
24166
24185
|
(!te || !te.tagName) && (te = {
|
|
24167
24186
|
namespaceURI: an,
|
|
24168
24187
|
tagName: "template"
|
|
24169
24188
|
});
|
|
24170
24189
|
const ce = ko(D.tagName), De = ko(te.tagName);
|
|
24171
|
-
return
|
|
24190
|
+
return Tn[D.namespaceURI] ? D.namespaceURI === qn ? te.namespaceURI === Et ? ce === "svg" : te.namespaceURI === je ? ce === "svg" && (De === "annotation-xml" || Zn[De]) : !!En[ce] : D.namespaceURI === je ? te.namespaceURI === Et ? ce === "math" : te.namespaceURI === qn ? ce === "math" && Gn[De] : !!bt[ce] : D.namespaceURI === Et ? te.namespaceURI === qn && !Gn[De] || te.namespaceURI === je && !Zn[De] ? !1 : !bt[ce] && (Xr[ce] || !En[ce]) : !!(fn === "application/xhtml+xml" && Tn[D.namespaceURI]) : !1;
|
|
24172
24191
|
}, Pt = function(D) {
|
|
24173
24192
|
Cr(t.removed, {
|
|
24174
24193
|
element: D
|
|
@@ -24209,9 +24228,9 @@ function Np() {
|
|
|
24209
24228
|
const qe = Ja(D, /^[\r\n\t ]+/);
|
|
24210
24229
|
ce = qe && qe[0];
|
|
24211
24230
|
}
|
|
24212
|
-
fn === "application/xhtml+xml" && an ===
|
|
24231
|
+
fn === "application/xhtml+xml" && an === Et && (D = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + D + "</body></html>");
|
|
24213
24232
|
const De = b ? b.createHTML(D) : D;
|
|
24214
|
-
if (an ===
|
|
24233
|
+
if (an === Et)
|
|
24215
24234
|
try {
|
|
24216
24235
|
te = new f().parseFromString(De, fn);
|
|
24217
24236
|
} catch {
|
|
@@ -24224,7 +24243,7 @@ function Np() {
|
|
|
24224
24243
|
}
|
|
24225
24244
|
}
|
|
24226
24245
|
const it = te.body || te.documentElement;
|
|
24227
|
-
return D && ce && it.insertBefore(n.createTextNode(ce), it.childNodes[0] || null), an ===
|
|
24246
|
+
return D && ce && it.insertBefore(n.createTextNode(ce), it.childNodes[0] || null), an === Et ? I.call(te, Ye ? "html" : "body")[0] : Ye ? te.documentElement : it;
|
|
24228
24247
|
}, ji = function(D) {
|
|
24229
24248
|
return P.call(
|
|
24230
24249
|
D.ownerDocument || D,
|
|
@@ -24251,7 +24270,7 @@ function Np() {
|
|
|
24251
24270
|
if (sn(z.uponSanitizeElement, D, {
|
|
24252
24271
|
tagName: ce,
|
|
24253
24272
|
allowedTags: ee
|
|
24254
|
-
}), Me && D.hasChildNodes() && !Ui(D.firstElementChild) && lt(/<[/\w!]/g, D.innerHTML) && lt(/<[/\w!]/g, D.textContent) || D.nodeType ===
|
|
24273
|
+
}), Me && D.hasChildNodes() && !Ui(D.firstElementChild) && lt(/<[/\w!]/g, D.innerHTML) && lt(/<[/\w!]/g, D.textContent) || D.nodeType === Tr.progressingInstruction || Me && D.nodeType === Tr.comment && lt(/<[/\w]/g, D.data))
|
|
24255
24274
|
return Pt(D), !0;
|
|
24256
24275
|
if (!(ne.tagCheck instanceof Function && ne.tagCheck(ce)) && (!ee[ce] || de[ce])) {
|
|
24257
24276
|
if (!de[ce] && Hi(ce) && (q.tagNameCheck instanceof RegExp && lt(q.tagNameCheck, ce) || q.tagNameCheck instanceof Function && q.tagNameCheck(ce)))
|
|
@@ -24268,7 +24287,7 @@ function Np() {
|
|
|
24268
24287
|
}
|
|
24269
24288
|
return Pt(D), !0;
|
|
24270
24289
|
}
|
|
24271
|
-
return D instanceof l && !Nt(D) || (ce === "noscript" || ce === "noembed" || ce === "noframes") && lt(/<\/no(script|embed|frames)/i, D.innerHTML) ? (Pt(D), !0) : (ye && D.nodeType ===
|
|
24290
|
+
return D instanceof l && !Nt(D) || (ce === "noscript" || ce === "noembed" || ce === "noframes") && lt(/<\/no(script|embed|frames)/i, D.innerHTML) ? (Pt(D), !0) : (ye && D.nodeType === Tr.text && (te = D.textContent, go([C, T, R], (De) => {
|
|
24272
24291
|
te = Nr(te, De, " ");
|
|
24273
24292
|
}), D.textContent !== te && (Cr(t.removed, {
|
|
24274
24293
|
element: D.cloneNode()
|
|
@@ -24288,10 +24307,10 @@ function Np() {
|
|
|
24288
24307
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
24289
24308
|
te === "is" && q.allowCustomizedBuiltInElements && (q.tagNameCheck instanceof RegExp && lt(q.tagNameCheck, ce) || q.tagNameCheck instanceof Function && q.tagNameCheck(ce)))
|
|
24290
24309
|
) return !1;
|
|
24291
|
-
} else if (!
|
|
24310
|
+
} else if (!Te[te]) {
|
|
24292
24311
|
if (!lt(Q, Nr(ce, A, ""))) {
|
|
24293
24312
|
if (!((te === "src" || te === "xlink:href" || te === "href") && D !== "script" && GC(ce, "data:") === 0 && ae[D])) {
|
|
24294
|
-
if (!(oe && !lt(
|
|
24313
|
+
if (!(oe && !lt(E, Nr(ce, A, "")))) {
|
|
24295
24314
|
if (ce)
|
|
24296
24315
|
return !1;
|
|
24297
24316
|
}
|
|
@@ -24344,7 +24363,7 @@ function Np() {
|
|
|
24344
24363
|
ct(qe, D);
|
|
24345
24364
|
continue;
|
|
24346
24365
|
}
|
|
24347
|
-
ye && go([C,
|
|
24366
|
+
ye && go([C, T, R], (Gi) => {
|
|
24348
24367
|
rt = Nr(rt, Gi, " ");
|
|
24349
24368
|
});
|
|
24350
24369
|
const Zi = Ne(D.nodeName);
|
|
@@ -24395,7 +24414,7 @@ function Np() {
|
|
|
24395
24414
|
throw Pr("root node is forbidden and cannot be sanitized in-place");
|
|
24396
24415
|
}
|
|
24397
24416
|
} else if (pe instanceof c)
|
|
24398
|
-
te = Ca("<!---->"), ce = te.ownerDocument.importNode(pe, !0), ce.nodeType ===
|
|
24417
|
+
te = Ca("<!---->"), ce = te.ownerDocument.importNode(pe, !0), ce.nodeType === Tr.element && ce.nodeName === "BODY" || ce.nodeName === "HTML" ? te = ce : te.appendChild(ce);
|
|
24399
24418
|
else {
|
|
24400
24419
|
if (!St && !ye && !Ye && // eslint-disable-next-line unicorn/prefer-includes
|
|
24401
24420
|
pe.indexOf("<") === -1)
|
|
@@ -24419,7 +24438,7 @@ function Np() {
|
|
|
24419
24438
|
}
|
|
24420
24439
|
let wt = Ye ? te.outerHTML : te.innerHTML;
|
|
24421
24440
|
return Ye && ee["!doctype"] && te.ownerDocument && te.ownerDocument.doctype && te.ownerDocument.doctype.name && lt(Cp, te.ownerDocument.doctype.name) && (wt = "<!DOCTYPE " + te.ownerDocument.doctype.name + `>
|
|
24422
|
-
` + wt), ye && go([C,
|
|
24441
|
+
` + wt), ye && go([C, T, R], (cn) => {
|
|
24423
24442
|
wt = Nr(wt, cn, " ");
|
|
24424
24443
|
}), b && qt ? b.createHTML(wt) : wt;
|
|
24425
24444
|
}, t.setConfig = function() {
|
|
@@ -24736,21 +24755,21 @@ function kl(e, t) {
|
|
|
24736
24755
|
(n) => Object.entries(t).every(([r, a]) => n.options[r] === a)
|
|
24737
24756
|
) ?? null;
|
|
24738
24757
|
}
|
|
24739
|
-
function
|
|
24758
|
+
function Tp(e) {
|
|
24740
24759
|
return e.inventoryStatus === "out_of_stock" || typeof e.inventoryQuantity == "number" && e.inventoryQuantity <= 0;
|
|
24741
24760
|
}
|
|
24742
24761
|
function gN(e) {
|
|
24743
24762
|
return e.inventoryStatus === "low" || typeof e.inventoryQuantity == "number" && e.inventoryQuantity > 0 && e.inventoryQuantity <= 5;
|
|
24744
24763
|
}
|
|
24745
24764
|
function yN(e) {
|
|
24746
|
-
const t =
|
|
24765
|
+
const t = Tp(e), n = !t && gN(e), r = typeof e.inventoryQuantity == "number" ? e.inventoryQuantity : void 0;
|
|
24747
24766
|
return { isOutOfStock: t, isLow: n, quantity: r };
|
|
24748
24767
|
}
|
|
24749
24768
|
function vN(e, t, n, r) {
|
|
24750
24769
|
const a = { ...t, [n]: r }, s = e.filter(
|
|
24751
24770
|
(i) => Object.entries(a).every(([c, l]) => i.options[c] === l)
|
|
24752
24771
|
);
|
|
24753
|
-
return s.length === 0 ? !1 : s.some((i) => !
|
|
24772
|
+
return s.length === 0 ? !1 : s.some((i) => !Tp(i));
|
|
24754
24773
|
}
|
|
24755
24774
|
function Ri({
|
|
24756
24775
|
product: e,
|
|
@@ -24932,7 +24951,7 @@ function Mi({
|
|
|
24932
24951
|
] })
|
|
24933
24952
|
] }) });
|
|
24934
24953
|
}
|
|
24935
|
-
function
|
|
24954
|
+
function Es({
|
|
24936
24955
|
categories: e,
|
|
24937
24956
|
activeSlug: t,
|
|
24938
24957
|
onSelect: n,
|
|
@@ -25350,7 +25369,7 @@ function zi({
|
|
|
25350
25369
|
] })
|
|
25351
25370
|
] });
|
|
25352
25371
|
}
|
|
25353
|
-
function
|
|
25372
|
+
function Ep({
|
|
25354
25373
|
onCheckout: e,
|
|
25355
25374
|
className: t
|
|
25356
25375
|
}) {
|
|
@@ -25582,7 +25601,7 @@ function Zr({
|
|
|
25582
25601
|
),
|
|
25583
25602
|
children: [
|
|
25584
25603
|
/* @__PURE__ */ o(fa, { className: "space-y-0", children: /* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-3", children: [
|
|
25585
|
-
/* @__PURE__ */ o(
|
|
25604
|
+
/* @__PURE__ */ o(Ti, { value: c, onValueChange: (u) => l(u), children: /* @__PURE__ */ d(wa, { className: "h-9", children: [
|
|
25586
25605
|
/* @__PURE__ */ o(qr, { value: "cart", className: "text-sm", children: "Cart" }),
|
|
25587
25606
|
/* @__PURE__ */ o(qr, { value: "chat", className: "text-sm", children: "Chat" })
|
|
25588
25607
|
] }) }),
|
|
@@ -25602,7 +25621,7 @@ function Zr({
|
|
|
25602
25621
|
/* @__PURE__ */ o("div", { className: "text-sm text-neutral-600 dark:text-neutral-400", children: "Get help finding a product or ask us any questions. We’re both your shopping assistant and support chat." }),
|
|
25603
25622
|
/* @__PURE__ */ o("div", { className: "mt-3 min-h-0 flex-1", children: /* @__PURE__ */ o(_N, { className: "h-full" }) })
|
|
25604
25623
|
] }) : /* @__PURE__ */ o(
|
|
25605
|
-
|
|
25624
|
+
Ep,
|
|
25606
25625
|
{
|
|
25607
25626
|
onCheckout: () => {
|
|
25608
25627
|
a(), r?.(!1);
|
|
@@ -26172,7 +26191,7 @@ function zp({
|
|
|
26172
26191
|
const g = Md({ items: c.items }), [x, y] = v.useState(!1), h = v.useMemo(
|
|
26173
26192
|
() => i.checkout.paymentMethods && i.checkout.paymentMethods.length ? i.checkout.paymentMethods : [{ id: "card", label: "Card", ctaLabel: "Pay now" }],
|
|
26174
26193
|
[i.checkout.paymentMethods]
|
|
26175
|
-
), _ = v.useMemo(() => h.filter((
|
|
26194
|
+
), _ = v.useMemo(() => h.filter((T) => !(T.id === "card" && !u.card || T.id === "crypto" && !u.crypto || T.id === "credits" && !u.credits || T.id === "crypto" && !m)), [m, h, u]), [k, w] = v.useState((_[0] ?? h[0]).id);
|
|
26176
26195
|
v.useEffect(() => {
|
|
26177
26196
|
_.length && (_.some((C) => C.id === k) || w(_[0].id));
|
|
26178
26197
|
}, [k, _]), v.useEffect(() => {
|
|
@@ -26180,8 +26199,8 @@ function zp({
|
|
|
26180
26199
|
}, [k]);
|
|
26181
26200
|
const b = _.find((C) => C.id === k) ?? h.find((C) => C.id === k) ?? h[0], S = b.description ?? (k === "crypto" ? "Pay using a connected wallet." : void 0), O = k === "crypto" && !m, P = p || l.status === "validating" || l.status === "creating_session" || l.status === "redirecting" || g.isVerifying, N = t ?? b.ctaLabel ?? (i.checkout.mode === "none" ? "Continue to payment" : "Pay now"), I = v.useCallback(
|
|
26182
26201
|
async (C) => {
|
|
26183
|
-
const
|
|
26184
|
-
if (!
|
|
26202
|
+
const T = await g.verify();
|
|
26203
|
+
if (!T.ok && T.issues.length > 0) {
|
|
26185
26204
|
y(!0);
|
|
26186
26205
|
return;
|
|
26187
26206
|
}
|
|
@@ -26192,7 +26211,7 @@ function zp({
|
|
|
26192
26211
|
return /* @__PURE__ */ d("div", { className: G("space-y-3", e), children: [
|
|
26193
26212
|
_.length > 1 ? /* @__PURE__ */ d("div", { className: "space-y-2", children: [
|
|
26194
26213
|
/* @__PURE__ */ o("div", { className: "text-xs font-medium text-neutral-600 dark:text-neutral-400", children: "Payment method" }),
|
|
26195
|
-
/* @__PURE__ */ o(
|
|
26214
|
+
/* @__PURE__ */ o(Ti, { value: k, onValueChange: w, children: /* @__PURE__ */ o(wa, { className: "w-full", children: _.map((C) => /* @__PURE__ */ o(qr, { value: C.id, className: "flex-1", disabled: P, children: C.label }, C.id)) }) })
|
|
26196
26215
|
] }) : null,
|
|
26197
26216
|
l.error ? /* @__PURE__ */ o("div", { className: "rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800 dark:border-red-900/40 dark:bg-red-950/30 dark:text-red-200", children: l.error }) : null,
|
|
26198
26217
|
z ? /* @__PURE__ */ o("div", { className: "space-y-3", children: a ? a(z) : s ?? /* @__PURE__ */ o("div", { className: "rounded-lg border border-neutral-200 bg-neutral-50 p-4 text-sm text-neutral-700 dark:border-neutral-800 dark:bg-neutral-900/40 dark:text-neutral-300", children: "Checkout session created. Provide `renderCustom` to render a custom payment UI." }) }) : M ? /* @__PURE__ */ o("div", { className: "space-y-3", children: n ? n(M) : r ?? /* @__PURE__ */ o("div", { className: "rounded-lg border border-neutral-200 bg-neutral-50 p-4 text-sm text-neutral-700 dark:border-neutral-800 dark:bg-neutral-900/40 dark:text-neutral-300", children: "Embedded checkout session created. Provide `renderEmbedded` to render your payment UI." }) }) : /* @__PURE__ */ o(
|
|
@@ -26216,11 +26235,11 @@ function zp({
|
|
|
26216
26235
|
y(C), C || g.reset();
|
|
26217
26236
|
},
|
|
26218
26237
|
issues: g.result?.issues ?? [],
|
|
26219
|
-
onRemoveItem: (C,
|
|
26220
|
-
c.removeItem(C,
|
|
26238
|
+
onRemoveItem: (C, T) => {
|
|
26239
|
+
c.removeItem(C, T);
|
|
26221
26240
|
},
|
|
26222
|
-
onUpdateQuantity: (C,
|
|
26223
|
-
c.setQty(C,
|
|
26241
|
+
onUpdateQuantity: (C, T, R) => {
|
|
26242
|
+
c.setQty(C, T, R);
|
|
26224
26243
|
}
|
|
26225
26244
|
}
|
|
26226
26245
|
)
|
|
@@ -26497,7 +26516,7 @@ function jp({
|
|
|
26497
26516
|
}) {
|
|
26498
26517
|
return /* @__PURE__ */ o("div", { className: G("grid gap-4", n), children: e.map((r) => /* @__PURE__ */ o(Bp, { order: r, onView: t }, r.id)) });
|
|
26499
26518
|
}
|
|
26500
|
-
function
|
|
26519
|
+
function TN(e) {
|
|
26501
26520
|
switch (e) {
|
|
26502
26521
|
case "paid":
|
|
26503
26522
|
return "default";
|
|
@@ -26546,7 +26565,7 @@ function Up({
|
|
|
26546
26565
|
] })
|
|
26547
26566
|
] }),
|
|
26548
26567
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 sm:justify-end", children: [
|
|
26549
|
-
/* @__PURE__ */ o(Mn, { variant:
|
|
26568
|
+
/* @__PURE__ */ o(Mn, { variant: TN(e.status), className: "capitalize", children: a }),
|
|
26550
26569
|
t ? /* @__PURE__ */ o(le, { type: "button", variant: "outline", size: "sm", className: "h-8", onClick: t, children: "Back" }) : null
|
|
26551
26570
|
] })
|
|
26552
26571
|
] }),
|
|
@@ -26580,7 +26599,7 @@ function Bi(e) {
|
|
|
26580
26599
|
const n = e.attributes?.shippingCountries;
|
|
26581
26600
|
return typeof n == "string" && n.trim() && (t.shippingCountries = n), Object.keys(t).length ? t : void 0;
|
|
26582
26601
|
}
|
|
26583
|
-
function
|
|
26602
|
+
function EN(e) {
|
|
26584
26603
|
return /* @__PURE__ */ o("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", ...e, children: /* @__PURE__ */ o("path", { d: "M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z" }) });
|
|
26585
26604
|
}
|
|
26586
26605
|
const IN = {
|
|
@@ -26624,7 +26643,7 @@ function ON({
|
|
|
26624
26643
|
sort: S,
|
|
26625
26644
|
page: w,
|
|
26626
26645
|
pageSize: 24
|
|
26627
|
-
}), C = v.useMemo(() => RN(I?.items ?? []), [I?.items]), { settings:
|
|
26646
|
+
}), C = v.useMemo(() => RN(I?.items ?? []), [I?.items]), { settings: T } = fr(), R = T.catalog.filters, j = T.catalog.sort, L = v.useMemo(() => {
|
|
26628
26647
|
const B = [];
|
|
26629
26648
|
return j.featured && B.push({ value: "featured", label: "Featured" }), j.priceAsc && B.push({ value: "price_asc", label: "Price: Low to High" }), j.priceDesc && B.push({ value: "price_desc", label: "Price: High to Low" }), B.length === 0 && B.push({ value: "featured", label: "Featured" }), B;
|
|
26630
26649
|
}, [j]);
|
|
@@ -26640,7 +26659,7 @@ function ON({
|
|
|
26640
26659
|
},
|
|
26641
26660
|
{ includeCategory: !0 }
|
|
26642
26661
|
);
|
|
26643
|
-
const [
|
|
26662
|
+
const [E, A] = v.useState(!1), [F, Q] = v.useState(!1), [ee, $] = v.useState(null), [W, X] = v.useState(!1), q = (B) => {
|
|
26644
26663
|
k(B.slug), b(1), A(!1);
|
|
26645
26664
|
}, de = v.useCallback(
|
|
26646
26665
|
(B, ne, ge) => {
|
|
@@ -26672,7 +26691,7 @@ function ON({
|
|
|
26672
26691
|
/* @__PURE__ */ o("a", { href: i.shop, className: "text-sm font-semibold tracking-tight", children: r.brand?.name ?? "Shop" }),
|
|
26673
26692
|
/* @__PURE__ */ o("div", { className: "flex-1", children: /* @__PURE__ */ o(Li, { value: y, onChange: h }) }),
|
|
26674
26693
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 lg:hidden", children: [
|
|
26675
|
-
/* @__PURE__ */ d(ma, { open:
|
|
26694
|
+
/* @__PURE__ */ d(ma, { open: E, onOpenChange: A, children: [
|
|
26676
26695
|
/* @__PURE__ */ o(pa, { asChild: !0, children: /* @__PURE__ */ o(le, { type: "button", variant: "outline", children: "Filters" }) }),
|
|
26677
26696
|
/* @__PURE__ */ d(Yr, { side: "left", children: [
|
|
26678
26697
|
/* @__PURE__ */ o(fa, { children: /* @__PURE__ */ o(ha, { children: "Browse" }) }),
|
|
@@ -26683,7 +26702,7 @@ function ON({
|
|
|
26683
26702
|
/* @__PURE__ */ o(Ue, { className: "h-9" }),
|
|
26684
26703
|
/* @__PURE__ */ o(Ue, { className: "h-9" })
|
|
26685
26704
|
] }) : /* @__PURE__ */ d("div", { className: "space-y-6", children: [
|
|
26686
|
-
/* @__PURE__ */ o(
|
|
26705
|
+
/* @__PURE__ */ o(Es, { categories: m, activeSlug: _, onSelect: q }),
|
|
26687
26706
|
/* @__PURE__ */ o(
|
|
26688
26707
|
Uo,
|
|
26689
26708
|
{
|
|
@@ -26797,7 +26816,7 @@ function ON({
|
|
|
26797
26816
|
},
|
|
26798
26817
|
"aria-label": "Open chat",
|
|
26799
26818
|
children: [
|
|
26800
|
-
/* @__PURE__ */ o(
|
|
26819
|
+
/* @__PURE__ */ o(EN, { className: "h-4 w-4" }),
|
|
26801
26820
|
"Chat"
|
|
26802
26821
|
]
|
|
26803
26822
|
}
|
|
@@ -26813,7 +26832,7 @@ function ON({
|
|
|
26813
26832
|
/* @__PURE__ */ o(Ue, { className: "h-9" }),
|
|
26814
26833
|
/* @__PURE__ */ o(Ue, { className: "h-9" }),
|
|
26815
26834
|
/* @__PURE__ */ o(Ue, { className: "h-9" })
|
|
26816
|
-
] }) : /* @__PURE__ */ o("div", { className: "mt-3", children: /* @__PURE__ */ o(
|
|
26835
|
+
] }) : /* @__PURE__ */ o("div", { className: "mt-3", children: /* @__PURE__ */ o(Es, { categories: m, activeSlug: _, onSelect: q }) })
|
|
26817
26836
|
] }),
|
|
26818
26837
|
L.length > 1 && /* @__PURE__ */ d("div", { children: [
|
|
26819
26838
|
/* @__PURE__ */ o("div", { className: "text-sm font-semibold", children: "Sort" }),
|
|
@@ -26849,8 +26868,8 @@ function ON({
|
|
|
26849
26868
|
] }) }) }),
|
|
26850
26869
|
/* @__PURE__ */ d("section", { children: [
|
|
26851
26870
|
/* @__PURE__ */ o("div", { className: "flex items-end justify-between gap-3", children: /* @__PURE__ */ d("div", { children: [
|
|
26852
|
-
/* @__PURE__ */ o("h1", { className: "text-2xl font-semibold tracking-tight", children:
|
|
26853
|
-
|
|
26871
|
+
/* @__PURE__ */ o("h1", { className: "text-2xl font-semibold tracking-tight", children: T.shopPage.title || "Shop" }),
|
|
26872
|
+
T.shopPage.description && /* @__PURE__ */ o("p", { className: "mt-1 text-sm text-neutral-600 dark:text-neutral-400", children: T.shopPage.description })
|
|
26854
26873
|
] }) }),
|
|
26855
26874
|
z ? /* @__PURE__ */ o(en, { className: "mt-6", description: z }) : null,
|
|
26856
26875
|
M ? /* @__PURE__ */ o("div", { className: "mt-6 grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-4", children: Array.from({ length: 8 }).map((B, ne) => /* @__PURE__ */ o(Ue, { className: "aspect-[4/5] rounded-2xl" }, ne)) }) : /* @__PURE__ */ d("div", { className: "mt-6", children: [
|
|
@@ -26864,8 +26883,8 @@ function ON({
|
|
|
26864
26883
|
onQuickView: (B) => {
|
|
26865
26884
|
$(B), X(!0);
|
|
26866
26885
|
},
|
|
26867
|
-
layout:
|
|
26868
|
-
imageCrop:
|
|
26886
|
+
layout: T.shopLayout.layout,
|
|
26887
|
+
imageCrop: T.shopLayout.imageCrop
|
|
26869
26888
|
}
|
|
26870
26889
|
),
|
|
26871
26890
|
/* @__PURE__ */ d("div", { className: "mt-8 flex items-center justify-between", children: [
|
|
@@ -26925,15 +26944,15 @@ function DN({
|
|
|
26925
26944
|
const oe = () => l(Z.matches);
|
|
26926
26945
|
return oe(), Z.addEventListener?.("change", oe), () => Z.removeEventListener?.("change", oe);
|
|
26927
26946
|
}, []);
|
|
26928
|
-
const [u, p] = v.useState(!1), [m, f] = v.useState(!1), [g, x] = v.useState("cart"), y = v.useMemo(() => Qs({ includeCategory: !1 }), []), [h, _] = v.useState(y?.search ?? ""), [k, w] = v.useState(y?.page ?? 1), [b, S] = v.useState(y?.sort ?? "featured"), [O, P] = v.useState(y?.filters ?? {}), [N, I] = v.useState(null), [M, z] = v.useState(!1), C = i.find((Z) => Z.slug === e) ?? null, { data:
|
|
26947
|
+
const [u, p] = v.useState(!1), [m, f] = v.useState(!1), [g, x] = v.useState("cart"), y = v.useMemo(() => Qs({ includeCategory: !1 }), []), [h, _] = v.useState(y?.search ?? ""), [k, w] = v.useState(y?.page ?? 1), [b, S] = v.useState(y?.sort ?? "featured"), [O, P] = v.useState(y?.filters ?? {}), [N, I] = v.useState(null), [M, z] = v.useState(!1), C = i.find((Z) => Z.slug === e) ?? null, { data: T, isLoading: R, error: j } = Qo({
|
|
26929
26948
|
category: e,
|
|
26930
26949
|
search: h.trim() || void 0,
|
|
26931
26950
|
filters: O,
|
|
26932
26951
|
sort: b,
|
|
26933
26952
|
page: k,
|
|
26934
26953
|
pageSize: 24
|
|
26935
|
-
}), L = n?.product ?? ((Z) => `/product/${Z}`),
|
|
26936
|
-
const Z =
|
|
26954
|
+
}), L = n?.product ?? ((Z) => `/product/${Z}`), E = n?.shop ?? "/shop", A = n?.cart ?? "/cart", F = n?.checkout ?? "/checkout", Q = v.useMemo(() => {
|
|
26955
|
+
const Z = T?.items ?? [], oe = /* @__PURE__ */ new Set();
|
|
26937
26956
|
let ue = Number.POSITIVE_INFINITY, ye = 0;
|
|
26938
26957
|
for (const Ke of Z) {
|
|
26939
26958
|
for (const Xe of Ke.tags ?? []) oe.add(Xe);
|
|
@@ -26941,7 +26960,7 @@ function DN({
|
|
|
26941
26960
|
}
|
|
26942
26961
|
const Me = Array.from(oe).slice(0, 12), Ye = Number.isFinite(ue) ? { min: ue, max: ye } : void 0;
|
|
26943
26962
|
return { tags: Me, price: Ye };
|
|
26944
|
-
}, [
|
|
26963
|
+
}, [T?.items]), { settings: ee } = fr(), $ = ee.catalog.filters, W = ee.catalog.sort, X = v.useMemo(() => {
|
|
26945
26964
|
const Z = [];
|
|
26946
26965
|
return W.featured && Z.push({ value: "featured", label: "Featured" }), W.priceAsc && Z.push({ value: "price_asc", label: "Price: Low to High" }), W.priceDesc && Z.push({ value: "price_desc", label: "Price: High to Low" }), Z.length === 0 && Z.push({ value: "featured", label: "Featured" }), Z;
|
|
26947
26966
|
}, [W]);
|
|
@@ -26990,7 +27009,7 @@ function DN({
|
|
|
26990
27009
|
/* @__PURE__ */ d("div", { className: "space-y-1", children: [
|
|
26991
27010
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-2", children: [
|
|
26992
27011
|
/* @__PURE__ */ o("div", { className: "text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:text-neutral-400", children: "Category" }),
|
|
26993
|
-
/* @__PURE__ */ o(le, { asChild: !0, type: "button", variant: "ghost", size: "sm", className: "h-8 px-2 text-xs", children: /* @__PURE__ */ o("a", { href:
|
|
27012
|
+
/* @__PURE__ */ o(le, { asChild: !0, type: "button", variant: "ghost", size: "sm", className: "h-8 px-2 text-xs", children: /* @__PURE__ */ o("a", { href: E, children: "All categories" }) })
|
|
26994
27013
|
] }),
|
|
26995
27014
|
/* @__PURE__ */ o("div", { className: "text-base font-semibold text-neutral-950 dark:text-neutral-50", children: C?.name ?? e }),
|
|
26996
27015
|
/* @__PURE__ */ o("div", { className: "text-sm text-neutral-600 dark:text-neutral-400", children: C?.description ?? "Browse products in this category." })
|
|
@@ -27007,7 +27026,7 @@ function DN({
|
|
|
27007
27026
|
] }) });
|
|
27008
27027
|
return /* @__PURE__ */ d("div", { className: G("min-h-screen bg-neutral-50 text-neutral-950 dark:bg-neutral-950 dark:text-neutral-50", t), children: [
|
|
27009
27028
|
/* @__PURE__ */ o("header", { className: "sticky top-0 z-40 border-b border-neutral-200 bg-neutral-50/80 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/70", children: /* @__PURE__ */ d("div", { className: "mx-auto flex max-w-7xl items-center gap-3 px-4 py-3", children: [
|
|
27010
|
-
/* @__PURE__ */ o("a", { href:
|
|
27029
|
+
/* @__PURE__ */ o("a", { href: E, className: "text-sm font-semibold tracking-tight", children: r.brand?.name ?? "Shop" }),
|
|
27011
27030
|
/* @__PURE__ */ o("div", { className: "flex-1", children: /* @__PURE__ */ o(Li, { value: h, onChange: _ }) }),
|
|
27012
27031
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 lg:hidden", children: [
|
|
27013
27032
|
/* @__PURE__ */ d(ma, { open: u, onOpenChange: p, children: [
|
|
@@ -27086,7 +27105,7 @@ function DN({
|
|
|
27086
27105
|
}
|
|
27087
27106
|
),
|
|
27088
27107
|
/* @__PURE__ */ d("main", { className: "mx-auto max-w-7xl px-4 py-8", children: [
|
|
27089
|
-
/* @__PURE__ */ o(Di, { items: [{ label: "Shop", href:
|
|
27108
|
+
/* @__PURE__ */ o(Di, { items: [{ label: "Shop", href: E }, { label: C?.name ?? e }] }),
|
|
27090
27109
|
/* @__PURE__ */ d("div", { className: "mt-6", children: [
|
|
27091
27110
|
/* @__PURE__ */ o("h1", { className: "text-2xl font-semibold tracking-tight", children: C?.name ?? "Category" }),
|
|
27092
27111
|
/* @__PURE__ */ o("p", { className: "mt-1 text-sm text-neutral-600 dark:text-neutral-400", children: C?.description ?? "Browse products in this category." })
|
|
@@ -27098,7 +27117,7 @@ function DN({
|
|
|
27098
27117
|
/* @__PURE__ */ o(
|
|
27099
27118
|
ka,
|
|
27100
27119
|
{
|
|
27101
|
-
products:
|
|
27120
|
+
products: T?.items ?? [],
|
|
27102
27121
|
columns: r.ui?.productGrid?.columns,
|
|
27103
27122
|
getProductHref: (Z) => L(Z.slug),
|
|
27104
27123
|
onAddToCart: (Z) => q(Z, null, 1),
|
|
@@ -27129,7 +27148,7 @@ function DN({
|
|
|
27129
27148
|
{
|
|
27130
27149
|
type: "button",
|
|
27131
27150
|
variant: "outline",
|
|
27132
|
-
disabled: !
|
|
27151
|
+
disabled: !T?.hasNextPage,
|
|
27133
27152
|
onClick: () => w((Z) => Z + 1),
|
|
27134
27153
|
children: "Next"
|
|
27135
27154
|
}
|
|
@@ -27158,7 +27177,7 @@ function $N({
|
|
|
27158
27177
|
className: t,
|
|
27159
27178
|
routes: n
|
|
27160
27179
|
}) {
|
|
27161
|
-
const r = Wt(), a = _a(), { product: s, isLoading: i, error: c } =
|
|
27180
|
+
const r = Wt(), a = _a(), { product: s, isLoading: i, error: c } = Ed(e), [l, u] = v.useState(1), [p, m] = v.useState({
|
|
27162
27181
|
selectedOptions: {},
|
|
27163
27182
|
variant: null
|
|
27164
27183
|
});
|
|
@@ -27171,23 +27190,23 @@ function $N({
|
|
|
27171
27190
|
productId: s?.id,
|
|
27172
27191
|
enabled: g === "ai" && !!s?.id
|
|
27173
27192
|
}), h = v.useMemo(() => g === "by_category" && s?.categoryIds?.length ? { category: s.categoryIds[0], page: 1, pageSize: x + 1 } : { page: 1, pageSize: x + 4 }, [g, x, s?.categoryIds]), _ = Qo(h), k = v.useMemo(() => {
|
|
27174
|
-
const
|
|
27193
|
+
const T = (_.data?.items ?? []).filter((R) => R.slug !== e);
|
|
27175
27194
|
if (g === "manual" && s) {
|
|
27176
27195
|
const R = s.attributes?.relatedProductIds || s.attributes?.related_product_ids;
|
|
27177
27196
|
if (R) {
|
|
27178
27197
|
const j = LN(String(R));
|
|
27179
27198
|
if (j.length > 0) {
|
|
27180
|
-
const L = new Map(
|
|
27199
|
+
const L = new Map(T.map((A) => [A.id, A]));
|
|
27181
27200
|
return j.map((A) => L.get(A)).filter((A) => !!A).slice(0, x);
|
|
27182
27201
|
}
|
|
27183
27202
|
}
|
|
27184
27203
|
}
|
|
27185
27204
|
if (g === "ai" && y.relatedProductIds && y.relatedProductIds.length > 0) {
|
|
27186
|
-
const R = new Map(
|
|
27205
|
+
const R = new Map(T.map((L) => [L.id, L])), j = y.relatedProductIds.map((L) => R.get(L)).filter((L) => !!L);
|
|
27187
27206
|
if (j.length > 0)
|
|
27188
27207
|
return j.slice(0, x);
|
|
27189
27208
|
}
|
|
27190
|
-
return
|
|
27209
|
+
return T.slice(0, x);
|
|
27191
27210
|
}, [_.data?.items, e, g, x, s, y.relatedProductIds]), w = n?.shop ?? "/shop", b = n?.checkout ?? "/checkout", S = n?.cart ?? "/cart", O = n?.product ?? ((C) => `/product/${C}`);
|
|
27192
27211
|
if (i)
|
|
27193
27212
|
return /* @__PURE__ */ o("div", { className: G("min-h-screen bg-neutral-50 p-6 dark:bg-neutral-950", t), children: /* @__PURE__ */ d("div", { className: "mx-auto max-w-6xl", children: [
|
|
@@ -27265,13 +27284,13 @@ function $N({
|
|
|
27265
27284
|
] }),
|
|
27266
27285
|
f.sections.showSpecs && /* @__PURE__ */ d(Mr, { value: "specs", children: [
|
|
27267
27286
|
/* @__PURE__ */ o(Dr, { children: "Specs" }),
|
|
27268
|
-
/* @__PURE__ */ o(Lr, { children: /* @__PURE__ */ o("div", { className: "text-sm text-neutral-600 dark:text-neutral-400", children: s.attributes ? /* @__PURE__ */ o("div", { className: "space-y-1", children: Object.entries(s.attributes).map(([C,
|
|
27287
|
+
/* @__PURE__ */ o(Lr, { children: /* @__PURE__ */ o("div", { className: "text-sm text-neutral-600 dark:text-neutral-400", children: s.attributes ? /* @__PURE__ */ o("div", { className: "space-y-1", children: Object.entries(s.attributes).map(([C, T]) => /* @__PURE__ */ d("div", { children: [
|
|
27269
27288
|
/* @__PURE__ */ d("span", { className: "font-medium text-neutral-950 dark:text-neutral-50", children: [
|
|
27270
27289
|
C,
|
|
27271
27290
|
":"
|
|
27272
27291
|
] }),
|
|
27273
27292
|
" ",
|
|
27274
|
-
String(
|
|
27293
|
+
String(T)
|
|
27275
27294
|
] }, C)) }) : "No specs provided." }) })
|
|
27276
27295
|
] }),
|
|
27277
27296
|
f.sections.showShipping && /* @__PURE__ */ d(Mr, { value: "ship", children: [
|
|
@@ -27353,7 +27372,7 @@ function FN({
|
|
|
27353
27372
|
/* @__PURE__ */ o("h1", { className: "text-3xl font-semibold tracking-tight", children: "Checkout" }),
|
|
27354
27373
|
/* @__PURE__ */ o("p", { className: "mt-2 text-sm text-neutral-600 dark:text-neutral-400", children: n.checkout.mode === "none" ? "Confirm and pay." : "Enter details, then complete payment." })
|
|
27355
27374
|
] }),
|
|
27356
|
-
/* @__PURE__ */ o("div", { className: "mt-8", children: /* @__PURE__ */ o(
|
|
27375
|
+
/* @__PURE__ */ o("div", { className: "mt-8", children: /* @__PURE__ */ o(Td, { children: c ? /* @__PURE__ */ d(Bt, { className: "rounded-2xl", children: [
|
|
27357
27376
|
/* @__PURE__ */ o(Fr, { className: "pb-4", children: /* @__PURE__ */ o(Br, { className: "text-base", children: "Sign in required" }) }),
|
|
27358
27377
|
/* @__PURE__ */ d(tn, { children: [
|
|
27359
27378
|
/* @__PURE__ */ o("div", { className: "text-sm text-neutral-600 dark:text-neutral-400", children: "This store requires an account to complete checkout." }),
|
|
@@ -27728,18 +27747,18 @@ const A1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
27728
27747
|
CardTitle: Br,
|
|
27729
27748
|
CartLineItem: $i,
|
|
27730
27749
|
CartPageContent: Rp,
|
|
27731
|
-
CartPanel:
|
|
27750
|
+
CartPanel: Ep,
|
|
27732
27751
|
CartProvider: Fh,
|
|
27733
27752
|
CartSidebar: Zr,
|
|
27734
27753
|
CartSummary: zi,
|
|
27735
27754
|
CartTemplate: zN,
|
|
27736
|
-
CategoryNav:
|
|
27755
|
+
CategoryNav: Es,
|
|
27737
27756
|
CategoryTemplate: DN,
|
|
27738
27757
|
CedrosShopProvider: _h,
|
|
27739
27758
|
CheckoutCancelPage: PN,
|
|
27740
27759
|
CheckoutForm: Dp,
|
|
27741
27760
|
CheckoutLayout: Op,
|
|
27742
|
-
CheckoutProvider:
|
|
27761
|
+
CheckoutProvider: Td,
|
|
27743
27762
|
CheckoutReceipt: Sa,
|
|
27744
27763
|
CheckoutSuccessPage: NN,
|
|
27745
27764
|
CheckoutTemplate: FN,
|
|
@@ -27798,7 +27817,7 @@ const A1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
27798
27817
|
ShopTemplate: ON,
|
|
27799
27818
|
Skeleton: Ue,
|
|
27800
27819
|
SubscriptionTemplate: qN,
|
|
27801
|
-
Tabs:
|
|
27820
|
+
Tabs: Ti,
|
|
27802
27821
|
TabsContent: xp,
|
|
27803
27822
|
TabsList: wa,
|
|
27804
27823
|
TabsTrigger: qr,
|
|
@@ -27822,14 +27841,14 @@ const A1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
27822
27841
|
useOptionalToast: _a,
|
|
27823
27842
|
useOrders: Id,
|
|
27824
27843
|
usePaymentMethodsConfig: Dd,
|
|
27825
|
-
useProduct:
|
|
27844
|
+
useProduct: Ed,
|
|
27826
27845
|
useProducts: Qo,
|
|
27827
27846
|
useShippingMethods: Od,
|
|
27828
27847
|
useStandaloneCheckout: y0,
|
|
27829
27848
|
useStorefrontSettings: fr,
|
|
27830
27849
|
useSubscriptionData: Rd,
|
|
27831
27850
|
useToast: jC,
|
|
27832
|
-
validateCommerceAdapterContract:
|
|
27851
|
+
validateCommerceAdapterContract: E0
|
|
27833
27852
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
27834
27853
|
export {
|
|
27835
27854
|
$l as $,
|
|
@@ -27862,7 +27881,7 @@ export {
|
|
|
27862
27881
|
Mf as _,
|
|
27863
27882
|
y1 as a,
|
|
27864
27883
|
lr as a0,
|
|
27865
|
-
|
|
27884
|
+
El as a1,
|
|
27866
27885
|
Ol as a2,
|
|
27867
27886
|
yf as a3,
|
|
27868
27887
|
Rl as b,
|