@burdenoff/microfe-kadaikodi 2026.802.1 → 2026.830.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/kadaikodi/KadaikodiRoot.d.ts.map +1 -1
  2. package/dist/kadaikodi/KadaikodiRoot.js +69 -72
  3. package/dist/kadaikodi/KadaikodiRoot.js.map +1 -1
  4. package/dist/kadaikodi/components/InvestmentCard.d.ts.map +1 -1
  5. package/dist/kadaikodi/components/InvestmentCard.js +58 -54
  6. package/dist/kadaikodi/components/InvestmentCard.js.map +1 -1
  7. package/dist/kadaikodi/components/OrderCard.d.ts.map +1 -1
  8. package/dist/kadaikodi/components/StatusBadge.d.ts.map +1 -1
  9. package/dist/kadaikodi/components/StatusBadge.js +25 -14
  10. package/dist/kadaikodi/components/StatusBadge.js.map +1 -1
  11. package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts +24 -0
  12. package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts.map +1 -1
  13. package/dist/kadaikodi/hooks/useKadaikodiApi.js +177 -132
  14. package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
  15. package/dist/kadaikodi/pages/HomePage.d.ts.map +1 -1
  16. package/dist/kadaikodi/pages/HomePage.js +284 -282
  17. package/dist/kadaikodi/pages/HomePage.js.map +1 -1
  18. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.d.ts +7 -2
  19. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.d.ts.map +1 -1
  20. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +319 -228
  21. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
  22. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +1 -1
  23. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
  24. package/dist/kadaikodi/pages/admin/CartManagementPage.d.ts +10 -4
  25. package/dist/kadaikodi/pages/admin/CartManagementPage.d.ts.map +1 -1
  26. package/dist/kadaikodi/pages/admin/CartManagementPage.js +320 -279
  27. package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
  28. package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.d.ts.map +1 -1
  29. package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js +365 -292
  30. package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js.map +1 -1
  31. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.d.ts +7 -2
  32. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.d.ts.map +1 -1
  33. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +300 -158
  34. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
  35. package/dist/kadaikodi/pages/common/SettingsPage.js +286 -286
  36. package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
  37. package/dist/kadaikodi/pages/customer/CartDetailPage.d.ts.map +1 -1
  38. package/dist/kadaikodi/pages/customer/CartDetailPage.js +3 -3
  39. package/dist/kadaikodi/pages/customer/CartDetailPage.js.map +1 -1
  40. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.d.ts +13 -3
  41. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.d.ts.map +1 -1
  42. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js +270 -220
  43. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js.map +1 -1
  44. package/dist/kadaikodi/pages/customer/CustomerDashboard.js +97 -97
  45. package/dist/kadaikodi/pages/customer/OrderTrackingPage.d.ts.map +1 -1
  46. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +1 -1
  47. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
  48. package/dist/kadaikodi/pages/worker/TaskDetailsPage.d.ts +5 -3
  49. package/dist/kadaikodi/pages/worker/TaskDetailsPage.d.ts.map +1 -1
  50. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +286 -199
  51. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
  52. package/dist/kadaikodi/types/index.d.ts +46 -2
  53. package/dist/kadaikodi/types/index.d.ts.map +1 -1
  54. package/dist/shared/hooks/useTr.d.ts +2 -0
  55. package/dist/shared/hooks/useTr.d.ts.map +1 -0
  56. package/dist/shared/hooks/useTr.js +14 -0
  57. package/dist/shared/hooks/useTr.js.map +1 -0
  58. package/package.json +2 -2
@@ -4,11 +4,11 @@ import { useCreateProvider as n, useProviders as r } from "../../hooks/useKadaik
4
4
  import { StepProgress as i } from "../../components/viz/StepProgress.js";
5
5
  import "../../components/viz/index.js";
6
6
  import { useMemo as a, useState as o } from "react";
7
- import { ArrowLeft as s, ArrowRight as c, CheckCircle2 as l, MapPin as u, ShieldCheck as d, Store as f, Truck as p } from "lucide-react";
8
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
- import { GlassCard as g } from "@burdenoff/fe-libs/ui";
7
+ import { ArrowLeft as s, ArrowRight as c, CheckCircle2 as l, Clock as u, Image as d, MapPin as f, ShieldCheck as p, Store as m, Truck as h } from "lucide-react";
8
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
9
+ import { GlassCard as v } from "@burdenoff/fe-libs/ui";
10
10
  //#region src/kadaikodi/pages/cart-owner/MerchantOnboardingPage.tsx
11
- var _ = [
11
+ var y = [
12
12
  ["FOOD_BEVERAGE", "Food & Beverage"],
13
13
  ["GROCERY_ESSENTIALS", "Grocery & Essentials"],
14
14
  ["CLOTHING_FASHION", "Clothing & Fashion"],
@@ -18,66 +18,154 @@ var _ = [
18
18
  ["HOME_SERVICES", "Home Services"],
19
19
  ["HEALTH_WELLNESS", "Health & Wellness"],
20
20
  ["EDUCATION_SKILLS", "Education & Skills"]
21
- ], v = [
22
- ["PICKUP", "Pickup"],
23
- ["DELIVERY", "Delivery"],
24
- ["CART_DISPATCH", "Cart dispatch"],
25
- ["ON_LOCATION", "On-location"],
26
- ["HOME_SERVICE", "Home service"]
27
- ], y = [
21
+ ], b = [
22
+ ["pickup", "Pickup"],
23
+ ["delivery", "Delivery"],
24
+ ["scheduled_stop", "Scheduled stop"],
25
+ ["direct_service", "Direct service"]
26
+ ], x = [
28
27
  { label: "Business details" },
29
28
  { label: "Location & hours" },
30
29
  { label: "Fulfilment" },
31
30
  { label: "Review & submit" }
32
- ], b = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 40) + "-" + Math.random().toString(36).slice(2, 7);
33
- function x() {
34
- let { navigateTo: x, currentUser: S } = e(), { data: C = [] } = r(), w = n(), T = a(() => C.some((e) => e.ownerId === S?.id), [C, S?.id]), [E, D] = o(0), [O, k] = o(!1), [A, j] = o(""), [M, N] = o({
31
+ ], S = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 40) + "-" + Math.random().toString(36).slice(2, 7);
32
+ function C() {
33
+ let { navigateTo: C, currentUser: w } = e(), { data: T = [] } = r(), E = n(), D = a(() => T.some((e) => e.ownerId === w?.id), [T, w?.id]), [O, k] = o(0), [A, j] = o(!1), [M, N] = o(null), [P, F] = o(""), [I, L] = o({
35
34
  name: "",
36
35
  category: "FOOD_BEVERAGE",
37
36
  description: "",
38
37
  address: "",
39
38
  open: "08:00",
40
39
  close: "22:00",
41
- fulfilments: ["PICKUP", "DELIVERY"]
42
- }), P = (e, t) => N((n) => ({
40
+ fulfilments: ["pickup", "delivery"]
41
+ }), R = (e, t) => L((n) => ({
43
42
  ...n,
44
43
  [e]: t
45
- })), F = "w-full rounded-lg border border-border-subtle bg-bg-canvas px-3 py-2 text-sm text-text-primary outline-none focus:border-border-strong", I = E === 0 ? M.name.trim().length > 1 : E === 1 ? M.address.trim().length > 3 : !0;
46
- return O ? /* @__PURE__ */ m(t, {
44
+ })), z = "w-full rounded-lg border border-border-subtle bg-bg-canvas px-3 py-2 text-sm text-text-primary outline-none focus:border-border-strong", B = O === 0 ? I.name.trim().length > 1 : O === 1 ? I.address.trim().length > 3 : !0, V = () => {
45
+ F(""), E.mutate({
46
+ ownerId: w?.id,
47
+ name: I.name.trim(),
48
+ slug: S(I.name),
49
+ description: I.description.trim() || void 0,
50
+ category: I.category,
51
+ offeringType: "both",
52
+ serviceTypes: I.fulfilments,
53
+ location: { address: I.address.trim() },
54
+ businessHours: {
55
+ open: I.open,
56
+ close: I.close
57
+ }
58
+ }, {
59
+ onSuccess: (e) => {
60
+ N(e.status), j(!0);
61
+ },
62
+ onError: (e) => F(e instanceof Error ? e.message : "Could not create your cart.")
63
+ });
64
+ }, H = y.find((e) => e[0] === I.category)?.[1] ?? "", U = I.fulfilments.flatMap((e) => {
65
+ let t = b.find((t) => t[0] === e)?.[1];
66
+ return t ? [t] : [];
67
+ }), W = /* @__PURE__ */ _(v, {
68
+ treatment: "plain",
69
+ className: "p-5",
70
+ children: [
71
+ /* @__PURE__ */ g("p", {
72
+ className: "mb-3 text-xs font-medium uppercase tracking-wide text-text-muted",
73
+ children: "Storefront preview"
74
+ }),
75
+ /* @__PURE__ */ g("div", {
76
+ className: "mb-4 flex h-28 items-center justify-center rounded-lg border border-border-subtle bg-bg-sunken text-text-muted",
77
+ children: /* @__PURE__ */ g(d, { className: "h-8 w-8" })
78
+ }),
79
+ /* @__PURE__ */ g("h4", {
80
+ className: "text-base font-semibold text-text-primary",
81
+ children: I.name.trim() || "Your cart name"
82
+ }),
83
+ /* @__PURE__ */ _("p", {
84
+ className: "mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-text-secondary",
85
+ children: [
86
+ /* @__PURE__ */ _("span", {
87
+ className: "inline-flex items-center gap-1",
88
+ children: [/* @__PURE__ */ g(m, { className: "h-3 w-3" }), H]
89
+ }),
90
+ /* @__PURE__ */ g("span", {
91
+ "aria-hidden": "true",
92
+ children: "·"
93
+ }),
94
+ /* @__PURE__ */ _("span", {
95
+ className: "inline-flex items-center gap-1",
96
+ children: [
97
+ /* @__PURE__ */ g(u, { className: "h-3 w-3" }),
98
+ I.open,
99
+ "–",
100
+ I.close
101
+ ]
102
+ })
103
+ ]
104
+ }),
105
+ I.address.trim() && /* @__PURE__ */ _("p", {
106
+ className: "mt-1 flex items-start gap-1 text-xs text-text-secondary",
107
+ children: [/* @__PURE__ */ g(f, { className: "mt-0.5 h-3 w-3 shrink-0" }), I.address.trim()]
108
+ }),
109
+ I.description.trim() && /* @__PURE__ */ g("p", {
110
+ className: "mt-2 text-xs text-text-secondary",
111
+ children: I.description.trim()
112
+ }),
113
+ U.length > 0 && /* @__PURE__ */ g("div", {
114
+ className: "mt-3 flex flex-wrap gap-1.5",
115
+ children: U.map((e) => /* @__PURE__ */ g("span", {
116
+ className: "rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary",
117
+ children: e
118
+ }, e))
119
+ }),
120
+ /* @__PURE__ */ g("p", {
121
+ className: "mt-4 border-t border-border-subtle pt-3 text-xs text-text-muted",
122
+ children: "This is how your cart will read to customers once an admin verifies it."
123
+ })
124
+ ]
125
+ });
126
+ return A ? /* @__PURE__ */ g(t, {
47
127
  title: "You're all set",
48
128
  description: "Your cart has been submitted",
49
- children: /* @__PURE__ */ m("div", {
129
+ children: /* @__PURE__ */ g("div", {
50
130
  className: "mx-auto max-w-xl",
51
- children: /* @__PURE__ */ h(g, {
131
+ children: /* @__PURE__ */ _(v, {
52
132
  treatment: "glass",
53
133
  className: "p-8 text-center",
54
134
  children: [
55
- /* @__PURE__ */ m("div", {
135
+ /* @__PURE__ */ g("div", {
56
136
  className: "mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-status-success-bg-subtle",
57
- children: /* @__PURE__ */ m(l, { className: "h-7 w-7 text-status-success-text" })
137
+ children: /* @__PURE__ */ g(l, { className: "h-7 w-7 text-status-success-text" })
58
138
  }),
59
- /* @__PURE__ */ m("h3", {
139
+ /* @__PURE__ */ g("h3", {
60
140
  className: "text-lg font-semibold text-text-primary",
61
141
  children: "Submitted for verification"
62
142
  }),
63
- /* @__PURE__ */ h("p", {
143
+ /* @__PURE__ */ _("p", {
64
144
  className: "mx-auto mt-2 max-w-md text-sm text-text-secondary",
65
145
  children: [
66
146
  "“",
67
- M.name,
147
+ I.name,
68
148
  "” has been created and sent for admin review. You can add offerings, set detailed hours and open your service from the dashboard now."
69
149
  ]
70
150
  }),
71
- /* @__PURE__ */ h("div", {
151
+ M && /* @__PURE__ */ _("p", {
152
+ className: "mt-3 inline-flex items-center gap-1.5 rounded-full bg-status-warning-bg-subtle px-3 py-1 text-xs font-medium text-status-warning-text",
153
+ children: [
154
+ /* @__PURE__ */ g(p, { className: "h-3.5 w-3.5" }),
155
+ "Verification status: ",
156
+ M.toLowerCase()
157
+ ]
158
+ }),
159
+ /* @__PURE__ */ _("div", {
72
160
  className: "mt-6 flex flex-col justify-center gap-3 sm:flex-row",
73
- children: [/* @__PURE__ */ m("button", {
161
+ children: [/* @__PURE__ */ g("button", {
74
162
  type: "button",
75
- onClick: () => x("/cart-owner/inventory"),
163
+ onClick: () => C("/cart-owner/inventory"),
76
164
  className: "rounded-lg border border-border-default bg-bg-surface px-5 py-2.5 text-sm font-medium text-text-secondary hover:bg-bg-sunken",
77
165
  children: "Add offerings"
78
- }), /* @__PURE__ */ m("button", {
166
+ }), /* @__PURE__ */ g("button", {
79
167
  type: "button",
80
- onClick: () => x("/cart-owner/dashboard"),
168
+ onClick: () => C("/cart-owner/dashboard"),
81
169
  className: "rounded-lg bg-action-primary-bg px-5 py-2.5 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bg-hover",
82
170
  children: "Go to Dashboard"
83
171
  })]
@@ -85,289 +173,274 @@ function x() {
85
173
  ]
86
174
  })
87
175
  })
88
- }) : /* @__PURE__ */ m(t, {
176
+ }) : /* @__PURE__ */ g(t, {
89
177
  title: "Set up your cart",
90
178
  description: "Get your business live and discoverable on the marketplace",
91
- children: /* @__PURE__ */ h("div", {
92
- className: "mx-auto max-w-2xl space-y-6",
179
+ children: /* @__PURE__ */ _("div", {
180
+ className: "mx-auto max-w-4xl space-y-6",
93
181
  children: [
94
- T && /* @__PURE__ */ h("div", {
182
+ D && /* @__PURE__ */ _("div", {
95
183
  className: "flex items-center gap-2 rounded-lg border border-status-info-text/30 bg-status-info-bg-subtle p-3 text-sm text-text-secondary",
96
- children: [/* @__PURE__ */ m(d, { className: "h-4 w-4 text-status-info-text" }), "You already have a cart — this creates an additional one."]
184
+ children: [/* @__PURE__ */ g(p, { className: "h-4 w-4 text-status-info-text" }), "You already have a cart — this creates an additional one."]
97
185
  }),
98
- /* @__PURE__ */ m(i, {
99
- steps: y,
100
- current: E
186
+ /* @__PURE__ */ g(i, {
187
+ steps: x,
188
+ current: O
101
189
  }),
102
- /* @__PURE__ */ h(g, {
103
- treatment: "plain",
104
- className: "p-6",
105
- children: [
106
- E === 0 && /* @__PURE__ */ h("div", {
107
- className: "space-y-4",
108
- children: [
109
- /* @__PURE__ */ h("div", {
110
- className: "flex items-center gap-2 text-text-primary",
111
- children: [
112
- /* @__PURE__ */ m(f, { className: "h-5 w-5 text-accent-primary" }),
113
- " ",
114
- /* @__PURE__ */ m("h3", {
115
- className: "font-semibold",
116
- children: "Business details"
117
- })
118
- ]
119
- }),
120
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
121
- className: "mb-1 block text-sm font-medium text-text-secondary",
122
- children: "Business name"
123
- }), /* @__PURE__ */ m("input", {
124
- className: F,
125
- value: M.name,
126
- onChange: (e) => P("name", e.target.value),
127
- placeholder: "Anna Nagar Tiffin Cart"
128
- })] }),
129
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
130
- className: "mb-1 block text-sm font-medium text-text-secondary",
131
- children: "Category"
132
- }), /* @__PURE__ */ m("div", {
133
- className: "grid grid-cols-2 gap-2 sm:grid-cols-3",
134
- children: _.map(([e, t]) => /* @__PURE__ */ m("button", {
135
- type: "button",
136
- onClick: () => P("category", e),
137
- className: "rounded-lg border px-3 py-2 text-xs font-medium transition " + (M.category === e ? "border-accent-primary bg-accent-primary/10 text-accent-primary" : "border-border-subtle bg-bg-canvas text-text-secondary hover:bg-bg-sunken"),
138
- children: t
139
- }, e))
140
- })] }),
141
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
142
- className: "mb-1 block text-sm font-medium text-text-secondary",
143
- children: "Description"
144
- }), /* @__PURE__ */ m("textarea", {
145
- className: F,
146
- rows: 3,
147
- value: M.description,
148
- onChange: (e) => P("description", e.target.value),
149
- placeholder: "What you sell and what makes you special."
150
- })] })
151
- ]
152
- }),
153
- E === 1 && /* @__PURE__ */ h("div", {
154
- className: "space-y-4",
155
- children: [
156
- /* @__PURE__ */ h("div", {
157
- className: "flex items-center gap-2 text-text-primary",
158
- children: [
159
- /* @__PURE__ */ m(u, { className: "h-5 w-5 text-accent-primary" }),
160
- " ",
161
- /* @__PURE__ */ m("h3", {
162
- className: "font-semibold",
163
- children: "Location & hours"
164
- })
165
- ]
166
- }),
167
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
168
- className: "mb-1 block text-sm font-medium text-text-secondary",
169
- children: "Address"
170
- }), /* @__PURE__ */ m("input", {
171
- className: F,
172
- value: M.address,
173
- onChange: (e) => P("address", e.target.value),
174
- placeholder: "24 North Usman Rd, Anna Nagar, Chennai"
175
- })] }),
176
- /* @__PURE__ */ h("div", {
177
- className: "grid grid-cols-2 gap-4",
178
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
190
+ /* @__PURE__ */ _("div", {
191
+ className: "grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",
192
+ children: [/* @__PURE__ */ _(v, {
193
+ treatment: "plain",
194
+ className: "p-6",
195
+ children: [
196
+ O === 0 && /* @__PURE__ */ _("div", {
197
+ className: "space-y-4",
198
+ children: [
199
+ /* @__PURE__ */ _("div", {
200
+ className: "flex items-center gap-2 text-text-primary",
201
+ children: [
202
+ /* @__PURE__ */ g(m, { className: "h-5 w-5 text-accent-primary" }),
203
+ " ",
204
+ /* @__PURE__ */ g("h3", {
205
+ className: "font-semibold",
206
+ children: "Business details"
207
+ })
208
+ ]
209
+ }),
210
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
179
211
  className: "mb-1 block text-sm font-medium text-text-secondary",
180
- children: "Opens"
181
- }), /* @__PURE__ */ m("input", {
182
- type: "time",
183
- className: F,
184
- value: M.open,
185
- onChange: (e) => P("open", e.target.value)
186
- })] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
212
+ children: "Business name"
213
+ }), /* @__PURE__ */ g("input", {
214
+ className: z,
215
+ value: I.name,
216
+ onChange: (e) => R("name", e.target.value),
217
+ placeholder: "Anna Nagar Tiffin Cart"
218
+ })] }),
219
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
187
220
  className: "mb-1 block text-sm font-medium text-text-secondary",
188
- children: "Closes"
189
- }), /* @__PURE__ */ m("input", {
190
- type: "time",
191
- className: F,
192
- value: M.close,
193
- onChange: (e) => P("close", e.target.value)
194
- })] })]
195
- }),
196
- /* @__PURE__ */ m("p", {
197
- className: "text-xs text-text-muted",
198
- children: "You can set detailed per-day hours later in Service Config."
199
- })
200
- ]
201
- }),
202
- E === 2 && /* @__PURE__ */ h("div", {
203
- className: "space-y-4",
204
- children: [
205
- /* @__PURE__ */ h("div", {
206
- className: "flex items-center gap-2 text-text-primary",
207
- children: [
208
- /* @__PURE__ */ m(p, { className: "h-5 w-5 text-accent-primary" }),
209
- " ",
210
- /* @__PURE__ */ m("h3", {
211
- className: "font-semibold",
212
- children: "Fulfilment modes"
213
- })
214
- ]
215
- }),
216
- /* @__PURE__ */ m("p", {
217
- className: "text-sm text-text-secondary",
218
- children: "How will customers receive their orders?"
219
- }),
220
- /* @__PURE__ */ m("div", {
221
- className: "grid grid-cols-2 gap-2 sm:grid-cols-3",
222
- children: v.map(([e, t]) => {
223
- let n = M.fulfilments.includes(e);
224
- return /* @__PURE__ */ m("button", {
221
+ children: "Category"
222
+ }), /* @__PURE__ */ g("div", {
223
+ className: "grid grid-cols-2 gap-2 sm:grid-cols-3",
224
+ children: y.map(([e, t]) => /* @__PURE__ */ g("button", {
225
225
  type: "button",
226
- onClick: () => P("fulfilments", n ? M.fulfilments.filter((t) => t !== e) : [...M.fulfilments, e]),
227
- className: "rounded-lg border px-3 py-2 text-sm font-medium transition " + (n ? "border-accent-primary bg-accent-primary/10 text-accent-primary" : "border-border-subtle bg-bg-canvas text-text-secondary hover:bg-bg-sunken"),
226
+ onClick: () => R("category", e),
227
+ className: "rounded-lg border px-3 py-2 text-xs font-medium transition " + (I.category === e ? "border-accent-primary bg-accent-primary/10 text-accent-primary" : "border-border-subtle bg-bg-canvas text-text-secondary hover:bg-bg-sunken"),
228
228
  children: t
229
- }, e);
229
+ }, e))
230
+ })] }),
231
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
232
+ className: "mb-1 block text-sm font-medium text-text-secondary",
233
+ children: "Description"
234
+ }), /* @__PURE__ */ g("textarea", {
235
+ className: z,
236
+ rows: 3,
237
+ value: I.description,
238
+ onChange: (e) => R("description", e.target.value),
239
+ placeholder: "What you sell and what makes you special."
240
+ })] })
241
+ ]
242
+ }),
243
+ O === 1 && /* @__PURE__ */ _("div", {
244
+ className: "space-y-4",
245
+ children: [
246
+ /* @__PURE__ */ _("div", {
247
+ className: "flex items-center gap-2 text-text-primary",
248
+ children: [
249
+ /* @__PURE__ */ g(f, { className: "h-5 w-5 text-accent-primary" }),
250
+ " ",
251
+ /* @__PURE__ */ g("h3", {
252
+ className: "font-semibold",
253
+ children: "Location & hours"
254
+ })
255
+ ]
256
+ }),
257
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
258
+ className: "mb-1 block text-sm font-medium text-text-secondary",
259
+ children: "Address"
260
+ }), /* @__PURE__ */ g("input", {
261
+ className: z,
262
+ value: I.address,
263
+ onChange: (e) => R("address", e.target.value),
264
+ placeholder: "24 North Usman Rd, Anna Nagar, Chennai"
265
+ })] }),
266
+ /* @__PURE__ */ _("div", {
267
+ className: "grid grid-cols-2 gap-4",
268
+ children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
269
+ className: "mb-1 block text-sm font-medium text-text-secondary",
270
+ children: "Opens"
271
+ }), /* @__PURE__ */ g("input", {
272
+ type: "time",
273
+ className: z,
274
+ value: I.open,
275
+ onChange: (e) => R("open", e.target.value)
276
+ })] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
277
+ className: "mb-1 block text-sm font-medium text-text-secondary",
278
+ children: "Closes"
279
+ }), /* @__PURE__ */ g("input", {
280
+ type: "time",
281
+ className: z,
282
+ value: I.close,
283
+ onChange: (e) => R("close", e.target.value)
284
+ })] })]
285
+ }),
286
+ /* @__PURE__ */ g("p", {
287
+ className: "text-xs text-text-muted",
288
+ children: "You can set detailed per-day hours later in Service Config."
289
+ })
290
+ ]
291
+ }),
292
+ O === 2 && /* @__PURE__ */ _("div", {
293
+ className: "space-y-4",
294
+ children: [
295
+ /* @__PURE__ */ _("div", {
296
+ className: "flex items-center gap-2 text-text-primary",
297
+ children: [
298
+ /* @__PURE__ */ g(h, { className: "h-5 w-5 text-accent-primary" }),
299
+ " ",
300
+ /* @__PURE__ */ g("h3", {
301
+ className: "font-semibold",
302
+ children: "Fulfilment modes"
303
+ })
304
+ ]
305
+ }),
306
+ /* @__PURE__ */ g("p", {
307
+ className: "text-sm text-text-secondary",
308
+ children: "How will customers receive their orders?"
309
+ }),
310
+ /* @__PURE__ */ g("div", {
311
+ className: "grid grid-cols-2 gap-2 sm:grid-cols-3",
312
+ children: b.map(([e, t]) => {
313
+ let n = I.fulfilments.includes(e);
314
+ return /* @__PURE__ */ g("button", {
315
+ type: "button",
316
+ onClick: () => R("fulfilments", n ? I.fulfilments.filter((t) => t !== e) : [...I.fulfilments, e]),
317
+ className: "rounded-lg border px-3 py-2 text-sm font-medium transition " + (n ? "border-accent-primary bg-accent-primary/10 text-accent-primary" : "border-border-subtle bg-bg-canvas text-text-secondary hover:bg-bg-sunken"),
318
+ children: t
319
+ }, e);
320
+ })
230
321
  })
231
- })
232
- ]
233
- }),
234
- E === 3 && /* @__PURE__ */ h("div", {
235
- className: "space-y-4",
236
- children: [
237
- /* @__PURE__ */ h("div", {
238
- className: "flex items-center gap-2 text-text-primary",
322
+ ]
323
+ }),
324
+ O === 3 && /* @__PURE__ */ _("div", {
325
+ className: "space-y-4",
326
+ children: [
327
+ /* @__PURE__ */ _("div", {
328
+ className: "flex items-center gap-2 text-text-primary",
329
+ children: [
330
+ /* @__PURE__ */ g(p, { className: "h-5 w-5 text-accent-primary" }),
331
+ " ",
332
+ /* @__PURE__ */ g("h3", {
333
+ className: "font-semibold",
334
+ children: "Review & submit"
335
+ })
336
+ ]
337
+ }),
338
+ /* @__PURE__ */ _("dl", {
339
+ className: "space-y-2 text-sm",
340
+ children: [
341
+ /* @__PURE__ */ _("div", {
342
+ className: "flex justify-between border-b border-border-subtle py-2",
343
+ children: [/* @__PURE__ */ g("dt", {
344
+ className: "text-text-secondary",
345
+ children: "Business"
346
+ }), /* @__PURE__ */ g("dd", {
347
+ className: "font-medium text-text-primary",
348
+ children: I.name || "—"
349
+ })]
350
+ }),
351
+ /* @__PURE__ */ _("div", {
352
+ className: "flex justify-between border-b border-border-subtle py-2",
353
+ children: [/* @__PURE__ */ g("dt", {
354
+ className: "text-text-secondary",
355
+ children: "Category"
356
+ }), /* @__PURE__ */ g("dd", {
357
+ className: "font-medium text-text-primary",
358
+ children: y.find((e) => e[0] === I.category)?.[1]
359
+ })]
360
+ }),
361
+ /* @__PURE__ */ _("div", {
362
+ className: "flex justify-between border-b border-border-subtle py-2",
363
+ children: [/* @__PURE__ */ g("dt", {
364
+ className: "text-text-secondary",
365
+ children: "Address"
366
+ }), /* @__PURE__ */ g("dd", {
367
+ className: "max-w-[60%] text-right font-medium text-text-primary",
368
+ children: I.address || "—"
369
+ })]
370
+ }),
371
+ /* @__PURE__ */ _("div", {
372
+ className: "flex justify-between border-b border-border-subtle py-2",
373
+ children: [/* @__PURE__ */ g("dt", {
374
+ className: "text-text-secondary",
375
+ children: "Hours"
376
+ }), /* @__PURE__ */ _("dd", {
377
+ className: "font-medium text-text-primary",
378
+ children: [
379
+ I.open,
380
+ "–",
381
+ I.close
382
+ ]
383
+ })]
384
+ }),
385
+ /* @__PURE__ */ _("div", {
386
+ className: "flex justify-between py-2",
387
+ children: [/* @__PURE__ */ g("dt", {
388
+ className: "text-text-secondary",
389
+ children: "Fulfilment"
390
+ }), /* @__PURE__ */ g("dd", {
391
+ className: "max-w-[60%] text-right font-medium text-text-primary",
392
+ children: I.fulfilments.map((e) => b.find((t) => t[0] === e)?.[1]).join(", ") || "—"
393
+ })]
394
+ })
395
+ ]
396
+ }),
397
+ /* @__PURE__ */ g("div", {
398
+ className: "rounded-lg border border-border-subtle bg-bg-sunken/50 p-3 text-xs text-text-secondary",
399
+ children: "On submit, your cart is created and sent to platform admins for verification. Verification documents (GST, licences) can be added from your profile once that step is enabled."
400
+ }),
401
+ P && /* @__PURE__ */ g("p", {
402
+ className: "text-sm text-status-error-text",
403
+ children: P
404
+ })
405
+ ]
406
+ }),
407
+ /* @__PURE__ */ _("div", {
408
+ className: "mt-6 flex items-center justify-between border-t border-border-subtle pt-4",
409
+ children: [/* @__PURE__ */ _("button", {
410
+ type: "button",
411
+ onClick: () => O === 0 ? C("/cart-owner/dashboard") : k((e) => e - 1),
412
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-default bg-bg-surface px-4 py-2 text-sm font-medium text-text-secondary hover:bg-bg-sunken",
239
413
  children: [
240
- /* @__PURE__ */ m(d, { className: "h-5 w-5 text-accent-primary" }),
414
+ /* @__PURE__ */ g(s, { className: "h-4 w-4" }),
241
415
  " ",
242
- /* @__PURE__ */ m("h3", {
243
- className: "font-semibold",
244
- children: "Review & submit"
245
- })
416
+ O === 0 ? "Cancel" : "Back"
246
417
  ]
247
- }),
248
- /* @__PURE__ */ h("dl", {
249
- className: "space-y-2 text-sm",
418
+ }), O < x.length - 1 ? /* @__PURE__ */ _("button", {
419
+ type: "button",
420
+ disabled: !B,
421
+ onClick: () => k((e) => e + 1),
422
+ className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-5 py-2 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bg-hover disabled:opacity-50",
423
+ children: ["Continue ", /* @__PURE__ */ g(c, { className: "h-4 w-4" })]
424
+ }) : /* @__PURE__ */ _("button", {
425
+ type: "button",
426
+ disabled: E.isPending,
427
+ onClick: V,
428
+ className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-5 py-2 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bg-hover disabled:opacity-60",
250
429
  children: [
251
- /* @__PURE__ */ h("div", {
252
- className: "flex justify-between border-b border-border-subtle py-2",
253
- children: [/* @__PURE__ */ m("dt", {
254
- className: "text-text-secondary",
255
- children: "Business"
256
- }), /* @__PURE__ */ m("dd", {
257
- className: "font-medium text-text-primary",
258
- children: M.name || "—"
259
- })]
260
- }),
261
- /* @__PURE__ */ h("div", {
262
- className: "flex justify-between border-b border-border-subtle py-2",
263
- children: [/* @__PURE__ */ m("dt", {
264
- className: "text-text-secondary",
265
- children: "Category"
266
- }), /* @__PURE__ */ m("dd", {
267
- className: "font-medium text-text-primary",
268
- children: _.find((e) => e[0] === M.category)?.[1]
269
- })]
270
- }),
271
- /* @__PURE__ */ h("div", {
272
- className: "flex justify-between border-b border-border-subtle py-2",
273
- children: [/* @__PURE__ */ m("dt", {
274
- className: "text-text-secondary",
275
- children: "Address"
276
- }), /* @__PURE__ */ m("dd", {
277
- className: "max-w-[60%] text-right font-medium text-text-primary",
278
- children: M.address || "—"
279
- })]
280
- }),
281
- /* @__PURE__ */ h("div", {
282
- className: "flex justify-between border-b border-border-subtle py-2",
283
- children: [/* @__PURE__ */ m("dt", {
284
- className: "text-text-secondary",
285
- children: "Hours"
286
- }), /* @__PURE__ */ h("dd", {
287
- className: "font-medium text-text-primary",
288
- children: [
289
- M.open,
290
- "–",
291
- M.close
292
- ]
293
- })]
294
- }),
295
- /* @__PURE__ */ h("div", {
296
- className: "flex justify-between py-2",
297
- children: [/* @__PURE__ */ m("dt", {
298
- className: "text-text-secondary",
299
- children: "Fulfilment"
300
- }), /* @__PURE__ */ m("dd", {
301
- className: "max-w-[60%] text-right font-medium text-text-primary",
302
- children: M.fulfilments.map((e) => v.find((t) => t[0] === e)?.[1]).join(", ") || "—"
303
- })]
304
- })
430
+ /* @__PURE__ */ g(p, { className: "h-4 w-4" }),
431
+ " ",
432
+ E.isPending ? "Submitting…" : "Submit for Verification"
305
433
  ]
306
- }),
307
- /* @__PURE__ */ m("div", {
308
- className: "rounded-lg border border-border-subtle bg-bg-sunken/50 p-3 text-xs text-text-secondary",
309
- children: "On submit, your cart is created and sent to platform admins for verification. Verification documents (GST, licences) can be added from your profile once that step is enabled."
310
- }),
311
- A && /* @__PURE__ */ m("p", {
312
- className: "text-sm text-status-error-text",
313
- children: A
314
- })
315
- ]
316
- }),
317
- /* @__PURE__ */ h("div", {
318
- className: "mt-6 flex items-center justify-between border-t border-border-subtle pt-4",
319
- children: [/* @__PURE__ */ h("button", {
320
- type: "button",
321
- onClick: () => E === 0 ? x("/cart-owner/dashboard") : D((e) => e - 1),
322
- className: "inline-flex items-center gap-1.5 rounded-lg border border-border-default bg-bg-surface px-4 py-2 text-sm font-medium text-text-secondary hover:bg-bg-sunken",
323
- children: [
324
- /* @__PURE__ */ m(s, { className: "h-4 w-4" }),
325
- " ",
326
- E === 0 ? "Cancel" : "Back"
327
- ]
328
- }), E < y.length - 1 ? /* @__PURE__ */ h("button", {
329
- type: "button",
330
- disabled: !I,
331
- onClick: () => D((e) => e + 1),
332
- className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-5 py-2 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bg-hover disabled:opacity-50",
333
- children: ["Continue ", /* @__PURE__ */ m(c, { className: "h-4 w-4" })]
334
- }) : /* @__PURE__ */ h("button", {
335
- type: "button",
336
- disabled: w.isPending,
337
- onClick: () => {
338
- j(""), w.mutate({
339
- ownerId: S?.id,
340
- name: M.name.trim(),
341
- slug: b(M.name),
342
- description: M.description.trim() || void 0,
343
- category: M.category,
344
- offeringType: "both",
345
- serviceTypes: [],
346
- location: { address: M.address.trim() },
347
- businessHours: {
348
- open: M.open,
349
- close: M.close
350
- }
351
- }, {
352
- onSuccess: () => k(!0),
353
- onError: (e) => j(e instanceof Error ? e.message : "Could not create your cart.")
354
- });
355
- },
356
- className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-5 py-2 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bg-hover disabled:opacity-60",
357
- children: [
358
- /* @__PURE__ */ m(d, { className: "h-4 w-4" }),
359
- " ",
360
- w.isPending ? "Submitting…" : "Submit for Verification"
361
- ]
362
- })]
363
- })
364
- ]
434
+ })]
435
+ })
436
+ ]
437
+ }), W]
365
438
  })
366
439
  ]
367
440
  })
368
441
  });
369
442
  }
370
443
  //#endregion
371
- export { x as MerchantOnboardingPage };
444
+ export { C as MerchantOnboardingPage };
372
445
 
373
446
  //# sourceMappingURL=MerchantOnboardingPage.js.map