trade-safety 1.9.0 → 1.10.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/index.mjs CHANGED
@@ -1,27 +1,27 @@
1
- import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
- import { useTranslation as u } from "react-i18next";
1
+ import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
+ import { useTranslation as m } from "react-i18next";
3
3
  import "i18next";
4
4
  import "i18next-resources-to-backend";
5
- import { TRADE_SAFETY_NS as h } from "./locale.mjs";
6
- import { tradeSafetyTranslations as we } from "./locale.mjs";
5
+ import { TRADE_SAFETY_NS as u } from "./locale.mjs";
6
+ import { tradeSafetyTranslations as Ne } from "./locale.mjs";
7
7
  import * as o from "react";
8
- import m from "react";
9
- import { BaseCrudRepository as R } from "@aioia/core";
8
+ import h from "react";
9
+ import { BaseCrudRepository as P } from "@aioia/core";
10
10
  import { z as s } from "zod";
11
- function _(e) {
11
+ function S(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 l = e.length;
16
- for (t = 0; t < l; t++) e[t] && (r = _(e[t])) && (n && (n += " "), n += r);
15
+ var i = e.length;
16
+ for (t = 0; t < i; t++) e[t] && (r = S(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 S() {
21
- for (var e, t, r = 0, n = "", l = arguments.length; r < l; r++) (e = arguments[r]) && (t = _(e)) && (n && (n += " "), n += t);
20
+ function O() {
21
+ for (var e, t, r = 0, n = "", i = arguments.length; r < i; r++) (e = arguments[r]) && (t = S(e)) && (n && (n += " "), n += t);
22
22
  return n;
23
23
  }
24
- const P = {
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,45 +34,45 @@ function p({
34
34
  variant: r = "default",
35
35
  children: n
36
36
  }) {
37
- return n ? /* @__PURE__ */ i("div", { className: S("rounded-lg border p-6", P[r]), children: [
38
- e && /* @__PURE__ */ i("h2", { className: "mb-2 flex items-center gap-2 font-bold", children: [
37
+ return n ? /* @__PURE__ */ l("div", { className: O("rounded-lg border p-6", C[r]), children: [
38
+ e && /* @__PURE__ */ l("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 C({ summary: e }) {
46
- const { t } = u(h);
45
+ function k({ summary: e }) {
46
+ const { t } = m(u);
47
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
48
  }
49
- function k({ data: e }) {
50
- const { t, i18n: r } = u(h);
51
- return e ? /* @__PURE__ */ i(p, { title: t("result.priceAnalysis"), children: [
52
- e.market_price_range && /* @__PURE__ */ i("div", { className: "mb-2", children: [
49
+ function z({ data: e }) {
50
+ const { t, i18n: r } = m(u);
51
+ return e ? /* @__PURE__ */ l(p, { title: t("result.priceAnalysis"), children: [
52
+ e.market_price_range && /* @__PURE__ */ l("div", { className: "mb-2", children: [
53
53
  /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: t("result.marketPrice") }),
54
54
  /* @__PURE__ */ a("p", { className: "text-xs", children: e.market_price_range })
55
55
  ] }),
56
- e.offered_price && /* @__PURE__ */ i("div", { className: "mb-2", children: [
56
+ e.offered_price && /* @__PURE__ */ l("div", { className: "mb-2", children: [
57
57
  /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: t("result.offeredPrice") }),
58
58
  /* @__PURE__ */ a("p", { className: "text-xs", children: new Intl.NumberFormat(r.language, {
59
59
  style: "currency",
60
60
  currency: e.currency || "USD"
61
61
  }).format(e.offered_price) })
62
62
  ] }),
63
- e.price_assessment && /* @__PURE__ */ i("div", { children: [
63
+ e.price_assessment && /* @__PURE__ */ l("div", { children: [
64
64
  /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: t("result.priceAssessment") }),
65
65
  /* @__PURE__ */ a("p", { className: "text-xs", children: e.price_assessment })
66
66
  ] })
67
67
  ] }) : null;
68
68
  }
69
- function z({
69
+ function T({
70
70
  recommendation: e
71
71
  }) {
72
- const { t } = u(h);
72
+ const { t } = m(u);
73
73
  return e ? /* @__PURE__ */ a(p, { title: t("result.recommendation"), children: /* @__PURE__ */ a("p", { className: "text-xs", children: e }) }) : null;
74
74
  }
75
- function T({
75
+ function A({
76
76
  title: e,
77
77
  titleId: t,
78
78
  ...r
@@ -93,8 +93,8 @@ function T({
93
93
  clipRule: "evenodd"
94
94
  }));
95
95
  }
96
- const A = /* @__PURE__ */ o.forwardRef(T);
97
- function D({
96
+ const D = /* @__PURE__ */ o.forwardRef(A);
97
+ function L({
98
98
  title: e,
99
99
  titleId: t,
100
100
  ...r
@@ -115,7 +115,7 @@ function D({
115
115
  clipRule: "evenodd"
116
116
  }));
117
117
  }
118
- const M = /* @__PURE__ */ o.forwardRef(D);
118
+ const M = /* @__PURE__ */ o.forwardRef(L);
119
119
  function Z({
120
120
  title: e,
121
121
  titleId: t,
@@ -161,14 +161,14 @@ function B({
161
161
  }
162
162
  const H = /* @__PURE__ */ o.forwardRef(B);
163
163
  function I({ items: e }) {
164
- const { t } = u(h);
165
- return e.length === 0 ? null : /* @__PURE__ */ i("div", { className: "mb-4", children: [
166
- /* @__PURE__ */ i("h2", { className: "flex items-center gap-1 py-4 font-bold", children: [
164
+ const { t } = m(u);
165
+ return e.length === 0 ? null : /* @__PURE__ */ l("div", { className: "mb-4", children: [
166
+ /* @__PURE__ */ l("h2", { className: "flex items-center gap-1 py-4 font-bold", children: [
167
167
  t("result.safetyChecklist"),
168
168
  " ",
169
- /* @__PURE__ */ a(A, { className: "size-6" })
169
+ /* @__PURE__ */ a(D, { className: "size-6" })
170
170
  ] }),
171
- /* @__PURE__ */ a(p, { variant: "info", children: e.map((r, n) => /* @__PURE__ */ i("label", { className: "label w-fit cursor-pointer gap-2", children: [
171
+ /* @__PURE__ */ a(p, { variant: "info", children: e.map((r, n) => /* @__PURE__ */ l("label", { className: "label w-fit cursor-pointer gap-2", children: [
172
172
  /* @__PURE__ */ a(
173
173
  "input",
174
174
  {
@@ -180,11 +180,11 @@ function I({ items: e }) {
180
180
  ] }, n)) })
181
181
  ] });
182
182
  }
183
- const L = {
183
+ const $ = {
184
184
  error: F,
185
185
  warning: M,
186
186
  success: H
187
- }, $ = {
187
+ }, W = {
188
188
  error: "result.riskSignals",
189
189
  warning: "result.cautions",
190
190
  success: "result.safeIndicators"
@@ -193,56 +193,56 @@ function v({
193
193
  signals: e,
194
194
  variant: t = "error"
195
195
  }) {
196
- const { t: r } = u(h);
196
+ const { t: r } = m(u);
197
197
  if (e.length === 0) return null;
198
- const n = L[t];
199
- return /* @__PURE__ */ i("div", { className: "mb-4", children: [
200
- /* @__PURE__ */ i("h2", { className: "flex items-center gap-1 py-4 font-bold", children: [
201
- r($[t]),
198
+ const n = $[t];
199
+ return /* @__PURE__ */ l("div", { className: "mb-4", children: [
200
+ /* @__PURE__ */ l("h2", { className: "flex items-center gap-1 py-4 font-bold", children: [
201
+ r(W[t]),
202
202
  " ",
203
203
  /* @__PURE__ */ a(n, { className: "size-6" })
204
204
  ] }),
205
- /* @__PURE__ */ a("div", { className: "space-y-3", children: e.map((l, c) => /* @__PURE__ */ a(p, { variant: t, children: /* @__PURE__ */ i("div", { className: "space-y-2", children: [
206
- /* @__PURE__ */ i("div", { children: [
207
- /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: l.title }),
208
- /* @__PURE__ */ a("p", { className: "text-xs", children: l.description })
205
+ /* @__PURE__ */ a("div", { className: "space-y-3", children: e.map((i, c) => /* @__PURE__ */ a(p, { variant: t, children: /* @__PURE__ */ l("div", { className: "space-y-2", children: [
206
+ /* @__PURE__ */ l("div", { children: [
207
+ /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: i.title }),
208
+ /* @__PURE__ */ a("p", { className: "text-xs", children: i.description })
209
209
  ] }),
210
- /* @__PURE__ */ i("div", { children: [
210
+ /* @__PURE__ */ l("div", { children: [
211
211
  /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: r("result.whatToDo") }),
212
- /* @__PURE__ */ a("p", { className: "text-xs", children: l.what_to_do })
212
+ /* @__PURE__ */ a("p", { className: "text-xs", children: i.what_to_do })
213
213
  ] })
214
214
  ] }) }, c)) })
215
215
  ] });
216
216
  }
217
- function W({
217
+ function K({
218
218
  translation: e,
219
219
  nuance: t
220
220
  }) {
221
- const { t: r } = u(h);
222
- return /* @__PURE__ */ i(p, { title: r("result.translation"), children: [
223
- e && /* @__PURE__ */ i("div", { className: "mb-2", children: [
221
+ const { t: r } = m(u);
222
+ return /* @__PURE__ */ l(p, { title: r("result.translation"), children: [
223
+ e && /* @__PURE__ */ l("div", { className: "mb-2", children: [
224
224
  /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: r("result.translationTitle") }),
225
225
  /* @__PURE__ */ a("p", { className: "text-xs", children: e })
226
226
  ] }),
227
- t && /* @__PURE__ */ i("div", { children: [
227
+ t && /* @__PURE__ */ l("div", { children: [
228
228
  /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: r("result.nuanceTitle") }),
229
229
  /* @__PURE__ */ a("p", { className: "text-xs", children: t })
230
230
  ] })
231
231
  ] });
232
232
  }
233
- function fe({ analysis: e }) {
234
- return /* @__PURE__ */ i("div", { children: [
235
- e.ai_summary && /* @__PURE__ */ a(C, { summary: e.ai_summary }),
236
- /* @__PURE__ */ i("div", { className: "my-4 flex flex-col gap-4", children: [
233
+ function pe({ analysis: e }) {
234
+ return /* @__PURE__ */ l("div", { children: [
235
+ e.ai_summary && /* @__PURE__ */ a(k, { summary: e.ai_summary }),
236
+ /* @__PURE__ */ l("div", { className: "my-4 flex flex-col gap-4", children: [
237
237
  (e.translation || e.nuance_explanation) && /* @__PURE__ */ a(
238
- W,
238
+ K,
239
239
  {
240
240
  translation: e.translation,
241
241
  nuance: e.nuance_explanation
242
242
  }
243
243
  ),
244
- e.price_analysis && /* @__PURE__ */ a(k, { data: e.price_analysis }),
245
- e.recommendation && /* @__PURE__ */ a(z, { recommendation: e.recommendation })
244
+ e.price_analysis && /* @__PURE__ */ a(z, { data: e.price_analysis }),
245
+ e.recommendation && /* @__PURE__ */ a(T, { recommendation: e.recommendation })
246
246
  ] }),
247
247
  e.risk_signals.length > 0 && /* @__PURE__ */ a(v, { signals: e.risk_signals, variant: "error" }),
248
248
  e.cautions.length > 0 && /* @__PURE__ */ a(v, { signals: e.cautions, variant: "warning" }),
@@ -250,24 +250,24 @@ function fe({ analysis: e }) {
250
250
  e.safety_checklist.length > 0 && /* @__PURE__ */ a(I, { items: e.safety_checklist })
251
251
  ] });
252
252
  }
253
- var O = {
253
+ var j = {
254
254
  color: void 0,
255
255
  size: void 0,
256
256
  className: void 0,
257
257
  style: void 0,
258
258
  attr: void 0
259
- }, y = m.createContext && /* @__PURE__ */ m.createContext(O), K = ["attr", "size", "title"];
260
- function U(e, t) {
259
+ }, y = h.createContext && /* @__PURE__ */ h.createContext(j), U = ["attr", "size", "title"];
260
+ function V(e, t) {
261
261
  if (e == null) return {};
262
- var r = V(e, t), n, l;
262
+ var r = X(e, t), n, i;
263
263
  if (Object.getOwnPropertySymbols) {
264
264
  var c = Object.getOwnPropertySymbols(e);
265
- for (l = 0; l < c.length; l++)
266
- n = c[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
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]);
267
267
  }
268
268
  return r;
269
269
  }
270
- function V(e, t) {
270
+ function X(e, t) {
271
271
  if (e == null) return {};
272
272
  var r = {};
273
273
  for (var n in e)
@@ -291,8 +291,8 @@ function N(e, t) {
291
291
  var r = Object.keys(e);
292
292
  if (Object.getOwnPropertySymbols) {
293
293
  var n = Object.getOwnPropertySymbols(e);
294
- t && (n = n.filter(function(l) {
295
- return Object.getOwnPropertyDescriptor(e, l).enumerable;
294
+ t && (n = n.filter(function(i) {
295
+ return Object.getOwnPropertyDescriptor(e, i).enumerable;
296
296
  })), r.push.apply(r, n);
297
297
  }
298
298
  return r;
@@ -301,21 +301,21 @@ function x(e) {
301
301
  for (var t = 1; t < arguments.length; t++) {
302
302
  var r = arguments[t] != null ? arguments[t] : {};
303
303
  t % 2 ? N(Object(r), !0).forEach(function(n) {
304
- X(e, n, r[n]);
304
+ Y(e, n, r[n]);
305
305
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : N(Object(r)).forEach(function(n) {
306
306
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
307
307
  });
308
308
  }
309
309
  return e;
310
310
  }
311
- function X(e, t, r) {
312
- return t = Y(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
311
+ function Y(e, t, r) {
312
+ return t = q(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
313
313
  }
314
- function Y(e) {
315
- var t = q(e, "string");
314
+ function q(e) {
315
+ var t = G(e, "string");
316
316
  return typeof t == "symbol" ? t : t + "";
317
317
  }
318
- function q(e, t) {
318
+ function G(e, t) {
319
319
  if (typeof e != "object" || !e) return e;
320
320
  var r = e[Symbol.toPrimitive];
321
321
  if (r !== void 0) {
@@ -325,24 +325,24 @@ function q(e, t) {
325
325
  }
326
326
  return (t === "string" ? String : Number)(e);
327
327
  }
328
- function j(e) {
329
- return e && e.map((t, r) => /* @__PURE__ */ m.createElement(t.tag, x({
328
+ function E(e) {
329
+ return e && e.map((t, r) => /* @__PURE__ */ h.createElement(t.tag, x({
330
330
  key: r
331
- }, t.attr), j(t.child)));
331
+ }, t.attr), E(t.child)));
332
332
  }
333
- function E(e) {
334
- return (t) => /* @__PURE__ */ m.createElement(G, g({
333
+ function R(e) {
334
+ return (t) => /* @__PURE__ */ h.createElement(J, g({
335
335
  attr: x({}, e.attr)
336
- }, t), j(e.child));
336
+ }, t), E(e.child));
337
337
  }
338
- function G(e) {
338
+ function J(e) {
339
339
  var t = (r) => {
340
340
  var {
341
341
  attr: n,
342
- size: l,
342
+ size: i,
343
343
  title: c
344
- } = e, b = U(e, K), f = l || r.size || "1em", d;
345
- return r.className && (d = r.className), e.className && (d = (d ? d + " " : "") + e.className), /* @__PURE__ */ m.createElement("svg", g({
344
+ } = e, b = V(e, U), f = i || r.size || "1em", d;
345
+ return r.className && (d = r.className), e.className && (d = (d ? d + " " : "") + e.className), /* @__PURE__ */ h.createElement("svg", g({
346
346
  stroke: "currentColor",
347
347
  fill: "currentColor",
348
348
  strokeWidth: "0"
@@ -354,29 +354,29 @@ function G(e) {
354
354
  height: f,
355
355
  width: f,
356
356
  xmlns: "http://www.w3.org/2000/svg"
357
- }), c && /* @__PURE__ */ m.createElement("title", null, c), e.children);
357
+ }), c && /* @__PURE__ */ h.createElement("title", null, c), e.children);
358
358
  };
359
- return y !== void 0 ? /* @__PURE__ */ m.createElement(y.Consumer, null, (r) => t(r)) : t(O);
360
- }
361
- function J(e) {
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);
359
+ return y !== void 0 ? /* @__PURE__ */ h.createElement(y.Consumer, null, (r) => t(r)) : t(j);
363
360
  }
364
361
  function Q(e) {
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);
362
+ return R({ 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);
366
363
  }
367
- function pe({
364
+ function ee(e) {
365
+ return R({ 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);
366
+ }
367
+ function be({
368
368
  value: e,
369
369
  onChange: t,
370
370
  onSubmit: r,
371
371
  isLoading: n,
372
- error: l
372
+ error: i
373
373
  }) {
374
- const { t: c } = u(h), b = n ? /* @__PURE__ */ a("span", { className: "loading loading-spinner loading-sm" }) : c("hero.checkSafety"), f = n || !e.trim();
375
- return /* @__PURE__ */ a("div", { className: "flex w-full flex-col items-center justify-center", children: /* @__PURE__ */ i("div", { className: "w-full lg:max-w-[720px]", children: [
374
+ const { t: c } = m(u), b = n ? /* @__PURE__ */ a("span", { className: "loading loading-spinner loading-sm" }) : c("hero.checkSafety"), f = n || !e.trim();
375
+ return /* @__PURE__ */ a("div", { className: "flex w-full flex-col items-center justify-center", children: /* @__PURE__ */ l("div", { className: "w-full lg:max-w-[720px]", children: [
376
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") }),
377
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") }),
378
- /* @__PURE__ */ i("div", { className: S("mb-4", !l && "sm:mb-8 md:mb-12"), children: [
379
- /* @__PURE__ */ i("div", { className: "relative hidden lg:block", children: [
378
+ /* @__PURE__ */ l("div", { className: O("mb-4", !i && "sm:mb-8 md:mb-12"), children: [
379
+ /* @__PURE__ */ l("div", { className: "relative hidden lg:block", children: [
380
380
  /* @__PURE__ */ a(
381
381
  "input",
382
382
  {
@@ -402,13 +402,13 @@ function pe({
402
402
  }
403
403
  )
404
404
  ] }),
405
- /* @__PURE__ */ a("div", { className: "block lg:hidden", children: /* @__PURE__ */ i("div", { className: "relative h-[400px] w-full overflow-hidden rounded-xl border border-base-300 bg-base-100", children: [
405
+ /* @__PURE__ */ a("div", { className: "block lg:hidden", children: /* @__PURE__ */ l("div", { className: "relative h-[400px] w-full overflow-hidden rounded-xl border border-base-300 bg-base-100", children: [
406
406
  !e && /* @__PURE__ */ a(
407
407
  "div",
408
408
  {
409
409
  className: "pointer-events-none absolute inset-0 overflow-hidden p-5 pb-24 text-base text-base-300",
410
410
  "aria-hidden": "true",
411
- children: /* @__PURE__ */ i("div", { className: "whitespace-pre-line leading-relaxed", children: [
411
+ children: /* @__PURE__ */ l("div", { className: "whitespace-pre-line leading-relaxed", children: [
412
412
  /* @__PURE__ */ a("p", { className: "mb-4 text-base-300", children: c("hero.placeholder") }),
413
413
  c("hero.placeholderExample")
414
414
  ] })
@@ -436,9 +436,9 @@ function pe({
436
436
  ) })
437
437
  ] }) })
438
438
  ] }),
439
- l && /* @__PURE__ */ a("div", { className: "alert alert-error mb-6 flex items-center gap-2 text-sm", children: /* @__PURE__ */ a("span", { children: l }) }),
439
+ i && /* @__PURE__ */ a("div", { className: "alert alert-error mb-6 flex items-center gap-2 text-sm", children: /* @__PURE__ */ a("span", { children: i }) }),
440
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") }),
441
- /* @__PURE__ */ i("div", { className: "flex items-center justify-start gap-6 sm:justify-center", children: [
441
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-start gap-6 sm:justify-center", children: [
442
442
  /* @__PURE__ */ a(
443
443
  "a",
444
444
  {
@@ -446,7 +446,7 @@ function pe({
446
446
  target: "_blank",
447
447
  rel: "noopener noreferrer",
448
448
  "aria-label": "X",
449
- children: /* @__PURE__ */ a(Q, { className: "size-6 text-base-content transition-colors hover:text-base-content/70" })
449
+ children: /* @__PURE__ */ a(ee, { className: "size-6 text-base-content transition-colors hover:text-base-content/70" })
450
450
  }
451
451
  ),
452
452
  /* @__PURE__ */ a(
@@ -456,41 +456,51 @@ function pe({
456
456
  target: "_blank",
457
457
  rel: "noopener noreferrer",
458
458
  "aria-label": "Reddit",
459
- children: /* @__PURE__ */ a(J, { className: "size-6 text-base-content transition-colors hover:text-base-content/70" })
459
+ children: /* @__PURE__ */ a(Q, { className: "size-6 text-base-content transition-colors hover:text-base-content/70" })
460
460
  }
461
461
  )
462
462
  ] })
463
463
  ] }) });
464
464
  }
465
- const w = s.object({
465
+ function ge({ level: e, score: t }) {
466
+ const { t: r } = m(u);
467
+ return /* @__PURE__ */ l("div", { className: "mb-4 rounded-lg", children: [
468
+ /* @__PURE__ */ a("h1", { className: "mb-2 text-3xl font-bold", children: r(`result.safetyLevel.${e}.title`) }),
469
+ /* @__PURE__ */ a("p", { className: "mt-2 text-sm text-neutral", children: r(`result.safetyLevel.${e}.description`, { score: t }) })
470
+ ] });
471
+ }
472
+ const _ = {
473
+ safe: 70,
474
+ caution: 40
475
+ }, xe = (e) => e >= _.safe ? "safe" : e >= _.caution ? "caution" : "danger", w = s.object({
466
476
  category: s.enum(["payment", "seller", "platform", "price", "content"]),
467
477
  severity: s.enum(["high", "medium", "low"]),
468
478
  title: s.string(),
469
479
  description: s.string(),
470
480
  what_to_do: s.string()
471
- }), ee = s.object({
481
+ }), te = s.object({
472
482
  market_price_range: s.string().nullish(),
473
483
  offered_price: s.number().nullish(),
474
484
  currency: s.string().nullish(),
475
485
  price_assessment: s.string(),
476
486
  warnings: s.array(s.string())
477
- }), te = s.object({
487
+ }), re = s.object({
478
488
  ai_summary: s.string(),
479
489
  translation: s.string().nullish(),
480
490
  nuance_explanation: s.string().nullish(),
481
491
  risk_signals: s.array(w),
482
492
  cautions: s.array(w),
483
493
  safe_indicators: s.array(w),
484
- price_analysis: ee,
494
+ price_analysis: te,
485
495
  safety_checklist: s.array(s.string()),
486
496
  safe_score: s.number(),
487
497
  recommendation: s.string(),
488
498
  emotional_support: s.string()
489
- }), re = s.object({
499
+ }), ne = s.object({
490
500
  id: s.string(),
491
501
  user_id: s.string().nullish(),
492
502
  input_text: s.string(),
493
- llm_analysis: te,
503
+ llm_analysis: re,
494
504
  safe_score: s.number(),
495
505
  expert_advice: s.string().nullish(),
496
506
  expert_reviewed: s.boolean(),
@@ -498,47 +508,45 @@ const w = s.object({
498
508
  expert_reviewed_by: s.string().nullish(),
499
509
  created_at: s.string(),
500
510
  updated_at: s.string()
501
- }), ne = s.enum(["twitter"]), ae = s.object({
502
- platform: ne,
511
+ }), ae = s.enum(["twitter"]), se = s.object({
512
+ platform: ae,
503
513
  author: s.string(),
504
514
  created_at: s.string().nullish(),
505
515
  text: s.string(),
506
516
  text_preview: s.string(),
507
517
  images: s.array(s.string())
508
- }), se = s.object({
509
- data: ae
518
+ }), le = s.object({
519
+ data: se
510
520
  });
511
- class be extends R {
521
+ class ve extends P {
512
522
  constructor() {
513
523
  super(...arguments), this.resource = "trade-safety";
514
524
  }
515
525
  getDataSchema() {
516
- return re;
526
+ return ne;
517
527
  }
518
528
  /**
519
529
  * Fetch post preview metadata from a social media URL
520
530
  * POST /trade-safety/preview
521
531
  */
522
532
  async fetchPreview(t, r) {
523
- const n = `${this.apiService.buildUrl(this.resource)}/preview`, l = await this.apiService.request(n, {
533
+ const n = `${this.apiService.buildUrl(this.resource)}/preview`, i = await this.apiService.request(n, {
524
534
  ...r,
525
535
  method: "POST",
526
536
  headers: { "Content-Type": "application/json" },
527
537
  body: JSON.stringify({ url: t })
528
538
  });
529
- return this.validateResponse(l, se).data;
539
+ return this.validateResponse(i, le).data;
530
540
  }
531
541
  }
532
- const ge = {
533
- safe: 70,
534
- caution: 40
535
- };
536
542
  export {
537
- fe as DetailedResult,
538
- pe as HomeHeroSection,
539
- ge as SAFETY_SCORE_THRESHOLDS,
540
- h as TRADE_SAFETY_NS,
541
- be as TradeSafetyRepository,
542
- we as tradeSafetyTranslations
543
+ pe as DetailedResult,
544
+ be as HomeHeroSection,
545
+ ge as PageHeader,
546
+ _ as SAFETY_SCORE_THRESHOLDS,
547
+ u as TRADE_SAFETY_NS,
548
+ ve as TradeSafetyRepository,
549
+ xe as getSafetyLevel,
550
+ Ne as tradeSafetyTranslations
543
551
  };
544
552
  //# sourceMappingURL=index.mjs.map