@burdenoff/microfe-kadaikodi 2026.704.1 → 2026.704.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kadaikodi/hooks/useKadaikodiApi.js +77 -26
- package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +341 -461
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminDashboard.js +115 -399
- package/dist/kadaikodi/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js +140 -283
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +282 -453
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminProfilePage.js +115 -242
- package/dist/kadaikodi/pages/admin/AdminProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminSettingsPage.js +2 -2
- package/dist/kadaikodi/pages/admin/AdminSettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js +503 -627
- package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js +339 -282
- package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +323 -422
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js +374 -383
- package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +249 -208
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js +1 -1
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +1 -1
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +171 -627
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/HelpSupportPage.js +331 -415
- package/dist/kadaikodi/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/NotificationCenterPage.js +18 -670
- package/dist/kadaikodi/pages/common/NotificationCenterPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CheckoutPage.js +4 -2
- package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CustomerDashboard.js +191 -369
- package/dist/kadaikodi/pages/customer/CustomerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CustomerProfilePage.js +233 -389
- package/dist/kadaikodi/pages/customer/CustomerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js +76 -118
- package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/SavedAddressesPage.js +135 -213
- package/dist/kadaikodi/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js +272 -774
- package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js +232 -343
- package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js +112 -600
- package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorDashboard.js +127 -294
- package/dist/kadaikodi/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js +204 -290
- package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js +159 -500
- package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorProfilePage.js +399 -487
- package/dist/kadaikodi/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +13 -13
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerDashboard.js +192 -296
- package/dist/kadaikodi/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js +245 -397
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js +85 -117
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js +177 -395
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,13 +2,12 @@ import { useKadaikodi as e } from "../../context/KadaikodiContext.js";
|
|
|
2
2
|
import { cn as t } from "../../utils/cn.js";
|
|
3
3
|
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
4
|
import { EmptyState as r } from "../../components/EmptyState.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { EmphasisPanel as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
|
|
5
|
+
import { useState as i } from "react";
|
|
6
|
+
import { Briefcase as a, CheckCircle2 as o, Home as s, MapPin as c, Pencil as l, Plus as u, Star as d, Trash2 as f, X as p } from "lucide-react";
|
|
7
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
8
|
+
import { EmphasisPanel as g, PagePurpose as _ } from "@burdenoff/fe-libs/ui";
|
|
10
9
|
//#region src/kadaikodi/pages/customer/SavedAddressesPage.tsx
|
|
11
|
-
var
|
|
10
|
+
var v = {
|
|
12
11
|
type: "home",
|
|
13
12
|
nickname: "",
|
|
14
13
|
addressLine1: "",
|
|
@@ -17,102 +16,49 @@ var x = {
|
|
|
17
16
|
state: "",
|
|
18
17
|
zipCode: "",
|
|
19
18
|
isDefault: !1
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
addressLine1: "123, MG Road",
|
|
26
|
-
addressLine2: "Near Central Mall",
|
|
27
|
-
city: "Bangalore",
|
|
28
|
-
state: "Karnataka",
|
|
29
|
-
zipCode: "560001",
|
|
30
|
-
isDefault: !0,
|
|
31
|
-
usageCount: 45,
|
|
32
|
-
lastUsed: "2024-06-24T08:30:00Z"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
id: "addr-002",
|
|
36
|
-
type: "office",
|
|
37
|
-
nickname: "Office",
|
|
38
|
-
addressLine1: "456, Brigade Road",
|
|
39
|
-
addressLine2: "Floor 3, Tech Tower",
|
|
40
|
-
city: "Bangalore",
|
|
41
|
-
state: "Karnataka",
|
|
42
|
-
zipCode: "560025",
|
|
43
|
-
isDefault: !1,
|
|
44
|
-
usageCount: 28,
|
|
45
|
-
lastUsed: "2024-06-23T13:15:00Z"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: "addr-003",
|
|
49
|
-
type: "other",
|
|
50
|
-
nickname: "Friend's Place",
|
|
51
|
-
addressLine1: "789, Koramangala",
|
|
52
|
-
addressLine2: "Near Forum Mall",
|
|
53
|
-
city: "Bangalore",
|
|
54
|
-
state: "Karnataka",
|
|
55
|
-
zipCode: "560034",
|
|
56
|
-
isDefault: !1,
|
|
57
|
-
usageCount: 12,
|
|
58
|
-
lastUsed: "2024-06-20T19:45:00Z"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
id: "addr-004",
|
|
62
|
-
type: "home",
|
|
63
|
-
nickname: "Weekend Place",
|
|
64
|
-
addressLine1: "321, Indiranagar",
|
|
65
|
-
addressLine2: "Near Metro Station",
|
|
66
|
-
city: "Bangalore",
|
|
67
|
-
state: "Karnataka",
|
|
68
|
-
zipCode: "560038",
|
|
69
|
-
isDefault: !1,
|
|
70
|
-
usageCount: 8,
|
|
71
|
-
lastUsed: "2024-06-18T11:30:00Z"
|
|
72
|
-
}
|
|
73
|
-
], C = {
|
|
74
|
-
home: u,
|
|
75
|
-
office: o,
|
|
76
|
-
other: d
|
|
77
|
-
}, w = {
|
|
19
|
+
}, y = {
|
|
20
|
+
home: s,
|
|
21
|
+
office: a,
|
|
22
|
+
other: c
|
|
23
|
+
}, b = {
|
|
78
24
|
home: "bg-status-success-bg-subtle text-status-success-text",
|
|
79
25
|
office: "bg-[var(--color-accent-soft)] text-text-primary",
|
|
80
26
|
other: "bg-accent-purple-subtle text-text-primary"
|
|
81
27
|
};
|
|
82
|
-
function
|
|
83
|
-
return /* @__PURE__ */
|
|
28
|
+
function x({ data: e, onChange: t, onSubmit: n, onCancel: r, submitLabel: i }) {
|
|
29
|
+
return /* @__PURE__ */ h("div", {
|
|
84
30
|
className: "space-y-4",
|
|
85
31
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ h("div", {
|
|
87
33
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
88
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
|
|
89
35
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
90
|
-
children: ["Address Type ", /* @__PURE__ */
|
|
36
|
+
children: ["Address Type ", /* @__PURE__ */ m("span", {
|
|
91
37
|
className: "text-status-error-text",
|
|
92
38
|
children: "*"
|
|
93
39
|
})]
|
|
94
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ h("select", {
|
|
95
41
|
value: e.type,
|
|
96
42
|
onChange: (e) => t("type", e.target.value),
|
|
97
43
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
98
44
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ m("option", {
|
|
100
46
|
value: "home",
|
|
101
47
|
children: "Home"
|
|
102
48
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ m("option", {
|
|
104
50
|
value: "office",
|
|
105
51
|
children: "Office"
|
|
106
52
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ m("option", {
|
|
108
54
|
value: "other",
|
|
109
55
|
children: "Other"
|
|
110
56
|
})
|
|
111
57
|
]
|
|
112
|
-
})] }), /* @__PURE__ */
|
|
58
|
+
})] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
113
59
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
114
60
|
children: "Nickname"
|
|
115
|
-
}), /* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ m("input", {
|
|
116
62
|
type: "text",
|
|
117
63
|
placeholder: "e.g., Home Sweet Home",
|
|
118
64
|
value: e.nickname,
|
|
@@ -120,65 +66,65 @@ function T({ data: e, onChange: t, onSubmit: n, onCancel: r, submitLabel: i }) {
|
|
|
120
66
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
121
67
|
})] })]
|
|
122
68
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
|
|
124
70
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
125
|
-
children: ["Address Line 1 ", /* @__PURE__ */
|
|
71
|
+
children: ["Address Line 1 ", /* @__PURE__ */ m("span", {
|
|
126
72
|
className: "text-status-error-text",
|
|
127
73
|
children: "*"
|
|
128
74
|
})]
|
|
129
|
-
}), /* @__PURE__ */
|
|
75
|
+
}), /* @__PURE__ */ m("input", {
|
|
130
76
|
type: "text",
|
|
131
77
|
placeholder: "House/Flat number, Street name",
|
|
132
78
|
value: e.addressLine1,
|
|
133
79
|
onChange: (e) => t("addressLine1", e.target.value),
|
|
134
80
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
135
81
|
})] }),
|
|
136
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
137
83
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
138
84
|
children: "Address Line 2"
|
|
139
|
-
}), /* @__PURE__ */
|
|
85
|
+
}), /* @__PURE__ */ m("input", {
|
|
140
86
|
type: "text",
|
|
141
87
|
placeholder: "Area, Landmark",
|
|
142
88
|
value: e.addressLine2,
|
|
143
89
|
onChange: (e) => t("addressLine2", e.target.value),
|
|
144
90
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
145
91
|
})] }),
|
|
146
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ h("div", {
|
|
147
93
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
|
|
148
94
|
children: [
|
|
149
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
|
|
150
96
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
151
|
-
children: ["City ", /* @__PURE__ */
|
|
97
|
+
children: ["City ", /* @__PURE__ */ m("span", {
|
|
152
98
|
className: "text-status-error-text",
|
|
153
99
|
children: "*"
|
|
154
100
|
})]
|
|
155
|
-
}), /* @__PURE__ */
|
|
101
|
+
}), /* @__PURE__ */ m("input", {
|
|
156
102
|
type: "text",
|
|
157
103
|
placeholder: "City",
|
|
158
104
|
value: e.city,
|
|
159
105
|
onChange: (e) => t("city", e.target.value),
|
|
160
106
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
161
107
|
})] }),
|
|
162
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
|
|
163
109
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
164
|
-
children: ["State ", /* @__PURE__ */
|
|
110
|
+
children: ["State ", /* @__PURE__ */ m("span", {
|
|
165
111
|
className: "text-status-error-text",
|
|
166
112
|
children: "*"
|
|
167
113
|
})]
|
|
168
|
-
}), /* @__PURE__ */
|
|
114
|
+
}), /* @__PURE__ */ m("input", {
|
|
169
115
|
type: "text",
|
|
170
116
|
placeholder: "State",
|
|
171
117
|
value: e.state,
|
|
172
118
|
onChange: (e) => t("state", e.target.value),
|
|
173
119
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
174
120
|
})] }),
|
|
175
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
|
|
176
122
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
177
|
-
children: ["ZIP Code ", /* @__PURE__ */
|
|
123
|
+
children: ["ZIP Code ", /* @__PURE__ */ m("span", {
|
|
178
124
|
className: "text-status-error-text",
|
|
179
125
|
children: "*"
|
|
180
126
|
})]
|
|
181
|
-
}), /* @__PURE__ */
|
|
127
|
+
}), /* @__PURE__ */ m("input", {
|
|
182
128
|
type: "text",
|
|
183
129
|
placeholder: "560001",
|
|
184
130
|
value: e.zipCode,
|
|
@@ -187,26 +133,26 @@ function T({ data: e, onChange: t, onSubmit: n, onCancel: r, submitLabel: i }) {
|
|
|
187
133
|
})] })
|
|
188
134
|
]
|
|
189
135
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ h("label", {
|
|
191
137
|
className: "flex items-center gap-2 cursor-pointer",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
138
|
+
children: [/* @__PURE__ */ m("input", {
|
|
193
139
|
type: "checkbox",
|
|
194
140
|
checked: e.isDefault,
|
|
195
141
|
onChange: (e) => t("isDefault", e.target.checked),
|
|
196
142
|
className: "h-4 w-4 rounded border-border-subtle text-text-primary"
|
|
197
|
-
}), /* @__PURE__ */
|
|
143
|
+
}), /* @__PURE__ */ m("span", {
|
|
198
144
|
className: "text-sm text-text-secondary",
|
|
199
145
|
children: "Set as default address"
|
|
200
146
|
})]
|
|
201
147
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ h("div", {
|
|
203
149
|
className: "flex items-center gap-3 pt-2",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ m("button", {
|
|
205
151
|
type: "button",
|
|
206
152
|
onClick: n,
|
|
207
153
|
className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
|
|
208
154
|
children: i
|
|
209
|
-
}), /* @__PURE__ */
|
|
155
|
+
}), /* @__PURE__ */ m("button", {
|
|
210
156
|
type: "button",
|
|
211
157
|
onClick: r,
|
|
212
158
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
@@ -216,139 +162,139 @@ function T({ data: e, onChange: t, onSubmit: n, onCancel: r, submitLabel: i }) {
|
|
|
216
162
|
]
|
|
217
163
|
});
|
|
218
164
|
}
|
|
219
|
-
function
|
|
220
|
-
let { navigateTo:
|
|
221
|
-
|
|
222
|
-
},
|
|
223
|
-
if (!
|
|
165
|
+
function S() {
|
|
166
|
+
let { navigateTo: a } = e(), [s, S] = i([]), [C, w] = i(!1), [T, E] = i(null), [D, O] = i({ ...v }), [k, A] = i(null), j = (e) => {
|
|
167
|
+
A(e), setTimeout(() => A(null), 3e3);
|
|
168
|
+
}, M = (e) => !e.addressLine1.trim() || !e.city.trim() || !e.state.trim() || !e.zipCode.trim() ? (alert("Please fill in all required fields (Address Line 1, City, State, ZIP Code)."), !1) : !0, N = () => {
|
|
169
|
+
if (!M(D)) return;
|
|
224
170
|
let e = {
|
|
225
171
|
id: `addr-${Date.now()}`,
|
|
226
|
-
type:
|
|
227
|
-
nickname:
|
|
228
|
-
addressLine1:
|
|
229
|
-
addressLine2:
|
|
230
|
-
city:
|
|
231
|
-
state:
|
|
232
|
-
zipCode:
|
|
233
|
-
isDefault:
|
|
172
|
+
type: D.type,
|
|
173
|
+
nickname: D.nickname,
|
|
174
|
+
addressLine1: D.addressLine1,
|
|
175
|
+
addressLine2: D.addressLine2,
|
|
176
|
+
city: D.city,
|
|
177
|
+
state: D.state,
|
|
178
|
+
zipCode: D.zipCode,
|
|
179
|
+
isDefault: D.isDefault,
|
|
234
180
|
usageCount: 0
|
|
235
181
|
};
|
|
236
|
-
|
|
182
|
+
S((t) => {
|
|
237
183
|
let n = [...t];
|
|
238
184
|
return e.isDefault && (n = n.map((e) => ({
|
|
239
185
|
...e,
|
|
240
186
|
isDefault: !1
|
|
241
187
|
}))), [...n, e];
|
|
242
|
-
}),
|
|
243
|
-
},
|
|
244
|
-
|
|
188
|
+
}), O({ ...v }), w(!1), j("Address added successfully");
|
|
189
|
+
}, P = () => {
|
|
190
|
+
T && M(T) && (S((e) => e.map((e) => e.id === T.id ? T : T.isDefault ? {
|
|
245
191
|
...e,
|
|
246
192
|
isDefault: !1
|
|
247
|
-
} : e)),
|
|
248
|
-
},
|
|
249
|
-
if (
|
|
193
|
+
} : e)), E(null), j("Address updated successfully"));
|
|
194
|
+
}, F = (e) => {
|
|
195
|
+
if (s.find((t) => t.id === e)?.isDefault) {
|
|
250
196
|
alert("Cannot delete default address. Set another address as default first.");
|
|
251
197
|
return;
|
|
252
198
|
}
|
|
253
|
-
|
|
254
|
-
},
|
|
255
|
-
|
|
199
|
+
S((t) => t.filter((t) => t.id !== e)), j("Address deleted successfully");
|
|
200
|
+
}, I = (e) => {
|
|
201
|
+
S((t) => t.map((t) => ({
|
|
256
202
|
...t,
|
|
257
203
|
isDefault: t.id === e
|
|
258
|
-
}))),
|
|
259
|
-
},
|
|
204
|
+
}))), j("Default address updated");
|
|
205
|
+
}, L = (e, t, n) => {
|
|
260
206
|
e((e) => ({
|
|
261
207
|
...e,
|
|
262
208
|
[t]: n
|
|
263
209
|
}));
|
|
264
210
|
};
|
|
265
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ h(n, {
|
|
266
212
|
title: "Saved Addresses",
|
|
267
213
|
description: "Manage your delivery addresses for faster checkout",
|
|
268
|
-
actions:
|
|
214
|
+
actions: C ? void 0 : /* @__PURE__ */ h("button", {
|
|
269
215
|
type: "button",
|
|
270
|
-
onClick: () =>
|
|
216
|
+
onClick: () => w(!0),
|
|
271
217
|
className: t("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-opacity", "bg-foreground text-background hover:opacity-90"),
|
|
272
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ m(u, { className: "h-4 w-4" }), "Add New Address"]
|
|
273
219
|
}),
|
|
274
220
|
children: [
|
|
275
|
-
/* @__PURE__ */ _
|
|
221
|
+
/* @__PURE__ */ m(_, {
|
|
276
222
|
className: "mb-6",
|
|
277
223
|
children: "Save the places you order to most — home, work, a friend's flat — so checkout is one tap and your courier always knows exactly where to go. Set a default to make it the automatic pick at checkout."
|
|
278
224
|
}),
|
|
279
|
-
|
|
225
|
+
s.length > 0 && /* @__PURE__ */ m(g, {
|
|
280
226
|
className: "mb-6",
|
|
281
|
-
children: /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ h("div", {
|
|
282
228
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
284
|
-
|
|
229
|
+
children: [/* @__PURE__ */ m(c, { className: "h-4 w-4" }), /* @__PURE__ */ h("span", { children: [
|
|
230
|
+
s.length,
|
|
285
231
|
" saved ",
|
|
286
|
-
|
|
287
|
-
|
|
232
|
+
s.length === 1 ? "address" : "addresses",
|
|
233
|
+
s.some((e) => e.isDefault) ? ` · default set to ${s.find((e) => e.isDefault)?.nickname ?? "one address"}` : " · no default set yet"
|
|
288
234
|
] })]
|
|
289
235
|
})
|
|
290
236
|
}),
|
|
291
|
-
|
|
237
|
+
k && /* @__PURE__ */ h("div", {
|
|
292
238
|
className: "mb-4 rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3 flex items-center gap-2",
|
|
293
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ m(o, { className: "h-4 w-4 text-status-success-text shrink-0" }), /* @__PURE__ */ m("p", {
|
|
294
240
|
className: "text-sm text-status-success-text",
|
|
295
|
-
children:
|
|
241
|
+
children: k
|
|
296
242
|
})]
|
|
297
243
|
}),
|
|
298
|
-
|
|
244
|
+
C && /* @__PURE__ */ h("div", {
|
|
299
245
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5 mb-6",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
246
|
+
children: [/* @__PURE__ */ m("h3", {
|
|
301
247
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
302
248
|
children: "Add New Address"
|
|
303
|
-
}), /* @__PURE__ */
|
|
304
|
-
data:
|
|
305
|
-
onChange: (e, t) =>
|
|
306
|
-
onSubmit:
|
|
249
|
+
}), /* @__PURE__ */ m(x, {
|
|
250
|
+
data: D,
|
|
251
|
+
onChange: (e, t) => L(O, e, t),
|
|
252
|
+
onSubmit: N,
|
|
307
253
|
onCancel: () => {
|
|
308
|
-
|
|
254
|
+
w(!1), O({ ...v });
|
|
309
255
|
},
|
|
310
256
|
submitLabel: "Save Address"
|
|
311
257
|
})]
|
|
312
258
|
}),
|
|
313
|
-
|
|
259
|
+
s.length > 0 ? /* @__PURE__ */ m("div", {
|
|
314
260
|
className: "space-y-3",
|
|
315
|
-
children:
|
|
316
|
-
let n =
|
|
317
|
-
return /* @__PURE__ */
|
|
261
|
+
children: s.map((e) => {
|
|
262
|
+
let n = y[e.type];
|
|
263
|
+
return /* @__PURE__ */ m("div", {
|
|
318
264
|
className: t("rounded-lg border bg-bg-surface p-4", e.isDefault ? "border-foreground/30" : "border-border-subtle"),
|
|
319
|
-
children: /* @__PURE__ */
|
|
265
|
+
children: /* @__PURE__ */ h("div", {
|
|
320
266
|
className: "flex items-start justify-between gap-3",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ h("div", {
|
|
322
268
|
className: "flex items-start gap-3 flex-1 min-w-0",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ m("div", {
|
|
324
270
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken",
|
|
325
|
-
children: /* @__PURE__ */
|
|
326
|
-
}), /* @__PURE__ */
|
|
271
|
+
children: /* @__PURE__ */ m(n, { className: "h-5 w-5 text-text-secondary" })
|
|
272
|
+
}), /* @__PURE__ */ h("div", {
|
|
327
273
|
className: "min-w-0 flex-1",
|
|
328
274
|
children: [
|
|
329
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ h("div", {
|
|
330
276
|
className: "flex flex-wrap items-center gap-2",
|
|
331
|
-
children: [/* @__PURE__ */
|
|
332
|
-
className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize",
|
|
277
|
+
children: [/* @__PURE__ */ m("span", {
|
|
278
|
+
className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize", b[e.type]),
|
|
333
279
|
children: e.type
|
|
334
|
-
}), e.isDefault && /* @__PURE__ */
|
|
280
|
+
}), e.isDefault && /* @__PURE__ */ h("span", {
|
|
335
281
|
className: "inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-[10px] font-medium text-status-success-text",
|
|
336
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ m(o, { className: "h-3 w-3" }), "Default"]
|
|
337
283
|
})]
|
|
338
284
|
}),
|
|
339
|
-
e.nickname && /* @__PURE__ */
|
|
285
|
+
e.nickname && /* @__PURE__ */ m("p", {
|
|
340
286
|
className: "mt-1 text-sm font-semibold text-text-primary",
|
|
341
287
|
children: e.nickname
|
|
342
288
|
}),
|
|
343
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ m("p", {
|
|
344
290
|
className: "mt-0.5 text-sm text-text-primary",
|
|
345
291
|
children: e.addressLine1
|
|
346
292
|
}),
|
|
347
|
-
e.addressLine2 && /* @__PURE__ */
|
|
293
|
+
e.addressLine2 && /* @__PURE__ */ m("p", {
|
|
348
294
|
className: "text-sm text-text-secondary",
|
|
349
295
|
children: e.addressLine2
|
|
350
296
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ h("p", {
|
|
352
298
|
className: "text-sm text-text-secondary",
|
|
353
299
|
children: [
|
|
354
300
|
e.city,
|
|
@@ -357,96 +303,72 @@ function E() {
|
|
|
357
303
|
" - ",
|
|
358
304
|
e.zipCode
|
|
359
305
|
]
|
|
360
|
-
}),
|
|
361
|
-
/* @__PURE__ */ v("div", {
|
|
362
|
-
className: "mt-2 flex flex-wrap items-center gap-3 text-xs text-text-secondary",
|
|
363
|
-
children: [/* @__PURE__ */ v("span", {
|
|
364
|
-
className: "flex items-center gap-1",
|
|
365
|
-
children: [
|
|
366
|
-
/* @__PURE__ */ _(l, { className: "h-3 w-3" }),
|
|
367
|
-
"Used ",
|
|
368
|
-
e.usageCount,
|
|
369
|
-
" times"
|
|
370
|
-
]
|
|
371
|
-
}), e.lastUsed && /* @__PURE__ */ v("span", {
|
|
372
|
-
className: "flex items-center gap-1",
|
|
373
|
-
children: [
|
|
374
|
-
/* @__PURE__ */ _(c, { className: "h-3 w-3" }),
|
|
375
|
-
"Last used:",
|
|
376
|
-
" ",
|
|
377
|
-
i(e.lastUsed, {
|
|
378
|
-
hour: void 0,
|
|
379
|
-
minute: void 0,
|
|
380
|
-
hour12: void 0
|
|
381
|
-
})
|
|
382
|
-
]
|
|
383
|
-
})]
|
|
384
306
|
})
|
|
385
307
|
]
|
|
386
308
|
})]
|
|
387
|
-
}), /* @__PURE__ */
|
|
309
|
+
}), /* @__PURE__ */ h("div", {
|
|
388
310
|
className: "flex items-center gap-1 shrink-0",
|
|
389
311
|
children: [
|
|
390
|
-
!e.isDefault && /* @__PURE__ */
|
|
312
|
+
!e.isDefault && /* @__PURE__ */ m("button", {
|
|
391
313
|
type: "button",
|
|
392
|
-
onClick: () =>
|
|
314
|
+
onClick: () => I(e.id),
|
|
393
315
|
title: "Set as default",
|
|
394
316
|
className: "rounded-md p-2 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors",
|
|
395
|
-
children: /* @__PURE__ */
|
|
317
|
+
children: /* @__PURE__ */ m(d, { className: "h-4 w-4" })
|
|
396
318
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ m("button", {
|
|
398
320
|
type: "button",
|
|
399
|
-
onClick: () =>
|
|
321
|
+
onClick: () => E({ ...e }),
|
|
400
322
|
title: "Edit address",
|
|
401
323
|
className: "rounded-md p-2 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors",
|
|
402
|
-
children: /* @__PURE__ */
|
|
324
|
+
children: /* @__PURE__ */ m(l, { className: "h-4 w-4" })
|
|
403
325
|
}),
|
|
404
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ m("button", {
|
|
405
327
|
type: "button",
|
|
406
|
-
onClick: () =>
|
|
328
|
+
onClick: () => F(e.id),
|
|
407
329
|
title: "Delete address",
|
|
408
330
|
className: "rounded-md p-2 text-text-secondary hover:bg-status-error-bg/10 hover:text-status-error-text transition-colors",
|
|
409
|
-
children: /* @__PURE__ */
|
|
331
|
+
children: /* @__PURE__ */ m(f, { className: "h-4 w-4" })
|
|
410
332
|
})
|
|
411
333
|
]
|
|
412
334
|
})]
|
|
413
335
|
})
|
|
414
336
|
}, e.id);
|
|
415
337
|
})
|
|
416
|
-
}) : /* @__PURE__ */
|
|
338
|
+
}) : /* @__PURE__ */ m(r, {
|
|
417
339
|
illustration: "empty-files",
|
|
418
|
-
icon: /* @__PURE__ */
|
|
340
|
+
icon: /* @__PURE__ */ m(c, { className: "h-12 w-12" }),
|
|
419
341
|
title: "No saved addresses",
|
|
420
|
-
description: "Add a delivery address to get started.",
|
|
421
|
-
action: /* @__PURE__ */
|
|
342
|
+
description: "Add a delivery address to get started. Address book sync is coming soon — for now, entries are kept for this session.",
|
|
343
|
+
action: /* @__PURE__ */ m("button", {
|
|
422
344
|
type: "button",
|
|
423
|
-
onClick: () =>
|
|
345
|
+
onClick: () => w(!0),
|
|
424
346
|
className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
|
|
425
347
|
children: "Add Address"
|
|
426
348
|
})
|
|
427
349
|
}),
|
|
428
|
-
|
|
350
|
+
T && /* @__PURE__ */ m("div", {
|
|
429
351
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
|
|
430
|
-
children: /* @__PURE__ */
|
|
352
|
+
children: /* @__PURE__ */ m("div", {
|
|
431
353
|
className: "w-full max-w-2xl max-h-[90vh] overflow-y-auto rounded-lg border border-border-subtle bg-bg-surface shadow-lg",
|
|
432
|
-
children: /* @__PURE__ */
|
|
354
|
+
children: /* @__PURE__ */ h("div", {
|
|
433
355
|
className: "p-5",
|
|
434
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ h("div", {
|
|
435
357
|
className: "flex items-center justify-between mb-4",
|
|
436
|
-
children: [/* @__PURE__ */
|
|
358
|
+
children: [/* @__PURE__ */ m("h3", {
|
|
437
359
|
className: "text-lg font-semibold text-text-primary",
|
|
438
360
|
children: "Edit Address"
|
|
439
|
-
}), /* @__PURE__ */
|
|
361
|
+
}), /* @__PURE__ */ m("button", {
|
|
440
362
|
type: "button",
|
|
441
|
-
onClick: () =>
|
|
363
|
+
onClick: () => E(null),
|
|
442
364
|
className: "rounded-md p-2 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors",
|
|
443
|
-
children: /* @__PURE__ */
|
|
365
|
+
children: /* @__PURE__ */ m(p, { className: "h-4 w-4" })
|
|
444
366
|
})]
|
|
445
|
-
}), /* @__PURE__ */
|
|
446
|
-
data:
|
|
447
|
-
onChange: (e, t) =>
|
|
448
|
-
onSubmit:
|
|
449
|
-
onCancel: () =>
|
|
367
|
+
}), /* @__PURE__ */ m(x, {
|
|
368
|
+
data: T,
|
|
369
|
+
onChange: (e, t) => L(E, e, t),
|
|
370
|
+
onSubmit: P,
|
|
371
|
+
onCancel: () => E(null),
|
|
450
372
|
submitLabel: "Save Changes"
|
|
451
373
|
})]
|
|
452
374
|
})
|
|
@@ -456,6 +378,6 @@ function E() {
|
|
|
456
378
|
});
|
|
457
379
|
}
|
|
458
380
|
//#endregion
|
|
459
|
-
export {
|
|
381
|
+
export { S as SavedAddressesPage };
|
|
460
382
|
|
|
461
383
|
//# sourceMappingURL=SavedAddressesPage.js.map
|