trade-safety 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DetailedResult/AISummarySection.d.ts +6 -0
- package/dist/components/DetailedResult/AISummarySection.d.ts.map +1 -0
- package/dist/components/DetailedResult/index.d.ts.map +1 -1
- package/dist/components/PageHeader.d.ts +8 -0
- package/dist/components/PageHeader.d.ts.map +1 -0
- package/dist/i18n/translations.d.ts +90 -0
- package/dist/i18n/translations.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +115 -112
- package/dist/index.mjs.map +1 -1
- package/dist/locale.js +6 -6
- package/dist/locale.js.map +1 -1
- package/dist/locale.mjs +25 -25
- package/dist/repositories/TradeSafetyRepository.d.ts +26 -16
- package/dist/repositories/TradeSafetyRepository.d.ts.map +1 -1
- package/dist/types.d.ts +7 -9
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useTranslation as
|
|
1
|
+
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as u } from "react-i18next";
|
|
3
3
|
import "i18next";
|
|
4
4
|
import "i18next-resources-to-backend";
|
|
5
5
|
import { TRADE_SAFETY_NS as f } from "./locale.mjs";
|
|
6
|
-
import { tradeSafetyTranslations as
|
|
6
|
+
import { tradeSafetyTranslations as ge } from "./locale.mjs";
|
|
7
7
|
import * as o from "react";
|
|
8
8
|
import m from "react";
|
|
9
9
|
import { BaseCrudRepository as R } from "@aioia/core";
|
|
@@ -12,16 +12,16 @@ function _(e) {
|
|
|
12
12
|
var t, r, n = "";
|
|
13
13
|
if (typeof e == "string" || typeof e == "number") n += e;
|
|
14
14
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
15
|
-
var
|
|
16
|
-
for (t = 0; t <
|
|
15
|
+
var i = e.length;
|
|
16
|
+
for (t = 0; t < i; t++) e[t] && (r = _(e[t])) && (n && (n += " "), n += r);
|
|
17
17
|
} else for (r in e) e[r] && (n && (n += " "), n += r);
|
|
18
18
|
return n;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
for (var e, t, r = 0, n = "",
|
|
20
|
+
function S() {
|
|
21
|
+
for (var e, t, r = 0, n = "", i = arguments.length; r < i; r++) (e = arguments[r]) && (t = _(e)) && (n && (n += " "), n += t);
|
|
22
22
|
return n;
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const C = {
|
|
25
25
|
default: "border-base-300",
|
|
26
26
|
error: "border-error bg-error/10",
|
|
27
27
|
warning: "border-warning bg-warning/10",
|
|
@@ -34,41 +34,45 @@ function p({
|
|
|
34
34
|
variant: r = "default",
|
|
35
35
|
children: n
|
|
36
36
|
}) {
|
|
37
|
-
return n ? /* @__PURE__ */
|
|
38
|
-
e && /* @__PURE__ */
|
|
37
|
+
return n ? /* @__PURE__ */ s("div", { className: S("rounded-lg border p-6", C[r]), children: [
|
|
38
|
+
e && /* @__PURE__ */ s("h2", { className: "mb-2 flex items-center gap-2 font-bold", children: [
|
|
39
39
|
e,
|
|
40
40
|
t
|
|
41
41
|
] }),
|
|
42
42
|
n
|
|
43
43
|
] }) : null;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
const { t
|
|
47
|
-
return
|
|
48
|
-
|
|
45
|
+
function k({ summary: e }) {
|
|
46
|
+
const { t } = u(f);
|
|
47
|
+
return /* @__PURE__ */ a(p, { title: t("result.aiSummary"), children: /* @__PURE__ */ a("p", { className: "rounded-lg bg-base-200 p-6 text-sm leading-relaxed text-base-content", children: e }) });
|
|
48
|
+
}
|
|
49
|
+
function P({ data: e }) {
|
|
50
|
+
const { t, i18n: r } = u(f);
|
|
51
|
+
return e ? /* @__PURE__ */ s(p, { title: t("result.priceAnalysis"), children: [
|
|
52
|
+
e.market_price_range && /* @__PURE__ */ s("div", { className: "mb-2", children: [
|
|
49
53
|
/* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: t("result.marketPrice") }),
|
|
50
54
|
/* @__PURE__ */ a("p", { className: "text-xs", children: e.market_price_range })
|
|
51
55
|
] }),
|
|
52
|
-
e.offered_price && /* @__PURE__ */
|
|
56
|
+
e.offered_price && /* @__PURE__ */ s("div", { className: "mb-2", children: [
|
|
53
57
|
/* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: t("result.offeredPrice") }),
|
|
54
58
|
/* @__PURE__ */ a("p", { className: "text-xs", children: new Intl.NumberFormat(r.language, {
|
|
55
59
|
style: "currency",
|
|
56
60
|
currency: e.currency || "USD"
|
|
57
61
|
}).format(e.offered_price) })
|
|
58
62
|
] }),
|
|
59
|
-
e.price_assessment && /* @__PURE__ */
|
|
63
|
+
e.price_assessment && /* @__PURE__ */ s("div", { children: [
|
|
60
64
|
/* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: t("result.priceAssessment") }),
|
|
61
65
|
/* @__PURE__ */ a("p", { className: "text-xs", children: e.price_assessment })
|
|
62
66
|
] })
|
|
63
67
|
] }) : null;
|
|
64
68
|
}
|
|
65
|
-
function
|
|
69
|
+
function z({
|
|
66
70
|
recommendation: e
|
|
67
71
|
}) {
|
|
68
|
-
const { t } =
|
|
72
|
+
const { t } = u(f);
|
|
69
73
|
return e ? /* @__PURE__ */ a(p, { title: t("result.recommendation"), children: /* @__PURE__ */ a("p", { className: "text-xs", children: e }) }) : null;
|
|
70
74
|
}
|
|
71
|
-
function
|
|
75
|
+
function A({
|
|
72
76
|
title: e,
|
|
73
77
|
titleId: t,
|
|
74
78
|
...r
|
|
@@ -89,8 +93,8 @@ function z({
|
|
|
89
93
|
clipRule: "evenodd"
|
|
90
94
|
}));
|
|
91
95
|
}
|
|
92
|
-
const T = /* @__PURE__ */ o.forwardRef(
|
|
93
|
-
function
|
|
96
|
+
const T = /* @__PURE__ */ o.forwardRef(A);
|
|
97
|
+
function D({
|
|
94
98
|
title: e,
|
|
95
99
|
titleId: t,
|
|
96
100
|
...r
|
|
@@ -111,8 +115,8 @@ function A({
|
|
|
111
115
|
clipRule: "evenodd"
|
|
112
116
|
}));
|
|
113
117
|
}
|
|
114
|
-
const
|
|
115
|
-
function
|
|
118
|
+
const M = /* @__PURE__ */ o.forwardRef(D);
|
|
119
|
+
function Z({
|
|
116
120
|
title: e,
|
|
117
121
|
titleId: t,
|
|
118
122
|
...r
|
|
@@ -133,7 +137,7 @@ function M({
|
|
|
133
137
|
clipRule: "evenodd"
|
|
134
138
|
}));
|
|
135
139
|
}
|
|
136
|
-
const
|
|
140
|
+
const F = /* @__PURE__ */ o.forwardRef(Z);
|
|
137
141
|
function B({
|
|
138
142
|
title: e,
|
|
139
143
|
titleId: t,
|
|
@@ -155,16 +159,16 @@ function B({
|
|
|
155
159
|
clipRule: "evenodd"
|
|
156
160
|
}));
|
|
157
161
|
}
|
|
158
|
-
const
|
|
159
|
-
function
|
|
160
|
-
const { t } =
|
|
161
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
162
|
+
const H = /* @__PURE__ */ o.forwardRef(B);
|
|
163
|
+
function I({ items: e }) {
|
|
164
|
+
const { t } = u(f);
|
|
165
|
+
return e.length === 0 ? null : /* @__PURE__ */ s("div", { className: "mb-4", children: [
|
|
166
|
+
/* @__PURE__ */ s("h2", { className: "flex items-center gap-1 py-4 font-bold", children: [
|
|
163
167
|
t("result.safetyChecklist"),
|
|
164
168
|
" ",
|
|
165
169
|
/* @__PURE__ */ a(T, { className: "size-6" })
|
|
166
170
|
] }),
|
|
167
|
-
/* @__PURE__ */ a(p, { variant: "info", children: e.map((r, n) => /* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ a(p, { variant: "info", children: e.map((r, n) => /* @__PURE__ */ s("label", { className: "label w-fit cursor-pointer gap-2", children: [
|
|
168
172
|
/* @__PURE__ */ a(
|
|
169
173
|
"input",
|
|
170
174
|
{
|
|
@@ -176,11 +180,11 @@ function H({ items: e }) {
|
|
|
176
180
|
] }, n)) })
|
|
177
181
|
] });
|
|
178
182
|
}
|
|
179
|
-
const
|
|
180
|
-
error:
|
|
181
|
-
warning:
|
|
182
|
-
success:
|
|
183
|
-
},
|
|
183
|
+
const L = {
|
|
184
|
+
error: F,
|
|
185
|
+
warning: M,
|
|
186
|
+
success: H
|
|
187
|
+
}, W = {
|
|
184
188
|
error: "result.riskSignals",
|
|
185
189
|
warning: "result.cautions",
|
|
186
190
|
success: "result.safeIndicators"
|
|
@@ -189,80 +193,81 @@ function v({
|
|
|
189
193
|
signals: e,
|
|
190
194
|
variant: t = "error"
|
|
191
195
|
}) {
|
|
192
|
-
const { t: r } =
|
|
196
|
+
const { t: r } = u(f);
|
|
193
197
|
if (e.length === 0) return null;
|
|
194
|
-
const n =
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
r(
|
|
198
|
+
const n = L[t];
|
|
199
|
+
return /* @__PURE__ */ s("div", { className: "mb-4", children: [
|
|
200
|
+
/* @__PURE__ */ s("h2", { className: "flex items-center gap-1 py-4 font-bold", children: [
|
|
201
|
+
r(W[t]),
|
|
198
202
|
" ",
|
|
199
203
|
/* @__PURE__ */ a(n, { className: "size-6" })
|
|
200
204
|
] }),
|
|
201
|
-
/* @__PURE__ */ a("div", { className: "space-y-3", children: e.map((
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
/* @__PURE__ */ a("h3", { className: "text-sm font-bold", children:
|
|
204
|
-
/* @__PURE__ */ a("p", { className: "text-xs", children:
|
|
205
|
+
/* @__PURE__ */ a("div", { className: "space-y-3", children: e.map((i, c) => /* @__PURE__ */ a(p, { variant: t, children: /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
206
|
+
/* @__PURE__ */ s("div", { children: [
|
|
207
|
+
/* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: i.title }),
|
|
208
|
+
/* @__PURE__ */ a("p", { className: "text-xs", children: i.description })
|
|
205
209
|
] }),
|
|
206
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ s("div", { children: [
|
|
207
211
|
/* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: r("result.whatToDo") }),
|
|
208
|
-
/* @__PURE__ */ a("p", { className: "text-xs", children:
|
|
212
|
+
/* @__PURE__ */ a("p", { className: "text-xs", children: i.what_to_do })
|
|
209
213
|
] })
|
|
210
214
|
] }) }, c)) })
|
|
211
215
|
] });
|
|
212
216
|
}
|
|
213
|
-
function
|
|
217
|
+
function $({
|
|
214
218
|
translation: e,
|
|
215
219
|
nuance: t
|
|
216
220
|
}) {
|
|
217
|
-
const { t: r } =
|
|
218
|
-
return /* @__PURE__ */
|
|
219
|
-
e && /* @__PURE__ */
|
|
221
|
+
const { t: r } = u(f);
|
|
222
|
+
return /* @__PURE__ */ s(p, { title: r("result.translation"), children: [
|
|
223
|
+
e && /* @__PURE__ */ s("div", { className: "mb-2", children: [
|
|
220
224
|
/* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: r("result.translationTitle") }),
|
|
221
225
|
/* @__PURE__ */ a("p", { className: "text-xs", children: e })
|
|
222
226
|
] }),
|
|
223
|
-
t && /* @__PURE__ */
|
|
227
|
+
t && /* @__PURE__ */ s("div", { children: [
|
|
224
228
|
/* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: r("result.nuanceTitle") }),
|
|
225
229
|
/* @__PURE__ */ a("p", { className: "text-xs", children: t })
|
|
226
230
|
] })
|
|
227
231
|
] });
|
|
228
232
|
}
|
|
229
|
-
function
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
-
/* @__PURE__ */
|
|
233
|
+
function me({ analysis: e }) {
|
|
234
|
+
return /* @__PURE__ */ s("div", { children: [
|
|
235
|
+
e.ai_summary && /* @__PURE__ */ a(k, { summary: e.ai_summary }),
|
|
236
|
+
/* @__PURE__ */ s("div", { className: "my-4 flex flex-col gap-4", children: [
|
|
232
237
|
(e.translation || e.nuance_explanation) && /* @__PURE__ */ a(
|
|
233
|
-
|
|
238
|
+
$,
|
|
234
239
|
{
|
|
235
240
|
translation: e.translation,
|
|
236
241
|
nuance: e.nuance_explanation
|
|
237
242
|
}
|
|
238
243
|
),
|
|
239
|
-
e.price_analysis && /* @__PURE__ */ a(
|
|
240
|
-
e.recommendation && /* @__PURE__ */ a(
|
|
244
|
+
e.price_analysis && /* @__PURE__ */ a(P, { data: e.price_analysis }),
|
|
245
|
+
e.recommendation && /* @__PURE__ */ a(z, { recommendation: e.recommendation })
|
|
241
246
|
] }),
|
|
242
247
|
e.risk_signals.length > 0 && /* @__PURE__ */ a(v, { signals: e.risk_signals, variant: "error" }),
|
|
243
248
|
e.cautions.length > 0 && /* @__PURE__ */ a(v, { signals: e.cautions, variant: "warning" }),
|
|
244
249
|
e.safe_indicators.length > 0 && /* @__PURE__ */ a(v, { signals: e.safe_indicators, variant: "success" }),
|
|
245
|
-
e.safety_checklist.length > 0 && /* @__PURE__ */ a(
|
|
250
|
+
e.safety_checklist.length > 0 && /* @__PURE__ */ a(I, { items: e.safety_checklist })
|
|
246
251
|
] });
|
|
247
252
|
}
|
|
248
|
-
var
|
|
253
|
+
var O = {
|
|
249
254
|
color: void 0,
|
|
250
255
|
size: void 0,
|
|
251
256
|
className: void 0,
|
|
252
257
|
style: void 0,
|
|
253
258
|
attr: void 0
|
|
254
|
-
}, y = m.createContext && /* @__PURE__ */ m.createContext(
|
|
255
|
-
function
|
|
259
|
+
}, y = m.createContext && /* @__PURE__ */ m.createContext(O), K = ["attr", "size", "title"];
|
|
260
|
+
function V(e, t) {
|
|
256
261
|
if (e == null) return {};
|
|
257
|
-
var r =
|
|
262
|
+
var r = X(e, t), n, i;
|
|
258
263
|
if (Object.getOwnPropertySymbols) {
|
|
259
264
|
var c = Object.getOwnPropertySymbols(e);
|
|
260
|
-
for (
|
|
261
|
-
n = c[
|
|
265
|
+
for (i = 0; i < c.length; i++)
|
|
266
|
+
n = c[i], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
|
|
262
267
|
}
|
|
263
268
|
return r;
|
|
264
269
|
}
|
|
265
|
-
function
|
|
270
|
+
function X(e, t) {
|
|
266
271
|
if (e == null) return {};
|
|
267
272
|
var r = {};
|
|
268
273
|
for (var n in e)
|
|
@@ -286,8 +291,8 @@ function N(e, t) {
|
|
|
286
291
|
var r = Object.keys(e);
|
|
287
292
|
if (Object.getOwnPropertySymbols) {
|
|
288
293
|
var n = Object.getOwnPropertySymbols(e);
|
|
289
|
-
t && (n = n.filter(function(
|
|
290
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
294
|
+
t && (n = n.filter(function(i) {
|
|
295
|
+
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
|
291
296
|
})), r.push.apply(r, n);
|
|
292
297
|
}
|
|
293
298
|
return r;
|
|
@@ -296,14 +301,14 @@ function x(e) {
|
|
|
296
301
|
for (var t = 1; t < arguments.length; t++) {
|
|
297
302
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
298
303
|
t % 2 ? N(Object(r), !0).forEach(function(n) {
|
|
299
|
-
|
|
304
|
+
Y(e, n, r[n]);
|
|
300
305
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : N(Object(r)).forEach(function(n) {
|
|
301
306
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
302
307
|
});
|
|
303
308
|
}
|
|
304
309
|
return e;
|
|
305
310
|
}
|
|
306
|
-
function
|
|
311
|
+
function Y(e, t, r) {
|
|
307
312
|
return t = G(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
308
313
|
}
|
|
309
314
|
function G(e) {
|
|
@@ -326,17 +331,17 @@ function j(e) {
|
|
|
326
331
|
}, t.attr), j(t.child)));
|
|
327
332
|
}
|
|
328
333
|
function E(e) {
|
|
329
|
-
return (t) => /* @__PURE__ */ m.createElement(
|
|
334
|
+
return (t) => /* @__PURE__ */ m.createElement(q, g({
|
|
330
335
|
attr: x({}, e.attr)
|
|
331
336
|
}, t), j(e.child));
|
|
332
337
|
}
|
|
333
|
-
function
|
|
338
|
+
function q(e) {
|
|
334
339
|
var t = (r) => {
|
|
335
340
|
var {
|
|
336
341
|
attr: n,
|
|
337
|
-
size:
|
|
342
|
+
size: i,
|
|
338
343
|
title: c
|
|
339
|
-
} = e, b =
|
|
344
|
+
} = e, b = V(e, K), h = i || r.size || "1em", d;
|
|
340
345
|
return r.className && (d = r.className), e.className && (d = (d ? d + " " : "") + e.className), /* @__PURE__ */ m.createElement("svg", g({
|
|
341
346
|
stroke: "currentColor",
|
|
342
347
|
fill: "currentColor",
|
|
@@ -346,32 +351,32 @@ function Y(e) {
|
|
|
346
351
|
style: x(x({
|
|
347
352
|
color: e.color || r.color
|
|
348
353
|
}, r.style), e.style),
|
|
349
|
-
height:
|
|
350
|
-
width:
|
|
354
|
+
height: h,
|
|
355
|
+
width: h,
|
|
351
356
|
xmlns: "http://www.w3.org/2000/svg"
|
|
352
357
|
}), c && /* @__PURE__ */ m.createElement("title", null, c), e.children);
|
|
353
358
|
};
|
|
354
|
-
return y !== void 0 ? /* @__PURE__ */ m.createElement(y.Consumer, null, (r) => t(r)) : t(
|
|
359
|
+
return y !== void 0 ? /* @__PURE__ */ m.createElement(y.Consumer, null, (r) => t(r)) : t(O);
|
|
355
360
|
}
|
|
356
|
-
function
|
|
361
|
+
function J(e) {
|
|
357
362
|
return E({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M0 256C0 114.6 114.6 0 256 0S512 114.6 512 256s-114.6 256-256 256L37.1 512c-13.7 0-20.5-16.5-10.9-26.2L75 437C28.7 390.7 0 326.7 0 256zM349.6 153.6c23.6 0 42.7-19.1 42.7-42.7s-19.1-42.7-42.7-42.7c-20.6 0-37.8 14.6-41.8 34c-34.5 3.7-61.4 33-61.4 68.4l0 .2c-37.5 1.6-71.8 12.3-99 29.1c-10.1-7.8-22.8-12.5-36.5-12.5c-33 0-59.8 26.8-59.8 59.8c0 24 14.1 44.6 34.4 54.1c2 69.4 77.6 125.2 170.6 125.2s168.7-55.9 170.6-125.3c20.2-9.6 34.1-30.2 34.1-54c0-33-26.8-59.8-59.8-59.8c-13.7 0-26.3 4.6-36.4 12.4c-27.4-17-62.1-27.7-100-29.1l0-.2c0-25.4 18.9-46.5 43.4-49.9l0 0c4.4 18.8 21.3 32.8 41.5 32.8zM177.1 246.9c16.7 0 29.5 17.6 28.5 39.3s-13.5 29.6-30.3 29.6s-31.4-8.8-30.4-30.5s15.4-38.3 32.1-38.3zm190.1 38.3c1 21.7-13.7 30.5-30.4 30.5s-29.3-7.9-30.3-29.6c-1-21.7 11.8-39.3 28.5-39.3s31.2 16.6 32.1 38.3zm-48.1 56.7c-10.3 24.6-34.6 41.9-63 41.9s-52.7-17.3-63-41.9c-1.2-2.9 .8-6.2 3.9-6.5c18.4-1.9 38.3-2.9 59.1-2.9s40.7 1 59.1 2.9c3.1 .3 5.1 3.6 3.9 6.5z" }, child: [] }] })(e);
|
|
358
363
|
}
|
|
359
|
-
function
|
|
364
|
+
function Q(e) {
|
|
360
365
|
return E({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z" }, child: [] }] })(e);
|
|
361
366
|
}
|
|
362
|
-
function
|
|
367
|
+
function ue({
|
|
363
368
|
value: e,
|
|
364
369
|
onChange: t,
|
|
365
370
|
onSubmit: r,
|
|
366
371
|
isLoading: n,
|
|
367
|
-
error:
|
|
372
|
+
error: i
|
|
368
373
|
}) {
|
|
369
|
-
const { t: c } =
|
|
370
|
-
return /* @__PURE__ */ a("div", { className: "flex w-full flex-col items-center justify-center", children: /* @__PURE__ */
|
|
374
|
+
const { t: c } = u(f), b = n ? /* @__PURE__ */ a("span", { className: "loading loading-spinner loading-sm" }) : c("hero.checkSafety"), h = n || !e.trim();
|
|
375
|
+
return /* @__PURE__ */ a("div", { className: "flex w-full flex-col items-center justify-center", children: /* @__PURE__ */ s("div", { className: "w-full lg:max-w-[720px]", children: [
|
|
371
376
|
/* @__PURE__ */ a("h1", { className: "mb-2 text-left text-3xl font-bold text-base-content sm:mb-8 sm:text-center sm:text-4xl md:mb-8", children: c("hero.title") }),
|
|
372
377
|
/* @__PURE__ */ a("p", { className: "mb-4 text-left text-sm text-base-content/70 sm:mb-8 sm:text-center sm:text-base md:mb-16", children: c("hero.subtitle") }),
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ s("div", { className: S("mb-4", !i && "sm:mb-8 md:mb-12"), children: [
|
|
379
|
+
/* @__PURE__ */ s("div", { className: "relative hidden lg:block", children: [
|
|
375
380
|
/* @__PURE__ */ a(
|
|
376
381
|
"input",
|
|
377
382
|
{
|
|
@@ -383,7 +388,7 @@ function me({
|
|
|
383
388
|
onChange: (d) => t(d.target.value),
|
|
384
389
|
disabled: n,
|
|
385
390
|
onKeyDown: (d) => {
|
|
386
|
-
d.key === "Enter" && !
|
|
391
|
+
d.key === "Enter" && !h && r();
|
|
387
392
|
}
|
|
388
393
|
}
|
|
389
394
|
),
|
|
@@ -392,18 +397,18 @@ function me({
|
|
|
392
397
|
{
|
|
393
398
|
className: "btn btn-neutral absolute right-2 top-1/2 h-[56px] min-h-0 -translate-y-1/2 !animate-none px-6 font-bold text-neutral-content",
|
|
394
399
|
onClick: r,
|
|
395
|
-
disabled:
|
|
400
|
+
disabled: h,
|
|
396
401
|
children: b
|
|
397
402
|
}
|
|
398
403
|
)
|
|
399
404
|
] }),
|
|
400
|
-
/* @__PURE__ */ a("div", { className: "block lg:hidden", children: /* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ a("div", { className: "block lg:hidden", children: /* @__PURE__ */ s("div", { className: "relative h-[400px] w-full overflow-hidden rounded-xl border border-base-300 bg-base-100", children: [
|
|
401
406
|
!e && /* @__PURE__ */ a(
|
|
402
407
|
"div",
|
|
403
408
|
{
|
|
404
409
|
className: "pointer-events-none absolute inset-0 overflow-hidden p-5 pb-24 text-base text-base-300",
|
|
405
410
|
"aria-hidden": "true",
|
|
406
|
-
children: /* @__PURE__ */
|
|
411
|
+
children: /* @__PURE__ */ s("div", { className: "whitespace-pre-line leading-relaxed", children: [
|
|
407
412
|
/* @__PURE__ */ a("p", { className: "mb-4 text-base-300", children: c("hero.placeholder") }),
|
|
408
413
|
c("hero.placeholderExample")
|
|
409
414
|
] })
|
|
@@ -425,15 +430,15 @@ function me({
|
|
|
425
430
|
{
|
|
426
431
|
className: "btn btn-neutral h-16 w-full text-base font-medium text-neutral-content",
|
|
427
432
|
onClick: r,
|
|
428
|
-
disabled:
|
|
433
|
+
disabled: h,
|
|
429
434
|
children: b
|
|
430
435
|
}
|
|
431
436
|
) })
|
|
432
437
|
] }) })
|
|
433
438
|
] }),
|
|
434
|
-
|
|
439
|
+
i && /* @__PURE__ */ a("div", { className: "alert alert-error mb-6 flex items-center gap-2 text-sm", children: /* @__PURE__ */ a("span", { children: i }) }),
|
|
435
440
|
/* @__PURE__ */ a("p", { className: "mb-4 text-left text-xs text-base-content/60 sm:mb-8 sm:text-center md:mb-12", children: c("hero.disclaimer") }),
|
|
436
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-start gap-6 sm:justify-center", children: [
|
|
437
442
|
/* @__PURE__ */ a(
|
|
438
443
|
"a",
|
|
439
444
|
{
|
|
@@ -441,7 +446,7 @@ function me({
|
|
|
441
446
|
target: "_blank",
|
|
442
447
|
rel: "noopener noreferrer",
|
|
443
448
|
"aria-label": "X",
|
|
444
|
-
children: /* @__PURE__ */ a(
|
|
449
|
+
children: /* @__PURE__ */ a(Q, { className: "size-6 text-base-content transition-colors hover:text-base-content/70" })
|
|
445
450
|
}
|
|
446
451
|
),
|
|
447
452
|
/* @__PURE__ */ a(
|
|
@@ -451,7 +456,7 @@ function me({
|
|
|
451
456
|
target: "_blank",
|
|
452
457
|
rel: "noopener noreferrer",
|
|
453
458
|
"aria-label": "Reddit",
|
|
454
|
-
children: /* @__PURE__ */ a(
|
|
459
|
+
children: /* @__PURE__ */ a(J, { className: "size-6 text-base-content transition-colors hover:text-base-content/70" })
|
|
455
460
|
}
|
|
456
461
|
)
|
|
457
462
|
] })
|
|
@@ -463,29 +468,30 @@ const w = l.object({
|
|
|
463
468
|
title: l.string(),
|
|
464
469
|
description: l.string(),
|
|
465
470
|
what_to_do: l.string()
|
|
466
|
-
}),
|
|
471
|
+
}), ee = l.object({
|
|
467
472
|
market_price_range: l.string().nullish(),
|
|
468
473
|
offered_price: l.number().nullish(),
|
|
469
474
|
currency: l.string().nullish(),
|
|
470
475
|
price_assessment: l.string(),
|
|
471
476
|
warnings: l.array(l.string())
|
|
472
|
-
}),
|
|
477
|
+
}), te = l.object({
|
|
478
|
+
ai_summary: l.string(),
|
|
473
479
|
translation: l.string().nullish(),
|
|
474
480
|
nuance_explanation: l.string().nullish(),
|
|
475
481
|
risk_signals: l.array(w),
|
|
476
482
|
cautions: l.array(w),
|
|
477
483
|
safe_indicators: l.array(w),
|
|
478
|
-
price_analysis:
|
|
484
|
+
price_analysis: ee,
|
|
479
485
|
safety_checklist: l.array(l.string()),
|
|
480
|
-
|
|
486
|
+
safe_score: l.number(),
|
|
481
487
|
recommendation: l.string(),
|
|
482
488
|
emotional_support: l.string()
|
|
483
|
-
}),
|
|
489
|
+
}), re = l.object({
|
|
484
490
|
id: l.string(),
|
|
485
491
|
user_id: l.string().nullish(),
|
|
486
492
|
input_text: l.string(),
|
|
487
|
-
llm_analysis:
|
|
488
|
-
|
|
493
|
+
llm_analysis: te,
|
|
494
|
+
safe_score: l.number(),
|
|
489
495
|
expert_advice: l.string().nullish(),
|
|
490
496
|
expert_reviewed: l.boolean(),
|
|
491
497
|
expert_reviewed_at: l.string().nullish(),
|
|
@@ -493,27 +499,24 @@ const w = l.object({
|
|
|
493
499
|
created_at: l.string(),
|
|
494
500
|
updated_at: l.string()
|
|
495
501
|
});
|
|
496
|
-
class
|
|
502
|
+
class fe extends R {
|
|
497
503
|
constructor() {
|
|
498
504
|
super(...arguments), this.resource = "trade-safety";
|
|
499
505
|
}
|
|
500
506
|
getDataSchema() {
|
|
501
|
-
return
|
|
507
|
+
return re;
|
|
502
508
|
}
|
|
503
509
|
}
|
|
504
510
|
const he = {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
medium: 40
|
|
508
|
-
// >= 40: Medium risk (yellow)
|
|
509
|
-
// < 40: Low risk (green)
|
|
511
|
+
safe: 70,
|
|
512
|
+
caution: 40
|
|
510
513
|
};
|
|
511
514
|
export {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
he as
|
|
515
|
+
me as DetailedResult,
|
|
516
|
+
ue as HomeHeroSection,
|
|
517
|
+
he as SAFETY_SCORE_THRESHOLDS,
|
|
515
518
|
f as TRADE_SAFETY_NS,
|
|
516
|
-
|
|
517
|
-
|
|
519
|
+
fe as TradeSafetyRepository,
|
|
520
|
+
ge as tradeSafetyTranslations
|
|
518
521
|
};
|
|
519
522
|
//# sourceMappingURL=index.mjs.map
|