@burdenoff/microfe-devportal 2026.916.6 → 2026.916.7
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.
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { useDevportal as e } from "../providers/DevportalProvider.js";
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { PageLayout as n, PageSection as r } from "../components/PageLayout.js";
|
|
4
|
-
import {
|
|
4
|
+
import { DetailList as i } from "../components/DataTable.js";
|
|
5
|
+
import { CheckboxField as a, InputField as o, SelectField as s, TextareaField as c } from "../components/FormField.js";
|
|
5
6
|
import { usePackageUpload as ee } from "../hooks/usePackageUpload.js";
|
|
6
|
-
import { useCallback as
|
|
7
|
-
import { AlertCircle as
|
|
8
|
-
import { useParams as
|
|
9
|
-
import { Fragment as
|
|
7
|
+
import { useCallback as l, useEffect as te, useRef as ne, useState as u } from "react";
|
|
8
|
+
import { AlertCircle as re, AlertTriangle as ie, CheckCircle as ae, Clock as oe, Edit as se, ImageOff as ce, Info as le, Loader2 as d, RotateCw as ue, Upload as de, X as fe, XCircle as pe } from "lucide-react";
|
|
9
|
+
import { useParams as me } from "react-router";
|
|
10
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
11
|
+
import { EmphasisPanel as he, GlassCard as h } from "@burdenoff/fe-libs/ui";
|
|
10
12
|
//#region src/devportal/pages/EditPhysicalItemPage.tsx
|
|
11
|
-
var
|
|
13
|
+
var ge = [
|
|
12
14
|
{
|
|
13
15
|
value: "USD",
|
|
14
16
|
label: "USD — US Dollar"
|
|
@@ -33,7 +35,7 @@ var g = [
|
|
|
33
35
|
value: "AED",
|
|
34
36
|
label: "AED — UAE Dirham"
|
|
35
37
|
}
|
|
36
|
-
],
|
|
38
|
+
], _e = [
|
|
37
39
|
{
|
|
38
40
|
value: "GRAM",
|
|
39
41
|
label: "Grams (g)"
|
|
@@ -50,7 +52,7 @@ var g = [
|
|
|
50
52
|
value: "POUND",
|
|
51
53
|
label: "Pounds (lb)"
|
|
52
54
|
}
|
|
53
|
-
],
|
|
55
|
+
], g = [
|
|
54
56
|
{
|
|
55
57
|
value: "CENTIMETER",
|
|
56
58
|
label: "Centimeters (cm)"
|
|
@@ -63,21 +65,61 @@ var g = [
|
|
|
63
65
|
value: "METER",
|
|
64
66
|
label: "Meters (m)"
|
|
65
67
|
}
|
|
66
|
-
],
|
|
68
|
+
], _ = [
|
|
67
69
|
"name",
|
|
68
70
|
"shortDescription",
|
|
69
71
|
"price",
|
|
70
72
|
"currency",
|
|
71
73
|
"stockQuantity"
|
|
72
|
-
],
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
], ve = {
|
|
75
|
+
MERCHANDISE: "Merchandise",
|
|
76
|
+
HARDWARE: "Hardware",
|
|
77
|
+
ACCESSORY: "Accessory",
|
|
78
|
+
BOOK: "Book",
|
|
79
|
+
EQUIPMENT: "Equipment",
|
|
80
|
+
APPAREL: "Apparel",
|
|
81
|
+
COLLECTIBLE: "Collectible",
|
|
82
|
+
CONSUMABLE: "Consumable"
|
|
83
|
+
}, ye = {
|
|
84
|
+
PUBLISHED: {
|
|
85
|
+
label: "Published",
|
|
86
|
+
className: "text-status-success-text bg-status-success-bg-subtle"
|
|
87
|
+
},
|
|
88
|
+
PENDING_REVIEW: {
|
|
89
|
+
label: "Pending Review",
|
|
90
|
+
className: "text-status-warning-text bg-status-warning-bg-subtle"
|
|
91
|
+
},
|
|
92
|
+
DRAFT: {
|
|
93
|
+
label: "Draft",
|
|
94
|
+
className: "text-text-muted bg-bg-muted"
|
|
95
|
+
},
|
|
96
|
+
REJECTED: {
|
|
97
|
+
label: "Rejected",
|
|
98
|
+
className: "text-status-error-text bg-status-error-bg/10"
|
|
99
|
+
},
|
|
100
|
+
INACTIVE: {
|
|
101
|
+
label: "Inactive",
|
|
102
|
+
className: "text-text-muted bg-bg-muted"
|
|
103
|
+
}
|
|
104
|
+
}, be = "\n query GetPhysicalProduct($id: ID!) {\n product(id: $id) {\n id\n name\n slug\n type\n status\n nature\n description\n longDescription\n price\n currency\n tags\n stockQuantity\n sku\n trackInventory\n allowBackorder\n lowStockThreshold\n requiresShipping\n weight\n weightUnit\n length\n width\n height\n dimensionUnit\n brand\n manufacturer\n countryOfOrigin\n warrantyInfo\n returnPolicy\n icon\n screenshots\n category\n viewCount\n rating\n reviewCount\n createdAt\n updatedAt\n submittedAt\n reviewedAt\n reviewNotes\n rejectedReason\n publishedAt\n }\n }\n", xe = "\n mutation UpdatePhysicalProduct(\n $id: ID!\n $input: UpdatePhysicalProductInput!\n ) {\n updatePhysicalProduct(id: $id, input: $input) {\n id\n name\n status\n }\n }\n", Se = "\n mutation SubmitProductForReview($id: ID!, $notes: String) {\n submitProduct(id: $id, notes: $notes) {\n id\n status\n }\n }\n";
|
|
105
|
+
function Ce(e) {
|
|
106
|
+
return _.every((t) => {
|
|
75
107
|
let n = e[t];
|
|
76
108
|
return typeof n == "boolean" ? !0 : String(n).trim() !== "";
|
|
77
109
|
});
|
|
78
110
|
}
|
|
79
|
-
var
|
|
80
|
-
|
|
111
|
+
var v = ({ label: e, value: t }) => /* @__PURE__ */ m(h, {
|
|
112
|
+
treatment: "metric",
|
|
113
|
+
className: "p-4",
|
|
114
|
+
children: [/* @__PURE__ */ p("p", {
|
|
115
|
+
className: "text-sm text-text-secondary",
|
|
116
|
+
children: e
|
|
117
|
+
}), /* @__PURE__ */ p("p", {
|
|
118
|
+
className: "text-2xl font-bold tabular-nums",
|
|
119
|
+
children: t
|
|
120
|
+
})]
|
|
121
|
+
}), y = () => {
|
|
122
|
+
let { navigate: h, basePath: _, apiGatewayUrl: y, authToken: b, workspacesGatewayUrl: we, workspaceId: Te, getWorkspaceToken: Ee } = e(), { itemId: x } = me(), S = `${y || ""}/global/graphql`, [De, C] = u(!0), [w, T] = u(null), [E, Oe] = u(null), [D, O] = u("overview"), [k, ke] = u(null), [A, j] = u({
|
|
81
123
|
name: "",
|
|
82
124
|
shortDescription: "",
|
|
83
125
|
longDescription: "",
|
|
@@ -101,13 +143,13 @@ var C = () => {
|
|
|
101
143
|
countryOfOrigin: "",
|
|
102
144
|
warrantyInfo: "",
|
|
103
145
|
returnPolicy: ""
|
|
104
|
-
}), [
|
|
105
|
-
async function
|
|
106
|
-
let n = await (await fetch(
|
|
146
|
+
}), [M, N] = u([]), [P, F] = u(!1), I = ne(null), { upload: L } = ee(we, b, Te, Ee, "/DevPortal/Assets"), [R, z] = u(!1), [B, V] = u(null), [Ae, H] = u(!1), je = M.some((e) => e.uploading), U = Ce(A) && !je;
|
|
147
|
+
async function W(e, t) {
|
|
148
|
+
let n = await (await fetch(S, {
|
|
107
149
|
method: "POST",
|
|
108
150
|
headers: {
|
|
109
151
|
"Content-Type": "application/json",
|
|
110
|
-
...
|
|
152
|
+
...b ? { Authorization: `Bearer ${b}` } : {}
|
|
111
153
|
},
|
|
112
154
|
credentials: "include",
|
|
113
155
|
body: JSON.stringify({
|
|
@@ -119,18 +161,18 @@ var C = () => {
|
|
|
119
161
|
return n.data;
|
|
120
162
|
}
|
|
121
163
|
te(() => {
|
|
122
|
-
if (!
|
|
164
|
+
if (!x) return;
|
|
123
165
|
let e = !1;
|
|
124
|
-
return
|
|
166
|
+
return C(!0), T(null), (async () => {
|
|
125
167
|
try {
|
|
126
|
-
let t = await
|
|
168
|
+
let t = await W(be, { id: x });
|
|
127
169
|
if (e) return;
|
|
128
170
|
let n = t.product;
|
|
129
171
|
if (!n) {
|
|
130
|
-
|
|
172
|
+
T("Product not found.");
|
|
131
173
|
return;
|
|
132
174
|
}
|
|
133
|
-
|
|
175
|
+
Oe(n.status), j({
|
|
134
176
|
name: n.name,
|
|
135
177
|
shortDescription: n.description ?? "",
|
|
136
178
|
longDescription: n.longDescription ?? "",
|
|
@@ -154,518 +196,792 @@ var C = () => {
|
|
|
154
196
|
countryOfOrigin: n.countryOfOrigin ?? "",
|
|
155
197
|
warrantyInfo: n.warrantyInfo ?? "",
|
|
156
198
|
returnPolicy: n.returnPolicy ?? ""
|
|
157
|
-
}),
|
|
199
|
+
}), ke({
|
|
200
|
+
slug: n.slug,
|
|
201
|
+
type: n.type,
|
|
202
|
+
category: n.category,
|
|
203
|
+
viewCount: n.viewCount,
|
|
204
|
+
rating: n.rating,
|
|
205
|
+
reviewCount: n.reviewCount,
|
|
206
|
+
createdAt: n.createdAt,
|
|
207
|
+
updatedAt: n.updatedAt,
|
|
208
|
+
submittedAt: n.submittedAt,
|
|
209
|
+
reviewedAt: n.reviewedAt,
|
|
210
|
+
reviewNotes: n.reviewNotes,
|
|
211
|
+
rejectedReason: n.rejectedReason,
|
|
212
|
+
publishedAt: n.publishedAt
|
|
213
|
+
}), N([n.icon, ...n.screenshots ?? []].filter((e) => !!e).map((e) => ({
|
|
158
214
|
id: crypto.randomUUID(),
|
|
159
215
|
url: e,
|
|
160
216
|
downloadUrl: e,
|
|
161
217
|
uploading: !1
|
|
162
218
|
})));
|
|
163
219
|
} catch (t) {
|
|
164
|
-
e ||
|
|
220
|
+
e || T(t instanceof Error ? t.message : "Failed to load product");
|
|
165
221
|
} finally {
|
|
166
|
-
e ||
|
|
222
|
+
e || C(!1);
|
|
167
223
|
}
|
|
168
224
|
})(), () => {
|
|
169
225
|
e = !0;
|
|
170
226
|
};
|
|
171
227
|
}, [
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
228
|
+
x,
|
|
229
|
+
S,
|
|
230
|
+
b
|
|
175
231
|
]);
|
|
176
|
-
let
|
|
177
|
-
|
|
232
|
+
let G = (e, t) => {
|
|
233
|
+
j((n) => ({
|
|
178
234
|
...n,
|
|
179
235
|
[e]: t
|
|
180
236
|
}));
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
},
|
|
184
|
-
|
|
185
|
-
|
|
237
|
+
}, K = (e) => (t) => {
|
|
238
|
+
G(e, t.target.checked);
|
|
239
|
+
}, q = l((e, t) => {
|
|
240
|
+
L(t).then((t) => {
|
|
241
|
+
N((n) => n.map((n) => n.id === e ? {
|
|
186
242
|
...n,
|
|
187
243
|
uploading: !1,
|
|
188
244
|
downloadUrl: t.downloadUrl,
|
|
189
245
|
error: void 0
|
|
190
246
|
} : n));
|
|
191
247
|
}).catch((t) => {
|
|
192
|
-
|
|
248
|
+
N((n) => n.map((n) => n.id === e ? {
|
|
193
249
|
...n,
|
|
194
250
|
uploading: !1,
|
|
195
251
|
error: t instanceof Error ? t.message : "Upload failed"
|
|
196
252
|
} : n));
|
|
197
253
|
});
|
|
198
|
-
}, [
|
|
254
|
+
}, [L]), J = l((e) => {
|
|
199
255
|
let t = Array.from(e).filter((e) => e.type.startsWith("image/")).map((e) => ({
|
|
200
256
|
id: crypto.randomUUID(),
|
|
201
257
|
file: e,
|
|
202
258
|
url: URL.createObjectURL(e),
|
|
203
259
|
uploading: !0
|
|
204
260
|
}));
|
|
205
|
-
|
|
206
|
-
}, [
|
|
207
|
-
e.target.files &&
|
|
208
|
-
},
|
|
209
|
-
e.preventDefault(),
|
|
210
|
-
},
|
|
211
|
-
e.preventDefault(),
|
|
212
|
-
},
|
|
213
|
-
|
|
261
|
+
N((e) => [...e, ...t]), t.forEach((e) => q(e.id, e.file));
|
|
262
|
+
}, [q]), Me = (e) => {
|
|
263
|
+
e.target.files && J(e.target.files), e.target.value = "";
|
|
264
|
+
}, Ne = (e) => {
|
|
265
|
+
e.preventDefault(), F(!1), e.dataTransfer.files && J(e.dataTransfer.files);
|
|
266
|
+
}, Pe = (e) => {
|
|
267
|
+
e.preventDefault(), F(!0);
|
|
268
|
+
}, Fe = () => F(!1), Y = (e) => {
|
|
269
|
+
N((t) => {
|
|
214
270
|
let n = t.find((t) => t.id === e);
|
|
215
271
|
return n?.file && URL.revokeObjectURL(n.url), t.filter((t) => t.id !== e);
|
|
216
272
|
});
|
|
217
|
-
},
|
|
218
|
-
let t =
|
|
219
|
-
t?.file && (
|
|
273
|
+
}, Ie = (e) => {
|
|
274
|
+
let t = M.find((t) => t.id === e);
|
|
275
|
+
t?.file && (N((t) => t.map((t) => t.id === e ? {
|
|
220
276
|
...t,
|
|
221
277
|
uploading: !0,
|
|
222
278
|
error: void 0
|
|
223
|
-
} : t)),
|
|
224
|
-
},
|
|
225
|
-
if (!(!
|
|
226
|
-
|
|
279
|
+
} : t)), q(e, t.file));
|
|
280
|
+
}, X = async (e = !1) => {
|
|
281
|
+
if (!(!U || R || !x)) {
|
|
282
|
+
z(!0), V(null), H(!1);
|
|
227
283
|
try {
|
|
228
|
-
let t =
|
|
229
|
-
await
|
|
230
|
-
id:
|
|
284
|
+
let t = A.tags.split(",").map((e) => e.trim()).filter(Boolean), n = M.map((e) => e.downloadUrl).filter((e) => !!e), r = A.length.trim() || A.width.trim() || A.height.trim();
|
|
285
|
+
await W(xe, {
|
|
286
|
+
id: x,
|
|
231
287
|
input: {
|
|
232
|
-
name:
|
|
233
|
-
description:
|
|
234
|
-
longDescription:
|
|
235
|
-
price: parseFloat(
|
|
236
|
-
currency:
|
|
288
|
+
name: A.name.trim(),
|
|
289
|
+
description: A.shortDescription.trim(),
|
|
290
|
+
longDescription: A.longDescription.trim() || null,
|
|
291
|
+
price: parseFloat(A.price),
|
|
292
|
+
currency: A.currency,
|
|
237
293
|
tags: t.length > 0 ? t : null,
|
|
238
|
-
stockQuantity: parseInt(
|
|
239
|
-
sku:
|
|
240
|
-
trackInventory:
|
|
241
|
-
allowBackorder:
|
|
242
|
-
lowStockThreshold:
|
|
243
|
-
requiresShipping:
|
|
244
|
-
weight:
|
|
245
|
-
weightUnit:
|
|
246
|
-
length:
|
|
247
|
-
width:
|
|
248
|
-
height:
|
|
249
|
-
dimensionUnit:
|
|
250
|
-
brand:
|
|
251
|
-
manufacturer:
|
|
252
|
-
countryOfOrigin:
|
|
253
|
-
warrantyInfo:
|
|
254
|
-
returnPolicy:
|
|
294
|
+
stockQuantity: parseInt(A.stockQuantity, 10),
|
|
295
|
+
sku: A.sku.trim() || null,
|
|
296
|
+
trackInventory: A.trackInventory,
|
|
297
|
+
allowBackorder: A.allowBackorder,
|
|
298
|
+
lowStockThreshold: A.lowStockThreshold.trim() ? parseInt(A.lowStockThreshold, 10) : null,
|
|
299
|
+
requiresShipping: A.requiresShipping,
|
|
300
|
+
weight: A.requiresShipping && A.weightKg.trim() ? parseFloat(A.weightKg) : null,
|
|
301
|
+
weightUnit: A.requiresShipping && A.weightKg.trim() ? A.weightUnit : null,
|
|
302
|
+
length: A.requiresShipping && A.length.trim() ? parseFloat(A.length) : null,
|
|
303
|
+
width: A.requiresShipping && A.width.trim() ? parseFloat(A.width) : null,
|
|
304
|
+
height: A.requiresShipping && A.height.trim() ? parseFloat(A.height) : null,
|
|
305
|
+
dimensionUnit: A.requiresShipping && r ? A.dimensionUnit : null,
|
|
306
|
+
brand: A.brand.trim() || null,
|
|
307
|
+
manufacturer: A.manufacturer.trim() || null,
|
|
308
|
+
countryOfOrigin: A.countryOfOrigin.trim() || null,
|
|
309
|
+
warrantyInfo: A.warrantyInfo.trim() || null,
|
|
310
|
+
returnPolicy: A.returnPolicy.trim() || null,
|
|
255
311
|
icon: n[0] ?? null,
|
|
256
312
|
screenshots: n.length > 1 ? n.slice(1) : null
|
|
257
313
|
}
|
|
258
|
-
}), e && await
|
|
259
|
-
id:
|
|
314
|
+
}), e && await W(Se, {
|
|
315
|
+
id: x,
|
|
260
316
|
notes: "Resubmitted after edits"
|
|
261
|
-
}),
|
|
262
|
-
|
|
317
|
+
}), H(!0), setTimeout(() => {
|
|
318
|
+
h?.(`${_}/seller/items`);
|
|
263
319
|
}, 1500);
|
|
264
320
|
} catch (e) {
|
|
265
|
-
|
|
321
|
+
V(e instanceof Error ? e.message : "Save failed. Please try again.");
|
|
266
322
|
} finally {
|
|
267
|
-
|
|
323
|
+
z(!1);
|
|
268
324
|
}
|
|
269
325
|
}
|
|
270
326
|
};
|
|
271
|
-
if (
|
|
327
|
+
if (De) return /* @__PURE__ */ p(n, {
|
|
272
328
|
title: "Edit Item",
|
|
273
329
|
backLink: "/seller/items",
|
|
274
330
|
backLabel: "Back to My Items",
|
|
275
|
-
children: /* @__PURE__ */
|
|
331
|
+
children: /* @__PURE__ */ p("div", {
|
|
276
332
|
className: "flex items-center justify-center py-20",
|
|
277
|
-
children: /* @__PURE__ */
|
|
333
|
+
children: /* @__PURE__ */ p(d, { className: "h-8 w-8 animate-spin text-text-secondary" })
|
|
278
334
|
})
|
|
279
335
|
});
|
|
280
|
-
if (
|
|
336
|
+
if (w) return /* @__PURE__ */ p(n, {
|
|
281
337
|
title: "Edit Item",
|
|
282
338
|
backLink: "/seller/items",
|
|
283
339
|
backLabel: "Back to My Items",
|
|
284
|
-
children: /* @__PURE__ */
|
|
340
|
+
children: /* @__PURE__ */ m("div", {
|
|
285
341
|
className: "flex items-center gap-3 rounded-lg border border-status-error-border/50 bg-status-error-bg/10 px-4 py-3 text-sm",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ p(re, {
|
|
287
343
|
size: 16,
|
|
288
344
|
className: "shrink-0 text-status-error-text"
|
|
289
|
-
}), /* @__PURE__ */
|
|
345
|
+
}), /* @__PURE__ */ p("span", {
|
|
290
346
|
className: "text-status-error-text",
|
|
291
|
-
children:
|
|
347
|
+
children: w
|
|
292
348
|
})]
|
|
293
349
|
})
|
|
294
350
|
});
|
|
295
|
-
let
|
|
296
|
-
return /* @__PURE__ */
|
|
297
|
-
title:
|
|
298
|
-
|
|
351
|
+
let Z = E === "DRAFT" || E === "REJECTED", Q = M.find((e) => e.downloadUrl) ?? M[0], $ = E ? ye[E] : void 0;
|
|
352
|
+
return /* @__PURE__ */ p(n, {
|
|
353
|
+
title: /* @__PURE__ */ m("div", {
|
|
354
|
+
className: "flex items-center gap-3",
|
|
355
|
+
children: [Q ? /* @__PURE__ */ p("img", {
|
|
356
|
+
src: Q.url,
|
|
357
|
+
alt: "",
|
|
358
|
+
className: "h-10 w-10 shrink-0 rounded-input border border-border-subtle object-cover"
|
|
359
|
+
}) : /* @__PURE__ */ p("div", {
|
|
360
|
+
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-input border border-border-subtle bg-bg-sunken",
|
|
361
|
+
children: /* @__PURE__ */ p(ce, {
|
|
362
|
+
size: 16,
|
|
363
|
+
className: "text-text-muted"
|
|
364
|
+
})
|
|
365
|
+
}), /* @__PURE__ */ p("span", { children: A.name || "Item" })]
|
|
366
|
+
}),
|
|
367
|
+
description: A.shortDescription || void 0,
|
|
368
|
+
purpose: "Everything about this listing in one place — its performance, its store presence, and its editable details. Use the tabs to review or update it.",
|
|
299
369
|
backLink: "/seller/items",
|
|
300
370
|
backLabel: "Back to My Items",
|
|
301
|
-
|
|
302
|
-
|
|
371
|
+
actions: D === "overview" ? /* @__PURE__ */ m("button", {
|
|
372
|
+
type: "button",
|
|
373
|
+
onClick: () => O("edit"),
|
|
374
|
+
className: "inline-flex items-center gap-2 rounded-button bg-action-primary-bg px-5 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
|
|
375
|
+
children: [/* @__PURE__ */ p(se, { size: 15 }), "Edit Listing"]
|
|
376
|
+
}) : void 0,
|
|
377
|
+
children: /* @__PURE__ */ m("div", {
|
|
378
|
+
className: "space-y-6",
|
|
303
379
|
children: [
|
|
304
|
-
|
|
380
|
+
Ae && /* @__PURE__ */ p("div", {
|
|
305
381
|
className: "rounded-card border border-status-success-text/30 bg-status-success-bg-subtle px-4 py-3 text-sm text-status-success-text",
|
|
306
382
|
children: "Saved successfully! Redirecting to your items..."
|
|
307
383
|
}),
|
|
308
|
-
|
|
384
|
+
B && /* @__PURE__ */ p("div", {
|
|
309
385
|
className: "rounded-card border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
310
|
-
children:
|
|
386
|
+
children: B
|
|
311
387
|
}),
|
|
312
|
-
|
|
313
|
-
className: "flex items-
|
|
388
|
+
/* @__PURE__ */ m("div", {
|
|
389
|
+
className: "flex flex-wrap items-center gap-2",
|
|
314
390
|
children: [
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
|
|
317
|
-
|
|
391
|
+
$ && /* @__PURE__ */ p("span", {
|
|
392
|
+
className: t("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium", $.className),
|
|
393
|
+
children: $.label
|
|
318
394
|
}),
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
className: "font-medium text-text-primary",
|
|
323
|
-
children: A.replace(/_/g, " ")
|
|
395
|
+
/* @__PURE__ */ p("span", {
|
|
396
|
+
className: "text-sm text-text-secondary",
|
|
397
|
+
children: ve[k?.type ?? ""] || k?.type
|
|
324
398
|
}),
|
|
325
|
-
|
|
326
|
-
className: "
|
|
327
|
-
children:
|
|
399
|
+
k?.category && /* @__PURE__ */ p("span", {
|
|
400
|
+
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
|
|
401
|
+
children: k.category
|
|
328
402
|
})
|
|
329
403
|
]
|
|
330
404
|
}),
|
|
331
|
-
/* @__PURE__ */ m(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
className: "
|
|
405
|
+
E === "PENDING_REVIEW" && /* @__PURE__ */ m("div", {
|
|
406
|
+
className: "flex items-start gap-3 rounded-lg border border-border-subtle bg-status-warning-bg-subtle p-4",
|
|
407
|
+
children: [/* @__PURE__ */ p(oe, {
|
|
408
|
+
size: 18,
|
|
409
|
+
className: "text-status-warning-text mt-0.5 flex-shrink-0"
|
|
410
|
+
}), /* @__PURE__ */ m("div", {
|
|
411
|
+
className: "text-sm",
|
|
412
|
+
children: [/* @__PURE__ */ p("p", {
|
|
413
|
+
className: "font-medium text-status-warning-text",
|
|
414
|
+
children: "Under Review"
|
|
415
|
+
}), /* @__PURE__ */ m("p", {
|
|
416
|
+
className: "mt-0.5 text-text-secondary",
|
|
417
|
+
children: ["Your listing is being reviewed by our team. You'll be notified of the outcome.", k?.submittedAt && /* @__PURE__ */ m("span", {
|
|
418
|
+
className: "ml-1",
|
|
419
|
+
children: [
|
|
420
|
+
"Submitted",
|
|
421
|
+
" ",
|
|
422
|
+
new Date(k.submittedAt).toLocaleDateString(),
|
|
423
|
+
"."
|
|
424
|
+
]
|
|
425
|
+
})]
|
|
426
|
+
})]
|
|
427
|
+
})]
|
|
428
|
+
}),
|
|
429
|
+
E === "REJECTED" && /* @__PURE__ */ m("div", {
|
|
430
|
+
className: "flex items-start gap-3 rounded-lg border border-status-error-bg bg-status-error-bg-subtle p-4",
|
|
431
|
+
children: [/* @__PURE__ */ p(pe, {
|
|
432
|
+
size: 18,
|
|
433
|
+
className: "text-status-error-text mt-0.5 flex-shrink-0"
|
|
434
|
+
}), /* @__PURE__ */ m("div", {
|
|
435
|
+
className: "text-sm",
|
|
336
436
|
children: [
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
value: M.name,
|
|
341
|
-
onChange: (e) => q("name", e.target.value),
|
|
342
|
-
placeholder: "e.g. Wireless Ergonomic Keyboard",
|
|
343
|
-
maxLength: 120
|
|
437
|
+
/* @__PURE__ */ p("p", {
|
|
438
|
+
className: "font-medium text-status-error-text",
|
|
439
|
+
children: "Review Rejected"
|
|
344
440
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
value: M.shortDescription,
|
|
349
|
-
onChange: (e) => q("shortDescription", e.target.value),
|
|
350
|
-
placeholder: "One-line summary shown on the store card",
|
|
351
|
-
maxLength: 160,
|
|
352
|
-
hint: `${M.shortDescription.length}/160`
|
|
441
|
+
/* @__PURE__ */ p("p", {
|
|
442
|
+
className: "mt-0.5 text-text-secondary",
|
|
443
|
+
children: k?.rejectedReason || k?.reviewNotes || "Your submission was not approved. Please review the feedback, update your listing, and re-submit."
|
|
353
444
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
placeholder: "Detailed product description, features, specs…"
|
|
445
|
+
/* @__PURE__ */ p("button", {
|
|
446
|
+
type: "button",
|
|
447
|
+
onClick: () => O("edit"),
|
|
448
|
+
className: "mt-2 inline-flex items-center gap-1 text-xs font-medium text-primary underline",
|
|
449
|
+
children: "Edit listing and re-submit →"
|
|
360
450
|
})
|
|
361
451
|
]
|
|
452
|
+
})]
|
|
453
|
+
}),
|
|
454
|
+
E === "PUBLISHED" && /* @__PURE__ */ m("div", {
|
|
455
|
+
className: "flex items-start gap-3 rounded-lg border border-status-success-bg bg-status-success-bg-subtle p-4",
|
|
456
|
+
children: [/* @__PURE__ */ p(ae, {
|
|
457
|
+
size: 18,
|
|
458
|
+
className: "text-status-success-text mt-0.5 flex-shrink-0"
|
|
459
|
+
}), /* @__PURE__ */ m("div", {
|
|
460
|
+
className: "text-sm",
|
|
461
|
+
children: [/* @__PURE__ */ p("p", {
|
|
462
|
+
className: "font-medium text-status-success-text",
|
|
463
|
+
children: "Live in the Store"
|
|
464
|
+
}), /* @__PURE__ */ p("p", {
|
|
465
|
+
className: "mt-0.5 text-text-secondary",
|
|
466
|
+
children: "Your listing is published and visible to buyers in the marketplace."
|
|
467
|
+
})]
|
|
468
|
+
})]
|
|
469
|
+
}),
|
|
470
|
+
/* @__PURE__ */ p("div", {
|
|
471
|
+
className: "border-b",
|
|
472
|
+
children: /* @__PURE__ */ p("nav", {
|
|
473
|
+
className: "-mb-px flex gap-4 overflow-x-auto",
|
|
474
|
+
role: "tablist",
|
|
475
|
+
"aria-label": "Item sections",
|
|
476
|
+
children: [{
|
|
477
|
+
id: "overview",
|
|
478
|
+
label: "Overview"
|
|
479
|
+
}, {
|
|
480
|
+
id: "edit",
|
|
481
|
+
label: "Edit Listing"
|
|
482
|
+
}].map((e) => /* @__PURE__ */ p("button", {
|
|
483
|
+
id: `item-tab-${e.id}`,
|
|
484
|
+
role: "tab",
|
|
485
|
+
"aria-selected": D === e.id,
|
|
486
|
+
"aria-controls": `item-panel-${e.id}`,
|
|
487
|
+
onClick: () => O(e.id),
|
|
488
|
+
className: t("flex items-center gap-2 border-b-2 px-1 py-3 text-sm font-medium transition-colors", D === e.id ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary hover:border-muted-foreground"),
|
|
489
|
+
children: e.label
|
|
490
|
+
}, e.id))
|
|
362
491
|
})
|
|
363
492
|
}),
|
|
364
|
-
/* @__PURE__ */ m(
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
493
|
+
D === "overview" && /* @__PURE__ */ m("div", {
|
|
494
|
+
id: "item-panel-overview",
|
|
495
|
+
role: "tabpanel",
|
|
496
|
+
"aria-labelledby": "item-tab-overview",
|
|
497
|
+
className: "grid gap-6 lg:grid-cols-3",
|
|
498
|
+
children: [/* @__PURE__ */ m("div", {
|
|
499
|
+
className: "lg:col-span-2 space-y-6",
|
|
500
|
+
children: [
|
|
501
|
+
/* @__PURE__ */ p(he, { children: /* @__PURE__ */ m("div", {
|
|
502
|
+
className: "grid gap-4 sm:grid-cols-4",
|
|
503
|
+
children: [
|
|
504
|
+
/* @__PURE__ */ p(v, {
|
|
505
|
+
label: "Price",
|
|
506
|
+
value: `${A.currency} ${Number(A.price || 0).toFixed(2)}`
|
|
507
|
+
}),
|
|
508
|
+
/* @__PURE__ */ p(v, {
|
|
509
|
+
label: "Stock",
|
|
510
|
+
value: A.stockQuantity || "0"
|
|
511
|
+
}),
|
|
512
|
+
/* @__PURE__ */ p(v, {
|
|
513
|
+
label: "Views",
|
|
514
|
+
value: (k?.viewCount ?? 0).toLocaleString()
|
|
515
|
+
}),
|
|
516
|
+
/* @__PURE__ */ p(v, {
|
|
517
|
+
label: "Rating",
|
|
518
|
+
value: k?.rating ? `${k.rating.toFixed(1)} ★` : "N/A"
|
|
519
|
+
})
|
|
520
|
+
]
|
|
521
|
+
}) }),
|
|
522
|
+
/* @__PURE__ */ p(r, {
|
|
523
|
+
title: "Product Images",
|
|
524
|
+
children: M.length > 0 ? /* @__PURE__ */ p("div", {
|
|
525
|
+
className: "flex flex-wrap gap-3",
|
|
526
|
+
children: M.map((e, t) => /* @__PURE__ */ p("img", {
|
|
527
|
+
src: e.url,
|
|
528
|
+
alt: `Product image ${t + 1}`,
|
|
529
|
+
className: "h-24 w-24 rounded-input border border-border-subtle object-cover"
|
|
530
|
+
}, e.id))
|
|
531
|
+
}) : /* @__PURE__ */ p("p", {
|
|
532
|
+
className: "text-sm text-text-secondary",
|
|
533
|
+
children: "No images uploaded yet."
|
|
534
|
+
})
|
|
535
|
+
}),
|
|
536
|
+
/* @__PURE__ */ m(r, {
|
|
537
|
+
title: "Description",
|
|
538
|
+
children: [A.shortDescription && /* @__PURE__ */ p("p", {
|
|
539
|
+
className: "text-sm font-medium text-text-primary",
|
|
540
|
+
children: A.shortDescription
|
|
541
|
+
}), A.longDescription ? /* @__PURE__ */ p("p", {
|
|
542
|
+
className: "mt-2 whitespace-pre-wrap text-sm text-text-secondary",
|
|
543
|
+
children: A.longDescription
|
|
544
|
+
}) : !A.shortDescription && /* @__PURE__ */ p("p", {
|
|
545
|
+
className: "text-sm text-text-secondary",
|
|
546
|
+
children: "No description provided."
|
|
547
|
+
})]
|
|
548
|
+
}),
|
|
549
|
+
A.tags && /* @__PURE__ */ p(r, {
|
|
550
|
+
title: "Tags",
|
|
551
|
+
children: /* @__PURE__ */ p("div", {
|
|
552
|
+
className: "flex flex-wrap gap-2",
|
|
553
|
+
children: A.tags.split(",").map((e) => e.trim()).filter(Boolean).map((e) => /* @__PURE__ */ p("span", {
|
|
554
|
+
className: "rounded-full bg-action-primary-bg/10 px-3 py-1 text-xs font-medium text-primary",
|
|
555
|
+
children: e
|
|
556
|
+
}, e))
|
|
557
|
+
})
|
|
558
|
+
})
|
|
559
|
+
]
|
|
560
|
+
}), /* @__PURE__ */ m("div", {
|
|
561
|
+
className: "space-y-6",
|
|
562
|
+
children: [/* @__PURE__ */ p(r, {
|
|
563
|
+
title: "Details",
|
|
564
|
+
children: /* @__PURE__ */ p(i, { items: [
|
|
565
|
+
{
|
|
566
|
+
label: "Item ID",
|
|
567
|
+
value: /* @__PURE__ */ p("code", {
|
|
568
|
+
className: "text-xs",
|
|
569
|
+
children: x
|
|
570
|
+
})
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
label: "Slug",
|
|
574
|
+
value: k?.slug ?? "—"
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
label: "SKU",
|
|
578
|
+
value: A.sku || "—"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
label: "Brand",
|
|
582
|
+
value: A.brand || "—"
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
label: "Created",
|
|
586
|
+
value: k?.createdAt ? new Date(k.createdAt).toLocaleDateString() : "—"
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
label: "Updated",
|
|
590
|
+
value: k?.updatedAt ? new Date(k.updatedAt).toLocaleDateString() : "—"
|
|
591
|
+
},
|
|
592
|
+
...k?.publishedAt ? [{
|
|
593
|
+
label: "Published",
|
|
594
|
+
value: new Date(k.publishedAt).toLocaleDateString()
|
|
595
|
+
}] : []
|
|
596
|
+
] })
|
|
597
|
+
}), /* @__PURE__ */ p(r, {
|
|
598
|
+
title: "Inventory & Shipping",
|
|
599
|
+
children: /* @__PURE__ */ p(i, { items: [
|
|
600
|
+
{
|
|
601
|
+
label: "Stock quantity",
|
|
602
|
+
value: A.stockQuantity || "0"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
label: "Track inventory",
|
|
606
|
+
value: A.trackInventory ? "Yes" : "No"
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
label: "Requires shipping",
|
|
610
|
+
value: A.requiresShipping ? "Yes" : "No"
|
|
611
|
+
},
|
|
612
|
+
...A.requiresShipping && A.weightKg ? [{
|
|
613
|
+
label: "Weight",
|
|
614
|
+
value: `${A.weightKg} ${A.weightUnit.toLowerCase()}`
|
|
615
|
+
}] : []
|
|
616
|
+
] })
|
|
617
|
+
})]
|
|
618
|
+
})]
|
|
619
|
+
}),
|
|
620
|
+
D === "edit" && /* @__PURE__ */ m("div", {
|
|
621
|
+
id: "item-panel-edit",
|
|
622
|
+
role: "tabpanel",
|
|
623
|
+
"aria-labelledby": "item-tab-edit",
|
|
624
|
+
className: "space-y-8 max-w-3xl",
|
|
625
|
+
children: [
|
|
626
|
+
E && /* @__PURE__ */ m("div", {
|
|
627
|
+
className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
|
|
375
628
|
children: [
|
|
376
|
-
/* @__PURE__ */
|
|
377
|
-
size:
|
|
378
|
-
className:
|
|
629
|
+
/* @__PURE__ */ p(le, {
|
|
630
|
+
size: 13,
|
|
631
|
+
className: "mt-0.5 shrink-0 text-text-muted"
|
|
379
632
|
}),
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}), /* @__PURE__ */ m("p", {
|
|
386
|
-
className: "text-xs text-text-muted",
|
|
387
|
-
children: "or click to browse — accepts any image format, multiple files"
|
|
388
|
-
})]
|
|
633
|
+
"Current status:",
|
|
634
|
+
" ",
|
|
635
|
+
/* @__PURE__ */ p("span", {
|
|
636
|
+
className: "font-medium text-text-primary",
|
|
637
|
+
children: E.replace(/_/g, " ")
|
|
389
638
|
}),
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
accept: "image/*",
|
|
394
|
-
multiple: !0,
|
|
395
|
-
className: "sr-only",
|
|
396
|
-
onChange: ge
|
|
639
|
+
Z && /* @__PURE__ */ p("span", {
|
|
640
|
+
className: "ml-1",
|
|
641
|
+
children: "— use \"Save & Resubmit\" to send it for review again."
|
|
397
642
|
})
|
|
398
643
|
]
|
|
399
|
-
}),
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
644
|
+
}),
|
|
645
|
+
/* @__PURE__ */ p(r, {
|
|
646
|
+
title: "Basic Information",
|
|
647
|
+
description: "Core details shown in the store listing.",
|
|
648
|
+
children: /* @__PURE__ */ m("div", {
|
|
649
|
+
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
650
|
+
children: [
|
|
651
|
+
/* @__PURE__ */ p(o, {
|
|
652
|
+
label: "Name",
|
|
653
|
+
required: !0,
|
|
654
|
+
value: A.name,
|
|
655
|
+
onChange: (e) => G("name", e.target.value),
|
|
656
|
+
placeholder: "e.g. Wireless Ergonomic Keyboard",
|
|
657
|
+
maxLength: 120
|
|
658
|
+
}),
|
|
659
|
+
/* @__PURE__ */ p(o, {
|
|
660
|
+
label: "Short Description",
|
|
661
|
+
required: !0,
|
|
662
|
+
value: A.shortDescription,
|
|
663
|
+
onChange: (e) => G("shortDescription", e.target.value),
|
|
664
|
+
placeholder: "One-line summary shown on the store card",
|
|
665
|
+
maxLength: 160,
|
|
666
|
+
hint: `${A.shortDescription.length}/160`
|
|
667
|
+
}),
|
|
668
|
+
/* @__PURE__ */ p(c, {
|
|
669
|
+
label: "Long Description",
|
|
670
|
+
value: A.longDescription,
|
|
671
|
+
onChange: (e) => G("longDescription", e.target.value),
|
|
672
|
+
rows: 5,
|
|
673
|
+
placeholder: "Detailed product description, features, specs…"
|
|
674
|
+
})
|
|
675
|
+
]
|
|
676
|
+
})
|
|
677
|
+
}),
|
|
678
|
+
/* @__PURE__ */ p(r, {
|
|
679
|
+
title: "Product Images",
|
|
680
|
+
description: "The first image is used as the main icon.",
|
|
681
|
+
children: /* @__PURE__ */ m("div", {
|
|
682
|
+
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-4",
|
|
683
|
+
children: [/* @__PURE__ */ m("div", {
|
|
684
|
+
onDrop: Ne,
|
|
685
|
+
onDragOver: Pe,
|
|
686
|
+
onDragLeave: Fe,
|
|
687
|
+
onClick: () => I.current?.click(),
|
|
688
|
+
className: t("flex flex-col items-center justify-center gap-3 rounded-input border-2 border-dashed px-6 py-10 cursor-pointer transition-colors", P ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-subtle hover:border-border-strong"),
|
|
405
689
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
className: t("h-20 w-20 rounded-input object-cover border", n.error ? "border-status-error-text/50" : "border-border-subtle")
|
|
410
|
-
}),
|
|
411
|
-
n.uploading && /* @__PURE__ */ m("div", {
|
|
412
|
-
className: "absolute inset-0 flex items-center justify-center rounded-input bg-bg-overlay",
|
|
413
|
-
children: /* @__PURE__ */ m(f, {
|
|
414
|
-
size: 16,
|
|
415
|
-
className: "animate-spin text-white"
|
|
416
|
-
})
|
|
417
|
-
}),
|
|
418
|
-
n.error && /* @__PURE__ */ h("button", {
|
|
419
|
-
type: "button",
|
|
420
|
-
onClick: (e) => {
|
|
421
|
-
e.stopPropagation(), be(n.id);
|
|
422
|
-
},
|
|
423
|
-
title: `${n.error} — click to retry`,
|
|
424
|
-
className: "absolute inset-0 flex flex-col items-center justify-center gap-0.5 rounded-input bg-status-error-bg/80 text-status-error-text",
|
|
425
|
-
children: [/* @__PURE__ */ m(d, { size: 14 }), /* @__PURE__ */ m(ie, { size: 11 })]
|
|
690
|
+
/* @__PURE__ */ p(de, {
|
|
691
|
+
size: 28,
|
|
692
|
+
className: P ? "text-action-primary-bg" : "text-text-muted"
|
|
426
693
|
}),
|
|
427
|
-
|
|
428
|
-
className: "
|
|
429
|
-
children: "
|
|
694
|
+
/* @__PURE__ */ m("div", {
|
|
695
|
+
className: "text-center space-y-1",
|
|
696
|
+
children: [/* @__PURE__ */ p("p", {
|
|
697
|
+
className: "text-sm font-medium text-text-primary",
|
|
698
|
+
children: "Drag and drop images here"
|
|
699
|
+
}), /* @__PURE__ */ p("p", {
|
|
700
|
+
className: "text-xs text-text-muted",
|
|
701
|
+
children: "or click to browse — accepts any image format, multiple files"
|
|
702
|
+
})]
|
|
430
703
|
}),
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
className: "
|
|
437
|
-
|
|
438
|
-
children: /* @__PURE__ */ m(oe, { size: 11 })
|
|
704
|
+
/* @__PURE__ */ p("input", {
|
|
705
|
+
ref: I,
|
|
706
|
+
type: "file",
|
|
707
|
+
accept: "image/*",
|
|
708
|
+
multiple: !0,
|
|
709
|
+
className: "sr-only",
|
|
710
|
+
onChange: Me
|
|
439
711
|
})
|
|
440
712
|
]
|
|
441
|
-
},
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
children: [/* @__PURE__ */ m(a, {
|
|
486
|
-
label: "Stock Quantity",
|
|
487
|
-
required: !0,
|
|
488
|
-
type: "number",
|
|
489
|
-
value: M.stockQuantity,
|
|
490
|
-
onChange: (e) => q("stockQuantity", e.target.value),
|
|
491
|
-
min: 0,
|
|
492
|
-
step: 1
|
|
493
|
-
}), /* @__PURE__ */ m(a, {
|
|
494
|
-
label: "SKU",
|
|
495
|
-
value: M.sku,
|
|
496
|
-
onChange: (e) => q("sku", e.target.value),
|
|
497
|
-
placeholder: "e.g. KB-WL-001",
|
|
498
|
-
hint: "Your internal stock-keeping unit reference."
|
|
713
|
+
}), M.length > 0 && /* @__PURE__ */ p("div", {
|
|
714
|
+
className: "flex flex-wrap gap-3",
|
|
715
|
+
children: (() => {
|
|
716
|
+
let e = M.find((e) => e.downloadUrl)?.id;
|
|
717
|
+
return M.map((n, r) => /* @__PURE__ */ m("div", {
|
|
718
|
+
className: "relative group",
|
|
719
|
+
children: [
|
|
720
|
+
/* @__PURE__ */ p("img", {
|
|
721
|
+
src: n.url,
|
|
722
|
+
alt: `Product image ${r + 1}`,
|
|
723
|
+
className: t("h-20 w-20 rounded-input object-cover border", n.error ? "border-status-error-text/50" : "border-border-subtle")
|
|
724
|
+
}),
|
|
725
|
+
n.uploading && /* @__PURE__ */ p("div", {
|
|
726
|
+
className: "absolute inset-0 flex items-center justify-center rounded-input bg-bg-overlay",
|
|
727
|
+
children: /* @__PURE__ */ p(d, {
|
|
728
|
+
size: 16,
|
|
729
|
+
className: "animate-spin text-white"
|
|
730
|
+
})
|
|
731
|
+
}),
|
|
732
|
+
n.error && /* @__PURE__ */ m("button", {
|
|
733
|
+
type: "button",
|
|
734
|
+
onClick: (e) => {
|
|
735
|
+
e.stopPropagation(), Ie(n.id);
|
|
736
|
+
},
|
|
737
|
+
title: `${n.error} — click to retry`,
|
|
738
|
+
className: "absolute inset-0 flex flex-col items-center justify-center gap-0.5 rounded-input bg-status-error-bg/80 text-status-error-text",
|
|
739
|
+
children: [/* @__PURE__ */ p(ie, { size: 14 }), /* @__PURE__ */ p(ue, { size: 11 })]
|
|
740
|
+
}),
|
|
741
|
+
n.id === e && /* @__PURE__ */ p("span", {
|
|
742
|
+
className: "absolute bottom-0 left-0 right-0 rounded-b-input bg-bg-surface/80 text-center text-[10px] font-medium py-0.5 text-text-secondary",
|
|
743
|
+
children: "Main"
|
|
744
|
+
}),
|
|
745
|
+
/* @__PURE__ */ p("button", {
|
|
746
|
+
type: "button",
|
|
747
|
+
onClick: (e) => {
|
|
748
|
+
e.stopPropagation(), Y(n.id);
|
|
749
|
+
},
|
|
750
|
+
className: "absolute -top-1.5 -right-1.5 hidden group-hover:flex h-5 w-5 items-center justify-center rounded-full bg-bg-surface border border-border-subtle text-text-muted hover:text-status-error-text hover:border-status-error-text/40 transition-colors",
|
|
751
|
+
"aria-label": "Remove image",
|
|
752
|
+
children: /* @__PURE__ */ p(fe, { size: 11 })
|
|
753
|
+
})
|
|
754
|
+
]
|
|
755
|
+
}, n.id));
|
|
756
|
+
})()
|
|
499
757
|
})]
|
|
500
|
-
}),
|
|
501
|
-
/* @__PURE__ */ m(a, {
|
|
502
|
-
label: "Low Stock Threshold",
|
|
503
|
-
type: "number",
|
|
504
|
-
value: M.lowStockThreshold,
|
|
505
|
-
onChange: (e) => q("lowStockThreshold", e.target.value),
|
|
506
|
-
placeholder: "e.g. 5",
|
|
507
|
-
min: 0,
|
|
508
|
-
step: 1,
|
|
509
|
-
hint: "Get flagged when stock falls to or below this number."
|
|
510
|
-
}),
|
|
511
|
-
/* @__PURE__ */ m(i, {
|
|
512
|
-
label: "Track Inventory",
|
|
513
|
-
description: "Automatically reduce stock when orders are placed.",
|
|
514
|
-
checked: M.trackInventory,
|
|
515
|
-
onChange: J("trackInventory")
|
|
516
|
-
}),
|
|
517
|
-
/* @__PURE__ */ m(i, {
|
|
518
|
-
label: "Allow Backorder",
|
|
519
|
-
description: "Let buyers order even when stock quantity is zero.",
|
|
520
|
-
checked: M.allowBackorder,
|
|
521
|
-
onChange: J("allowBackorder")
|
|
522
758
|
})
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
checked: M.requiresShipping,
|
|
534
|
-
onChange: J("requiresShipping")
|
|
535
|
-
}), M.requiresShipping && /* @__PURE__ */ h(p, { children: [
|
|
536
|
-
/* @__PURE__ */ h("div", {
|
|
537
|
-
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
538
|
-
children: [/* @__PURE__ */ m(a, {
|
|
539
|
-
label: "Weight",
|
|
540
|
-
type: "number",
|
|
541
|
-
value: M.weightKg,
|
|
542
|
-
onChange: (e) => q("weightKg", e.target.value),
|
|
543
|
-
placeholder: "0.0",
|
|
544
|
-
min: 0,
|
|
545
|
-
step: "0.01",
|
|
546
|
-
hint: "Used to calculate shipping costs."
|
|
547
|
-
}), /* @__PURE__ */ m(o, {
|
|
548
|
-
label: "Weight Unit",
|
|
549
|
-
value: M.weightUnit,
|
|
550
|
-
onChange: (e) => q("weightUnit", e.target.value),
|
|
551
|
-
options: _
|
|
552
|
-
})]
|
|
553
|
-
}),
|
|
554
|
-
/* @__PURE__ */ h("div", {
|
|
555
|
-
className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
|
|
556
|
-
children: [
|
|
557
|
-
/* @__PURE__ */ m(a, {
|
|
558
|
-
label: "Length",
|
|
759
|
+
}),
|
|
760
|
+
/* @__PURE__ */ p(r, {
|
|
761
|
+
title: "Pricing",
|
|
762
|
+
children: /* @__PURE__ */ m("div", {
|
|
763
|
+
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
764
|
+
children: [/* @__PURE__ */ m("div", {
|
|
765
|
+
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
766
|
+
children: [/* @__PURE__ */ p(o, {
|
|
767
|
+
label: "Price",
|
|
768
|
+
required: !0,
|
|
559
769
|
type: "number",
|
|
560
|
-
value:
|
|
561
|
-
onChange: (e) =>
|
|
562
|
-
placeholder: "0.
|
|
563
|
-
min:
|
|
770
|
+
value: A.price,
|
|
771
|
+
onChange: (e) => G("price", e.target.value),
|
|
772
|
+
placeholder: "0.00",
|
|
773
|
+
min: .01,
|
|
564
774
|
step: "0.01"
|
|
775
|
+
}), /* @__PURE__ */ p(s, {
|
|
776
|
+
label: "Currency",
|
|
777
|
+
required: !0,
|
|
778
|
+
value: A.currency,
|
|
779
|
+
onChange: (e) => G("currency", e.target.value),
|
|
780
|
+
options: ge,
|
|
781
|
+
placeholder: "Select currency"
|
|
782
|
+
})]
|
|
783
|
+
}), /* @__PURE__ */ p(o, {
|
|
784
|
+
label: "Tags",
|
|
785
|
+
value: A.tags,
|
|
786
|
+
onChange: (e) => G("tags", e.target.value),
|
|
787
|
+
placeholder: "mechanical, wireless, ergonomic",
|
|
788
|
+
hint: "Comma-separated keywords."
|
|
789
|
+
})]
|
|
790
|
+
})
|
|
791
|
+
}),
|
|
792
|
+
/* @__PURE__ */ p(r, {
|
|
793
|
+
title: "Inventory",
|
|
794
|
+
children: /* @__PURE__ */ m("div", {
|
|
795
|
+
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
796
|
+
children: [
|
|
797
|
+
/* @__PURE__ */ m("div", {
|
|
798
|
+
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
799
|
+
children: [/* @__PURE__ */ p(o, {
|
|
800
|
+
label: "Stock Quantity",
|
|
801
|
+
required: !0,
|
|
802
|
+
type: "number",
|
|
803
|
+
value: A.stockQuantity,
|
|
804
|
+
onChange: (e) => G("stockQuantity", e.target.value),
|
|
805
|
+
min: 0,
|
|
806
|
+
step: 1
|
|
807
|
+
}), /* @__PURE__ */ p(o, {
|
|
808
|
+
label: "SKU",
|
|
809
|
+
value: A.sku,
|
|
810
|
+
onChange: (e) => G("sku", e.target.value),
|
|
811
|
+
placeholder: "e.g. KB-WL-001",
|
|
812
|
+
hint: "Your internal stock-keeping unit reference."
|
|
813
|
+
})]
|
|
565
814
|
}),
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
label: "
|
|
815
|
+
/* @__PURE__ */ p(o, {
|
|
816
|
+
label: "Low Stock Threshold",
|
|
568
817
|
type: "number",
|
|
569
|
-
value:
|
|
570
|
-
onChange: (e) =>
|
|
571
|
-
placeholder: "
|
|
818
|
+
value: A.lowStockThreshold,
|
|
819
|
+
onChange: (e) => G("lowStockThreshold", e.target.value),
|
|
820
|
+
placeholder: "e.g. 5",
|
|
572
821
|
min: 0,
|
|
573
|
-
step:
|
|
822
|
+
step: 1,
|
|
823
|
+
hint: "Get flagged when stock falls to or below this number."
|
|
574
824
|
}),
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
label: "
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
onChange: (
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
825
|
+
/* @__PURE__ */ p(a, {
|
|
826
|
+
label: "Track Inventory",
|
|
827
|
+
description: "Automatically reduce stock when orders are placed.",
|
|
828
|
+
checked: A.trackInventory,
|
|
829
|
+
onChange: K("trackInventory")
|
|
830
|
+
}),
|
|
831
|
+
/* @__PURE__ */ p(a, {
|
|
832
|
+
label: "Allow Backorder",
|
|
833
|
+
description: "Let buyers order even when stock quantity is zero.",
|
|
834
|
+
checked: A.allowBackorder,
|
|
835
|
+
onChange: K("allowBackorder")
|
|
583
836
|
})
|
|
584
837
|
]
|
|
585
|
-
}),
|
|
586
|
-
/* @__PURE__ */ m(o, {
|
|
587
|
-
label: "Dimension Unit",
|
|
588
|
-
value: M.dimensionUnit,
|
|
589
|
-
onChange: (e) => q("dimensionUnit", e.target.value),
|
|
590
|
-
options: v,
|
|
591
|
-
hint: "Applies to length, width, and height above."
|
|
592
838
|
})
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
839
|
+
}),
|
|
840
|
+
/* @__PURE__ */ p(r, {
|
|
841
|
+
title: "Shipping",
|
|
842
|
+
children: /* @__PURE__ */ m("div", {
|
|
843
|
+
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
844
|
+
children: [/* @__PURE__ */ p(a, {
|
|
845
|
+
label: "Requires Shipping",
|
|
846
|
+
description: "This item will be physically shipped to the buyer.",
|
|
847
|
+
checked: A.requiresShipping,
|
|
848
|
+
onChange: K("requiresShipping")
|
|
849
|
+
}), A.requiresShipping && /* @__PURE__ */ m(f, { children: [
|
|
850
|
+
/* @__PURE__ */ m("div", {
|
|
851
|
+
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
852
|
+
children: [/* @__PURE__ */ p(o, {
|
|
853
|
+
label: "Weight",
|
|
854
|
+
type: "number",
|
|
855
|
+
value: A.weightKg,
|
|
856
|
+
onChange: (e) => G("weightKg", e.target.value),
|
|
857
|
+
placeholder: "0.0",
|
|
858
|
+
min: 0,
|
|
859
|
+
step: "0.01",
|
|
860
|
+
hint: "Used to calculate shipping costs."
|
|
861
|
+
}), /* @__PURE__ */ p(s, {
|
|
862
|
+
label: "Weight Unit",
|
|
863
|
+
value: A.weightUnit,
|
|
864
|
+
onChange: (e) => G("weightUnit", e.target.value),
|
|
865
|
+
options: _e
|
|
866
|
+
})]
|
|
867
|
+
}),
|
|
868
|
+
/* @__PURE__ */ m("div", {
|
|
869
|
+
className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
|
|
870
|
+
children: [
|
|
871
|
+
/* @__PURE__ */ p(o, {
|
|
872
|
+
label: "Length",
|
|
873
|
+
type: "number",
|
|
874
|
+
value: A.length,
|
|
875
|
+
onChange: (e) => G("length", e.target.value),
|
|
876
|
+
placeholder: "0.0",
|
|
877
|
+
min: 0,
|
|
878
|
+
step: "0.01"
|
|
879
|
+
}),
|
|
880
|
+
/* @__PURE__ */ p(o, {
|
|
881
|
+
label: "Width",
|
|
882
|
+
type: "number",
|
|
883
|
+
value: A.width,
|
|
884
|
+
onChange: (e) => G("width", e.target.value),
|
|
885
|
+
placeholder: "0.0",
|
|
886
|
+
min: 0,
|
|
887
|
+
step: "0.01"
|
|
888
|
+
}),
|
|
889
|
+
/* @__PURE__ */ p(o, {
|
|
890
|
+
label: "Height",
|
|
891
|
+
type: "number",
|
|
892
|
+
value: A.height,
|
|
893
|
+
onChange: (e) => G("height", e.target.value),
|
|
894
|
+
placeholder: "0.0",
|
|
895
|
+
min: 0,
|
|
896
|
+
step: "0.01"
|
|
897
|
+
})
|
|
898
|
+
]
|
|
899
|
+
}),
|
|
900
|
+
/* @__PURE__ */ p(s, {
|
|
901
|
+
label: "Dimension Unit",
|
|
902
|
+
value: A.dimensionUnit,
|
|
903
|
+
onChange: (e) => G("dimensionUnit", e.target.value),
|
|
904
|
+
options: g,
|
|
905
|
+
hint: "Applies to length, width, and height above."
|
|
906
|
+
})
|
|
907
|
+
] })]
|
|
634
908
|
})
|
|
635
|
-
]
|
|
636
|
-
})
|
|
637
|
-
}),
|
|
638
|
-
/* @__PURE__ */ h("div", {
|
|
639
|
-
className: "flex flex-wrap items-center gap-3 pb-8",
|
|
640
|
-
children: [
|
|
641
|
-
/* @__PURE__ */ m("button", {
|
|
642
|
-
type: "button",
|
|
643
|
-
onClick: () => y?.(`${C}/seller/items`),
|
|
644
|
-
className: "rounded-button border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
645
|
-
children: "Cancel"
|
|
646
909
|
}),
|
|
647
|
-
/* @__PURE__ */
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
910
|
+
/* @__PURE__ */ p(r, {
|
|
911
|
+
title: "Product Details",
|
|
912
|
+
description: "Optional supplemental information for buyers.",
|
|
913
|
+
children: /* @__PURE__ */ m("div", {
|
|
914
|
+
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
915
|
+
children: [
|
|
916
|
+
/* @__PURE__ */ m("div", {
|
|
917
|
+
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
918
|
+
children: [/* @__PURE__ */ p(o, {
|
|
919
|
+
label: "Brand",
|
|
920
|
+
value: A.brand,
|
|
921
|
+
onChange: (e) => G("brand", e.target.value),
|
|
922
|
+
placeholder: "e.g. Logitech"
|
|
923
|
+
}), /* @__PURE__ */ p(o, {
|
|
924
|
+
label: "Manufacturer",
|
|
925
|
+
value: A.manufacturer,
|
|
926
|
+
onChange: (e) => G("manufacturer", e.target.value),
|
|
927
|
+
placeholder: "e.g. Logitech Manufacturing Ltd."
|
|
928
|
+
})]
|
|
929
|
+
}),
|
|
930
|
+
/* @__PURE__ */ p(o, {
|
|
931
|
+
label: "Country of Origin",
|
|
932
|
+
value: A.countryOfOrigin,
|
|
933
|
+
onChange: (e) => G("countryOfOrigin", e.target.value),
|
|
934
|
+
placeholder: "e.g. China"
|
|
935
|
+
}),
|
|
936
|
+
/* @__PURE__ */ p(o, {
|
|
937
|
+
label: "Warranty Info",
|
|
938
|
+
value: A.warrantyInfo,
|
|
939
|
+
onChange: (e) => G("warrantyInfo", e.target.value),
|
|
940
|
+
placeholder: "e.g. 1-year limited manufacturer warranty"
|
|
941
|
+
}),
|
|
942
|
+
/* @__PURE__ */ p(c, {
|
|
943
|
+
label: "Return Policy",
|
|
944
|
+
value: A.returnPolicy,
|
|
945
|
+
onChange: (e) => G("returnPolicy", e.target.value),
|
|
946
|
+
rows: 3,
|
|
947
|
+
placeholder: "e.g. 30-day returns accepted"
|
|
948
|
+
})
|
|
949
|
+
]
|
|
950
|
+
})
|
|
658
951
|
}),
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
952
|
+
/* @__PURE__ */ m("div", {
|
|
953
|
+
className: "flex flex-wrap items-center gap-3 pb-8",
|
|
954
|
+
children: [
|
|
955
|
+
/* @__PURE__ */ p("button", {
|
|
956
|
+
type: "button",
|
|
957
|
+
onClick: () => h?.(`${_}/seller/items`),
|
|
958
|
+
className: "rounded-button border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
959
|
+
children: "Cancel"
|
|
960
|
+
}),
|
|
961
|
+
/* @__PURE__ */ p("button", {
|
|
962
|
+
type: "button",
|
|
963
|
+
onClick: () => void X(!1),
|
|
964
|
+
disabled: !U || R,
|
|
965
|
+
"aria-disabled": !U || R,
|
|
966
|
+
title: U ? void 0 : "Fill in all required fields to continue",
|
|
967
|
+
className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "border border-border-strong bg-bg-surface text-text-primary", "hover:bg-bg-sunken", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
968
|
+
children: R ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, {
|
|
969
|
+
size: 15,
|
|
970
|
+
className: "animate-spin"
|
|
971
|
+
}), "Saving..."] }) : "Save Changes"
|
|
972
|
+
}),
|
|
973
|
+
Z && /* @__PURE__ */ p("button", {
|
|
974
|
+
type: "button",
|
|
975
|
+
onClick: () => void X(!0),
|
|
976
|
+
disabled: !U || R,
|
|
977
|
+
"aria-disabled": !U || R,
|
|
978
|
+
className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "bg-action-primary-bg text-action-primary-text", "hover:bg-action-primary-bg/90", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
979
|
+
children: R ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, {
|
|
980
|
+
size: 15,
|
|
981
|
+
className: "animate-spin"
|
|
982
|
+
}), "Saving..."] }) : "Save & Resubmit for Review"
|
|
983
|
+
})
|
|
984
|
+
]
|
|
669
985
|
})
|
|
670
986
|
]
|
|
671
987
|
})
|
|
@@ -674,6 +990,6 @@ var C = () => {
|
|
|
674
990
|
});
|
|
675
991
|
};
|
|
676
992
|
//#endregion
|
|
677
|
-
export {
|
|
993
|
+
export { y as EditPhysicalItemPage };
|
|
678
994
|
|
|
679
995
|
//# sourceMappingURL=EditPhysicalItemPage.js.map
|