@shophost/react 2.0.49 → 2.0.50
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/admin-client.cjs +1 -1
- package/admin-client.js +73 -73
- package/package.json +3 -3
package/admin-client.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createAuthClient as Ni } from "better-auth/react";
|
|
|
10
10
|
import { useFormContext as Ai, useFormState as gt, useForm as ue, FormProvider as Ue, useFieldArray as ar } from "react-hook-form";
|
|
11
11
|
import { Search as tr, ChevronDown as sa, Check as Ra, MailIcon as Os, XIcon as ht, CloudUpload as at, Loader2 as Ls, Phone as Ci, X as Ba, LanguagesIcon as Si, ChevronLeft as ga, ShoppingBasketIcon as Ii, UserIcon as tt, LayoutDashboardIcon as js, ShoppingBagIcon as pa, CalendarDaysIcon as ta, LogOutIcon as Vs, ArrowRightIcon as Ei, PartyPopperIcon as Zs, CopyIcon as Hs, AtSign as Us, PlusCircleIcon as qs, XCircleIcon as Ws, PlusIcon as Re, CheckCircle as ft, ArrowRight as _s, CheckIcon as Ma, EyeOffIcon as zi, PencilIcon as Di, Trash2 as rr, TrashIcon as $s, BookCopyIcon as Zr, Trash2Icon as Ks, ExternalLinkIcon as Gs, ChevronRightIcon as Ys, HomeIcon as Fi, RadioIcon as Ri, LogsIcon as Bi, CalendarCheckIcon as Mi, PackageIcon as Pi, BoxesIcon as Qi, FactoryIcon as Ti, UserCircleIcon as Xs } from "lucide-react";
|
|
12
12
|
import { upload as Ji } from "@vercel/blob/client";
|
|
13
|
-
import
|
|
13
|
+
import Ne from "next/image.js";
|
|
14
14
|
import { useDebounce as qe } from "use-debounce";
|
|
15
15
|
import w from "classnames";
|
|
16
16
|
import { withMask as el } from "use-mask-input";
|
|
@@ -103,7 +103,7 @@ const Kr = "shophost-cart", jl = { items: [], isInitialized: !1, modifierModal:
|
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
105
|
}), r + o;
|
|
106
|
-
}, 0),
|
|
106
|
+
}, 0), ve = (a, t = "USD", r = "en-US") => new Intl.NumberFormat(r, { style: "currency", currency: t }).format(a), Dp = (a, t, r = "en-US") => {
|
|
107
107
|
const n = t(a.productId);
|
|
108
108
|
return !n || !a.modifierGroups || a.modifierGroups.length === 0 ? "" : a.modifierGroups.filter((s) => s && s.modifiers).map((s) => {
|
|
109
109
|
var u, m, g, p;
|
|
@@ -207,7 +207,7 @@ const Kr = "shophost-cart", jl = { items: [], isInitialized: !1, modifierModal:
|
|
|
207
207
|
}
|
|
208
208
|
};
|
|
209
209
|
function dn(a, t, r, n) {
|
|
210
|
-
const s = Number(t.discountedBasePrice ?? t.basePrice ?? 0), l =
|
|
210
|
+
const s = Number(t.discountedBasePrice ?? t.basePrice ?? 0), l = ve((a.quantity || 1) * s, r, n), o = a.modifierGroups ? a.modifierGroups.map((u) => {
|
|
211
211
|
const m = t.modifierGroups.find((p) => p.id === u.id);
|
|
212
212
|
if (!m) return null;
|
|
213
213
|
const g = u.modifiers.map((p) => {
|
|
@@ -217,7 +217,7 @@ function dn(a, t, r, n) {
|
|
|
217
217
|
}).filter(Boolean).join(", ");
|
|
218
218
|
return g ? `${m.title}: ${g}` : null;
|
|
219
219
|
}).filter(Boolean) : [], d = t.images && t.images.length > 0 ? t.images[0] : void 0;
|
|
220
|
-
return { title: t.title ?? t.slug ?? "Untitled product", subtitle: o, image: d, price: l, unitPrice:
|
|
220
|
+
return { title: t.title ?? t.slug ?? "Untitled product", subtitle: o, image: d, price: l, unitPrice: ve(s, r, n), quantity: a.quantity || 1 };
|
|
221
221
|
}
|
|
222
222
|
const cn = Ce(void 0), $l = ({ children: a, initialOrganization: t, organizationId: r }) => {
|
|
223
223
|
const { client: n } = E(), s = T({ queryKey: ["organization", r], queryFn: async () => {
|
|
@@ -226,12 +226,12 @@ const cn = Ce(void 0), $l = ({ children: a, initialOrganization: t, organization
|
|
|
226
226
|
return l.body;
|
|
227
227
|
}, initialData: t ?? void 0, placeholderData: he, enabled: !!r });
|
|
228
228
|
return e(cn.Provider, { value: { organizationId: r, loading: s.isLoading, organization: s.data, error: s.error }, children: a });
|
|
229
|
-
},
|
|
229
|
+
}, be = () => {
|
|
230
230
|
const a = fe(cn);
|
|
231
231
|
if (a === void 0) throw new Error("useOrganization must be used within a OrganizationProvider");
|
|
232
232
|
return a;
|
|
233
233
|
}, dr = Ce(void 0), Kl = ({ children: a, locale: t = "en", organizationId: r }) => {
|
|
234
|
-
const { organization: n } =
|
|
234
|
+
const { organization: n } = be(), s = n == null ? void 0 : n.configuration.defaultCurrency, { client: l } = E(), [o, d] = R(null), [u, m] = R(null), [{ items: g, isInitialized: p, modifierModal: h, totalAmount: b, itemCount: f, removedItemsAlert: k }, y] = Ts(on, jl), x = h !== null, v = (h == null ? void 0 : h.product) ?? null, N = (h == null ? void 0 : h.quantity) ?? 1, F = h == null ? void 0 : h.onAdded, J = pe(() => [...new Set(g.map((M) => M.productId))], [g]), { data: D, isLoading: Z, isRefetching: ie } = T({ queryKey: ["cartProducts", J, f, u == null ? void 0 : u.id], queryFn: async () => {
|
|
235
235
|
if (J.length === 0) return { products: {}, total: 0, subtotal: 0, invalidProductIds: [] };
|
|
236
236
|
const M = await l.cart.getCartData({ params: { organizationId: r }, query: { locale: t }, body: { items: g, shippingMethodId: u == null ? void 0 : u.id } });
|
|
237
237
|
if (M.status !== 200) throw new Error("Failed to fetch product data");
|
|
@@ -343,14 +343,14 @@ const cn = Ce(void 0), $l = ({ children: a, initialOrganization: t, organization
|
|
|
343
343
|
}, []), N = U(() => {
|
|
344
344
|
var B;
|
|
345
345
|
!l || !h() || (s({ productId: l.id, quantity: d, modifierGroups: f() }), u(1), n(), (B = r == null ? void 0 : r.onAdded) == null || B.call(r));
|
|
346
|
-
}, [s, n, f, r, l, d, h]), F = o.length > 0, J = pe(() => l ? "title" in l ? l.title ?? "" : k(l, "") : "", [k, l]), D = U((B) => B.selectMax > 1 || B.selectMax === 0, []), Z = U((B, V) => B.price > 0 ? ` (+${
|
|
346
|
+
}, [s, n, f, r, l, d, h]), F = o.length > 0, J = pe(() => l ? "title" in l ? l.title ?? "" : k(l, "") : "", [k, l]), D = U((B) => B.selectMax > 1 || B.selectMax === 0, []), Z = U((B, V) => B.price > 0 ? ` (+${ve(B.price, V, t)})` : "", [t]), ie = { isOpen: r !== null, onClose: n, product: l, productName: J, hasModifiers: F, quantity: d, handleIncrement: x, handleDecrement: v, handleAddToCart: N, validationError: b, modifierGroups: o, isModifierSelected: p, isMultiSelect: D, toggleModifier: m, selectModifier: g, getModifierGroupName: y, formatModifierPrice: Z, locale: t };
|
|
347
347
|
return e(mn.Provider, { value: ie, children: a });
|
|
348
348
|
}, Nt = () => {
|
|
349
349
|
const a = fe(mn);
|
|
350
350
|
if (!a) throw new Error("useModifiers must be used within a ModifiersProvider");
|
|
351
351
|
return a;
|
|
352
352
|
}, eo = ({ className: a, emptyCartComponent: t, renderItem: r, loadingComponent: n }) => {
|
|
353
|
-
const { organization: s } =
|
|
353
|
+
const { organization: s } = be(), { locale: l, items: o, removeItem: d, updateItemQuantity: u, products: m, isProductsLoading: g } = mr();
|
|
354
354
|
return !s || g ? n : o.length === 0 ? t : e("div", { className: a || "flex-1 overflow-y-auto", children: m && o.map((p) => {
|
|
355
355
|
const h = m[p.productId];
|
|
356
356
|
if (!h) return null;
|
|
@@ -374,14 +374,14 @@ const cn = Ce(void 0), $l = ({ children: a, initialOrganization: t, organization
|
|
|
374
374
|
}
|
|
375
375
|
o(g);
|
|
376
376
|
}, [d, s, l, o]);
|
|
377
|
-
return e("div", { className: w("p-1 mb-3 transition-shadow"), children: i("div", { className: "grid grid-cols-5", children: [e("div", { className: "shrink-0 w-full h-full mr-3 overflow-hidden col-span-2", children: r ? e(
|
|
377
|
+
return e("div", { className: w("p-1 mb-3 transition-shadow"), children: i("div", { className: "grid grid-cols-5", children: [e("div", { className: "shrink-0 w-full h-full mr-3 overflow-hidden col-span-2", children: r ? e(Ne, { width: 100, height: 100, src: r.url, alt: a, className: "w-full h-32 object-cover border rounded-md overflow-hidden" }) : e("div", { className: "bg-slate-100 h-full rounded-md flex items-center justify-center", children: e("span", { className: "text-slate-400", children: "No image" }) }) }), i("div", { className: "flex-1 min-w-0 pl-4 col-span-3", children: [i("div", { children: [e("h3", { className: "font-black text-slate-800 font-red-hat-display leading-tight", children: a }), t && e("p", { className: "text-xs font-medium text-gray-600 dark:text-gray-400", children: t }), e("p", { className: "text-xs font-medium text-gray-600 dark:text-gray-400 mt-1", children: n })] }), e("div", { className: "mt-3 flex items-center justify-between", children: i("div", { className: "inline-flex items-center overflow-hidden rounded-lg bg-white", children: [e("button", { type: "button", className: "storefront-primary-action flex h-8 w-8 cursor-pointer items-center justify-center text-sm font-semibold transition-colors", onClick: () => s <= 1 ? l() : o(Math.max(1, s - 1)), "aria-label": "Decrease quantity", children: "-" }), e("input", { type: "number", min: 1, step: 1, inputMode: "numeric", value: d, onChange: (g) => {
|
|
378
378
|
const p = g.target.value;
|
|
379
379
|
(p === "" || /^[0-9]+$/.test(p)) && u(p);
|
|
380
380
|
}, onBlur: m, onKeyDown: (g) => {
|
|
381
381
|
g.key === "Enter" && g.currentTarget.blur();
|
|
382
382
|
}, className: "h-8 w-11 border-x border-slate-200 bg-white px-0 text-center text-sm font-semibold text-slate-700 outline-none transition-colors focus:bg-slate-50 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", "aria-label": "Quantity" }), e("button", { type: "button", className: "storefront-primary-action flex h-8 w-8 cursor-pointer items-center justify-center text-sm font-semibold transition-colors", onClick: () => o(s + 1), "aria-label": "Increase quantity", children: "+" })] }) })] })] }) });
|
|
383
383
|
}, to = e("div", { className: "flex items-center justify-center h-32", children: i("svg", { "aria-hidden": "true", className: "storefront-primary-fill text-gray-200 animate-spin dark:text-gray-600 h-8 w-8", viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [e("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), e("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }) }), ro = i("div", { className: "text-center py-4 text-sm text-slate-500 flex flex-col items-center", children: [e("div", { className: "bg-slate-100 p-2 rounded-full mb-2", children: e("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-8 w-8 text-slate-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z" }) }) }), e("p", { className: "font-medium", children: "Your cart is empty" })] }), io = (a) => e(ao, { ...a }), no = ({ checkoutHref: a = "/checkout/customer-details", checkoutLabel: t = "Checkout", title: r = "Shopping bag", className: n = "bg-white shadow-xl rounded-lg overflow-hidden h-full flex flex-col", bodyClassName: s = "max-h-80 md:max-h-[550px] overflow-y-auto p-4 md:p-3 space-y-3 h-full", headerClassName: l = "storefront-primary-bg py-3 px-3 border-b border-slate-100 flex justify-between items-center", onClose: o, showCloseButton: d = !!o, emptyCartComponent: u = ro, loadingComponent: m = to, renderFooter: g, renderHeader: p, renderItem: h = io }) => {
|
|
384
|
-
const { itemCount: b, total: f, locale: k } = mr(), { organization: y } =
|
|
384
|
+
const { itemCount: b, total: f, locale: k } = mr(), { organization: y } = be(), x = (y == null ? void 0 : y.configuration.defaultCurrency) ?? "USD", v = ve(f, x, k), N = { checkoutHref: a, checkoutLabel: t, close: o ?? (() => {
|
|
385
385
|
}), formattedTotal: v, itemCount: b, total: f };
|
|
386
386
|
return i("div", { className: n, children: [p ? p({ onClose: o, showCloseButton: d, title: r }) : i("div", { className: l, children: [e("h3", { className: "text-lg font-black font-red-hat-display text-white", children: r }), d && o && e("button", { onClick: o, className: "storefront-primary-bg-hover text-white p-1 rounded-full transition-colors", "aria-label": "Close cart", type: "button", children: e(Li, { className: "h-5 w-5" }) })] }), e("div", { className: s, children: e(eo, { renderItem: (F) => h(F), loadingComponent: m, emptyCartComponent: u }) }), b > 0 && (g ? g(N) : i("div", { className: "flex items-center px-4 py-4 border-t border-t-slate-200 mt-auto w-full", children: [e("div", { className: "w-[125px] font-medium h-[45px] rounded-lg flex items-center text-sm justify-center border border-slate-200 whitespace-nowrap mr-2", children: v }), e(z, { href: a, className: "storefront-primary-action btn text-sm rounded-lg w-full", onClick: o, children: t })] }))] });
|
|
387
387
|
}, Bp = ({ isOpen: a, onClose: t, checkoutHref: r = "/checkout/customer-details", checkoutLabel: n = "Checkout", title: s = "Shopping bag", className: l, contentClassName: o, emptyCartComponent: d, loadingComponent: u, renderFooter: m, renderItem: g }) => {
|
|
@@ -548,7 +548,7 @@ const nd = ({ ...a }) => {
|
|
|
548
548
|
return e("div", { className: "flex items-center w-full mt-2", children: (() => {
|
|
549
549
|
if (a.value) {
|
|
550
550
|
const m = a.multiple ? a.value : [a.value];
|
|
551
|
-
return i("div", { className: "flex", children: [m.map((g) => e("div", { className: "flex flex-col w-40 h-40 mr-3 transition-all rounded-lg relative animate-fade", children: i("div", { className: "relative h-full w-40", children: [e("button", { className: "absolute w-6 h-6 bg-black flex items-center justify-center rounded-md right-1 top-1", onClick: () => u(g.id), children: e(ht, { className: "w-4 h-4 text-white" }) }), e(
|
|
551
|
+
return i("div", { className: "flex", children: [m.map((g) => e("div", { className: "flex flex-col w-40 h-40 mr-3 transition-all rounded-lg relative animate-fade", children: i("div", { className: "relative h-full w-40", children: [e("button", { className: "absolute w-6 h-6 bg-black flex items-center justify-center rounded-md right-1 top-1", onClick: () => u(g.id), children: e(ht, { className: "w-4 h-4 text-white" }) }), e(Ne, { src: g.url, alt: g.filename, width: 160, height: 160, className: "w-40 h-40 rounded-md object-cover" })] }) }, g.id)), a.multiple && i("div", { className: "group flex relative flex-col w-40 h-40 items-center justify-center cursor-pointer border-2 border-gray-200 border-dashed transition-all rounded-lg hover:bg-gray-100 hover:border-gray-300", children: [e("div", { className: "flex flex-col items-center justify-center", children: r ? i(C, { children: [e("svg", { className: "animate-spin w-4 h-4 fill-current shrink-0 mb-2", viewBox: "0 0 16 16", children: e("path", { d: "M8 16a7.928 7.928 0 01-3.428-.77l.857-1.807A6.006 6.006 0 0014 8c0-3.309-2.691-6-6-6a6.006 6.006 0 00-5.422 8.572l-1.806.859A7.929 7.929 0 010 8c0-4.411 3.589-8 8-8s8 3.589 8 8-3.589 8-8 8z" }) }), i("span", { className: "text-sm", children: ["Uploading... (", s, "%)"] })] }) : i(C, { children: [e(at, { className: "w-12 h-12 text-gray-300 group-hover:text-gray-600 transition-all stroke-1" }), e("p", { className: "pt-1 text-sm font-medium text-gray-400 group-hover:text-gray-600", children: "Upload an image" })] }) }), e("input", { type: "file", className: "opacity-0 w-full h-full absolute cursor-pointer", onChange: d, accept: "image/png, image/gif, image/jpeg" })] }, "upload-placeholder")] });
|
|
552
552
|
}
|
|
553
553
|
return i("div", { className: "group flex relative flex-col items-center justify-center cursor-pointer w-full h-40 border-2 border-gray-200 border-dashed transition-all rounded-lg hover:bg-gray-100 hover:border-gray-300", children: [e("div", { className: "flex flex-col items-center justify-center", children: r ? i(C, { children: [e("svg", { className: "animate-spin w-4 h-4 fill-current shrink-0 mb-2", viewBox: "0 0 16 16", children: e("path", { d: "M8 16a7.928 7.928 0 01-3.428-.77l.857-1.807A6.006 6.006 0 0014 8c0-3.309-2.691-6-6-6a6.006 6.006 0 00-5.422 8.572l-1.806.859A7.929 7.929 0 010 8c0-4.411 3.589-8 8-8s8 3.589 8 8-3.589 8-8 8z" }) }), i("span", { className: "text-sm", children: ["Uploading... (", s, "%)"] })] }) : i(C, { children: [e(at, { className: "w-12 h-12 text-gray-300 group-hover:text-gray-600 transition-all stroke-1" }), e("p", { className: "pt-1 text-sm font-medium text-gray-400 group-hover:text-gray-600", children: "Upload an image" })] }) }), e("input", { type: "file", className: "opacity-0 w-full h-full absolute cursor-pointer", onChange: d, accept: "image/png, image/gif, image/jpeg" })] }, "upload-placeholder");
|
|
554
554
|
})() });
|
|
@@ -692,7 +692,7 @@ const md = ({ value: a, onChange: t, disabled: r }) => {
|
|
|
692
692
|
}
|
|
693
693
|
}, pd = (a, t) => !a || typeof a != "object" ? void 0 : t ? t.replace(/\[/g, ".").replace(/\]/g, "").split(".").filter(Boolean).reduce((r, n) => {
|
|
694
694
|
if (r != null) return r[n];
|
|
695
|
-
}, a) : a,
|
|
695
|
+
}, a) : a, ke = ({ type: a = "text", name: t, label: r, className: n, locale: s, placeholder: l, multiple: o, options: d, localizable: u, prefix: m, disabled: g }) => {
|
|
696
696
|
const { errors: p } = gt(), h = pd(p, t);
|
|
697
697
|
return i("div", { className: w("w-full", n), children: [typeof r == "string" && i(ze, { htmlFor: t, className: "font-medium flex items-center justify-between", children: [i("span", { className: "flex items-center", children: [r, u && e(Si, { className: "w-4 h-4 ml-1 text-gray-500" })] }), s && u && i("span", { className: "flex items-center text-xs text-gray-500 ml-1 bg-gray-100 px-1 py-0.5 rounded-sm", children: [Ct.get(s), " (", s, ")"] })] }), e(ud, { type: a, name: t, placeholder: l, options: d, multiple: o, prefix: m, disabled: g }), (h == null ? void 0 : h.message) && e("p", { className: "mt-1 text-sm text-red-500", children: h.message })] });
|
|
698
698
|
}, gd = ({ isOpen: a, onClose: t, children: r }) => e(Oi, { show: a, as: ua, children: e(al, { as: "div", className: "fixed inset-0 overflow-hidden", onClose: t, children: i("div", { className: "absolute inset-0 overflow-hidden", children: [e(Hr, { as: ua, enter: "ease-in-out duration-500", enterFrom: "opacity-0", enterTo: "opacity-100", leave: "ease-in-out duration-500", leaveFrom: "opacity-100", leaveTo: "opacity-0", children: e("div", { className: "fixed inset-0 bg-black/75 z-20 transition-opacity" }) }), e("div", { className: "fixed h-1/2 top-0 right-0 z-30 max-w-full flex", children: e(Hr, { as: ua, enter: "transform transition ease-in-out duration-500", enterFrom: "-translate-y-full", enterTo: "translate-y-0", leave: "transform transition ease-in-out duration-500", leaveFrom: "translate-y-0", leaveTo: "-translate-y-full", children: e(tl, { className: "relative w-screen h-full", children: e("div", { className: "max-h-screen bg-gray-900 flex flex-col py-6 shadow-xl overflow-y-scroll", children: r }) }) }) })] }) }) }), hd = w("hidden h-6 select-none items-center justify-center rounded-md bg-gray-800 px-2 font-mono text-xs text-gray-400 ring-1 ring-inset ring-gray-700 transition sm:flex"), fd = ({ open: a = !1, onOpenChange: t, defaultOpen: r = !1, disableAutoFocus: n = !0, children: s }) => i(G.Root, { open: a, onOpenChange: t, defaultOpen: r, children: [e(G.Anchor, { className: w("fixed inset-x-0 bottom-8 mx-auto flex w-fit items-center") }), e(G.Portal, { children: e(G.Content, { side: "top", sideOffset: 0, onOpenAutoFocus: (l) => {
|
|
@@ -748,9 +748,9 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
748
748
|
}, onSuccess: () => n.push(t) }), g = (p) => {
|
|
749
749
|
(a ? m : u).mutate(p);
|
|
750
750
|
};
|
|
751
|
-
return e("div", { className: "flex flex-col gap-4", children: e(Ue, { ...l, children: i("form", { onSubmit: l.handleSubmit(g), children: [i("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [e(
|
|
751
|
+
return e("div", { className: "flex flex-col gap-4", children: e(Ue, { ...l, children: i("form", { onSubmit: l.handleSubmit(g), children: [i("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [e(ke, { name: "firstname", label: "First Name", type: "text", className: "col-span-2", placeholder: "e.g. John" }), e(ke, { name: "lastname", label: "Last Name", type: "text", className: "col-span-2", placeholder: "e.g. Doe" }), e(ke, { name: "phone", label: "Phone", type: "phone-number", className: "col-span-4", placeholder: "e.g. +48 123 456 789" }), i("div", { className: "col-span-4 md:col-span-3 text-sm text-gray-500", children: [e(ze, { htmlFor: "address.addressLineOne", className: "font-medium flex items-center justify-between", children: "Street Address" }), e(Nr, { onChange: (p) => {
|
|
752
752
|
l.setValue("addressLineOne", p.addressLineOne, { shouldValidate: !0, shouldDirty: !0 }), l.setValue("placeId", p.placeId, { shouldValidate: !0, shouldDirty: !0 });
|
|
753
|
-
}, value: d }), l.formState.errors.addressLineOne && e("p", { className: "mt-1 text-sm text-red-500", children: String(l.formState.errors.addressLineOne.message ?? "") })] }), e(
|
|
753
|
+
}, value: d }), l.formState.errors.addressLineOne && e("p", { className: "mt-1 text-sm text-red-500", children: String(l.formState.errors.addressLineOne.message ?? "") })] }), e(ke, { name: "doorNumber", label: "Door Number", type: "text", className: "md:col-span-1 col-span-2", placeholder: "e.g. 123" }), e(ke, { name: "zipCode", label: "Postal Code", type: "text", className: "col-span-2", placeholder: "e.g. 12345" }), e(ke, { name: "city", label: "City", type: "text", className: "col-span-2", placeholder: "e.g. Kraków" }), e(ke, { name: "country", label: "Country", type: "country", className: "col-span-2 md:col-span-4", disabled: !0 }), e(ke, { name: "deliveryInstructions", label: "Notes / Instructions", type: "textarea", className: "col-span-4", placeholder: "e.g. 4th floor, code 12345" })] }), i("div", { className: "grid grid-cols-2 gap-x-2 w-full mt-8", children: [e(Y, { variant: "secondary", className: "shadow-none", type: "button", onClick: () => n.push("/"), children: "Back" }), e(Y, { type: "submit", className: "shadow-none", isLoading: u.isPending || m.isPending, disabled: r === 0, loadingText: "Saving...", children: "Save & Continue" })] })] }) }) });
|
|
754
754
|
}, Nd = () => i("div", { className: "animate-pulse space-y-4", children: [i("div", { className: "grid grid-cols-4 gap-4", children: [e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-2" }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-2" })] }), e("div", { className: "h-[70px] bg-gray-100 rounded-sm" }), i("div", { className: "grid grid-cols-4 gap-4", children: [e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-3" }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-1" })] }), i("div", { className: "grid grid-cols-4 gap-4", children: [e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-2" }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-2" })] }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm" }), e("div", { className: "h-[100px] bg-gray-100 rounded-sm" }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm mt-8" })] }), ti = ({ shippingAndPaymentPageUrl: a = "/checkout/shipping-and-payment" }) => {
|
|
755
755
|
const t = _(), { client: r } = E(), { data: n, isLoading: s, error: l } = T({ queryKey: ["shippingAddress"], queryFn: async () => {
|
|
756
756
|
const { status: d, body: u } = await r.shipping.getShippingAddress();
|
|
@@ -761,7 +761,7 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
761
761
|
};
|
|
762
762
|
return s ? e(Nd, {}) : l ? i("div", { className: "p-4 rounded-lg bg-red-50 text-red-700", children: [e("p", { className: "font-semibold", children: "Failed to load shipping address" }), e("p", { className: "text-xs", children: "Please try refreshing the page or contact support if the issue persists." })] }) : i("div", { className: "flex flex-col gap-4 animate-fade-in", children: [i("div", { className: "flex flex-col gap-y-1", children: [e("h1", { className: "text-[32px] font-red-hat-display font-black dark:text-blue-500", children: "Shipping Details" }), e("p", { className: "text-gray-500", children: "Please fill in the your shipping details to continue." })] }), e(vd, { initialData: n ?? null, onSuccess: o, shippingAndPaymentPageUrl: a }, n == null ? void 0 : n.id)] });
|
|
763
763
|
}, Ad = () => i(C, { children: [e("div", { className: "animate-pulse space-y-4", children: e("div", { className: "space-y-2", children: [1, 2, 3].map((a) => i("div", { className: "flex items-center gap-3 p-4 border rounded-lg", children: [e("div", { className: "h-4 w-4 bg-gray-100 rounded-full" }), i("div", { className: "flex-1 space-y-2", children: [e("div", { className: "h-5 w-32 bg-gray-100 rounded-sm" }), e("div", { className: "h-4 w-24 bg-gray-100 rounded-sm" })] })] }, a)) }) }), e("div", { className: "animate-pulse space-y-4 mt-8", children: e("div", { className: "space-y-2", children: [1, 2].map((a) => i("div", { className: "flex items-center gap-3 p-4 border rounded-lg", children: [e("div", { className: "h-4 w-4 bg-gray-100 rounded-full" }), e("div", { className: "h-5 w-24 bg-gray-100 rounded-sm" })] }, a)) }) }), i("div", { className: "grid grid-cols-2 gap-x-2 w-full mt-4", children: [e("div", { className: "h-10 bg-gray-100 rounded-sm" }), e("div", { className: "h-10 bg-gray-100 rounded-sm" })] })] }), Cd = ({ shippingMethods: a, paymentMethods: t, customerDetailsPageUrl: r }) => {
|
|
764
|
-
const n = _(), { client: s, baseUrl: l } = E(), { organizationId: o } =
|
|
764
|
+
const n = _(), { client: s, baseUrl: l } = E(), { organizationId: o } = be(), { items: d, shippingMethod: u, paymentMethod: m, setPaymentMethod: g, setShippingMethod: p } = cr(), h = O({ mutationFn: async () => {
|
|
765
765
|
if (!u) throw new Error("Please select a shipping method");
|
|
766
766
|
if (!m) throw new Error("Please select a payment method");
|
|
767
767
|
const { body: f, status: k } = await s.order.createOrder({ params: { organizationId: o }, body: { items: d, shippingMethodId: u == null ? void 0 : u.id, fulfilmentMethod: "delivery", payment: { provider: m.provider, method: m.method }, checkoutBaseUrl: l } });
|
|
@@ -774,7 +774,7 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
774
774
|
a.length === 1 && p(a[0]);
|
|
775
775
|
}, [p, a]), i(C, { children: [i("div", { className: "flex flex-col gap-1", children: [e("h2", { className: "text-[32px] font-red-hat-display font-black", children: "Shipping Method" }), e("p", { className: "text-gray-500", children: "Select a shipping method" })] }), e(Kt, { className: "flex flex-col gap-2", value: u == null ? void 0 : u.id, children: a.map((f) => e(Yt, { value: f.id, disabled: !f.eligibleShippingZone, onClick: () => p(f), children: i("div", { className: w("flex items-center gap-3", { "opacity-60 cursor-not-allowed": !f.eligibleShippingZone }), children: [e(Gt, {}), e("div", { children: i("div", { children: [i("div", { className: "flex items-center", children: [i("span", { className: "leading-5 font-red-hat-display font-black mr-2", children: [f.title, " (", f.providerName, ")"] }), !f.eligibleShippingZone && e(za, { variant: "error", children: "Not Available" })] }), f.eligibleShippingZone && i("p", { className: "text-xs font-medium text-gray-500 mt-0.5", children: ["Shipping Fee: ", f.eligibleShippingZone.price, " zł ", e("br", {}), "ETA: ", f.eligibleShippingZone.eta] }), !f.eligibleShippingZone && i("p", { className: "mt-0.5 text-xs text-gray-500", children: ["Sorry, this address is too far for delivery ", e("br", {}), " from our store."] })] }) })] }) }, f.id)) }), i("div", { className: "flex flex-col gap-1 mt-3", children: [e("h2", { className: "text-[32px] font-red-hat-display font-black", children: "Payment Method" }), e("p", { className: "text-gray-500", children: "Select a payment method" })] }), e(Kt, { className: "flex flex-col gap-3", value: m == null ? void 0 : m.id, children: t.map((f) => e(Yt, { value: f.id, onClick: () => g(f), children: i("div", { className: w("flex items-center gap-3"), children: [e(Gt, {}), i("div", { children: [e("p", { className: "font-red-hat-display font-black mr-2 capitalize", children: f.method }), i("p", { className: "text-xs font-medium text-gray-500 capitalize", children: [f.provider, " • ", f.description] })] })] }) }, f.id)) }), h.error && e("div", { className: "p-4 mt-2 rounded-lg bg-red-50 text-red-700", children: e("p", { className: "text-sm", children: h.error.message }) }), e("div", { children: i("p", { className: "text-sm text-gray-500 mt-2 block", children: ["By confirming this order you agree to our", " ", e(z, { href: "/terms-and-conditions", className: "storefront-primary-text storefront-primary-text-hover mr-1", children: "Terms & Conditions" }), "and", " ", e(z, { href: "/privacy-policy", className: "storefront-primary-text storefront-primary-text-hover mr-1", children: "Privacy Policy" })] }) }), i("div", { className: "grid grid-cols-2 gap-x-2 w-full mt-3", children: [e(Y, { variant: "secondary", className: "shadow-none", onClick: () => n.push(r), children: "Back" }), e(Y, { className: "shadow-none", onClick: b, isLoading: h.isPending, children: "Pay & Confirm" })] })] });
|
|
776
776
|
}, Sd = ({ customerDetailsPageUrl: a = "/checkout/customer-details" }) => {
|
|
777
|
-
const { client: t } = E(), { organizationId: r } =
|
|
777
|
+
const { client: t } = E(), { organizationId: r } = be(), n = _(), s = T({ queryKey: ["shippingAddress"], queryFn: async () => {
|
|
778
778
|
const { status: u, body: m } = await t.shipping.getShippingAddress();
|
|
779
779
|
if (u !== 200) throw new Error("Failed to fetch shipping address");
|
|
780
780
|
return m || n.push(a), m;
|
|
@@ -800,7 +800,7 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
800
800
|
const a = fe(Qn);
|
|
801
801
|
if (a === void 0) throw new Error("useAuth must be used within a AuthProvider");
|
|
802
802
|
return a;
|
|
803
|
-
}, zd = () => i(C, { children: [e("div", { className: "animate-pulse", children: [1, 2].map((a) => i("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [e("div", { className: "w-14 sm:w-32 h-10 sm:h-24 overflow-hidden rounded-lg bg-white/10" }), i("div", { className: "pl-3 md:pl-5 flex-1", children: [e("div", { className: "h-4 bg-white/10 rounded-sm w-3/4 mb-2" }), e("div", { className: "h-3 bg-white/10 rounded-sm w-1/2 mb-2" }), e("div", { className: "text-white text-xs opacity-50 whitespace-nowrap sm:block hidden", children: e("div", { className: "h-3 bg-white/10 rounded-sm w-24 mb-2" }) }), e("div", { className: "text-white text-sm font-semibold whitespace-nowrap mt-2 sm:block hidden", children: e("div", { className: "h-4 bg-white/10 rounded-sm w-16" }) })] }), i("div", { className: "ml-auto pl-4 text-right sm:hidden", children: [e("div", { className: "h-4 bg-white/10 rounded-sm w-16 mb-2" }), e("div", { className: "h-3 bg-white/10 rounded-sm w-20" })] })] }, a)) }), e("hr", { className: " md:flex opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-4 w-20 bg-white/10 rounded-sm animate-pulse" }), e("div", { className: "h-4 w-16 bg-white/10 rounded-sm animate-pulse ml-auto" })] }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-4 w-20 bg-white/10 rounded-sm animate-pulse" }), e("div", { className: "h-4 w-16 bg-white/10 rounded-sm animate-pulse ml-auto" })] }), e("hr", { className: " md:flex opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-4 flex justify-between", children: [e("div", { className: "h-5 w-16 bg-white/10 rounded-sm animate-pulse" }), e("div", { className: "h-5 w-24 bg-white/10 rounded-sm animate-pulse" })] })] }), Ar = ({ loading: a = !1, items: t, total: r, subtotal: n, shipping: s, discount: l, currency: o }) => a ? e(zd, {}) : t.length === 0 ? e("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: e("div", { className: "my-3 sm:my-6 sm:pb-1", children: i("div", { className: "text-center py-6", children: [e("p", { className: "text-white font-red-hat-display text-xl font-black mb-4", children: "Your shopping cart is empty. Add some products to get started." }), e(z, { href: "/", className: "text-white hover:text-white/80 underline text-sm", children: "View products" })] }) }) }) : i("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: [e("div", { className: "my-3 sm:my-6 sm:pb-1", children: t.map(({ title: d, subtitle: u, image: m, price: g, unitPrice: p, quantity: h }, b) => e("div", { children: i("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [e("div", { className: "w-14 sm:min-w-32 h-10 sm:h-24 overflow-hidden rounded-lg", children: m != null && m.url ? e(
|
|
803
|
+
}, zd = () => i(C, { children: [e("div", { className: "animate-pulse", children: [1, 2].map((a) => i("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [e("div", { className: "w-14 sm:w-32 h-10 sm:h-24 overflow-hidden rounded-lg bg-white/10" }), i("div", { className: "pl-3 md:pl-5 flex-1", children: [e("div", { className: "h-4 bg-white/10 rounded-sm w-3/4 mb-2" }), e("div", { className: "h-3 bg-white/10 rounded-sm w-1/2 mb-2" }), e("div", { className: "text-white text-xs opacity-50 whitespace-nowrap sm:block hidden", children: e("div", { className: "h-3 bg-white/10 rounded-sm w-24 mb-2" }) }), e("div", { className: "text-white text-sm font-semibold whitespace-nowrap mt-2 sm:block hidden", children: e("div", { className: "h-4 bg-white/10 rounded-sm w-16" }) })] }), i("div", { className: "ml-auto pl-4 text-right sm:hidden", children: [e("div", { className: "h-4 bg-white/10 rounded-sm w-16 mb-2" }), e("div", { className: "h-3 bg-white/10 rounded-sm w-20" })] })] }, a)) }), e("hr", { className: " md:flex opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-4 w-20 bg-white/10 rounded-sm animate-pulse" }), e("div", { className: "h-4 w-16 bg-white/10 rounded-sm animate-pulse ml-auto" })] }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-4 w-20 bg-white/10 rounded-sm animate-pulse" }), e("div", { className: "h-4 w-16 bg-white/10 rounded-sm animate-pulse ml-auto" })] }), e("hr", { className: " md:flex opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-4 flex justify-between", children: [e("div", { className: "h-5 w-16 bg-white/10 rounded-sm animate-pulse" }), e("div", { className: "h-5 w-24 bg-white/10 rounded-sm animate-pulse" })] })] }), Ar = ({ loading: a = !1, items: t, total: r, subtotal: n, shipping: s, discount: l, currency: o }) => a ? e(zd, {}) : t.length === 0 ? e("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: e("div", { className: "my-3 sm:my-6 sm:pb-1", children: i("div", { className: "text-center py-6", children: [e("p", { className: "text-white font-red-hat-display text-xl font-black mb-4", children: "Your shopping cart is empty. Add some products to get started." }), e(z, { href: "/", className: "text-white hover:text-white/80 underline text-sm", children: "View products" })] }) }) }) : i("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: [e("div", { className: "my-3 sm:my-6 sm:pb-1", children: t.map(({ title: d, subtitle: u, image: m, price: g, unitPrice: p, quantity: h }, b) => e("div", { children: i("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [e("div", { className: "w-14 sm:min-w-32 h-10 sm:h-24 overflow-hidden rounded-lg", children: m != null && m.url ? e(Ne, { width: 100, height: 100, src: m.url, alt: "", className: "w-full h-full object-cover" }) : e("div", { className: "bg-slate-100 w-full h-full flex items-center justify-center", children: e("span", { className: "text-slate-400 text-xs", children: "No image" }) }) }), i("div", { className: "pl-3 md:pl-5", children: [e("div", { className: "flex font-red-hat-display h4 text-white text-sm items-center", children: d }), u && u.map((f, k) => e("div", { className: "text-white text-xs opacity-50", children: f }, k)), i("div", { className: "text-white text-xs opacity-50 whitespace-nowrap sm:block hidden", children: ["Price: ", p, " | Quantity: x ", h] }), e("div", { className: "font-red-hat-display h4 text-white text-sm whitespace-nowrap mt-2 sm:block hidden", children: g })] }), i("div", { className: "ml-auto pl-4 text-right sm:hidden", children: [e("div", { className: "font-red-hat-display h4 text-white text-sm whitespace-nowrap", children: g }), i("div", { className: "text-white text-xs opacity-50 whitespace-nowrap", children: ["Quantity: ", h] })] })] }) }, b)) }), e("hr", { className: " md:flex opacity-10 my-4 sm:my-4" }), typeof s == "number" && i("div", { className: "mt-3 flex items-center", children: [e("h2", { className: "text-xs xl:text-sm text-white opacity-40 font-red-hat-display", children: "Shipping" }), e("h3", { className: "text-xs xl:text-sm text-white opacity-40 ml-auto font-red-hat-display", children: ve(s, o) })] }), i("div", { className: "mt-3 flex items-center", children: [e("h2", { className: "text-xs xl:text-sm text-white opacity-40 font-red-hat-display", children: "Subtotal" }), e("h3", { className: "text-xs xl:text-sm text-white opacity-40 ml-auto font-red-hat-display", children: ve(n, o) })] }), l ? i("div", { className: "mt-3 flex items-center", children: [e("h2", { className: "text-xs xl:text-sm text-white opacity-40", children: "Discount" }), i("h3", { className: "text-xs xl:text-sm text-white opacity-40 ml-auto", children: ["- ", ve(n, o)] })] }) : null, e("hr", { className: " md:flex opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-4 flex justify-between", children: [e("h2", { className: "text-sm xl:text-lg text-white font-black font-red-hat-display", children: "Total" }), e("h3", { className: "xl:text-lg text-white font-black font-red-hat-display", children: ve(r, o) })] })] }), Dd = () => i("header", { className: "fixed flex justify-between px-2 md:px-6 py-4 md:py-12 z-50 bg-gray-900 md:bg-transparent w-full", children: [i("div", { className: "flex items-center", children: [e("span", { children: e(ga, { className: "w-5 h-5 text-white" }) }), e("div", { className: "ml-1.5 w-7 xl:w-8 h-7 xl:h-8 bg-gray-300 animate-pulse rounded-full" }), e("div", { className: "ml-2 bg-gray-300 animate-pulse h-5 xl:h-6 w-24 xl:w-28 rounded" })] }), i("div", { className: "flex items-center", children: [i("div", { className: "mr-6 flex items-center", children: [e("div", { className: "w-8 h-8 bg-gray-300 animate-pulse rounded-full mr-2" }), e("div", { className: "bg-gray-300 animate-pulse h-4 w-16 rounded" })] }), i("div", { className: "flex md:hidden items-center", children: [e("div", { className: "bg-gray-300 animate-pulse h-3 w-12 rounded mr-1.5" }), e(Ii, { className: "w-5 h-5 text-gray-300" })] })] })] }), Fd = () => {
|
|
804
804
|
const a = _(), { useSession: t, signOut: r } = Qe(), { data: n } = t(), s = () => {
|
|
805
805
|
var d;
|
|
806
806
|
if (!((d = n == null ? void 0 : n.user) != null && d.name)) return "";
|
|
@@ -811,11 +811,11 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
811
811
|
};
|
|
812
812
|
return e("div", { className: "hidden md:block", children: i(Qa, { children: [e(Ta, { className: "flex items-center focus:outline-hidden group", children: n != null && n.user ? e("div", { className: "w-8 h-8 rounded-full overflow-hidden flex items-center justify-center bg-blue-500 text-white relative transition-transform duration-200 group-hover:scale-110 group-hover:ring-2 group-hover:ring-white/50 group-hover:ring-offset-1 group-hover:cursor-pointer", children: n.user.image ? e("img", { src: n.user.image, alt: n.user.name || "User", className: "w-full h-full object-cover" }) : e("span", { className: "font-medium text-sm", children: s() }) }) : i("div", { className: "flex items-center text-white group-hover:text-blue-300 transition-colors duration-200", children: [e(tt, { className: "w-5 h-5 mr-1 group-hover:scale-110 transition-transform duration-200" }), e("span", { children: "Guest" })] }) }), e(Ja, { className: "w-52 min-w-52 p-0 py-1 data-[state=open]:animate-slideDownAndFade z-50", align: "end", sideOffset: 5, forceMount: !0, children: n != null && n.user ? i(C, { children: [i(z, { href: "/account", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(js, { className: "h-4 w-4" }), "My account"] }), i(z, { href: "/account/orders", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(pa, { className: "h-4 w-4" }), "Orders"] }), i(z, { href: "/account/reservations", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(ta, { className: "h-4 w-4" }), "Reservations"] }), i("button", { onClick: l, className: "flex w-full items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(Vs, { className: "h-4 w-4" }), "Logout"] })] }) : i(z, { href: "/account/sign-in", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(tt, { className: "h-4 w-4" }), "Sign in"] }) })] }) });
|
|
813
813
|
}, Oa = ({ summary: a }) => {
|
|
814
|
-
const { organization: t, loading: r } =
|
|
814
|
+
const { organization: t, loading: r } = be(), [n, s] = R(!1);
|
|
815
815
|
if (r) return e(Dd, {});
|
|
816
816
|
const l = (t == null ? void 0 : t.name) ?? "", o = t == null ? void 0 : t.logoFile, d = (t == null ? void 0 : t.configuration.defaultCurrency) ?? "USD";
|
|
817
|
-
return i(C, { children: [i("header", { className: "fixed flex justify-between px-2 md:px-6 py-4 md:py-12 z-50 bg-gray-900 md:bg-transparent w-full", children: [i(z, { href: "/", className: "flex items-center", children: [e("span", { children: e(ga, { className: "w-5 h-5 text-white" }) }), o ? e("span", { className: "ml-1.5 w-7 xl:w-8 h-7 xl:h-8 overflow-hidden rounded-full", children: e(
|
|
818
|
-
}, Tn = ({ children: a, description: t, title: r }) => i(C, { children: [e(Oa, {}), e("div", { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 relative", children: e("div", { className: "absolute inset-0 z-0", children: e(
|
|
817
|
+
return i(C, { children: [i("header", { className: "fixed flex justify-between px-2 md:px-6 py-4 md:py-12 z-50 bg-gray-900 md:bg-transparent w-full", children: [i(z, { href: "/", className: "flex items-center", children: [e("span", { children: e(ga, { className: "w-5 h-5 text-white" }) }), o ? e("span", { className: "ml-1.5 w-7 xl:w-8 h-7 xl:h-8 overflow-hidden rounded-full", children: e(Ne, { src: o.url, alt: l, className: "w-full h-full", width: 32, height: 32 }) }) : e("div", { className: "flex items-center justify-center w-8 h-8 bg-blue-500 rounded-full text-white text-sm uppercase font-semibold", children: e("span", { children: l.slice(0, 2) }) }), l ? e("span", { className: "xl:text-lg font-black text-white ml-2 font-red-hat-display", children: l }) : null] }), i("div", { className: "flex items-center", children: [e("div", { className: "mr-6", children: e(Fd, {}) }), a && e("div", { className: "flex md:hidden", children: n ? e("button", { className: "flex items-center text-white mr-2 animate-fade", onClick: () => s(!1), children: e(ht, { className: "w-5 h-5" }) }, 1) : i("button", { className: "flex items-center text-white mr-2 animate-fade", onClick: () => s(!0), children: [e("span", { className: "text-xs text-white font-semibold mr-1.5", children: ve(a.total, d) }), e(Ii, { className: "w-5 h-5" })] }, 2) })] })] }), a && e(gd, { isOpen: n, onClose: () => s(!1), children: e(Ar, { total: a.total, items: a.items, shipping: a.shipping, subtotal: a.subtotal, currency: d }) })] });
|
|
818
|
+
}, Tn = ({ children: a, description: t, title: r }) => i(C, { children: [e(Oa, {}), e("div", { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 relative", children: e("div", { className: "absolute inset-0 z-0", children: e(Ne, { src: "/images/15750.jpg", alt: "Authentication background", fill: !0, className: "object-cover brightness-50", priority: !0 }) }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative", children: i("div", { className: "py-10 xl:py-24 md:my-auto animate-fade w-full md:max-w-[432px]", children: [(r || t) && i("div", { className: "mb-4 flex flex-col gap-y-1", children: [r && e("h1", { className: "text-[32px] font-red-hat-display font-black", children: r }), t && e("p", { className: "text-gray-500", children: t })] }), a] }) })] }) })] }), ri = ({ children: a }) => {
|
|
819
819
|
const { useSession: t } = Qe(), r = _(), { data: n, isPending: s } = t();
|
|
820
820
|
return X(() => {
|
|
821
821
|
if (!s && n) return r.push("/checkout/customer-details");
|
|
@@ -869,7 +869,7 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
869
869
|
return t.length === 0 ? "Order placed" : t.length === 1 ? t[0] : `${t[0]} +${t.length - 1} more`;
|
|
870
870
|
}, ii = ({ description: a, href: t, icon: r, title: n }) => i(z, { href: t, className: "storefront-primary-border-hover group rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: [e("p", { className: "text-xs font-semibold uppercase tracking-[0.22em] text-stone-500", children: "Quick access" }), i("div", { className: "mt-3 flex items-start justify-between gap-3", children: [i("div", { children: [e("h3", { className: "font-red-hat-display text-xl font-black text-stone-950", children: n }), e("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: a })] }), e("span", { className: "storefront-primary-group-accent inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl bg-stone-100 text-stone-700 transition", children: e(r, { className: "h-5 w-5" }) })] })] }), Pd = () => {
|
|
871
871
|
var p, h, b;
|
|
872
|
-
const { client: a } = E(), { useSession: t } = Qe(), { organization: r, organizationId: n } =
|
|
872
|
+
const { client: a } = E(), { useSession: t } = Qe(), { organization: r, organizationId: n } = be(), { data: s } = t(), l = T({ queryKey: ["account", "orders", n], enabled: !!n && !!(s != null && s.user), queryFn: async () => {
|
|
873
873
|
const { body: f, status: k } = await a.order.getMyOrders({ params: { organizationId: n }, query: { limit: 4, page: 1 } });
|
|
874
874
|
if (k !== 200) throw new Error("Failed to fetch your orders");
|
|
875
875
|
return f;
|
|
@@ -881,7 +881,7 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
881
881
|
if (!(s != null && s.user)) return null;
|
|
882
882
|
if (l.isLoading || o.isLoading) return e(Cr, { title: "Your account" });
|
|
883
883
|
const d = ((p = l.data) == null ? void 0 : p.list) ?? [], u = ((h = o.data) == null ? void 0 : h.list) ?? [], m = [...u].filter((f) => !f.cancelledAt && !!f.date && new Date(f.date).getTime() > Date.now()).sort((f, k) => new Date(f.date ?? 0).getTime() - new Date(k.date ?? 0).getTime())[0], g = s.user.firstname ?? ((b = s.user.name) == null ? void 0 : b.split(" ").filter(Boolean)[0]) ?? "there";
|
|
884
|
-
return i(Rt, { eyebrow: "My account", title: `Welcome back, ${g}`, description: "Track recent orders, revisit reservation history, and jump straight into the parts of your account you use most.", actions: i(C, { children: [e(Y, { asChild: !0, variant: "secondary", children: e(z, { href: "/account/orders", children: "View orders" }) }), e(Y, { asChild: !0, children: e(z, { href: "/account/reservations", children: "Reservation history" }) })] }), children: [i("div", { className: "grid gap-6 lg:grid-cols-[1.25fr_0.95fr]", children: [e(ma, { title: "Recent orders", description: "A quick look at what you ordered most recently.", action: e(lt, { href: "/account/orders", label: "See all" }), children: l.isError ? e(He, { icon: pa, title: "Orders unavailable", description: "We couldn't load your recent orders just now. Please refresh and try again." }) : d.length === 0 ? e(He, { icon: pa, title: "Your order history will appear here", description: "Once you place an order, you'll be able to track its progress and reopen the details from this account page.", actionHref: "/", actionLabel: "Browse the menu" }) : e("div", { className: "space-y-4", children: d.map((f) => e(z, { href: `/account/orders/${f.id}`, className: "storefront-primary-border-hover group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [i("div", { children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Md(f) }), e(st, { tone: On(f.status), children: Jn(f.status) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", f.referenceId, " • ", f.items.length, " item", f.items.length === 1 ? "" : "s", " •", " ", f.fulfilmentMethod === "delivery" ? "Delivery" : "Pickup"] })] }), i("div", { className: "text-left sm:text-right", children: [e("p", { className: "text-lg font-black text-stone-950", children:
|
|
884
|
+
return i(Rt, { eyebrow: "My account", title: `Welcome back, ${g}`, description: "Track recent orders, revisit reservation history, and jump straight into the parts of your account you use most.", actions: i(C, { children: [e(Y, { asChild: !0, variant: "secondary", children: e(z, { href: "/account/orders", children: "View orders" }) }), e(Y, { asChild: !0, children: e(z, { href: "/account/reservations", children: "Reservation history" }) })] }), children: [i("div", { className: "grid gap-6 lg:grid-cols-[1.25fr_0.95fr]", children: [e(ma, { title: "Recent orders", description: "A quick look at what you ordered most recently.", action: e(lt, { href: "/account/orders", label: "See all" }), children: l.isError ? e(He, { icon: pa, title: "Orders unavailable", description: "We couldn't load your recent orders just now. Please refresh and try again." }) : d.length === 0 ? e(He, { icon: pa, title: "Your order history will appear here", description: "Once you place an order, you'll be able to track its progress and reopen the details from this account page.", actionHref: "/", actionLabel: "Browse the menu" }) : e("div", { className: "space-y-4", children: d.map((f) => e(z, { href: `/account/orders/${f.id}`, className: "storefront-primary-border-hover group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [i("div", { children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Md(f) }), e(st, { tone: On(f.status), children: Jn(f.status) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", f.referenceId, " • ", f.items.length, " item", f.items.length === 1 ? "" : "s", " •", " ", f.fulfilmentMethod === "delivery" ? "Delivery" : "Pickup"] })] }), i("div", { className: "text-left sm:text-right", children: [e("p", { className: "text-lg font-black text-stone-950", children: ve(f.payment.total, f.currency) }), e("p", { className: "mt-1 text-sm text-stone-500", children: Ze(f.createdAt, "Recently") })] })] }) }, f.id)) }) }), i("div", { className: "grid gap-6", children: [e(ma, { title: "Jump into your history", description: "The two most useful places for signed-in guests.", children: i("div", { className: "grid gap-4", children: [e(ii, { href: "/account/orders", icon: pa, title: "Orders list", description: "Review every purchase, total paid, fulfilment method, and live order status." }), e(ii, { href: "/account/reservations", icon: ta, title: "Reservation history", description: "See confirmed, pending, and cancelled bookings in one place." })] }) }), e(ma, { title: "Profile snapshot", description: "A quick summary of the details tied to this account.", children: i("div", { className: "rounded-[24px] border border-stone-200 bg-white p-5", children: [i("div", { className: "flex items-center gap-4", children: [e("div", { className: "flex h-14 w-14 items-center justify-center rounded-2xl bg-stone-900 text-lg font-black text-white", children: Bd(s.user.name) }), i("div", { children: [e("p", { className: "font-red-hat-display text-lg font-black text-stone-950", children: s.user.name }), e("p", { className: "text-sm text-stone-500", children: s.user.email })] })] }), i("div", { className: "mt-5 grid gap-3 rounded-[20px] bg-stone-50 p-4 text-sm text-stone-600", children: [i("div", { className: "flex items-center justify-between gap-3", children: [i("span", { className: "inline-flex items-center gap-2", children: [e(tt, { className: "h-4 w-4" }), "First name"] }), e("span", { className: "font-semibold text-stone-900", children: s.user.firstname })] }), i("div", { className: "flex items-center justify-between gap-3", children: [i("span", { className: "inline-flex items-center gap-2", children: [e(tt, { className: "h-4 w-4" }), "Last name"] }), e("span", { className: "font-semibold text-stone-900", children: s.user.lastname })] }), i("div", { className: "flex items-center justify-between gap-3", children: [i("span", { className: "inline-flex items-center gap-2", children: [e(ta, { className: "h-4 w-4" }), "Upcoming reservation"] }), e("span", { className: "font-semibold text-stone-900", children: m ? Ze(m.date, "Not scheduled", "MMM d, yyyy") : "Nothing booked" })] })] }), e("div", { className: "mt-5", children: e(Y, { asChild: !0, variant: "secondary", children: e(z, { href: "/account/reservations/book", children: "Book a table" }) }) })] }) })] })] }), e("div", { className: "mt-6", children: e(ma, { title: "Reservation activity", description: "Your most recent table bookings and their current status.", action: i("div", { className: "flex flex-wrap gap-3", children: [e(Y, { asChild: !0, variant: "secondary", children: e(z, { href: "/account/reservations/book", children: "Book a table" }) }), e(lt, { href: "/account/reservations", label: "Open history" })] }), children: o.isError ? e(He, { icon: ta, title: "Reservations unavailable", description: "We couldn't load your reservation history just now. Please refresh and try again." }) : u.length === 0 ? e(He, { icon: ta, title: "No reservations yet", description: "When you reserve a table, the details and status updates will show up here.", actionHref: "/account/reservations/book", actionLabel: "Book a table" }) : e("div", { className: "grid gap-4 md:grid-cols-2", children: u.map((f) => e(z, { href: `/account/reservations/${f.id}`, className: "storefront-primary-border-hover group rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: i("div", { className: "flex items-start justify-between gap-3", children: [i("div", { children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Ze(f.date, "Date pending", "MMM d, yyyy") }), e(st, { tone: jn(f), children: Ln(f) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", f.referenceId, " • ", f.guests, " ", "guest", f.guests === 1 ? "" : "s"] })] }), e("p", { className: "text-sm font-medium text-stone-500", children: Ze(f.date, "Awaiting confirmation", "h:mm a") })] }) }, f.id)) }) }) })] });
|
|
885
885
|
}, Qd = () => e(Xe, { children: e(Pd, {}) }), Td = { common: { cart: "Cart", checkout: "Checkout", products: "Products", home: "Home", search: "Search", loading: "Loading...", add: "Add", remove: "Remove", close: "Close", back: "Back", next: "Next", continue: "Continue", submit: "Submit", cancel: "Cancel", apply: "Apply", save: "Save", aboutUs: "About Us", ourStory: "Our Story", menu: "Menu", reservations: "Reservations", orderOnline: "Order Online", checkOurMenu: "Check Our Menu", privacyPolicy: "Privacy Policy", termsAndConditions: "Terms and Conditions", orderNow: "Order Now", makeReservation: "Make a Reservation" }, product: { addToCart: "Add to cart", outOfStock: "Out of stock", quantity: "Quantity", price: "Price", total: "Total", description: "Description", options: "Options", modifiers: "Modifiers" }, checkout: { yourOrder: "Your Order", orderSummary: "Order Summary", delivery: "Delivery", address: "Address", payment: "Payment", confirmation: "Confirmation", deliveryDetails: "Delivery Details", paymentMethod: "Payment Method", placeOrder: "Place Order", subtotal: "Subtotal", total: "Total" }, ourStory: { title: "Our Story", subtitle: "From the shores of South India to the heart of Poland – authentic flavors, unforgettable experiences", by: "By", paragraph1: "When Madras Bistro opened its doors in 2018, it marked a historic moment as Poland's first authentic South Indian restaurant. Our journey began with a simple yet profound vision: to introduce the rich, vibrant flavors of South India to the Polish culinary landscape.", paragraph2: "Our founders, inspired by their deep roots in Tamil Nadu, embarked on this venture after noticing that while North Indian cuisine had found its place in Poland, the diverse and distinctive flavors of South India remained undiscovered territory. They dreamed of creating a space where the aromatic spices, coconut-infused curries, and delicate dosas of their homeland could be experienced in their authentic form.", paragraph3: "The path wasn't always easy. Sourcing traditional ingredients, perfecting recipes that stayed true to their South Indian origins while appealing to Polish palates, and educating diners about a cuisine so different from what they knew – these were challenges we embraced with passion. Our chefs, trained in the time-honored techniques of South Indian cooking, worked tirelessly to ensure every dish that left our kitchen carried the essence of the regions they represented.", paragraph4: "Today, Madras Bistro stands as a cultural bridge between Poland and South India. We take pride in having introduced countless Polish diners to the joy of breaking a crispy dosa, savoring the complex flavors of a well-prepared sambar, and experiencing the unique combination of spices that makes South Indian cuisine so distinctive.", paragraph5: "Our story continues to unfold with each meal we serve, as we remain committed to our founding vision: bringing the authentic taste of South India to Poland, one delicious dish at a time.", paragraph6: "I warmly invite you to join us on this culinary adventure and discover the distinctive tastes of South India – a cuisine still new to many in Poland but certain to delight your palate with its rich traditions and bold flavors.", signature: "- Chef Victor", description: "Learn about Madras Bistro's journey in Krakow, bringing authentic South Indian cuisine with passion and tradition. Discover our story and culinary roots!" }, menuSection: { title: "Discover our menu", description: "Our menu is a collection of the most popular dishes from south india." }, orderOnline: { title: "Order Online", description: "Craving South Indian food? Order online from Madras Bistro in Krakow for delicious dosas, curries, and more. Fast, fresh, and authentic, delivered to you!" }, hero: { title: "Discover South Indian Cuisine that's Beyond Delicious", subtitle: "Embark on a flavorful journey rich in tradition and vibrant spices." }, introSection: { title: "Madras Bistro: Five Regions, One Extraordinary Table", paragraph1: "Step into a world where spices whisper ancient secrets and aromas tell tales of distant shores. At Madras Bistro, the diverse culinary heritage of South India comes alive on your plate—a gastronomic tapestry woven from the traditions of Tamil Nadu, Kerala, Andhra Pradesh, Karnataka, and Sri Lanka. Our kitchen celebrates this rich mosaic of regional cuisines, where coastal treasures meet inland specialties in a harmonious expression of flavor.", paragraph2: "In this tropical paradise, the climate nurtures abundant coconut groves and rice fields, giving birth to a culinary tradition that celebrates fresh ingredients and complex flavors. Unlike the heavy, cream-based dishes familiar to many, South Indian cuisine is a delicate dance of spices, featuring iconic dishes like crispy dosas, soft idlis, and tangy sambars that speak to centuries of culinary innovation. Each bite tells a story of coastal markets, family traditions, and a deep connection to the land." }, reservationSection: { title: "Reserve Your Table", description: "Experience authentic South Indian cuisine in a warm, inviting atmosphere. Make a reservation for a memorable dining experience." }, testimonialsSection: { title: "Google Reviews", description: "See what our customers are saying about us", testimonials: [{ name: "Konrad Górski", company: "Appy.com", text: "A bistro worth visiting for fans of Indian flavors. They serve Indian cuisine and from the north of Sri Lanka. I ate delicious milk chicken with aromatic jeera rice. The bistro is small (3 tables) and modest, but you can listen to Indian music hits." }, { name: "Sophia Mackney", company: "Nobi Bank", text: "My husband and I chanced upon this restaurant last Thursday whilst on a short break to Krakow from the UK. This small eatery with just 2 or 3 tables is run by the very friendly and obliging owner/chef and is conveniently located facing Ghetto Heroes Square. The Masala Uttapam, Masala Dosa, Kerala Chicken Curry, Chicken Roast and Masala Chai that we had were absolutely delicious. I highly recommend this restaurant to any lovers of South Indian food." }, { name: "Sridevi Madbhavi", company: "Sync", text: "Absolutely mouthwatering food! The owner (also the chef) is extremely passionate about the customers experience, and you can feel his expertise in every bite. Highly recommend the ghee dosa (he made it extra crispy for us on request). It tastes like home, is SO authentic. The only downside is that I'll miss the food terribly when I leave Kraków!" }, { name: "Bijeesh KB", company: "Appicu", text: "If you're looking for a place that serves real Malabar food, this is definitely the spot. Highly recommended for anyone craving a taste of home!" }] }, orderTracking: { orderPlaced: "Order Placed", orderPlacedDesc: "Your order has been received and is waiting to be accepted", orderAccepted: "Order Accepted", orderAcceptedDesc: "Your order has been accepted and is being processed", readyForDispatch: "Ready for Dispatch", readyForDispatchDesc: "Your order is packed and ready to be shipped", orderDispatched: "Order Dispatched", orderDispatchedDesc: "Your order is on its way to you", orderDelivered: "Order Delivered", orderDeliveredDesc: "Your order has been delivered", orderCancelled: "Order Cancelled", orderCancelledDesc: "Your order has been cancelled", price: "Price", quantity: "Quantity", subtotal: "Subtotal", total: "Total", poweredBy: "Powered by", reference: "Reference", status: "Status" }, reservation: { reservationDetails: "Reservation Details", name: "Name", phone: "Phone", guests: "Guests", date: "Date", reference: "Reference", status: "Status", notSpecified: "Not specified", invalidDate: "Invalid date", requestSent: "Reservation Request Sent", requestSentDesc: "Your reservation request has been received and is waiting to be confirmed by the restaurant", confirmed: "Reservation Confirmed", confirmedDesc: "Your reservation has been confirmed", cancelled: "Reservation Cancelled", cancelledDesc: "Your reservation has been cancelled", pendingStatus: "Pending", confirmedStatus: "Confirmed", cancelledStatus: "Cancelled", bookingEnabled: "Reservations are enabled", bookingEnabledDesc: "You can send a booking request below and the restaurant will review it shortly.", bookingDisabled: "Reservations are currently unavailable", bookingDisabledDesc: "This restaurant is not accepting reservations right now. Please contact them directly for assistance.", poweredBy: "Powered by" }, homepage: { description: "Discover Madras Bistro, Krakow's first South Indian restaurant. Savor authentic flavors, vibrant spices, and traditional dishes in a cozy setting. Visit us today!" }, menu: { description: "Explore the Madras Bistro menu featuring authentic South Indian dishes like dosas, curries, and biryanis. Fresh ingredients, bold flavors in Krakow!" }, privacyPolicy: { description: "Read Madras Bistro's Privacy Policy to understand how we protect your data and ensure a secure experience while enjoying our South Indian cuisine in Krakow." }, termsAndConditions: { description: "Review the Terms and Conditions for using Madras Bistro's website and services in Krakow. Learn about our policies for online orders and dining." } }, Jd = { common: { cart: "Koszyk", checkout: "Zamówienie", products: "Produkty", home: "Strona główna", search: "Szukaj", loading: "Ładowanie...", add: "Dodaj", remove: "Usuń", close: "Zamknij", back: "Wstecz", next: "Dalej", continue: "Kontynuuj", submit: "Wyślij", cancel: "Anuluj", apply: "Zastosuj", save: "Zapisz", aboutUs: "O nas", ourStory: "O Nas", menu: "Menu", reservations: "Rezerwacje", orderOnline: "Zamów online", checkOurMenu: "Sprawdź nasze menu", privacyPolicy: "Polityka prywatności", termsAndConditions: "Warunki korzystania", orderNow: "Zamów teraz", makeReservation: "Zarezerwuj stolik" }, product: { addToCart: "Dodaj do koszyka", outOfStock: "Brak w magazynie", quantity: "Ilość", price: "Cena", total: "Razem", description: "Opis", options: "Opcje", modifiers: "Modyfikatory" }, checkout: { yourOrder: "Twoje zamówienie", orderSummary: "Podsumowanie zamówienia", delivery: "Dostawa", address: "Adres", payment: "Płatność", confirmation: "Potwierdzenie", deliveryDetails: "Szczegóły dostawy", paymentMethod: "Metoda płatności", placeOrder: "Złóż zamówienie", subtotal: "Suma częściowa", total: "Razem" }, ourStory: { title: "Nasza historia", subtitle: "Z wybrzeży Południowych Indii do serca Polski – autentyczne smaki, niezapomniane doświadczenia", by: "Autor", paragraph1: "Kiedy Madras Bistro otworzyło swoje drzwi w 2018 roku, był to historyczny moment jako pierwsza autentyczna restauracja południowoindyjska w Polsce. Nasza podróż rozpoczęła się od prostej, ale głębokiej wizji: wprowadzenia bogatych, żywych smaków Południowych Indii do polskiego krajobrazu kulinarnego.", paragraph2: "Nasi założyciele, zainspirowani swoimi głębokimi korzeniami w Tamil Nadu, rozpoczęli tę przygodę po zauważeniu, że podczas gdy kuchnia północnoindyjska znalazła swoje miejsce w Polsce, różnorodne i charakterystyczne smaki Południowych Indii pozostały nieodkrytym terytorium. Marzyli o stworzeniu miejsca, gdzie aromatyczne przyprawy, curry nasycone kokosem i delikatne dosa z ich ojczyzny mogłyby być doświadczane w autentycznej formie.", paragraph3: "Droga nie zawsze była łatwa. Pozyskiwanie tradycyjnych składników, doskonalenie przepisów, które pozostały wierne południowoindyjskim korzeniom, a jednocześnie trafiały w gusta polskich podniebień, oraz edukowanie gości o kuchni tak różnej od tego, co znali – to były wyzwania, które przyjęliśmy z pasją. Nasi szefowie kuchni, wyszkoleni w tradycyjnych technikach gotowania południowoindyjskiego, pracowali niestrudzenie, aby zapewnić, że każde danie opuszczające naszą kuchnię niosło w sobie esencję regionów, które reprezentowali.", paragraph4: "Dziś Madras Bistro stoi jako kulturowy most między Polską a Południowymi Indiami. Jesteśmy dumni z tego, że wprowadziliśmy niezliczonych polskich gości w radość przełamywania chrupiącej dosy, smakowania złożonych smaków dobrze przygotowanego sambaru i doświadczania unikalnej kombinacji przypraw, która sprawia, że kuchnia południowoindyjska jest tak wyjątkowa.", paragraph5: "Nasza historia nadal rozwija się z każdym posiłkiem, który serwujemy, ponieważ pozostajemy wierni naszej wizji założycielskiej: przywiezienia autentycznego smaku Południowych Indii do Polski, jedno pyszne danie na raz.", paragraph6: "Serdecznie zapraszam do przyłączenia się do tej kulinarnej przygody i odkrycia charakterystycznych smaków Południowych Indii – kuchni nadal nowej dla wielu w Polsce, ale z pewnością zachwycającej podniebienie bogatymi tradycjami i wyrazistymi smakami.", signature: "- Szef kuchni Victor", description: "Poznaj historię Madras Bistro w Krakowie, które wprowadza autentyczną kuchnię południowoindyjską z pasją i tradycją. Odkryj naszą historię i kulinarne korzenie!" }, menuSection: { title: "Odkryj nasze menu", description: "Nasze menu to kolekcja najpopularniejszych dań z południowych Indii." }, orderOnline: { title: "Zamów online", description: "Masz ochotę na południowoindyjskie jedzenie? Zamów online z Madras Bistro w Krakowie pyszne dosa, curry i więcej. Szybkie, świeże i autentyczne, dostarczone prosto do Ciebie!" }, hero: { title: "Odkryj przepyszną południowo indyjską kuchnie", subtitle: "Wyrusz w pełną smaków podróż bogatą w tradycję i wyraziste przyprawy." }, introSection: { title: "Madras Bistro: Pięć regionów, jeden wyjątkowy stół", paragraph1: "Wejdź do świata, gdzie przyprawy szepczą dawne sekrety, a aromaty opowiadają historie z dalekich brzegów. W Madras Bistro różnorodne dziedzictwo kulinarne Południowych Indii ożywa na Twoim talerzu — gastronomiczna tkanina utkana z tradycji Tamil Nadu, Kerali, Andhra Pradesh, Karnataki i Sri Lanki. Nasza kuchnia celebruje tę bogatą mozaikę regionalnych kuchni, gdzie nadmorskie skarby spotykają się z wewnątrznymi specjałami w harmonijnym wyrażeniu smaku.", paragraph2: "W tym tropikalnym raju klimat sprzyja obfitym palmom kokosowym i polom ryżowym, dając początek tradycji kulinarnej, która celebruje świeże składniki i złożone smaki. W przeciwieństwie do ciężkich, kremowych dań znanych wielu osobom, kuchnia południowoindyjska to delikatny taniec przypraw, z takimi ikonicznymi daniami jak chrupiące dosy, miękkie idli i pikantne sambary, które mówią o wiekach kulinarnych innowacji. Każdy kęs opowiada historię nadmorskich targów, rodzinnych tradycji i głębokiego związku z ziemią." }, reservationSection: { title: "Zarezerwuj stolik", description: "Doświadcz autentycznej kuchni południowoindyjskiej w ciepłej, przyjaznej atmosferze. Dokonaj rezerwacji na niezapomniane doświadczenie kulinarne." }, testimonialsSection: { title: "Opinie Google", description: "Zobacz, co mówią o nas nasi klienci", testimonials: [{ name: "Konrad Górski", company: "Appy.com", text: "Bistro warte odwiedzenia dla fanów indyjskich smaków. Serwują kuchnię indyjską i z północy Sri Lanki. Zjadłem pysznego kurczaka w mleku z aromatycznym ryżem jeera. Bistro jest małe (3 stoliki) i skromne, ale można posłuchać indyjskich hitów muzycznych." }, { name: "Sophia Mackney", company: "Nobi Bank", text: "Ja i mój mąż przypadkowo trafiliśmy do tej restauracji w zeszły czwartek podczas krótkiego pobytu w Krakowie z Wielkiej Brytanii. Ta mała jadłodajnia z zaledwie 2 lub 3 stolikami jest prowadzona przez bardzo przyjaznego i uczynnego właściciela/szefa kuchni i jest dogodnie zlokalizowana naprzeciwko Placu Bohaterów Getta. Masala Uttapam, Masala Dosa, Curry z Kurczakiem Kerala, Kurczak Pieczony i Masala Chai, które jedliśmy, były absolutnie pyszne. Gorąco polecam tę restaurację wszystkim miłośnikom południowo-indyjskiej kuchni." }, { name: "Sridevi Madbhavi", company: "Sync", text: "Absolutnie pyszne jedzenie! Właściciel (również szef kuchni) jest niezwykle zaangażowany w doświadczenia klientów i można poczuć jego doświadczenie w każdym kęsie. Gorąco polecam ghee dosa (zrobił je dla nas ekstra chrupiące na prośbę). Smakuje jak w domu, jest BARDZO autentyczne. Jedynym minusem jest to, że będę tęsknić za tym jedzeniem, gdy opuszczę Kraków!" }, { name: "Bijeesh KB", company: "Appicu", text: "Jeśli szukasz miejsca, które serwuje prawdziwe jedzenie Malabar, to zdecydowanie jest to odpowiednie miejsce. Gorąco polecane dla każdego, kto tęskni za smakiem domu!" }] }, orderTracking: { orderPlaced: "Zamówienie złożone", orderPlacedDesc: "Twoje zamówienie zostało odebrane i czeka na akceptację", orderAccepted: "Zamówienie zaakceptowane", orderAcceptedDesc: "Twoje zamówienie zostało zaakceptowane i jest przetwarzane", readyForDispatch: "Gotowe do wysyłki", readyForDispatchDesc: "Twoje zamówienie jest spakowane i gotowe do wysyłki", orderDispatched: "Zamówienie wysłane", orderDispatchedDesc: "Twoje zamówienie jest w drodze do Ciebie", orderDelivered: "Zamówienie dostarczone", orderDeliveredDesc: "Twoje zamówienie zostało dostarczone", orderCancelled: "Zamówienie anulowane", orderCancelledDesc: "Twoje zamówienie zostało anulowane", price: "Cena", quantity: "Ilość", subtotal: "Suma częściowa", total: "Razem", poweredBy: "Wspierane przez", reference: "Numer referencyjny", status: "Status" }, reservation: { reservationDetails: "Szczegóły rezerwacji", name: "Imię i nazwisko", phone: "Telefon", guests: "Liczba gości", date: "Data", reference: "Numer referencyjny", status: "Status", notSpecified: "Nie określono", invalidDate: "Nieprawidłowa data", requestSent: "Prośba o rezerwację wysłana", requestSentDesc: "Twoja prośba o rezerwację została odebrana i czeka na potwierdzenie przez restaurację", confirmed: "Rezerwacja potwierdzona", confirmedDesc: "Twoja rezerwacja została potwierdzona", cancelled: "Rezerwacja anulowana", cancelledDesc: "Twoja rezerwacja została anulowana", pendingStatus: "Oczekujące", confirmedStatus: "Potwierdzone", cancelledStatus: "Anulowane", bookingEnabled: "Rezerwacje są włączone", bookingEnabledDesc: "Możesz wysłać prośbę o rezerwację poniżej, a restauracja wkrótce ją sprawdzi.", bookingDisabled: "Rezerwacje są obecnie niedostępne", bookingDisabledDesc: "Ta restauracja nie przyjmuje teraz rezerwacji. Skontaktuj się z nią bezpośrednio, aby uzyskać pomoc.", poweredBy: "Wspierane przez" }, homepage: { description: "Odkryj Madras Bistro, pierwszą restaurację południowoindyjską w Krakowie. Skosztuj autentycznych smaków, żywych przypraw i tradycyjnych dań w przytulnym otoczeniu. Odwiedź nas już dziś!" }, menu: { description: "Zapoznaj się z menu Madras Bistro oferującym autentyczne południowoindyjskie dania jak dosa, curry i biryani. Świeże składniki, wyraziste smaki w Krakowie!" }, privacyPolicy: { description: "Przeczytaj Politykę Prywatności Madras Bistro, aby zrozumieć, jak chronimy Twoje dane i zapewniamy bezpieczne doświadczenie podczas delektowania się naszą południowoindyjską kuchnią w Krakowie." }, termsAndConditions: { description: "Zapoznaj się z Warunkami korzystania ze strony internetowej i usług Madras Bistro w Krakowie. Dowiedz się o naszych zasadach dotyczących zamówień online i dań w restauracji." } }, ni = { en: Td, pl: Jd }, Vn = Ce(void 0), Od = ({ children: a, locale: t }) => {
|
|
886
886
|
const r = U((s) => {
|
|
887
887
|
const l = s.split(".");
|
|
@@ -903,7 +903,7 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
903
903
|
}, d = !!n, u = r && !n;
|
|
904
904
|
return i("div", { className: "relative flex items-start gap-4 pb-8", children: [e("div", { className: "flex items-center justify-center w-8 h-8 rounded-full shrink-0", children: i("div", { className: w("w-8 h-8 rounded-full flex items-center justify-center", { "bg-green-100 border-green-500 border-[3px]": d && !l, "bg-violet-100 border-violet-500 border-[3px]": d && l, "bg-white": !n, "border-gray-200 border-[3px]": !n && !r, "bg-red-100 border-red-500 border-[3px]": s }), children: [n && !l && !s && e(Ld, { className: "w-4 h-4 text-green-500" }), d && l && e(Zs, { className: "w-4 h-4 text-violet-500" }), s && e(jd, { className: "w-4 h-4 text-red-500" }), u && e(Vd, { className: "text-gray-200 animate-spin dark:text-gray-600 fill-blue-600 w-full" })] }) }), i("div", { className: "flex-1", children: [e("h3", { className: w("font-black font-red-hat-display", { "text-red-500": s, "text-gray-900": d, "text-gray-500": !s && !d }), children: a }), e("p", { className: w("text-sm font-medium", { "text-red-500": s, "text-gray-600": d, "text-gray-400": !s && !d }), children: t }), o(n) && e("p", { className: "text-xs text-gray-400 mt-1", children: o(n) })] })] });
|
|
905
905
|
}, Zd = ({ orderId: a }) => {
|
|
906
|
-
const { client: t } = E(), { organization: r, organizationId: n } =
|
|
906
|
+
const { client: t } = E(), { organization: r, organizationId: n } = be(), s = ye(), l = _(), o = We(), { t: d } = Sr(), u = r == null ? void 0 : r.configuration.defaultCurrency;
|
|
907
907
|
X(() => {
|
|
908
908
|
if ((s == null ? void 0 : s.get("clearCart")) === "true" && o) {
|
|
909
909
|
localStorage.removeItem("shophost-cart");
|
|
@@ -920,7 +920,7 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
920
920
|
const { status: k, body: y } = await t.order.getOrder({ params: { id: a, organizationId: n } });
|
|
921
921
|
if (k !== 200) throw new Error("Failed to fetch shipping address");
|
|
922
922
|
return y;
|
|
923
|
-
} }), h = pe(() => m ? m == null ? void 0 : m.items.map((k) => ({ title: k.translations[0].title, subtitle: [k.translations[0].subtitle], price:
|
|
923
|
+
} }), h = pe(() => m ? m == null ? void 0 : m.items.map((k) => ({ title: k.translations[0].title, subtitle: [k.translations[0].subtitle], price: ve(k.unitPrice, u ?? "USD"), unitPrice: ve(k.unitPrice, u ?? "USD"), quantity: k.quantity, image: k.image })) : [], [m, u]);
|
|
924
924
|
if (!m || g) return e(Zn, {});
|
|
925
925
|
const { status: b } = m, f = [{ title: d("orderTracking.orderPlaced"), description: d("orderTracking.orderPlacedDesc"), date: new Date(m.expiresAt), active: !1 }, { title: d("orderTracking.orderAccepted"), description: d("orderTracking.orderAcceptedDesc"), date: m.acceptedAt, active: !m.acceptedAt }, { title: d("orderTracking.readyForDispatch"), description: d("orderTracking.readyForDispatchDesc"), date: m.readyForDispatchAt, active: b === "accepted" }, { title: d("orderTracking.orderDispatched"), description: d("orderTracking.orderDispatchedDesc"), date: m.dispatchedAt, active: b === "ready-for-dispatch" }, { title: d("orderTracking.orderDelivered"), description: d("orderTracking.orderDeliveredDesc"), date: m.completedAt, active: b === "dispatched", showConfetti: !0 }];
|
|
926
926
|
return m.status === "cancelled" && f.push({ title: d("orderTracking.orderCancelled"), description: d("orderTracking.orderCancelledDesc"), date: m.cancelledAt, active: !!m.cancelledAt, cancelled: !0 }), i(C, { children: [e(Oa, { summary: { total: m.payment.total, subtotal: m.payment.subtotal, shipping: m.payment.shipping, items: h } }), e("div", { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 bg-gray-900 md:overflow-y-auto", children: e("div", { className: "w-96 animate-fade", children: i("div", { className: "pl-6", children: [e(Ar, { items: h, total: m.payment.total, subtotal: m.payment.subtotal, shipping: m.payment.shipping, currency: u ?? "USD" }), i("p", { className: "text-xs text-gray-500 dark:text-gray-400 text-center mt-14 w-full", children: [d("orderTracking.poweredBy"), " ", e("a", { href: "https://shophost.io", className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", children: "shophost.io" })] })] }) }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative", children: i("div", { className: "md:my-auto animate-fade w-full md:max-w-[432px] pt-14 sm:pt-0", children: [e("h1", { className: "h3 mb-1 font-red-hat-display", children: d("checkout.yourOrder") }), i("div", { className: "mb-8", children: [i("p", { className: "text-sm font-medium text-gray-500", children: [d("orderTracking.reference"), ": ", m.referenceId] }), i("p", { className: "text-sm font-medium text-gray-500", children: [d("orderTracking.status"), ":", " ", e("span", { className: `capitalize font-semibold ${m.status === "cancelled" ? "text-red-600" : "text-green-600"}`, children: m.status })] })] }), e("div", { className: "mt-8 space-y-4", children: i("div", { className: "relative", children: [e("div", { className: "absolute left-4 top-0 w-0.5 bg-gray-200", style: { height: `calc(100% - ${f.length > 1 ? "4rem" : "0rem"})` } }), f.map((k, y) => e(Hn, { ...k }, y))] }) })] }) })] }) })] });
|
|
@@ -932,7 +932,7 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
932
932
|
return t.length === 0 ? "Order placed" : t.length === 1 ? t[0] : `${t[0]} +${t.length - 1} more`;
|
|
933
933
|
}, Ud = () => {
|
|
934
934
|
var o;
|
|
935
|
-
const { client: a } = E(), { useSession: t } = Qe(), { organizationId: r } =
|
|
935
|
+
const { client: a } = E(), { useSession: t } = Qe(), { organizationId: r } = be(), { data: n } = t(), s = T({ queryKey: ["account", "orders", "history", r], enabled: !!r && !!(n != null && n.user), queryFn: async () => {
|
|
936
936
|
const { body: d, status: u } = await a.order.getMyOrders({ params: { organizationId: r }, query: { limit: 20, page: 1 } });
|
|
937
937
|
if (u !== 200) throw new Error("Failed to fetch your orders");
|
|
938
938
|
return d;
|
|
@@ -943,7 +943,7 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
943
943
|
return e(Rt, { eyebrow: "My account", title: "Your orders", description: "Everything you've ordered lives here, including totals, fulfilment details, and live status updates.", actions: i(C, { children: [e(Y, { asChild: !0, variant: "secondary", children: e(z, { href: "/account", children: "Back to account" }) }), e(Y, { asChild: !0, children: e(z, { href: "/account/reservations", children: "Reservation history" }) })] }), children: e("div", { children: e(ma, { title: "Order history", description: "Open any order to review the full tracker and line items.", action: e(lt, { href: "/account", label: "Back to dashboard" }), children: s.isError ? e(He, { icon: pa, title: "We couldn't load your orders", description: "Please refresh the page and try again. Your order tracker will be back as soon as the connection recovers." }) : l.length === 0 ? e(He, { icon: pa, title: "No orders yet", description: "Once you buy something, this page becomes your personal record of what you ordered and how each order progressed.", actionHref: "/", actionLabel: "Start shopping" }) : e("div", { className: "space-y-4", children: l.map((d) => e(z, { href: `/account/orders/${d.id}`, className: "storefront-primary-border-hover group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between", children: [i("div", { className: "min-w-0", children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Hd(d) }), e(st, { tone: On(d.status), children: Jn(d.status) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", d.referenceId, " • ", d.items.length, " item", d.items.length === 1 ? "" : "s", " •", " ", d.fulfilmentMethod === "delivery" ? "Delivery" : "Pickup"] }), e("div", { className: "mt-4 flex flex-wrap gap-2", children: d.items.slice(0, 3).map((u, m) => {
|
|
944
944
|
var g;
|
|
945
945
|
return e("span", { className: "rounded-full border border-stone-200 bg-stone-50 px-3 py-1 text-xs font-medium text-stone-600", children: ((g = u.translations[0]) == null ? void 0 : g.title) ?? "Item" }, `${d.id}-${m}`);
|
|
946
|
-
}) })] }), i("div", { className: "shrink-0 text-left lg:text-right", children: [e("p", { className: "text-lg font-black text-stone-950", children:
|
|
946
|
+
}) })] }), i("div", { className: "shrink-0 text-left lg:text-right", children: [e("p", { className: "text-lg font-black text-stone-950", children: ve(d.payment.total, d.currency) }), e("p", { className: "mt-1 text-sm text-stone-500", children: Ze(d.createdAt, "Recently") }), e("p", { className: "mt-3 text-sm font-semibold text-stone-700 transition group-hover:text-stone-950", children: "View details" })] })] }) }, d.id)) }) }) }) });
|
|
947
947
|
}, qd = (a, t, r) => {
|
|
948
948
|
if (t.length === 0) return;
|
|
949
949
|
let n = a;
|
|
@@ -963,23 +963,23 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
963
963
|
return { values: {}, errors: n };
|
|
964
964
|
}, _d = ({ initialData: a }) => {
|
|
965
965
|
var g;
|
|
966
|
-
const { client: t } = E(), { organizationId: r, organization: n } =
|
|
966
|
+
const { client: t } = E(), { organizationId: r, organization: n } = be(), { t: s } = Sr(), l = _(), o = (g = n == null ? void 0 : n.configuration) == null ? void 0 : g.isAcceptingReservations, d = [n == null ? void 0 : n.phone, n == null ? void 0 : n.email].filter((p) => !!p), u = ue({ resolver: Wd(qo), reValidateMode: "onChange", defaultValues: { firstname: a.firstname, lastname: a.lastname } }), m = O({ mutationFn: async (p) => {
|
|
967
967
|
const { status: h, body: b } = await t.reservation.createReservation({ body: p, params: { organizationId: r } });
|
|
968
968
|
if (h !== 201) throw new Error("Failed to create shipping address");
|
|
969
969
|
return b;
|
|
970
970
|
}, onSuccess: (p) => {
|
|
971
971
|
l.push(`/account/reservations/${p.id}`);
|
|
972
972
|
} });
|
|
973
|
-
return i("div", { className: "flex flex-col gap-4", children: [n && o === !1 && i("div", { className: "rounded-[28px] border border-amber-200 bg-amber-50 px-5 py-4 text-amber-950", children: [e("h2", { className: "font-red-hat-display text-lg font-black", children: s("reservation.bookingDisabled") }), e("p", { className: "mt-2 text-sm leading-6", children: s("reservation.bookingDisabledDesc") }), d.length > 0 && e("div", { className: "mt-3 text-sm font-medium", children: d.map((p) => e("div", { children: p }, p)) })] }), o === !1 ? e(Y, { variant: "secondary", className: "shadow-none", type: "button", onClick: () => l.push("/"), children: "Back" }) : e(Ue, { ...u, children: i("form", { onSubmit: u.handleSubmit((p) => m.mutate(p)), children: [i("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [e(
|
|
973
|
+
return i("div", { className: "flex flex-col gap-4", children: [n && o === !1 && i("div", { className: "rounded-[28px] border border-amber-200 bg-amber-50 px-5 py-4 text-amber-950", children: [e("h2", { className: "font-red-hat-display text-lg font-black", children: s("reservation.bookingDisabled") }), e("p", { className: "mt-2 text-sm leading-6", children: s("reservation.bookingDisabledDesc") }), d.length > 0 && e("div", { className: "mt-3 text-sm font-medium", children: d.map((p) => e("div", { children: p }, p)) })] }), o === !1 ? e(Y, { variant: "secondary", className: "shadow-none", type: "button", onClick: () => l.push("/"), children: "Back" }) : e(Ue, { ...u, children: i("form", { onSubmit: u.handleSubmit((p) => m.mutate(p)), children: [i("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [e(ke, { name: "firstname", label: "First Name", type: "text", className: "col-span-2", placeholder: "e.g. John" }), e(ke, { name: "lastname", label: "Last Name", type: "text", className: "col-span-2", placeholder: "e.g. Doe" }), e(ke, { name: "phone", label: "Phone", type: "phone-number", className: "col-span-4", placeholder: "e.g. +48 123 456 789" }), e(ke, { name: "guests", label: "Number of Guests", type: "number", className: "col-span-4", placeholder: "e.g. 2" }), e(ke, { name: "date", type: "week-time", className: "col-span-4 -mt-4" })] }), i("div", { className: "grid grid-cols-2 gap-x-2 w-full mt-8", children: [e(Y, { variant: "secondary", className: "shadow-none", type: "button", onClick: () => l.push("/"), children: "Back" }), e(Y, { type: "submit", className: "shadow-none", isLoading: m.isPending, loadingText: "Saving...", children: "Send Request" })] })] }) })] });
|
|
974
974
|
}, $d = () => {
|
|
975
|
-
const { useSession: a } = Qe(), {
|
|
976
|
-
return
|
|
975
|
+
const { useSession: a } = Qe(), { organization: t } = be(), { data: r } = a(), n = t != null && t.name ? `Enter your details to book a table at ${t.name}` : "Enter your details to book a table";
|
|
976
|
+
return r != null && r.user ? e(Tn, { title: "Book a table", description: n, children: e(_d, { initialData: { firstname: r.user.firstname, lastname: r.user.lastname } }) }) : null;
|
|
977
977
|
}, si = (a, t) => {
|
|
978
978
|
if (!a) return t("reservation.notSpecified");
|
|
979
979
|
const r = new Date(a);
|
|
980
980
|
return sr(r) ? $(r, "MMM d, yyyy - h:mm a") : t("reservation.invalidDate");
|
|
981
981
|
}, Kd = ({ reservationId: a }) => {
|
|
982
|
-
const { client: t } = E(), { organizationId: r } =
|
|
982
|
+
const { client: t } = E(), { organizationId: r } = be(), { t: n } = Sr(), { data: s, isLoading: l } = T({ queryKey: ["reservation", a], queryFn: async () => {
|
|
983
983
|
const { status: u, body: m } = await t.reservation.getReservation({ params: { reservationId: a, organizationId: r } });
|
|
984
984
|
if (u !== 200) throw new Error("Failed to fetch reservation");
|
|
985
985
|
return m;
|
|
@@ -994,7 +994,7 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
994
994
|
return i(C, { children: [e(Oa, {}), i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 bg-gray-900 md:overflow-y-auto", children: e("div", { className: "w-96 animate-fade", children: i("div", { className: "pl-6", children: [i("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: [e("div", { className: "my-3 sm:my-6 sm:pb-1", children: i("div", { className: "flex flex-col w-full mb-5 sm:mb-3", children: [e("h2", { className: "text-xl font-bold text-white mb-2", children: n("reservation.reservationDetails") }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.name"), ":"] }), " ", s.firstname, " ", s.lastname] }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.phone"), ":"] }), " ", s.phone] }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.guests"), ":"] }), " ", s.guests] }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.date"), ":"] }), " ", si(s.date, n)] })] }) }), e("hr", { className: "opacity-10 my-4 sm:my-4" }), e("div", { className: "mt-4", children: i("div", { className: "flex items-center", children: [e("h2", { className: "text-sm xl:text-lg text-white font-black font-red-hat-display", children: n("common.makeReservation") }), e("span", { className: `ml-auto py-1 px-3 rounded-full text-sm font-semibold ${s.cancelledAt ? "bg-red-100 text-red-800" : s.acceptedAt ? "bg-green-100 text-green-800" : "bg-yellow-100 text-yellow-800"}`, children: d() })] }) })] }), i("p", { className: "text-xs text-gray-500 dark:text-gray-400 text-center mt-14 w-full", children: [n("reservation.poweredBy"), " ", e("a", { href: "https://shophost.io", className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", children: "shophost.io" })] })] }) }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative animate-fade-in", children: i("div", { className: "md:my-auto animate-fade w-full md:max-w-[432px] pt-14 sm:pt-0", children: [e("h1", { className: "h3 mb-1 font-red-hat-display", children: n("common.makeReservation") }), i("div", { className: "mb-8", children: [i("p", { className: "text-sm font-medium text-gray-500", children: [n("reservation.reference"), ": ", s.referenceId] }), i("p", { className: "text-sm font-medium text-gray-500", children: [n("reservation.status"), ":", " ", e("span", { className: `capitalize font-semibold ${s.cancelledAt ? "text-red-600" : s.acceptedAt ? "text-green-600" : "text-yellow-600"}`, children: d() })] }), i("div", { className: "mt-10 border-b pb-6 md:hidden", children: [e("div", { className: "flex items-center", children: e("h2", { className: "text-lg font-black font-red-hat-display text-gray-900", children: n("reservation.reservationDetails") }) }), i("p", { className: "text-sm font-medium text-gray-600 mb-1", children: [i("span", { className: "font-semibold", children: [n("reservation.name"), ":"] }), " ", s.firstname, " ", s.lastname] }), i("p", { className: "text-sm font-medium text-gray-600 mb-1", children: [i("span", { className: "font-semibold", children: [n("reservation.phone"), ":"] }), " ", s.phone] }), i("p", { className: "text-sm text-gray-600 mb-1", children: [i("span", { className: "font-semibold", children: [n("reservation.guests"), ":"] }), " ", s.guests] }), i("p", { className: "text-sm font-medium text-gray-600 mb-1", children: [i("span", { className: "font-semibold", children: [n("reservation.date"), ":"] }), " ", si(s.date, n)] })] })] }), e("div", { className: "mt-8 space-y-4", children: i("div", { className: "relative", children: [e("div", { className: "absolute left-4 top-0 w-0.5 bg-gray-200", style: { height: `calc(100% - ${o.length > 1 ? "4rem" : "0rem"})` } }), o.map((u, m) => e(Hn, { ...u }, m))] }) })] }) })] })] });
|
|
995
995
|
}, Gd = () => {
|
|
996
996
|
var o;
|
|
997
|
-
const { client: a } = E(), { useSession: t } = Qe(), { organizationId: r } =
|
|
997
|
+
const { client: a } = E(), { useSession: t } = Qe(), { organizationId: r } = be(), { data: n } = t(), s = T({ queryKey: ["account", "reservations", "history", r], enabled: !!r && !!(n != null && n.user), queryFn: async () => {
|
|
998
998
|
const { body: d, status: u } = await a.reservation.getMyReservations({ params: { organizationId: r }, query: { limit: 20, page: 1 } });
|
|
999
999
|
if (u !== 200) throw new Error("Failed to fetch your reservations");
|
|
1000
1000
|
return d;
|
|
@@ -1040,7 +1040,7 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
1040
1040
|
return ea();
|
|
1041
1041
|
}
|
|
1042
1042
|
}, Qp = () => {
|
|
1043
|
-
const a = Ki(), { useSession: t } = Qe(), r = _(), { data: n, isPending: s } = t(), { loading: l, formattedCartItems: o, total: d, subtotal: u, shipping: m } = cr(), { organization: g, loading: p } =
|
|
1043
|
+
const a = Ki(), { useSession: t } = Qe(), r = _(), { data: n, isPending: s } = t(), { loading: l, formattedCartItems: o, total: d, subtotal: u, shipping: m } = cr(), { organization: g, loading: p } = be(), h = (a == null ? void 0 : a.segments) || [];
|
|
1044
1044
|
if (X(() => {
|
|
1045
1045
|
!s && !n && r.push("/account/sign-in?redirect=/checkout/customer-details");
|
|
1046
1046
|
}, [n, s, r]), p || l || s) return e("div", { className: "flex flex-col items-center justify-center h-screen w-screen bg-gray-900", children: e("div", { className: "mb-4", children: e("div", { className: "storefront-primary-border animate-spin rounded-full h-18 w-18 border-b-2" }) }) });
|
|
@@ -1150,7 +1150,7 @@ const vd = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
1150
1150
|
function ee(...a) {
|
|
1151
1151
|
return Yi(Gi(...a));
|
|
1152
1152
|
}
|
|
1153
|
-
const xa = ["focus:ring-2", "focus:ring-blue-200 dark:focus:ring-blue-700/30", "focus:border-blue-500 dark:focus:border-blue-700"],
|
|
1153
|
+
const xa = ["focus:ring-2", "focus:ring-blue-200 dark:focus:ring-blue-700/30", "focus:border-blue-500 dark:focus:border-blue-700"], xe = ["outline outline-offset-2 outline-0 focus-visible:outline-2", "outline-blue-500 dark:outline-blue-500"], Bt = ["ring-2", "border-red-500 dark:border-red-700", "ring-red-200 dark:ring-red-700/30"], fc = (a, t = 0) => Intl.NumberFormat("us", { minimumFractionDigits: t, maximumFractionDigits: t }).format(Number(a)).toString(), oe = { currency: (a, t = "USD") => new Intl.NumberFormat("en-US", { style: "currency", currency: t }).format(a), unit: (a) => `${fc(a)}` }, yc = Pe({ base: ["relative inline-flex items-center justify-center whitespace-nowrap rounded-lg border px-3 py-2 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out", "disabled:pointer-events-none disabled:shadow-none", xe], variants: { variant: { primary: ["border-transparent", "text-white dark:text-white", "bg-blue-600 dark:bg-blue-500", "shadow-[0_16px_8px_rgba(31,31,31,0.01),0_12px_6px_rgba(31,31,31,0.04),0_4px_4px_rgba(31,31,31,0.07),0_1.5px_3px_rgba(31,31,31,0.08),0_0_0_1px_#2563eb,inset_0_1px_2px_hsla(0,0%,100%,0.12)] dark:outline-0 outline outline-2 outline-transparent outline-offset-2", "hover:bg-blue-500 dark:hover:bg-blue-600", "disabled:bg-blue-100 disabled:text-gray-400", "dark:disabled:bg-blue-800 dark:disabled:text-blue-400"], secondary: ["border-gray-200 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "bg-white dark:bg-gray-950", "shadow-[0_1px_1px_0.5px_rgba(51,51,51,.04),0_3px_3px_-1.5px_rgba(51,51,51,.02),0_6px_6px_-3px_rgba(51,51,51,.04),0_12px_12px_-6px_rgba(51,51,51,.04),0_24px_24px_-12px_rgba(51,51,51,.04),0_48px_48px_-24px_rgba(51,51,51,.04),0_0_0_1px_rgba(51,51,51,.1),inset_0_-1px_1px_-0.5px_rgba(51,51,51,.06)] outline outline-2 dark:outline-0 outline-transparent outline-offset-2", "hover:bg-gray-50 dark:hover:bg-gray-900/60", "disabled:text-gray-400", "dark:disabled:text-gray-600"], light: ["shadow-none", "border-transparent", "text-gray-900 dark:text-gray-50", "bg-gray-200 dark:bg-gray-900", "hover:bg-gray-300/70 dark:hover:bg-gray-800/80", "disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:bg-gray-800 dark:disabled:text-gray-600"], ghost: ["shadow-none", "border-transparent", "text-gray-900 dark:text-gray-50", "bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800/80", "disabled:text-gray-400", "dark:disabled:text-gray-600"], destructive: ["text-white", "border-transparent", "bg-red-600 dark:bg-red-700", "hover:bg-red-700 dark:hover:bg-red-600", "disabled:bg-red-300 disabled:text-white", "dark:disabled:bg-red-950 dark:disabled:text-red-400"] } }, defaultVariants: { variant: "primary" } }), I = S.forwardRef(({ asChild: a, isLoading: t = !1, loadingText: r, className: n, disabled: s, variant: l, children: o, ...d }, u) => e(a ? lr : "button", { ref: u, className: w(yc({ variant: l }), n), disabled: s || t, ...d, children: t ? i("span", { className: "pointer-events-none flex shrink-0 items-center justify-center gap-1.5", children: [e(ji, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }), e("span", { className: "sr-only", children: r || "Loading" }), r || "Loading"] }) : o }));
|
|
1154
1154
|
I.displayName = "Button";
|
|
1155
1155
|
function qn({ onReset: a }) {
|
|
1156
1156
|
return e("div", { className: "shophost-admin flex h-screen flex-col items-center justify-center gap-4", children: e("div", { className: "py-8 px-4 mx-auto max-w-(--breakpoint-xl) pb-64 lg:px-6", children: i("div", { className: "mx-auto max-w-(--breakpoint-sm) text-center", children: [e("h1", { className: "mb-4 text-7xl tracking-tight font-extrabold lg:text-9xl text-red-500 dark:text-primary-500", children: "500" }), e("p", { className: "mb-3 font-red-hat-display text-3xl tracking-tight font-bold text-gray-800 md:text-4xl dark:text-white", children: "Something went wrong" }), i("p", { className: "mb-4 text-lg text-gray-500 dark:text-gray-400", children: ["We are sorry, but there was an unexpected error. ", e("br", {}), "Please try reloading the page."] }), a && e(I, { className: "mt-3", onClick: a, children: "Reload Page" })] }) }) });
|
|
@@ -1187,7 +1187,7 @@ const wc = Ce(void 0), kc = ({ children: a, initialState: t = !1 }) => {
|
|
|
1187
1187
|
return b;
|
|
1188
1188
|
}, enabled: !!r }), l = ((u = s.data) == null ? void 0 : u.configuration.defaultLocale) ?? "en", o = ((m = s.data) == null ? void 0 : m.configuration.defaultCurrency) ?? "USD", d = ((p = (g = s.data) == null ? void 0 : g.configuration.supportedLocales) == null ? void 0 : p.sort((b) => b === l ? -1 : 1)) || ["en"];
|
|
1189
1189
|
return e(Wn.Provider, { value: { defaultLocale: l, defaultCurrency: o, supportedLocales: d, organizations: { loading: n.isLoading, data: ((h = n.data) == null ? void 0 : h.list) ?? [], error: n.isError }, organization: { loading: s.isLoading, data: s.data ?? null, error: s.isError } }, children: s.isLoading || n.isLoading ? e("div", { className: "flex justify-center items-center h-screen mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(le, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : a });
|
|
1190
|
-
},
|
|
1190
|
+
}, we = () => {
|
|
1191
1191
|
const a = fe(Wn);
|
|
1192
1192
|
if (!a) throw new Error("useOrganization must be used within a OrganizationProvider");
|
|
1193
1193
|
return a;
|
|
@@ -1221,7 +1221,7 @@ const Cc = Pe({ base: ["relative block w-full rounded-lg border px-2.5 py-2.5 sh
|
|
|
1221
1221
|
y(!1);
|
|
1222
1222
|
}
|
|
1223
1223
|
};
|
|
1224
|
-
return i("div", { className: w("relative w-full", a), children: [o && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center px-3 text-slate-600 dark:text-gray-600 z-10 text-sm border-r border-gray-200", children: o }), e(F, { ref: h, type: x ? b : s, className: w(Cc({ hasError: r, enableStepper: l ? !1 : n, multiline: l }), { "pl-16": o, "pl-8": !o && v, "pr-24": N, "pr-10": !N && (d || !d && x) }, t), ...p }), !o && v && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2 text-gray-400 dark:text-gray-600", children: e(ir, { className: "size-[1.125rem]" }) }), N && e("div", { className: "absolute inset-y-0 right-0 flex items-center pr-1.5", children: i(I, { type: "button", variant: "ghost", onClick: J, isLoading: k, loadingText: "Copying...", className: "h-8 cursor-pointer px-2 text-xs hover:text-gray-600 dark:hover:bg-gray-800", children: [e(Hs, { className: "size-4", "aria-hidden": "true" }), e("span", { className: "sr-only", children: "Copy value" })] }) }), !N && d && e("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-gray-400 dark:text-gray-600", children: d }), !N && !d && x && e("div", { className: "absolute inset-y-0 right-0 flex items-center pr-3", children: e("button", { onClick: () => f(b === "password" ? "text" : "password"), className: w(
|
|
1224
|
+
return i("div", { className: w("relative w-full", a), children: [o && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center px-3 text-slate-600 dark:text-gray-600 z-10 text-sm border-r border-gray-200", children: o }), e(F, { ref: h, type: x ? b : s, className: w(Cc({ hasError: r, enableStepper: l ? !1 : n, multiline: l }), { "pl-16": o, "pl-8": !o && v, "pr-24": N, "pr-10": !N && (d || !d && x) }, t), ...p }), !o && v && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2 text-gray-400 dark:text-gray-600", children: e(ir, { className: "size-[1.125rem]" }) }), N && e("div", { className: "absolute inset-y-0 right-0 flex items-center pr-1.5", children: i(I, { type: "button", variant: "ghost", onClick: J, isLoading: k, loadingText: "Copying...", className: "h-8 cursor-pointer px-2 text-xs hover:text-gray-600 dark:hover:bg-gray-800", children: [e(Hs, { className: "size-4", "aria-hidden": "true" }), e("span", { className: "sr-only", children: "Copy value" })] }) }), !N && d && e("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-gray-400 dark:text-gray-600", children: d }), !N && !d && x && e("div", { className: "absolute inset-y-0 right-0 flex items-center pr-3", children: e("button", { onClick: () => f(b === "password" ? "text" : "password"), className: w(xe, "text-gray-400 hover:text-gray-500 dark:text-gray-600"), children: b === "password" ? e(Vi, { className: "size-5" }) : e(Zi, { className: "size-5" }) }) })] });
|
|
1225
1225
|
});
|
|
1226
1226
|
de.displayName = "Input";
|
|
1227
1227
|
const ce = A.forwardRef(({ className: a, disabled: t, ...r }, n) => e(Xi.Root, { ref: n, className: ee("text-sm leading-none", "text-gray-900 dark:text-gray-50", { "text-gray-400 dark:text-gray-600": t }, a), "aria-disabled": t, ...r }));
|
|
@@ -1236,7 +1236,7 @@ const Sc = () => {
|
|
|
1236
1236
|
};
|
|
1237
1237
|
function $n({ children: a }) {
|
|
1238
1238
|
const { appearance: t } = sn(), r = t == null ? void 0 : t.loginImage;
|
|
1239
|
-
return i("div", { className: "flex w-full min-h-screen", children: [r && e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: e(
|
|
1239
|
+
return i("div", { className: "flex w-full min-h-screen", children: [r && e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: e(Ne, { src: r, alt: "Login Visual", width: 4e3, height: 2250, className: "w-full h-full object-cover min-h-screen" }) }), e("div", { className: `w-full ${r ? "lg:w-1/2" : ""} flex items-center justify-center p-8`, children: e("div", { className: "w-full max-w-md space-y-8", children: a }) })] });
|
|
1240
1240
|
}
|
|
1241
1241
|
function Ic() {
|
|
1242
1242
|
return e($n, { children: e(Sc, {}) });
|
|
@@ -1252,7 +1252,7 @@ const la = S.forwardRef(({ className: a, asChild: t, ...r }, n) => e(t ? lr : "d
|
|
|
1252
1252
|
la.displayName = "Card";
|
|
1253
1253
|
const Ea = A.forwardRef(({ onClick: a, icon: t, disabled: r, ...n }, s) => {
|
|
1254
1254
|
const l = t;
|
|
1255
|
-
return e("button", { ref: s, type: "button", disabled: r, className: w("flex size-8 shrink-0 select-none items-center justify-center rounded border p-1 outline-hidden transition sm:size-[30px]", "text-gray-600 hover:text-gray-800", "dark:text-gray-400 dark:hover:text-gray-200", "border-gray-300 dark:border-gray-800", "hover:bg-gray-50 active:bg-gray-100", "dark:hover:bg-gray-900 dark:active:bg-gray-800", "disabled:pointer-events-none", "disabled:border-gray-200 dark:disabled:border-gray-800", "disabled:text-gray-400 dark:disabled:text-gray-600",
|
|
1255
|
+
return e("button", { ref: s, type: "button", disabled: r, className: w("flex size-8 shrink-0 select-none items-center justify-center rounded border p-1 outline-hidden transition sm:size-[30px]", "text-gray-600 hover:text-gray-800", "dark:text-gray-400 dark:hover:text-gray-200", "border-gray-300 dark:border-gray-800", "hover:bg-gray-50 active:bg-gray-100", "dark:hover:bg-gray-900 dark:active:bg-gray-800", "disabled:pointer-events-none", "disabled:border-gray-200 dark:disabled:border-gray-800", "disabled:text-gray-400 dark:disabled:text-gray-600", xe), onClick: a, ...n, children: e(l, { className: "size-full shrink-0" }) });
|
|
1256
1256
|
});
|
|
1257
1257
|
Ea.displayName = "NavigationButton";
|
|
1258
1258
|
function pi({ displayMonth: a, displayIndex: t, enableYearNavigation: r, disableNavigation: n, numberOfMonths: s, startMonth: l, endMonth: o }) {
|
|
@@ -1264,7 +1264,7 @@ function pi({ displayMonth: a, displayIndex: t, enableYearNavigation: r, disable
|
|
|
1264
1264
|
return i("div", { className: "flex items-center justify-between", children: [i("div", { className: "flex items-center gap-1", children: [r && !b && e(Ea, { disabled: n || !f || !x, "aria-label": "Go to previous year", onClick: N, icon: Hi }), !b && e(Ea, { disabled: n || !f, "aria-label": "Go to previous month", onClick: () => f && y(f), icon: Ui })] }), e("div", { role: "presentation", "aria-live": "polite", className: "text-sm font-medium capitalize tabular-nums text-gray-900 dark:text-gray-50", children: $(u, "LLLL yyy") }), i("div", { className: "flex items-center gap-1", children: [!h && e(Ea, { disabled: n || !k, "aria-label": "Go to next month", onClick: () => k && y(k), icon: bt }), r && !h && e(Ea, { disabled: n || !k || !v, "aria-label": "Go to next year", onClick: F, icon: qi })] })] });
|
|
1265
1265
|
}
|
|
1266
1266
|
const Kn = (a) => {
|
|
1267
|
-
const t = a.enableYearNavigation ?? !1, r = a.weekStartsOn ?? 1, n = a.numberOfMonths ?? 1, s = a.disableNavigation, l = a.fromMonth ?? (a.fromYear ? new Date(a.fromYear, 0, 1) : void 0), o = a.toMonth ?? (a.toYear ? new Date(a.toYear, 11, 1) : void 0), d = { months: "flex space-y-0", month: "space-y-4 p-3", caption: "p-4", table: "w-full border-collapse space-y-1", head_row: "flex", head_cell: "w-9 font-medium text-sm sm:text-xs text-center text-gray-400 dark:text-gray-600 pb-2", row: "mt-0.5 flex w-full", cell: w("relative p-0 text-center focus-within:relative", "text-gray-900 dark:text-gray-50"), day: w("size-9 rounded text-sm text-gray-900 focus:z-10 dark:text-gray-50", "hover:bg-gray-200 dark:hover:bg-gray-700",
|
|
1267
|
+
const t = a.enableYearNavigation ?? !1, r = a.weekStartsOn ?? 1, n = a.numberOfMonths ?? 1, s = a.disableNavigation, l = a.fromMonth ?? (a.fromYear ? new Date(a.fromYear, 0, 1) : void 0), o = a.toMonth ?? (a.toYear ? new Date(a.toYear, 11, 1) : void 0), d = { months: "flex space-y-0", month: "space-y-4 p-3", caption: "p-4", table: "w-full border-collapse space-y-1", head_row: "flex", head_cell: "w-9 font-medium text-sm sm:text-xs text-center text-gray-400 dark:text-gray-600 pb-2", row: "mt-0.5 flex w-full", cell: w("relative p-0 text-center focus-within:relative", "text-gray-900 dark:text-gray-50"), day: w("size-9 rounded text-sm text-gray-900 focus:z-10 dark:text-gray-50", "hover:bg-gray-200 dark:hover:bg-gray-700", xe), day_today: "font-semibold", day_selected: w("rounded", "bg-blue-600 text-gray-50", "dark:bg-blue-500 dark:text-gray-50"), day_disabled: "text-gray-300! dark:text-gray-700! line-through hover:bg-transparent", day_outside: "text-gray-400 dark:text-gray-600", day_range_middle: w("rounded-none!", "bg-gray-100! text-gray-900!", "dark:bg-gray-900! dark:text-gray-50!"), day_range_start: "rounded-r-none rounded-l!", day_range_end: "rounded-l-none rounded-r!", ...a.classNames }, u = { ...a.components, Caption: ({ displayMonth: N, displayIndex: F }) => e(pi, { displayMonth: N, displayIndex: F, enableYearNavigation: t, disableNavigation: s, numberOfMonths: n, startMonth: l, endMonth: o }), Chevron: () => e("span", {}), Nav: () => e("span", {}), MonthCaption: ({ calendarMonth: N, displayIndex: F }) => e(pi, { displayMonth: N.date, displayIndex: F, enableYearNavigation: t, disableNavigation: s, numberOfMonths: n, startMonth: l, endMonth: o }) }, m = { weekStartsOn: r, numberOfMonths: n, disableNavigation: s, showOutsideDays: n === 1, className: w(a.className), classNames: d, components: u };
|
|
1268
1268
|
if (a.mode === "range") {
|
|
1269
1269
|
const { enableYearNavigation: N, className: F, classNames: J, components: D, weekStartsOn: Z, numberOfMonths: ie, ...B } = a, V = { ...B, ...m, mode: "range" };
|
|
1270
1270
|
return e(Ua, { ...V });
|
|
@@ -1318,7 +1318,7 @@ const Xn = ({ presets: a, onSelect: t, currentValue: r }) => {
|
|
|
1318
1318
|
}
|
|
1319
1319
|
return !1;
|
|
1320
1320
|
};
|
|
1321
|
-
return e("ul", { className: "flex items-start gap-x-2 sm:flex-col", children: a.map((m, g) => e("li", { className: "sm:w-full sm:py-px", children: e("button", { title: m.label, className: ee("relative w-full overflow-hidden text-ellipsis whitespace-nowrap rounded border px-2.5 py-1.5 text-left text-base shadow-xs outline-hidden transition-all sm:border-none sm:py-2 sm:text-sm sm:shadow-none", "text-gray-700 dark:text-gray-300", "border-gray-200 dark:border-gray-800",
|
|
1321
|
+
return e("ul", { className: "flex items-start gap-x-2 sm:flex-col", children: a.map((m, g) => e("li", { className: "sm:w-full sm:py-px", children: e("button", { title: m.label, className: ee("relative w-full overflow-hidden text-ellipsis whitespace-nowrap rounded border px-2.5 py-1.5 text-left text-base shadow-xs outline-hidden transition-all sm:border-none sm:py-2 sm:text-sm sm:shadow-none", "text-gray-700 dark:text-gray-300", "border-gray-200 dark:border-gray-800", xe, "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-900", "hover:bg-gray-100 dark:hover:bg-gray-900", { "bg-gray-100 dark:bg-gray-900": u(m) }), onClick: () => l(m), "aria-label": `Select ${m.label}`, children: e("span", { children: m.label }) }) }, g)) });
|
|
1322
1322
|
};
|
|
1323
1323
|
Xn.displayName = "DatePicker.PresetContainer";
|
|
1324
1324
|
const gi = (a, t, r) => {
|
|
@@ -1463,7 +1463,7 @@ const is = K.Portal;
|
|
|
1463
1463
|
is.displayName = "DialogPortal";
|
|
1464
1464
|
const ns = S.forwardRef(({ className: a, ...t }, r) => e(K.Overlay, { ref: r, className: w("fixed inset-0 z-50 overflow-y-auto", "bg-black/70", "data-[state=open]:animate-dialogOverlayShow", a), ...t }));
|
|
1465
1465
|
ns.displayName = "DialogOverlay";
|
|
1466
|
-
const Tt = S.forwardRef(({ className: a, ...t }, r) => e(is, { children: e(ns, { children: e(K.Content, { ref: r, className: w("fixed left-1/2 top-1/2 z-50 w-[95vw] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-md border p-6 shadow-lg", "border-gray-200 dark:border-gray-900", "bg-white dark:bg-[#090E1A]", "data-[state=open]:animate-dialogContentShow",
|
|
1466
|
+
const Tt = S.forwardRef(({ className: a, ...t }, r) => e(is, { children: e(ns, { children: e(K.Content, { ref: r, className: w("fixed left-1/2 top-1/2 z-50 w-[95vw] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-md border p-6 shadow-lg", "border-gray-200 dark:border-gray-900", "bg-white dark:bg-[#090E1A]", "data-[state=open]:animate-dialogContentShow", xe, a), ...t }) }) }));
|
|
1467
1467
|
Tt.displayName = "DialogContent";
|
|
1468
1468
|
const Jt = ({ className: a, ...t }) => e("div", { className: w("flex flex-col gap-y-1", a), ...t });
|
|
1469
1469
|
Jt.displayName = "DialogHeader";
|
|
@@ -1539,7 +1539,7 @@ const Vc = ({ value: a, onChange: t }) => {
|
|
|
1539
1539
|
return e("div", { className: "flex items-center w-full mt-2", children: (() => {
|
|
1540
1540
|
if (a.value) {
|
|
1541
1541
|
const m = a.multiple ? a.value : [a.value];
|
|
1542
|
-
return i("div", { className: "flex", children: [m.map((g) => e("div", { className: "flex flex-col w-40 h-40 mr-3 transition-all rounded-lg relative animate-fade", children: i("div", { className: "relative h-full w-40", children: [e("button", { className: "absolute w-6 h-6 bg-black flex items-center justify-center rounded-md right-1 top-1", onClick: () => u(g.id), children: e(ht, { className: "w-4 h-4 text-white" }) }), e(
|
|
1542
|
+
return i("div", { className: "flex", children: [m.map((g) => e("div", { className: "flex flex-col w-40 h-40 mr-3 transition-all rounded-lg relative animate-fade", children: i("div", { className: "relative h-full w-40", children: [e("button", { className: "absolute w-6 h-6 bg-black flex items-center justify-center rounded-md right-1 top-1", onClick: () => u(g.id), children: e(ht, { className: "w-4 h-4 text-white" }) }), e(Ne, { src: g.url, alt: g.filename, width: 160, height: 160, className: "w-40 h-40 rounded-md object-cover" })] }) }, g.id)), a.multiple && i("div", { className: "group flex relative flex-col w-40 h-40 items-center justify-center cursor-pointer border-2 border-gray-200 border-dashed transition-all rounded-lg hover:bg-gray-100 hover:border-gray-300", children: [e("div", { className: "flex flex-col items-center justify-center", children: r ? i(C, { children: [e("svg", { className: "animate-spin w-4 h-4 fill-current shrink-0 mb-2", viewBox: "0 0 16 16", children: e("path", { d: "M8 16a7.928 7.928 0 01-3.428-.77l.857-1.807A6.006 6.006 0 0014 8c0-3.309-2.691-6-6-6a6.006 6.006 0 00-5.422 8.572l-1.806.859A7.929 7.929 0 010 8c0-4.411 3.589-8 8-8s8 3.589 8 8-3.589 8-8 8z" }) }), i("span", { className: "text-sm", children: ["Uploading... (", s, "%)"] })] }) : i(C, { children: [e(at, { className: "w-12 h-12 text-gray-300 group-hover:text-gray-600 transition-all stroke-1" }), e("p", { className: "pt-1 text-sm font-medium text-gray-400 group-hover:text-gray-600", children: "Upload an image" })] }) }), e("input", { type: "file", className: "opacity-0 w-full h-full absolute cursor-pointer", onChange: d, accept: "image/png, image/gif, image/jpeg" })] }, "upload-placeholder")] });
|
|
1543
1543
|
}
|
|
1544
1544
|
return i("div", { className: "group flex relative flex-col items-center justify-center cursor-pointer w-full h-40 border-2 border-gray-200 border-dashed transition-all rounded-lg hover:bg-gray-100 hover:border-gray-300", children: [e("div", { className: "flex flex-col items-center justify-center", children: r ? i(C, { children: [e("svg", { className: "animate-spin w-4 h-4 fill-current shrink-0 mb-2", viewBox: "0 0 16 16", children: e("path", { d: "M8 16a7.928 7.928 0 01-3.428-.77l.857-1.807A6.006 6.006 0 0014 8c0-3.309-2.691-6-6-6a6.006 6.006 0 00-5.422 8.572l-1.806.859A7.929 7.929 0 010 8c0-4.411 3.589-8 8-8s8 3.589 8 8-3.589 8-8 8z" }) }), i("span", { className: "text-sm", children: ["Uploading... (", s, "%)"] })] }) : i(C, { children: [e(at, { className: "w-12 h-12 text-gray-300 group-hover:text-gray-600 transition-all stroke-1" }), e("p", { className: "pt-1 text-sm font-medium text-gray-400 group-hover:text-gray-600", children: "Upload an image" })] }) }), e("input", { type: "file", className: "opacity-0 w-full h-full absolute cursor-pointer", onChange: d, accept: "image/png, image/gif, image/jpeg" })] }, "upload-placeholder");
|
|
1545
1545
|
})() });
|
|
@@ -1572,7 +1572,7 @@ const Uc = ({ disabled: a, value: t, onChange: r, options: n }) => i("div", { cl
|
|
|
1572
1572
|
b.preventDefault(), m(p);
|
|
1573
1573
|
}, className: "cursor-pointer ml-1" })] }, p) : null;
|
|
1574
1574
|
}) : e("span", { className: "px-1 text-sm", children: (g = a.find((p) => p.value === t)) == null ? void 0 : g.label }) }) : e("span", { className: "px-1 text-sm text-gray-400", children: s || (n ? "Select options" : "Select an option") }), e(sa, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), e(Qr, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50 p-0", align: "start", children: i(Er, { className: "p-0", children: [e(zr, { className: "w-full border-none pl-0", style: { boxShadow: "none" }, placeholder: "Search..." }), i(Dr, { children: [e(Fr, { children: "No options found." }), e(Rr, { children: a.map((p) => i(Br, { value: p.label, className: "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800", onSelect: () => u(p.value), children: [p.label, (n ? t.includes(p.value) : t === p.value) && e(Ra, { size: 16, strokeWidth: 2, className: "ml-auto" })] }, p.value)) })] })] }) })] }) });
|
|
1575
|
-
}, _c = Pe({ slots: { root: ["group relative isolate inline-flex shrink-0 cursor-pointer items-center rounded-full p-0.5 shadow-inner outline-hidden ring-1 ring-inset transition-all", "bg-gray-200 dark:bg-gray-950", "ring-black/5 dark:ring-gray-800", "data-[state=checked]:bg-blue-600 dark:data-[state=checked]:bg-blue-600", "data-disabled:cursor-default", "data-disabled:data-[state=checked]:bg-blue-200", "data-disabled:data-[state=checked]:ring-gray-300", "dark:data-disabled:data-[state=checked]:ring-gray-900", "dark:data-disabled:data-[state=checked]:bg-blue-900", "data-disabled:data-[state=unchecked]:ring-gray-300", "data-disabled:data-[state=unchecked]:bg-gray-100", "dark:data-disabled:data-[state=unchecked]:ring-gray-700", "dark:data-disabled:data-[state=unchecked]:bg-gray-800",
|
|
1575
|
+
}, _c = Pe({ slots: { root: ["group relative isolate inline-flex shrink-0 cursor-pointer items-center rounded-full p-0.5 shadow-inner outline-hidden ring-1 ring-inset transition-all", "bg-gray-200 dark:bg-gray-950", "ring-black/5 dark:ring-gray-800", "data-[state=checked]:bg-blue-600 dark:data-[state=checked]:bg-blue-600", "data-disabled:cursor-default", "data-disabled:data-[state=checked]:bg-blue-200", "data-disabled:data-[state=checked]:ring-gray-300", "dark:data-disabled:data-[state=checked]:ring-gray-900", "dark:data-disabled:data-[state=checked]:bg-blue-900", "data-disabled:data-[state=unchecked]:ring-gray-300", "data-disabled:data-[state=unchecked]:bg-gray-100", "dark:data-disabled:data-[state=unchecked]:ring-gray-700", "dark:data-disabled:data-[state=unchecked]:bg-gray-800", xe], thumb: ["pointer-events-none relative inline-block transform appearance-none rounded-full border-none shadow-lg outline-hidden transition-all duration-150 ease-in-out focus:border-none focus:outline-hidden focus:outline-transparent", "bg-white dark:bg-gray-50", "group-data-disabled:shadow-none", "group-data-disabled:bg-gray-50 dark:group-data-disabled:bg-gray-500"] }, variants: { size: { default: { root: "h-7 w-14", thumb: "h-4 w-4 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0" }, small: { root: "h-4 w-7", thumb: "h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0" } } }, defaultVariants: { size: "default" } }), os = S.forwardRef(({ className: a, size: t, ...r }, n) => {
|
|
1576
1576
|
const { root: s, thumb: l } = _c({ size: t });
|
|
1577
1577
|
return e(rt.Root, { ref: n, className: w(s(), a), ...r, children: e(rt.Thumb, { className: w(l()) }) });
|
|
1578
1578
|
});
|
|
@@ -1626,10 +1626,10 @@ function Xc(a, t) {
|
|
|
1626
1626
|
const Tr = S.forwardRef(({ className: a, children: t, ...r }, n) => e(it.Root, { ref: n, ...r, asChild: !1, children: e(it.List, { className: w("flex items-center justify-start whitespace-nowrap border-b [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", "border-gray-200 dark:border-gray-800", a), children: t }) }));
|
|
1627
1627
|
Tr.displayName = "TabNavigation";
|
|
1628
1628
|
const Jr = S.forwardRef(({ asChild: a, disabled: t, className: r, children: n, ...s }, l) => e(it.Item, { className: "flex", "aria-disabled": t, children: e(it.Link, { "aria-disabled": t, className: w("group relative flex shrink-0 select-none items-center justify-center", t ? "pointer-events-none" : ""), ref: l, onSelect: () => {
|
|
1629
|
-
}, asChild: a, ...s, children: Xc({ asChild: a, children: n }, (o) => e("span", { className: w("-mb-px flex items-center justify-center whitespace-nowrap border-b-2 border-transparent px-3 pb-2 text-sm font-medium transition-all", "text-gray-500 dark:text-gray-500", "group-hover:text-gray-700 dark:group-hover:text-gray-400", "group-hover:border-gray-300 dark:group-hover:border-gray-400", "group-data-active:border-blue-600 group-data-active:text-blue-600", "dark:group-data-active:border-blue-500 dark:group-data-active:text-blue-500", t ? "pointer-events-none text-gray-300 dark:text-gray-700" : "",
|
|
1629
|
+
}, asChild: a, ...s, children: Xc({ asChild: a, children: n }, (o) => e("span", { className: w("-mb-px flex items-center justify-center whitespace-nowrap border-b-2 border-transparent px-3 pb-2 text-sm font-medium transition-all", "text-gray-500 dark:text-gray-500", "group-hover:text-gray-700 dark:group-hover:text-gray-400", "group-hover:border-gray-300 dark:group-hover:border-gray-400", "group-data-active:border-blue-600 group-data-active:text-blue-600", "dark:group-data-active:border-blue-500 dark:group-data-active:text-blue-500", t ? "pointer-events-none text-gray-300 dark:text-gray-700" : "", xe, r), children: o })) }) }));
|
|
1630
1630
|
Jr.displayName = "TabNavigationLink";
|
|
1631
1631
|
const De = ({ form: a, okText: t, config: r, loading: n, onCancel: s, cancelText: l, columns: o = 2, onSubmit: d }) => {
|
|
1632
|
-
const u = a.watch("translations"), { organization: m, defaultLocale: g, supportedLocales: p } =
|
|
1632
|
+
const u = a.watch("translations"), { organization: m, defaultLocale: g, supportedLocales: p } = we(), [h, b] = R(), f = pe(() => r.some((y) => y.localizable), [r]);
|
|
1633
1633
|
X(() => {
|
|
1634
1634
|
m.data && b(g);
|
|
1635
1635
|
}, [m.data, g, a, p, u]), X(() => {
|
|
@@ -1644,7 +1644,7 @@ const De = ({ form: a, okText: t, config: r, loading: n, onCancel: s, cancelText
|
|
|
1644
1644
|
}), d && i("div", { className: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-6 col-span-full border-t pt-7", children: [s && e(I, { type: "button", className: "w-full sm:w-fit", variant: "secondary", onClick: s, children: l ?? "Cancel" }), e(I, { type: "submit", className: "w-full sm:w-fit", isLoading: n, loadingText: "Saving...", children: t ?? "Save Data" })] })] });
|
|
1645
1645
|
return d ? e(Ue, { ...a, children: e("form", { onSubmit: a.handleSubmit((y) => d(y)), children: k }) }) : e("div", { className: "w-full", children: k });
|
|
1646
1646
|
}, em = [{ name: "name", label: "Manufacturer Name", type: "text", placeholder: "Acme Inc.", colspan: 2 }, { name: "about", label: "About", type: "textarea", placeholder: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", colspan: 2, localizable: !0 }, { name: "logo", label: "Logo", type: "file" }], ds = ({ initialData: a }) => {
|
|
1647
|
-
const { client: t } = E(), r = _(), n = q(), s = j(), { defaultLocale: l, supportedLocales: o } =
|
|
1647
|
+
const { client: t } = E(), r = _(), n = q(), s = j(), { defaultLocale: l, supportedLocales: o } = we(), d = ue({ resolver: ge(a ? Oo : Jo), defaultValues: a ? { defaultLocale: l, name: a.name, logo: a.logo, translations: a.translations } : { defaultLocale: l, translations: o.map((p) => ({ locale: p })) } }), u = O({ mutationFn: async (p) => {
|
|
1648
1648
|
var f;
|
|
1649
1649
|
const h = { name: p.name, defaultLocale: p.defaultLocale, translations: p.translations, logoId: (f = p.logo) == null ? void 0 : f.id }, { status: b } = await t.manufacturer.createManufacturer({ params: { organizationId: s }, body: h });
|
|
1650
1650
|
if (b !== 201) throw Q.error("Failed to create manufacturer. Please try again later."), new Error("Failed to create manufacturer");
|
|
@@ -1705,7 +1705,7 @@ const Xa = A.forwardRef(({ className: a, type: t = "button", label: r, action: n
|
|
|
1705
1705
|
return l || document.addEventListener("keydown", u), () => {
|
|
1706
1706
|
document.removeEventListener("keydown", u);
|
|
1707
1707
|
};
|
|
1708
|
-
}, [n, s, l]), e("span", { className: w("flex items-center gap-x-2 rounded-lg bg-gray-900 p-1 text-base font-medium text-gray-50 outline-hidden transition focus:z-10 sm:text-sm", "sm:last-of-type:-mr-1", a), children: i("button", { ref: d, type: t, onClick: n, disabled: l, className: w("flex items-center gap-x-2 rounded-md px-1 py-1 hover:bg-gray-800", "focus-visible:bg-gray-800 focus-visible:hover:bg-gray-800", "disabled:text-gray-500",
|
|
1708
|
+
}, [n, s, l]), e("span", { className: w("flex items-center gap-x-2 rounded-lg bg-gray-900 p-1 text-base font-medium text-gray-50 outline-hidden transition focus:z-10 sm:text-sm", "sm:last-of-type:-mr-1", a), children: i("button", { ref: d, type: t, onClick: n, disabled: l, className: w("flex items-center gap-x-2 rounded-md px-1 py-1 hover:bg-gray-800", "focus-visible:bg-gray-800 focus-visible:hover:bg-gray-800", "disabled:text-gray-500", xe), ...o, children: [e("span", { children: r }), e("span", { className: sm, children: s.label ? s.label.toUpperCase() : s.shortcut.toUpperCase() })] }) })));
|
|
1709
1709
|
Xa.displayName = "CommandBar.Command";
|
|
1710
1710
|
function lm({ table: a, rowSelection: t }) {
|
|
1711
1711
|
const r = Object.keys(t).length > 0;
|
|
@@ -1741,7 +1741,7 @@ function ka({ meta: a, columns: t, error: r, data: n, loading: s, className: l,
|
|
|
1741
1741
|
}
|
|
1742
1742
|
const dm = Pe({ base: ["relative block w-full appearance-none rounded-md border px-2.5 py-1.5 outline-hidden transition sm:text-sm", "border-transparent dark:border-gray-800", "text-gray-900 dark:text-gray-50", "placeholder-gray-400 dark:placeholder-gray-500", "bg-gray-100 dark:bg-gray-950", "disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:border-gray-700 dark:disabled:bg-gray-800 dark:disabled:text-gray-500", xa, "[&::--webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden"], variants: { hasError: { true: Bt }, enableStepper: { true: "[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none" } } }), va = A.forwardRef(({ className: a, inputClassName: t, hasError: r, enableStepper: n, type: s = "search", ...l }, o) => i("div", { className: w("relative w-full", a), children: [e("input", { ref: o, type: s, className: w(dm({ hasError: r, enableStepper: n }), "pl-8", t), ...l }), e("div", { className: w("pointer-events-none absolute bottom-0 left-2 flex h-full items-center justify-center", "text-gray-400 dark:text-gray-600"), children: e(ir, { className: "size-[1.125rem] shrink-0", "aria-hidden": "true" }) })] }));
|
|
1743
1743
|
va.displayName = "Searchbar";
|
|
1744
|
-
const Be = S.forwardRef(({ className: a, checked: t, ...r }, n) => e($r.Root, { ref: n, ...r, checked: t, className: w("relative inline-flex size-4 shrink-0 appearance-none items-center justify-center rounded shadow-xs outline-hidden ring-1 ring-inset transition duration-100 enabled:cursor-pointer", "text-white dark:text-gray-50", "bg-white dark:bg-gray-950", "ring-gray-300 dark:ring-gray-800", "data-disabled:bg-gray-100 data-disabled:text-gray-400 data-disabled:ring-gray-300", "dark:data-disabled:bg-gray-800 dark:data-disabled:text-gray-500 dark:data-disabled:ring-gray-700", "enabled:data-[state=checked]:bg-blue-600 enabled:data-[state=checked]:ring-0 enabled:data-[state=checked]:ring-transparent", "enabled:data-[state=indeterminate]:bg-blue-600 enabled:data-[state=indeterminate]:ring-0 enabled:data-[state=indeterminate]:ring-transparent",
|
|
1744
|
+
const Be = S.forwardRef(({ className: a, checked: t, ...r }, n) => e($r.Root, { ref: n, ...r, checked: t, className: w("relative inline-flex size-4 shrink-0 appearance-none items-center justify-center rounded shadow-xs outline-hidden ring-1 ring-inset transition duration-100 enabled:cursor-pointer", "text-white dark:text-gray-50", "bg-white dark:bg-gray-950", "ring-gray-300 dark:ring-gray-800", "data-disabled:bg-gray-100 data-disabled:text-gray-400 data-disabled:ring-gray-300", "dark:data-disabled:bg-gray-800 dark:data-disabled:text-gray-500 dark:data-disabled:ring-gray-700", "enabled:data-[state=checked]:bg-blue-600 enabled:data-[state=checked]:ring-0 enabled:data-[state=checked]:ring-transparent", "enabled:data-[state=indeterminate]:bg-blue-600 enabled:data-[state=indeterminate]:ring-0 enabled:data-[state=indeterminate]:ring-transparent", xe, a), children: e($r.Indicator, { asChild: !0, className: "flex size-full items-center justify-center", children: t === "indeterminate" ? e("svg", { "aria-hidden": "true", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: e("line", { stroke: "currentColor", strokeLinecap: "round", strokeWidth: "2", x1: "4", x2: "12", y1: "8", y2: "8" }) }) : e("svg", { "aria-hidden": "true", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M11.2 5.59998L6.79999 9.99998L4.79999 7.99998", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2" }) }) }) }));
|
|
1745
1745
|
Be.displayName = "Checkbox";
|
|
1746
1746
|
function P({ column: a, title: t, className: r }) {
|
|
1747
1747
|
return a.getCanSort() ? i("div", { onClick: a.getToggleSortingHandler(), className: w(a.columnDef.enableSorting === !0 ? "-mx-2 inline-flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1 hover:bg-gray-50 dark:hover:bg-gray-900" : ""), children: [e("span", { children: t }), a.getCanSort() ? i("div", { className: "-space-y-2", children: [e(Wi, { className: w("size-3.5 text-gray-900 dark:text-gray-50", a.getIsSorted() === "desc" ? "opacity-30" : ""), "aria-hidden": "true" }), e(nr, { className: w("size-3.5 text-gray-900 dark:text-gray-50", a.getIsSorted() === "asc" ? "opacity-30" : ""), "aria-hidden": "true" })] }) : null] }) : e("div", { className: w(r), children: t });
|
|
@@ -1941,18 +1941,18 @@ const ys = ({ onClose: a, initialData: t }) => {
|
|
|
1941
1941
|
} });
|
|
1942
1942
|
return i("div", { className: "relative flex items-center rounded-md border border-dashed border-emerald-300 bg-emerald-50/50 px-4 py-3 shadow-xs dark:border-emerald-700 dark:bg-emerald-950/20", children: [e("span", { className: "absolute inset-x-0 top-1/2 h-10 w-1 -translate-y-1/2 rounded-r-md bg-emerald-500 dark:bg-emerald-500", "aria-hidden": "true" }), e("div", { className: "rounded-full ml-2", children: i("div", { className: "rounded-full h-14 w-14 bg-emerald-500 text-white text-xl flex items-center justify-center", children: [a.organization.name.charAt(0).toUpperCase(), (n = a.organization.name.charAt(1)) == null ? void 0 : n.toUpperCase()] }) }), i("div", { className: "border-l border-emerald-200 dark:border-emerald-800 ml-6 pl-6 flex justify-between items-center w-full", children: [i("div", { children: [i("p", { className: "flex items-center gap-2", children: [e("span", { className: "text-lg font-semibold text-gray-900 dark:text-gray-50", children: a.organization.name }), e("span", { className: "inline-flex items-center rounded-md bg-emerald-100 px-2 py-0.5 text-xs font-medium text-emerald-700 dark:bg-emerald-900 dark:text-emerald-300", children: "Invited" })] }), e("p", { className: "flex items-center gap-2", children: i("span", { className: "text-sm text-gray-500 dark:text-gray-500", children: ["You have been invited as", " ", e("span", { className: "font-medium", children: a.role ?? "member" })] }) })] }), e("div", { children: e("button", { onClick: () => r.mutate(), disabled: r.isPending, className: "block rounded-full text-emerald-500 p-2 hover:bg-emerald-500 hover:text-white hover:translate-y-[-2px] hover:shadow-lg transition mr-2 border border-emerald-200 dark:border-emerald-700/60 hover:border-emerald-500 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:hover:shadow-none", children: e(Ma, { className: "w-5 h-5" }) }) })] })] });
|
|
1943
1943
|
}, Nm = () => {
|
|
1944
|
-
const [a, t] = R(!1), r = q(), { client: n } = E(), { organizations: s } =
|
|
1944
|
+
const [a, t] = R(!1), r = q(), { client: n } = E(), { organizations: s } = we(), { data: l } = T({ queryKey: ["user-invitations"], queryFn: async () => {
|
|
1945
1945
|
const { body: d, status: u } = await n.access.getUserInvitations();
|
|
1946
1946
|
return u !== 200 ? [] : d;
|
|
1947
1947
|
} }), o = () => t(!1);
|
|
1948
1948
|
return i(C, { children: [i("div", { className: "max-w-4xl mx-auto py-8 px-4", children: [i("div", { className: "flex justify-between items-center", children: [i("div", { children: [e("h1", { className: "text-2xl font-semibold text-gray-900 dark:text-gray-50", children: "Organizations" }), e("p", { className: "text-gray-500 sm:text-sm/6 dark:text-gray-500", children: "Select a organization to get started." })] }), e("div", { className: "w-min h-min", children: i(I, { onClick: () => t(!0), variant: "primary", children: [e(Re, { className: "w-4 h-4 mr-1" }), " Add New"] }) })] }), s.loading ? e("div", { className: "flex justify-center items-center h-32 mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [i("svg", { "aria-hidden": "true", className: "w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600", viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [e("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), e("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }), e("p", { className: "text-gray-500 text-sm mt-2", children: "Loading organizations..." })] }) }) : i("div", { className: "grid grid-cols-1 gap-y-3 gap-x-4 animate-fade-in mt-5", children: [l == null ? void 0 : l.map((d) => e(vm, { invitation: d }, d.id)), s.data.map((d) => {
|
|
1949
1949
|
var u, m;
|
|
1950
|
-
return i("div", { className: "relative flex items-center rounded-md border border-gray-200 bg-white px-4 py-3 shadow-xs dark:border-gray-800 dark:bg-gray-900", children: [e("span", { className: "absolute inset-x-0 top-1/2 h-10 w-1 -translate-y-1/2 rounded-r-md bg-blue-500 dark:bg-blue-500", "aria-hidden": "true" }), d.logoFile ? e(
|
|
1950
|
+
return i("div", { className: "relative flex items-center rounded-md border border-gray-200 bg-white px-4 py-3 shadow-xs dark:border-gray-800 dark:bg-gray-900", children: [e("span", { className: "absolute inset-x-0 top-1/2 h-10 w-1 -translate-y-1/2 rounded-r-md bg-blue-500 dark:bg-blue-500", "aria-hidden": "true" }), d.logoFile ? e(Ne, { src: d.logoFile.url, alt: d.name, width: 100, height: 100, className: "rounded-lg ml-2 h-16 w-16 object-cover" }) : e("div", { className: "rounded-full ml-2", children: i("div", { className: "rounded-full h-14 w-14 bg-blue-500 text-white text-xl flex items-center justify-center", children: [d.name.charAt(0).toUpperCase(), d.name.charAt(1).toUpperCase()] }) }), i("div", { className: "border-l ml-6 pl-6 flex justify-between items-center w-full", children: [i("div", { children: [e("p", { className: "flex items-center justify-between gap-2", children: e("span", { className: "text-lg font-semibold text-gray-900 dark:text-gray-50", children: d.name }) }), e("p", { className: "flex items-center justify-between gap-2", children: i("span", { className: "text-sm text-gray-500 dark:text-gray-500", children: [(u = d.address) == null ? void 0 : u.addressLineOne, ",", " ", (m = d.address) == null ? void 0 : m.city] }) })] }), e("div", { children: e(z, { className: "block rounded-full text-blue-500 p-2 hover:bg-blue-500 hover:text-white hover:translate-y-[-2px] hover:shadow-lg transition mr-2 border border-gray-200 dark:border-gray-700/60 hover:border-blue-500", href: r.dashboard(d.id), children: e(_s, { className: "w-5 h-5" }) }) })] })] }, d.id);
|
|
1951
1951
|
})] })] }), i(Qt, { onOpenChange: o, open: a, children: [e(ts, { className: "w-full text-left" }), i(Tt, { className: "sm:max-w-xl", children: [i(Jt, { children: [e(Ot, { children: "Create a Organization" }), e(Lt, { className: "mt-1 text-sm leading-6", children: "Fill in the details below to create a new organization" })] }), e(ys, { onClose: o })] })] })] });
|
|
1952
1952
|
};
|
|
1953
1953
|
function Am() {
|
|
1954
1954
|
const { appearance: a } = sn(), t = a == null ? void 0 : a.organizationImage;
|
|
1955
|
-
return i("div", { className: "flex w-full min-h-screen", children: [t && e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: e(
|
|
1955
|
+
return i("div", { className: "flex w-full min-h-screen", children: [t && e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: e(Ne, { src: t, alt: "Organization Visual", width: 4e3, height: 2250, className: "w-full h-full object-cover min-h-screen" }) }), e("div", { className: `w-full ${t ? "lg:w-1/2" : ""} flex items-center justify-center p-8`, children: e("div", { className: "w-full max-w-md space-y-8", children: e(Nm, {}) }) })] });
|
|
1956
1956
|
}
|
|
1957
1957
|
const dt = te.Root;
|
|
1958
1958
|
dt.displayName = "Select";
|
|
@@ -2002,7 +2002,7 @@ const Ye = ha(), Dm = ({ row: a, table: t }) => {
|
|
|
2002
2002
|
const t = a.getValue("createdAt");
|
|
2003
2003
|
return new Date(t).toLocaleDateString();
|
|
2004
2004
|
} }), Ye.display({ id: "edit", header: "Edit", enableSorting: !1, enableHiding: !1, meta: { className: "text-right", displayName: "Edit" }, cell: ({ row: a, table: t }) => e(Fm, { row: a, table: t }) })], Bm = () => {
|
|
2005
|
-
const { client: a } = E(), t = q(), { defaultLocale: r } =
|
|
2005
|
+
const { client: a } = E(), t = q(), { defaultLocale: r } = we(), n = j(), s = We(), l = _(), o = ye(), [d, u] = R(""), [m, g] = R("all"), p = Number((o == null ? void 0 : o.get("page")) || "1"), [h] = qe(d, 300), b = m === "all" ? void 0 : m, f = (J, D) => {
|
|
2006
2006
|
const Z = new URLSearchParams(o == null ? void 0 : o.toString());
|
|
2007
2007
|
return Z.set(J, D), Z.toString();
|
|
2008
2008
|
}, k = () => {
|
|
@@ -2022,7 +2022,7 @@ function Mm() {
|
|
|
2022
2022
|
return i(C, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Product Categories" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-6", children: e(Bm, {}) })] });
|
|
2023
2023
|
}
|
|
2024
2024
|
const Pm = [{ name: "slug", label: "Slug", type: "text", placeholder: "electronics", colspan: 2 }, { name: "title", label: "Title", type: "text", placeholder: "Electronics", colspan: 2, localizable: !0 }, { name: "description", label: "Description", type: "textarea", placeholder: "All electronic devices and accessories.", colspan: 2, localizable: !0 }, { name: "image", label: "Image", type: "file" }], ws = ({ initialData: a }) => {
|
|
2025
|
-
const { client: t } = E(), r = _(), n = q(), s = j(), { defaultLocale: l, supportedLocales: o } =
|
|
2025
|
+
const { client: t } = E(), r = _(), n = q(), s = j(), { defaultLocale: l, supportedLocales: o } = we(), d = ue({ resolver: ge(a ? wo : xo), defaultValues: a ? { defaultLocale: l, slug: a.slug, image: a.image, translations: a.translations } : { defaultLocale: l, translations: o.map((p) => ({ locale: p })) } }), u = O({ mutationFn: async (p) => {
|
|
2026
2026
|
var f;
|
|
2027
2027
|
const h = { slug: p.slug, defaultLocale: p.defaultLocale, translations: p.translations, imageId: (f = p.image) == null ? void 0 : f.id }, { status: b } = await t.productCategory.createProductCategory({ params: { organizationId: s }, body: h });
|
|
2028
2028
|
if (b !== 201) throw Q.error("Failed to create product category. Please try again later."), new Error("Failed to create product category");
|
|
@@ -2082,12 +2082,12 @@ const Jm = ({ form: a }) => {
|
|
|
2082
2082
|
};
|
|
2083
2083
|
return e("section", { "aria-labelledby": "product-metadata", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-metadata", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Metadata" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Add custom key-value pairs to store additional information about your product. Keys must start with a letter and contain only letters, numbers, underscores, or dashes." })] }), e("div", { className: "md:col-span-2", children: i("div", { className: "space-y-4", children: [t.map((d, u) => i("div", { className: "flex gap-4 items-start", children: [i("div", { className: "flex-1", children: [e(ce, { htmlFor: `metadata-key-${u}`, className: "font-medium", children: "Key" }), e(de, { id: `metadata-key-${u}`, type: "text", value: d.key, onChange: (m) => o(u, "key", m.target.value), placeholder: "e.g., color, size, weight", className: "mt-2" })] }), i("div", { className: "flex-1", children: [e(ce, { htmlFor: `metadata-value-${u}`, className: "font-medium", children: "Value" }), e(de, { id: `metadata-value-${u}`, type: "text", value: d.value, onChange: (m) => o(u, "value", m.target.value), placeholder: "e.g., red, large, 2.5kg", className: "mt-2" })] }), e(I, { type: "button", variant: "destructive", className: "mt-8 min-w-[42px] h-[42px] p-0", onClick: () => l(u), children: e($s, { className: "w-4 h-4" }) })] }, d.id)), t.length === 0 && e("p", { className: "text-sm text-gray-500 italic", children: "No metadata added yet. Click the button below to add key-value pairs." }), i(I, { type: "button", variant: "secondary", onClick: s, className: "w-full shadow-none mt-2", children: [e(Re, { className: "w-4 h-4 mr-2" }), "Add Row"] })] }) })] }) });
|
|
2084
2084
|
}, Lm = ({ open: a, onClose: t, initialData: r, onSubmit: n }) => {
|
|
2085
|
-
const { defaultLocale: s, supportedLocales: l } =
|
|
2085
|
+
const { defaultLocale: s, supportedLocales: l } = we(), o = ue({ resolver: ge(fn), defaultValues: r ? { ...r, defaultLocale: s } : { defaultLocale: s, translations: l.map((p) => ({ locale: p, title: "" })), modifiers: [{ title: "", price: 0 }] } }), { fields: d, append: u, remove: m } = ar({ control: o.control, name: "modifiers" }), g = (p) => {
|
|
2086
2086
|
n(p), t(), o.reset({ defaultLocale: s, translations: l.map((h) => ({ locale: h, title: "" })), modifiers: [{ title: "", price: 0 }] });
|
|
2087
2087
|
};
|
|
2088
2088
|
return e(Qt, { open: a, onOpenChange: t, children: i(Tt, { className: "max-w-[710px]", children: [i(Jt, { children: [e(Ot, { children: "New Modifier Group" }), e(Lt, { className: "text-sm mb-5", children: "Modifiers allow you to create different variants of the same product. Create or choose existing modifiers for your product." })] }), i(Ue, { ...o, children: [e(De, { form: o, config: [{ name: "title", label: "Group Title", type: "text", placeholder: 'For example: "Spice Level" or "Select toppings".', colspan: 2, localizable: !0 }, { name: "selectMin", label: "Select Min", type: "number", placeholder: "Minimum selections", colspan: 1 }, { name: "selectMax", label: "Select Max", type: "number", placeholder: "Maximum selections", colspan: 1 }] }), e("h3", { className: "text-lg font-semibold mt-6", children: "Modifier Options" }), e("p", { className: "text-sm text-gray-500 mb-6 mt-1", children: "Add options to this modifier group. Modifier options are the different variants of the product. The price adds to the base price of the product. Leave the price as 0 if it's free." }), d.map((p, h) => i("div", { className: "mb-4 flex", children: [e(De, { form: o, columns: 2, config: [{ name: `modifiers.${h}.title`, label: "Title", type: "text", placeholder: 'eg: "Mild" or "Pepperoni"', colspan: 1 }, { name: `modifiers.${h}.price`, label: "Price", type: "number", placeholder: "Price for this modifier", colspan: 1, prefix: "USD" }] }), d.length > 1 && e(I, { type: "button", variant: "destructive", className: "mt-auto ml-4 min-w-[42px] h-[42px] p-0! shadow-none!", onClick: () => m(h), children: e(ht, { className: "w-4 h-4" }) })] }, p.id)), e(I, { type: "button", variant: "secondary", className: "mb-4 mt-4 ml-auto w-full shadow-none", onClick: () => u({ title: "", price: 0 }), children: "Add Another Option" }), e(L, { className: "mt-8 mb-6" }), i("div", { className: "flex justify-end space-x-3 mt-6 col-span-full", children: [e(I, { type: "button", className: "w-full sm:w-fit", variant: "secondary", onClick: t, children: "Cancel" }), e(I, { type: "button", className: "w-full sm:w-fit", onClick: o.handleSubmit(g), children: r ? "Save Modifier Group" : "Create Modifier Group" })] })] })] }) });
|
|
2089
2089
|
}, jm = ({ form: a }) => {
|
|
2090
|
-
const { control: t } = a, { defaultLocale: r } =
|
|
2090
|
+
const { control: t } = a, { defaultLocale: r } = we(), { fields: n, append: s, remove: l, update: o } = ar({ control: t, name: "modifierGroups" }), [d, u] = R(!1), [m, g] = R(null), p = (y) => ({ ...y, defaultLocale: y.defaultLocale ?? r, modifiers: y.modifiers ?? [] }), h = (y) => {
|
|
2091
2091
|
y.preventDefault(), g(null), u(!0);
|
|
2092
2092
|
}, b = (y) => {
|
|
2093
2093
|
g(y), u(!0);
|
|
@@ -2107,11 +2107,11 @@ const Jm = ({ form: a }) => {
|
|
|
2107
2107
|
u(!1), g(null);
|
|
2108
2108
|
} }, m)] });
|
|
2109
2109
|
}, Vm = ({ form: a, loading: t }) => {
|
|
2110
|
-
const { defaultCurrency: r } =
|
|
2110
|
+
const { defaultCurrency: r } = we();
|
|
2111
2111
|
return e("section", { "aria-labelledby": "product-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Pricing" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the pricing details of your product, including the base price and discounted price." })] }), e("div", { className: "md:col-span-2", children: e(De, { form: a, config: [{ name: "basePrice", label: "Base Price", type: "number", placeholder: "Enter base price", prefix: r }, { name: "discountedBasePrice", label: "Discounted Price", type: "number", placeholder: "Enter discounted price", prefix: r }], loading: t }) })] }) });
|
|
2112
2112
|
}, ks = ({ initialData: a }) => {
|
|
2113
2113
|
var f, k;
|
|
2114
|
-
const { client: t } = E(), r = _(), n = q(), s = j(), { defaultCurrency: l, defaultLocale: o, supportedLocales: d } =
|
|
2114
|
+
const { client: t } = E(), r = _(), n = q(), s = j(), { defaultCurrency: l, defaultLocale: o, supportedLocales: d } = we(), u = a == null ? void 0 : a.id, m = ue({ resolver: ge(a ? Ao : No), defaultValues: a ? { ...a, defaultLocale: o, categories: (f = a.categories) == null ? void 0 : f.map((y) => y.id), translations: a.translations, images: a.images, metadata: a.metadata, modifierGroups: (k = a.modifierGroups) == null ? void 0 : k.map((y) => ({ ...y, defaultLocale: o, translations: y.translations, modifiers: y.modifiers })) } : { defaultLocale: o, translations: d.map((y) => ({ locale: y })), currency: l } }), g = O({ mutationFn: async (y) => {
|
|
2115
2115
|
const { status: x } = await t.product.createProduct({ params: { organizationId: s }, body: y });
|
|
2116
2116
|
if (x !== 201) throw new Error("Failed to create product");
|
|
2117
2117
|
} }), p = O({ mutationFn: async (y) => {
|
|
@@ -2164,7 +2164,7 @@ const Te = ha(), Um = ({ row: a, table: t }) => {
|
|
|
2164
2164
|
const t = a.getValue("createdAt");
|
|
2165
2165
|
return new Date(t).toLocaleDateString();
|
|
2166
2166
|
} }), Te.display({ id: "edit", header: "Edit", enableSorting: !1, enableHiding: !1, meta: { className: "text-right", displayName: "Edit" }, cell: ({ row: a, table: t }) => e(qm, { row: a, table: t }) })], _m = () => {
|
|
2167
|
-
const { client: a } = E(), t = q(), { defaultLocale: r } =
|
|
2167
|
+
const { client: a } = E(), t = q(), { defaultLocale: r } = we(), n = j(), s = We(), l = _(), o = ye(), [d, u] = R(""), [m, g] = R("all"), [p, h] = R("all"), [b] = qe(d, 300), f = Number((o == null ? void 0 : o.get("page")) || "1"), k = m === "all" ? void 0 : m, y = p === "all" ? void 0 : p, x = (B, V) => {
|
|
2168
2168
|
const Se = new URLSearchParams(o == null ? void 0 : o.toString());
|
|
2169
2169
|
return Se.set(B, V), Se.toString();
|
|
2170
2170
|
}, v = () => {
|
|
@@ -2415,7 +2415,7 @@ const ku = [{ name: "configuration.openingTimes.monday", label: "Monday", type:
|
|
|
2415
2415
|
return e(De, { form: n, config: ku, onSubmit: (b) => l(b), onCancel: a, loading: s, cancelText: "Go back", okText: "Save Schedule" });
|
|
2416
2416
|
};
|
|
2417
2417
|
function Nu() {
|
|
2418
|
-
const { organization: a } =
|
|
2418
|
+
const { organization: a } = we();
|
|
2419
2419
|
return a.data ? e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "opening-times", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "opening-times", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Opening and Closing Times" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Set the opening and closing times for your organization" })] }), e("div", { className: "md:col-span-2", children: e(vu, { initialData: a.data }) })] }) }) }) : e("div", { children: "Loading..." });
|
|
2420
2420
|
}
|
|
2421
2421
|
const As = ({ initialData: a }) => {
|
|
@@ -2478,7 +2478,7 @@ const zu = [{ name: "configuration.defaultLocale", label: "Default Locale", type
|
|
|
2478
2478
|
return e(De, { form: n, config: zu, onSubmit: (m) => l(m), onCancel: a, loading: s, cancelText: "Go back", okText: "Save Settings" });
|
|
2479
2479
|
};
|
|
2480
2480
|
function Fu() {
|
|
2481
|
-
const { organization: a } =
|
|
2481
|
+
const { organization: a } = we(), { client: t } = E(), r = j(), n = _(), s = q(), l = O({ mutationFn: async () => {
|
|
2482
2482
|
const { status: o } = await t.access.leaveOrganization({ params: { organizationId: r } });
|
|
2483
2483
|
if (o !== 204) throw new Error("Failed to leave organization");
|
|
2484
2484
|
}, onSuccess: async () => {
|
|
@@ -2564,7 +2564,7 @@ const Es = K.Portal;
|
|
|
2564
2564
|
Es.displayName = "DrawerPortal";
|
|
2565
2565
|
const zs = A.forwardRef(({ className: a, ...t }, r) => e(K.Overlay, { ref: r, className: w("fixed inset-0 z-50 overflow-y-auto", "bg-black/30", "data-[state=closed]:animate-hide data-[state=open]:animate-dialogOverlayShow", a), ...t, style: { animationDuration: "400ms", animationFillMode: "backwards" } }));
|
|
2566
2566
|
zs.displayName = "DrawerOverlay";
|
|
2567
|
-
const Ds = A.forwardRef(({ className: a, ...t }, r) => e(Es, { children: e(zs, { children: e(K.Content, { ref: r, className: w("fixed inset-y-2 mx-auto flex w-[95vw] flex-1 flex-col overflow-y-auto rounded-md border p-4 shadow-lg focus:outline-hidden max-sm:inset-x-2 sm:inset-y-2 sm:right-2 sm:max-w-lg sm:p-6", "border-gray-200 dark:border-gray-900", "bg-white dark:bg-[#090E1A]", "data-[state=closed]:animate-drawerSlideRightAndFade data-[state=open]:animate-drawerSlideLeftAndFade",
|
|
2567
|
+
const Ds = A.forwardRef(({ className: a, ...t }, r) => e(Es, { children: e(zs, { children: e(K.Content, { ref: r, className: w("fixed inset-y-2 mx-auto flex w-[95vw] flex-1 flex-col overflow-y-auto rounded-md border p-4 shadow-lg focus:outline-hidden max-sm:inset-x-2 sm:inset-y-2 sm:right-2 sm:max-w-lg sm:p-6", "border-gray-200 dark:border-gray-900", "bg-white dark:bg-[#090E1A]", "data-[state=closed]:animate-drawerSlideRightAndFade data-[state=open]:animate-drawerSlideLeftAndFade", xe, a), ...t }) }) }));
|
|
2568
2568
|
Ds.displayName = "DrawerContent";
|
|
2569
2569
|
const Fs = A.forwardRef(({ children: a, className: t, ...r }, n) => i("div", { ref: n, className: "flex items-start justify-between gap-x-4 border-b border-gray-200 pb-4 dark:border-gray-900", ...r, children: [e("div", { className: w("mt-1 flex flex-col gap-y-1", t), children: a }), e(K.Close, { asChild: !0, children: e(I, { variant: "ghost", className: "aspect-square p-1 hover:bg-gray-100 dark:hover:bg-gray-400/10", children: e(Li, { className: "size-6", "aria-hidden": "true" }) }) })] }));
|
|
2570
2570
|
Fs.displayName = "Drawer.Header";
|
|
@@ -2578,24 +2578,24 @@ function Qu() {
|
|
|
2578
2578
|
const a = We(), t = j(), r = q();
|
|
2579
2579
|
if (!t) return null;
|
|
2580
2580
|
const n = [{ name: "Dashboard", href: r.dashboard(t), icon: Fi }, { name: "Live Orders", href: r.liveOrders(t), icon: Ri }, { name: "Orders", href: r.orders(t), icon: Bi }, { name: "Reservations", href: r.reservations(t), icon: Mi }, { name: "Products", href: r.products(t), icon: Pi }, { name: "Categories", href: r.productCategories(t), icon: Qi }, { name: "Manufacturers", href: r.manufacturers(t), icon: Ti }, { name: "Settings", href: r.settings(t), icon: _i }];
|
|
2581
|
-
return i(Cs, { children: [e(Ss, { asChild: !0, children: e(I, { variant: "ghost", "aria-label": "open sidebar", className: "group flex items-center rounded-md p-2 text-sm font-medium hover:bg-gray-100 data-[state=open]:bg-gray-100 data-[state=open]:bg-gray-400/10 dark:hover:bg-gray-400/10", children: e(ul, { className: "size-6 shrink-0 sm:size-5", "aria-hidden": "true" }) }) }), i(Ds, { className: "sm:max-w-lg", children: [e(Fs, { children: e(Rs, { children: "Navigation" }) }), e(Bs, { children: e("nav", { "aria-label": "mobile navigation links", className: "flex flex-1 flex-col space-y-10", children: e("ul", { role: "list", className: "space-y-1.5", children: n.map((s) => e("li", { children: e(Is, { asChild: !0, children: i(z, { href: s.href, className: ee(a === s.href || a != null && a.startsWith(s.href) ? "text-blue-600 dark:text-blue-400" : "text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50", "flex items-center gap-x-2.5 rounded-md px-2 py-1.5 text-base font-medium transition hover:bg-gray-100 sm:text-sm dark:hover:bg-gray-900",
|
|
2581
|
+
return i(Cs, { children: [e(Ss, { asChild: !0, children: e(I, { variant: "ghost", "aria-label": "open sidebar", className: "group flex items-center rounded-md p-2 text-sm font-medium hover:bg-gray-100 data-[state=open]:bg-gray-100 data-[state=open]:bg-gray-400/10 dark:hover:bg-gray-400/10", children: e(ul, { className: "size-6 shrink-0 sm:size-5", "aria-hidden": "true" }) }) }), i(Ds, { className: "sm:max-w-lg", children: [e(Fs, { children: e(Rs, { children: "Navigation" }) }), e(Bs, { children: e("nav", { "aria-label": "mobile navigation links", className: "flex flex-1 flex-col space-y-10", children: e("ul", { role: "list", className: "space-y-1.5", children: n.map((s) => e("li", { children: e(Is, { asChild: !0, children: i(z, { href: s.href, className: ee(a === s.href || a != null && a.startsWith(s.href) ? "text-blue-600 dark:text-blue-400" : "text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50", "flex items-center gap-x-2.5 rounded-md px-2 py-1.5 text-base font-medium transition hover:bg-gray-100 sm:text-sm dark:hover:bg-gray-900", xe), children: [e(s.icon, { className: "size-5 shrink-0", "aria-hidden": "true" }), s.name] }) }) }, s.name)) }) }) })] })] });
|
|
2582
2582
|
}
|
|
2583
2583
|
const Tu = () => {
|
|
2584
2584
|
var d;
|
|
2585
|
-
const [a, t] = S.useState(!1), r = S.useRef(null), { organizations: n, organization: s } =
|
|
2586
|
-
return e(C, { children: i($e, { open: a, onOpenChange: t, modal: !1, children: [e(Ke, { asChild: !0, children: s.data && i("button", { className: w("flex w-full items-center gap-x-2.5 rounded-md border border-gray-300 bg-white p-2 text-sm shadow-xs transition-all hover:bg-gray-50 dark:border-gray-800 dark:bg-gray-950 dark:hover:bg-gray-900", xa), children: [s.data.logoFile ? e(
|
|
2585
|
+
const [a, t] = S.useState(!1), r = S.useRef(null), { organizations: n, organization: s } = we(), l = _(), o = q();
|
|
2586
|
+
return e(C, { children: i($e, { open: a, onOpenChange: t, modal: !1, children: [e(Ke, { asChild: !0, children: s.data && i("button", { className: w("flex w-full items-center gap-x-2.5 rounded-md border border-gray-300 bg-white p-2 text-sm shadow-xs transition-all hover:bg-gray-50 dark:border-gray-800 dark:bg-gray-950 dark:hover:bg-gray-900", xa), children: [s.data.logoFile ? e(Ne, { src: s.data.logoFile.url, alt: s.data.name, width: 40, height: 40, className: "flex aspect-square size-8 items-center justify-center rounded" }) : i("span", { className: "flex aspect-square size-8 items-center justify-center rounded bg-blue-600 p-2 text-xs font-medium text-white dark:bg-blue-500 uppercase", "aria-hidden": "true", children: [s.data.name[0], s.data.name[1]] }), i("div", { className: "flex w-full items-center justify-between gap-x-4 truncate", children: [i("div", { className: "truncate text-left", children: [e("p", { className: "truncate whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-50", children: s.data.name }), e("p", { className: "whitespace-nowrap text-left text-xs text-gray-700 dark:text-gray-300", children: (d = s.data.address) == null ? void 0 : d.addressLineOne })] }), e($i, { className: "size-5 shrink-0 text-gray-500", "aria-hidden": "true" })] })] }) }), e(Ge, { hidden: !1, onCloseAutoFocus: (u) => {
|
|
2587
2587
|
r.current && (r.current.focus(), r.current = null, u.preventDefault());
|
|
2588
2588
|
}, children: i(Fa, { children: [i(jt, { children: ["Workspaces (", n.data.length, ")"] }), n.data.map((u) => {
|
|
2589
2589
|
var m;
|
|
2590
|
-
return e(Ae, { onClick: () => l.push(o.dashboard(u.id)), children: i("div", { className: "flex w-full items-center gap-x-2.5", children: [u.logoFile ? e(
|
|
2590
|
+
return e(Ae, { onClick: () => l.push(o.dashboard(u.id)), children: i("div", { className: "flex w-full items-center gap-x-2.5", children: [u.logoFile ? e(Ne, { src: u.logoFile.url, alt: u.name, width: 40, height: 40, className: "flex aspect-square size-8 items-center justify-center rounded" }) : i("span", { className: "flex aspect-square size-8 items-center justify-center rounded bg-blue-600 p-2 text-xs font-medium text-white dark:bg-blue-500 uppercase", "aria-hidden": "true", children: [u.name[0], u.name[1]] }), i("div", { children: [e("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-50", children: u.name }), e("p", { className: "text-xs text-gray-700 dark:text-gray-400", children: (m = u.address) == null ? void 0 : m.addressLineOne })] })] }) }, u.id);
|
|
2591
2591
|
})] }) })] }) });
|
|
2592
2592
|
}, Ju = () => {
|
|
2593
|
-
const [a, t] = S.useState(!1), r = S.useRef(null), { organizations: n, organization: s } =
|
|
2594
|
-
return i($e, { open: a, onOpenChange: t, modal: !1, children: [e(Ke, { asChild: !0, children: s.data && i("button", { className: "flex items-center gap-x-1.5 rounded-md p-2 hover:bg-gray-100 focus:outline-hidden dark:hover:bg-gray-900", children: [s.data.logoFile ? e(
|
|
2593
|
+
const [a, t] = S.useState(!1), r = S.useRef(null), { organizations: n, organization: s } = we(), l = _(), o = q();
|
|
2594
|
+
return i($e, { open: a, onOpenChange: t, modal: !1, children: [e(Ke, { asChild: !0, children: s.data && i("button", { className: "flex items-center gap-x-1.5 rounded-md p-2 hover:bg-gray-100 focus:outline-hidden dark:hover:bg-gray-900", children: [s.data.logoFile ? e(Ne, { src: s.data.logoFile.url, alt: s.data.name, width: 28, height: 28, className: "flex aspect-square size-7 items-center justify-center rounded" }) : i("span", { className: "flex aspect-square size-7 items-center justify-center rounded bg-blue-600 p-2 text-xs font-medium text-white dark:bg-blue-500 uppercase", "aria-hidden": "true", children: [s.data.name[0], s.data.name[1]] }), e(bt, { className: "size-4 shrink-0 text-gray-500", "aria-hidden": "true" }), i("div", { className: "flex w-full items-center justify-between gap-x-3 truncate", children: [e("p", { className: "truncate whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-50", children: s.data.name }), e($i, { className: "size-4 shrink-0 text-gray-500", "aria-hidden": "true" })] })] }) }), e(Ge, { className: "min-w-72!", onCloseAutoFocus: (d) => {
|
|
2595
2595
|
r.current && (r.current.focus(), r.current = null, d.preventDefault());
|
|
2596
2596
|
}, children: i(Fa, { children: [i(jt, { children: ["Workspaces (", n.data.length, ")"] }), n.data.map((d) => {
|
|
2597
2597
|
var u;
|
|
2598
|
-
return e(Ae, { onClick: () => l.push(o.dashboard(d.id)), children: i("div", { className: "flex w-full items-center gap-x-2.5", children: [d.logoFile ? e(
|
|
2598
|
+
return e(Ae, { onClick: () => l.push(o.dashboard(d.id)), children: i("div", { className: "flex w-full items-center gap-x-2.5", children: [d.logoFile ? e(Ne, { src: d.logoFile.url, alt: d.name, width: 28, height: 28, className: "flex aspect-square size-7 items-center justify-center rounded" }) : i("span", { className: "flex aspect-square size-7 items-center justify-center rounded bg-blue-600 p-2 text-xs font-medium text-white dark:bg-blue-500 uppercase", "aria-hidden": "true", children: [d.name[0], d.name[1]] }), i("div", { children: [e("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-50", children: d.name }), e("p", { className: "text-xs text-gray-700 dark:text-gray-400", children: (u = d.address) == null ? void 0 : u.addressLineOne })] })] }) }, d.id);
|
|
2599
2599
|
})] }) })] });
|
|
2600
2600
|
};
|
|
2601
2601
|
function Ms({ children: a, align: t = "start" }) {
|
|
@@ -2612,11 +2612,11 @@ function Ms({ children: a, align: t = "start" }) {
|
|
|
2612
2612
|
const Ou = () => {
|
|
2613
2613
|
var n;
|
|
2614
2614
|
const a = Pa().useSession(), { firstname: t, lastname: r } = ((n = a.data) == null ? void 0 : n.user) || {};
|
|
2615
|
-
return e(Ms, { children: i(I, { "aria-label": "User settings", variant: "ghost", className: ee(
|
|
2615
|
+
return e(Ms, { children: i(I, { "aria-label": "User settings", variant: "ghost", className: ee(xe, "group flex w-full items-center justify-between rounded-md p-2 text-sm font-medium text-gray-900 hover:bg-gray-100 data-[state=open]:bg-gray-100 data-[state=open]:bg-gray-400/10 dark:hover:bg-gray-400/10"), children: [i("span", { className: "flex items-center gap-3", children: [i("span", { className: "flex size-8 shrink-0 items-center justify-center rounded-full border border-gray-300 bg-white text-xs text-gray-700 dark:border-gray-800 dark:bg-gray-950 dark:text-gray-300", "aria-hidden": "true", children: [t == null ? void 0 : t.charAt(0), r == null ? void 0 : r.charAt(0)] }), i("span", { children: [t, " ", r] })] }), e(fl, { className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-400", "aria-hidden": "true" })] }) });
|
|
2616
2616
|
}, Lu = () => e(Ms, { align: "end", children: e(I, { "aria-label": "User settings", variant: "ghost", className: ee("group flex items-center rounded-md p-1 text-sm font-medium text-gray-900 hover:bg-gray-100 data-[state=open]:bg-gray-100 data-[state=open]:bg-gray-400/10 dark:hover:bg-gray-400/10"), children: e("span", { className: "flex size-7 shrink-0 items-center justify-center rounded-full border border-gray-300 bg-white text-xs text-gray-700 dark:border-gray-800 dark:bg-gray-950 dark:text-gray-300", "aria-hidden": "true", children: "ES" }) }) });
|
|
2617
2617
|
function ju() {
|
|
2618
2618
|
const a = We(), t = j(), r = q(), n = [{ name: "Home", href: r.dashboard(t), icon: Fi }, { name: "Live Orders", href: r.liveOrders(t), icon: Ri }, { name: "Orders List", href: r.orders(t), icon: Bi }, { name: "Reservations", href: r.reservations(t), icon: Mi }, { name: "Products", href: r.products(t), icon: Pi }, { name: "Product Categories", href: r.productCategories(t), icon: Qi }, { name: "Manufacturers", href: r.manufacturers(t), icon: Ti }, { name: "Customers", href: `${r.dashboard(t)}/customers`, icon: Xs }, { name: "Settings", href: r.settings(t), icon: _i }], s = (l) => a === l || (a == null ? void 0 : a.startsWith(l));
|
|
2619
|
-
return i(C, { children: [e("nav", { className: "hidden lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-72 lg:flex-col", children: i("aside", { className: "flex grow flex-col gap-y-6 overflow-y-auto border-r border-gray-200 bg-slate-50 p-4 dark:border-gray-800 dark:bg-gray-950", children: [e(z, { href: r.home, className: "-ml-2", children: e(Mu, {}) }), e("hr", { className: "block border-t border-gray-200 dark:border-gray-800 -mt-3 mb-1" }), e(Tu, {}), e("nav", { "aria-label": "core navigation links", className: "flex flex-1 flex-col space-y-10", children: e("ul", { role: "list", className: "space-y-0.5", children: n.map((l) => e("li", { children: i(z, { href: l.href, className: w(s(l.href) ? "text-blue-600 dark:text-blue-400" : "text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50", "flex items-center gap-x-2.5 rounded-md px-2 py-1.5 text-sm font-medium transition hover:bg-gray-100 dark:hover:bg-gray-900",
|
|
2619
|
+
return i(C, { children: [e("nav", { className: "hidden lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-72 lg:flex-col", children: i("aside", { className: "flex grow flex-col gap-y-6 overflow-y-auto border-r border-gray-200 bg-slate-50 p-4 dark:border-gray-800 dark:bg-gray-950", children: [e(z, { href: r.home, className: "-ml-2", children: e(Mu, {}) }), e("hr", { className: "block border-t border-gray-200 dark:border-gray-800 -mt-3 mb-1" }), e(Tu, {}), e("nav", { "aria-label": "core navigation links", className: "flex flex-1 flex-col space-y-10", children: e("ul", { role: "list", className: "space-y-0.5", children: n.map((l) => e("li", { children: i(z, { href: l.href, className: w(s(l.href) ? "text-blue-600 dark:text-blue-400" : "text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50", "flex items-center gap-x-2.5 rounded-md px-2 py-1.5 text-sm font-medium transition hover:bg-gray-100 dark:hover:bg-gray-900", xe), children: [e(l.icon, { className: "size-4 shrink-0", "aria-hidden": "true" }), l.name] }) }, l.name)) }) }), e("div", { className: "mt-auto", children: e(Ou, {}) })] }) }), i("div", { className: "sticky top-0 z-40 flex h-16 shrink-0 items-center justify-between border-b border-gray-200 bg-white px-2 shadow-xs sm:gap-x-6 sm:px-4 lg:hidden dark:border-gray-800 dark:bg-gray-950", children: [e(Ju, {}), i("div", { className: "flex items-center gap-1 sm:gap-2", children: [e(Lu, {}), e(Qu, {})] })] })] });
|
|
2620
2620
|
}
|
|
2621
2621
|
function Vu({ children: a, view: t }) {
|
|
2622
2622
|
return i(C, { children: [e("div", { className: "bg-slate-50 dark:hidden w-1/2 absolute top-0 left-0 h-screen" }), i("div", { className: "mx-auto max-w-(--breakpoint-2xl)", children: [e(ju, {}), e("main", { className: "lg:pl-72 bg-white dark:bg-gray-950 z-10 relative min-h-screen", children: e("div", { className: "relative", children: i("div", { className: "p-4 sm:px-6 sm:pb-10 sm:pt-10 lg:px-10 lg:pt-[34px]", children: [e(Bu, { view: t }), a] }) }) })] })] });
|
|
@@ -2703,7 +2703,7 @@ function Hu(a) {
|
|
|
2703
2703
|
}
|
|
2704
2704
|
}
|
|
2705
2705
|
export {
|
|
2706
|
-
|
|
2706
|
+
ke as $,
|
|
2707
2707
|
Ep as A,
|
|
2708
2708
|
Fp as B,
|
|
2709
2709
|
Kl as C,
|
|
@@ -2713,7 +2713,7 @@ export {
|
|
|
2713
2713
|
Zp as G,
|
|
2714
2714
|
tn as H,
|
|
2715
2715
|
E as I,
|
|
2716
|
-
|
|
2716
|
+
be as J,
|
|
2717
2717
|
Y as K,
|
|
2718
2718
|
_o as L,
|
|
2719
2719
|
Tp as M,
|
|
@@ -2789,6 +2789,6 @@ export {
|
|
|
2789
2789
|
Xl as v,
|
|
2790
2790
|
Gl as w,
|
|
2791
2791
|
zp as x,
|
|
2792
|
-
|
|
2792
|
+
ve as y,
|
|
2793
2793
|
Dp as z
|
|
2794
2794
|
};
|