trade-safety 1.2.0 → 1.3.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,305 +1,507 @@
1
- import { jsxs as i, jsx as s } from "react/jsx-runtime";
2
- import { useTranslation as o } from "react-i18next";
1
+ import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
+ import { useTranslation as h } from "react-i18next";
3
3
  import "i18next";
4
4
  import "i18next-resources-to-backend";
5
- import { TRADE_SAFETY_NS as d } from "./locale.mjs";
6
- import { tradeSafetyTranslations as J } from "./locale.mjs";
7
- import * as c from "react";
8
- import { BaseCrudRepository as p } from "@aioia/core";
9
- import { z as r } from "zod";
10
- function f(e) {
11
- var t, n, a = "";
12
- if (typeof e == "string" || typeof e == "number") a += e;
5
+ import { TRADE_SAFETY_NS as f } from "./locale.mjs";
6
+ import { tradeSafetyTranslations as be } from "./locale.mjs";
7
+ import * as o from "react";
8
+ import m from "react";
9
+ import { BaseCrudRepository as R } from "@aioia/core";
10
+ import { z as l } from "zod";
11
+ function _(e) {
12
+ var t, r, n = "";
13
+ if (typeof e == "string" || typeof e == "number") n += e;
13
14
  else if (typeof e == "object") if (Array.isArray(e)) {
14
- var l = e.length;
15
- for (t = 0; t < l; t++) e[t] && (n = f(e[t])) && (a && (a += " "), a += n);
16
- } else for (n in e) e[n] && (a && (a += " "), a += n);
17
- return a;
15
+ var s = e.length;
16
+ for (t = 0; t < s; t++) e[t] && (r = _(e[t])) && (n && (n += " "), n += r);
17
+ } else for (r in e) e[r] && (n && (n += " "), n += r);
18
+ return n;
18
19
  }
19
- function b() {
20
- for (var e, t, n = 0, a = "", l = arguments.length; n < l; n++) (e = arguments[n]) && (t = f(e)) && (a && (a += " "), a += t);
21
- return a;
20
+ function O() {
21
+ for (var e, t, r = 0, n = "", s = arguments.length; r < s; r++) (e = arguments[r]) && (t = _(e)) && (n && (n += " "), n += t);
22
+ return n;
22
23
  }
23
- const _ = {
24
+ const k = {
24
25
  default: "border-base-300",
25
26
  error: "border-error bg-error/10",
26
27
  warning: "border-warning bg-warning/10",
27
28
  success: "border-success bg-success/10",
28
29
  info: "border-info bg-info/10"
29
30
  };
30
- function u({
31
+ function p({
31
32
  title: e,
32
33
  icon: t,
33
- variant: n = "default",
34
- children: a
34
+ variant: r = "default",
35
+ children: n
35
36
  }) {
36
- return a ? /* @__PURE__ */ i("div", { className: b("rounded-lg border p-6", _[n]), children: [
37
+ return n ? /* @__PURE__ */ i("div", { className: O("rounded-lg border p-6", k[r]), children: [
37
38
  e && /* @__PURE__ */ i("h2", { className: "mb-2 flex items-center gap-2 font-bold", children: [
38
39
  e,
39
40
  t
40
41
  ] }),
41
- a
42
+ n
42
43
  ] }) : null;
43
44
  }
44
- function x({ data: e }) {
45
- const { t, i18n: n } = o(d);
46
- return e ? /* @__PURE__ */ i(u, { title: t("result.priceAnalysis"), children: [
45
+ function C({ data: e }) {
46
+ const { t, i18n: r } = h(f);
47
+ return e ? /* @__PURE__ */ i(p, { title: t("result.priceAnalysis"), children: [
47
48
  e.market_price_range && /* @__PURE__ */ i("div", { className: "mb-2", children: [
48
- /* @__PURE__ */ s("h3", { className: "text-sm font-bold", children: t("result.marketPrice") }),
49
- /* @__PURE__ */ s("p", { className: "text-xs", children: e.market_price_range })
49
+ /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: t("result.marketPrice") }),
50
+ /* @__PURE__ */ a("p", { className: "text-xs", children: e.market_price_range })
50
51
  ] }),
51
52
  e.offered_price && /* @__PURE__ */ i("div", { className: "mb-2", children: [
52
- /* @__PURE__ */ s("h3", { className: "text-sm font-bold", children: t("result.offeredPrice") }),
53
- /* @__PURE__ */ s("p", { className: "text-xs", children: new Intl.NumberFormat(n.language, {
53
+ /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: t("result.offeredPrice") }),
54
+ /* @__PURE__ */ a("p", { className: "text-xs", children: new Intl.NumberFormat(r.language, {
54
55
  style: "currency",
55
56
  currency: e.currency || "USD"
56
57
  }).format(e.offered_price) })
57
58
  ] }),
58
59
  e.price_assessment && /* @__PURE__ */ i("div", { children: [
59
- /* @__PURE__ */ s("h3", { className: "text-sm font-bold", children: t("result.priceAssessment") }),
60
- /* @__PURE__ */ s("p", { className: "text-xs", children: e.price_assessment })
60
+ /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: t("result.priceAssessment") }),
61
+ /* @__PURE__ */ a("p", { className: "text-xs", children: e.price_assessment })
61
62
  ] })
62
63
  ] }) : null;
63
64
  }
64
- function v({
65
+ function P({
65
66
  recommendation: e
66
67
  }) {
67
- const { t } = o(d);
68
- return e ? /* @__PURE__ */ s(u, { title: t("result.recommendation"), children: /* @__PURE__ */ s("p", { className: "text-xs", children: e }) }) : null;
68
+ const { t } = h(f);
69
+ return e ? /* @__PURE__ */ a(p, { title: t("result.recommendation"), children: /* @__PURE__ */ a("p", { className: "text-xs", children: e }) }) : null;
69
70
  }
70
- function w({
71
+ function z({
71
72
  title: e,
72
73
  titleId: t,
73
- ...n
74
- }, a) {
75
- return /* @__PURE__ */ c.createElement("svg", Object.assign({
74
+ ...r
75
+ }, n) {
76
+ return /* @__PURE__ */ o.createElement("svg", Object.assign({
76
77
  xmlns: "http://www.w3.org/2000/svg",
77
78
  viewBox: "0 0 24 24",
78
79
  fill: "currentColor",
79
80
  "aria-hidden": "true",
80
81
  "data-slot": "icon",
81
- ref: a,
82
+ ref: n,
82
83
  "aria-labelledby": t
83
- }, n), e ? /* @__PURE__ */ c.createElement("title", {
84
+ }, r), e ? /* @__PURE__ */ o.createElement("title", {
84
85
  id: t
85
- }, e) : null, /* @__PURE__ */ c.createElement("path", {
86
+ }, e) : null, /* @__PURE__ */ o.createElement("path", {
86
87
  fillRule: "evenodd",
87
88
  d: "M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
88
89
  clipRule: "evenodd"
89
90
  }));
90
91
  }
91
- const y = /* @__PURE__ */ c.forwardRef(w);
92
- function N({
92
+ const T = /* @__PURE__ */ o.forwardRef(z);
93
+ function A({
93
94
  title: e,
94
95
  titleId: t,
95
- ...n
96
- }, a) {
97
- return /* @__PURE__ */ c.createElement("svg", Object.assign({
96
+ ...r
97
+ }, n) {
98
+ return /* @__PURE__ */ o.createElement("svg", Object.assign({
98
99
  xmlns: "http://www.w3.org/2000/svg",
99
100
  viewBox: "0 0 24 24",
100
101
  fill: "currentColor",
101
102
  "aria-hidden": "true",
102
103
  "data-slot": "icon",
103
- ref: a,
104
+ ref: n,
104
105
  "aria-labelledby": t
105
- }, n), e ? /* @__PURE__ */ c.createElement("title", {
106
+ }, r), e ? /* @__PURE__ */ o.createElement("title", {
106
107
  id: t
107
- }, e) : null, /* @__PURE__ */ c.createElement("path", {
108
+ }, e) : null, /* @__PURE__ */ o.createElement("path", {
108
109
  fillRule: "evenodd",
109
110
  d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",
110
111
  clipRule: "evenodd"
111
112
  }));
112
113
  }
113
- const S = /* @__PURE__ */ c.forwardRef(N);
114
- function R({
114
+ const D = /* @__PURE__ */ o.forwardRef(A);
115
+ function M({
115
116
  title: e,
116
117
  titleId: t,
117
- ...n
118
- }, a) {
119
- return /* @__PURE__ */ c.createElement("svg", Object.assign({
118
+ ...r
119
+ }, n) {
120
+ return /* @__PURE__ */ o.createElement("svg", Object.assign({
120
121
  xmlns: "http://www.w3.org/2000/svg",
121
122
  viewBox: "0 0 24 24",
122
123
  fill: "currentColor",
123
124
  "aria-hidden": "true",
124
125
  "data-slot": "icon",
125
- ref: a,
126
+ ref: n,
126
127
  "aria-labelledby": t
127
- }, n), e ? /* @__PURE__ */ c.createElement("title", {
128
+ }, r), e ? /* @__PURE__ */ o.createElement("title", {
128
129
  id: t
129
- }, e) : null, /* @__PURE__ */ c.createElement("path", {
130
+ }, e) : null, /* @__PURE__ */ o.createElement("path", {
130
131
  fillRule: "evenodd",
131
132
  d: "M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-2.625 6c-.54 0-.828.419-.936.634a1.96 1.96 0 0 0-.189.866c0 .298.059.605.189.866.108.215.395.634.936.634.54 0 .828-.419.936-.634.13-.26.189-.568.189-.866 0-.298-.059-.605-.189-.866-.108-.215-.395-.634-.936-.634Zm4.314.634c.108-.215.395-.634.936-.634.54 0 .828.419.936.634.13.26.189.568.189.866 0 .298-.059.605-.189.866-.108.215-.395.634-.936.634-.54 0-.828-.419-.936-.634a1.96 1.96 0 0 1-.189-.866c0-.298.059-.605.189-.866Zm-4.34 7.964a.75.75 0 0 1-1.061-1.06 5.236 5.236 0 0 1 3.73-1.538 5.236 5.236 0 0 1 3.695 1.538.75.75 0 1 1-1.061 1.06 3.736 3.736 0 0 0-2.639-1.098 3.736 3.736 0 0 0-2.664 1.098Z",
132
133
  clipRule: "evenodd"
133
134
  }));
134
135
  }
135
- const k = /* @__PURE__ */ c.forwardRef(R);
136
- function E({
136
+ const Z = /* @__PURE__ */ o.forwardRef(M);
137
+ function B({
137
138
  title: e,
138
139
  titleId: t,
139
- ...n
140
- }, a) {
141
- return /* @__PURE__ */ c.createElement("svg", Object.assign({
140
+ ...r
141
+ }, n) {
142
+ return /* @__PURE__ */ o.createElement("svg", Object.assign({
142
143
  xmlns: "http://www.w3.org/2000/svg",
143
144
  viewBox: "0 0 24 24",
144
145
  fill: "currentColor",
145
146
  "aria-hidden": "true",
146
147
  "data-slot": "icon",
147
- ref: a,
148
+ ref: n,
148
149
  "aria-labelledby": t
149
- }, n), e ? /* @__PURE__ */ c.createElement("title", {
150
+ }, r), e ? /* @__PURE__ */ o.createElement("title", {
150
151
  id: t
151
- }, e) : null, /* @__PURE__ */ c.createElement("path", {
152
+ }, e) : null, /* @__PURE__ */ o.createElement("path", {
152
153
  fillRule: "evenodd",
153
154
  d: "M11.484 2.17a.75.75 0 0 1 1.032 0 11.209 11.209 0 0 0 7.877 3.08.75.75 0 0 1 .722.515 12.74 12.74 0 0 1 .635 3.985c0 5.942-4.064 10.933-9.563 12.348a.749.749 0 0 1-.374 0C6.314 20.683 2.25 15.692 2.25 9.75c0-1.39.223-2.73.635-3.985a.75.75 0 0 1 .722-.516l.143.001c2.996 0 5.718-1.17 7.734-3.08ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75ZM12 15a.75.75 0 0 0-.75.75v.008c0 .414.336.75.75.75h.008a.75.75 0 0 0 .75-.75v-.008a.75.75 0 0 0-.75-.75H12Z",
154
155
  clipRule: "evenodd"
155
156
  }));
156
157
  }
157
- const A = /* @__PURE__ */ c.forwardRef(E);
158
- function j({ items: e }) {
159
- const { t } = o(d);
158
+ const F = /* @__PURE__ */ o.forwardRef(B);
159
+ function H({ items: e }) {
160
+ const { t } = h(f);
160
161
  return e.length === 0 ? null : /* @__PURE__ */ i("div", { className: "mb-4", children: [
161
162
  /* @__PURE__ */ i("h2", { className: "flex items-center gap-1 py-4 font-bold", children: [
162
163
  t("result.safetyChecklist"),
163
164
  " ",
164
- /* @__PURE__ */ s(y, { className: "size-6" })
165
+ /* @__PURE__ */ a(T, { className: "size-6" })
165
166
  ] }),
166
- /* @__PURE__ */ s(u, { variant: "info", children: e.map((n, a) => /* @__PURE__ */ i("label", { className: "label w-fit cursor-pointer gap-2", children: [
167
- /* @__PURE__ */ s(
167
+ /* @__PURE__ */ a(p, { variant: "info", children: e.map((r, n) => /* @__PURE__ */ i("label", { className: "label w-fit cursor-pointer gap-2", children: [
168
+ /* @__PURE__ */ a(
168
169
  "input",
169
170
  {
170
171
  type: "checkbox",
171
172
  className: "checkbox rounded-full [--chkbg:theme(colors.neutral)] [--chkfg:theme(colors.neutral-content)]"
172
173
  }
173
174
  ),
174
- /* @__PURE__ */ s("span", { className: "label-text", children: n })
175
- ] }, a)) })
175
+ /* @__PURE__ */ a("span", { className: "label-text", children: r })
176
+ ] }, n)) })
176
177
  ] });
177
178
  }
178
- const C = {
179
- error: k,
180
- warning: S,
181
- success: A
182
- }, T = {
179
+ const I = {
180
+ error: Z,
181
+ warning: D,
182
+ success: F
183
+ }, L = {
183
184
  error: "result.riskSignals",
184
185
  warning: "result.cautions",
185
186
  success: "result.safeIndicators"
186
187
  };
187
- function m({
188
+ function v({
188
189
  signals: e,
189
190
  variant: t = "error"
190
191
  }) {
191
- const { t: n } = o(d);
192
+ const { t: r } = h(f);
192
193
  if (e.length === 0) return null;
193
- const a = C[t];
194
+ const n = I[t];
194
195
  return /* @__PURE__ */ i("div", { className: "mb-4", children: [
195
196
  /* @__PURE__ */ i("h2", { className: "flex items-center gap-1 py-4 font-bold", children: [
196
- n(T[t]),
197
+ r(L[t]),
197
198
  " ",
198
- /* @__PURE__ */ s(a, { className: "size-6" })
199
+ /* @__PURE__ */ a(n, { className: "size-6" })
199
200
  ] }),
200
- /* @__PURE__ */ s("div", { className: "space-y-3", children: e.map((l, g) => /* @__PURE__ */ s(u, { variant: t, children: /* @__PURE__ */ i("div", { className: "space-y-2", children: [
201
+ /* @__PURE__ */ a("div", { className: "space-y-3", children: e.map((s, c) => /* @__PURE__ */ a(p, { variant: t, children: /* @__PURE__ */ i("div", { className: "space-y-2", children: [
201
202
  /* @__PURE__ */ i("div", { children: [
202
- /* @__PURE__ */ s("h3", { className: "text-sm font-bold", children: l.title }),
203
- /* @__PURE__ */ s("p", { className: "text-xs", children: l.description })
203
+ /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: s.title }),
204
+ /* @__PURE__ */ a("p", { className: "text-xs", children: s.description })
204
205
  ] }),
205
206
  /* @__PURE__ */ i("div", { children: [
206
- /* @__PURE__ */ s("h3", { className: "text-sm font-bold", children: n("result.whatToDo") }),
207
- /* @__PURE__ */ s("p", { className: "text-xs", children: l.what_to_do })
207
+ /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: r("result.whatToDo") }),
208
+ /* @__PURE__ */ a("p", { className: "text-xs", children: s.what_to_do })
208
209
  ] })
209
- ] }) }, g)) })
210
+ ] }) }, c)) })
210
211
  ] });
211
212
  }
212
- function Z({
213
+ function K({
213
214
  translation: e,
214
215
  nuance: t
215
216
  }) {
216
- const { t: n } = o(d);
217
- return /* @__PURE__ */ i(u, { title: n("result.translation"), children: [
217
+ const { t: r } = h(f);
218
+ return /* @__PURE__ */ i(p, { title: r("result.translation"), children: [
218
219
  e && /* @__PURE__ */ i("div", { className: "mb-2", children: [
219
- /* @__PURE__ */ s("h3", { className: "text-sm font-bold", children: n("result.translationTitle") }),
220
- /* @__PURE__ */ s("p", { className: "text-xs", children: e })
220
+ /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: r("result.translationTitle") }),
221
+ /* @__PURE__ */ a("p", { className: "text-xs", children: e })
221
222
  ] }),
222
223
  t && /* @__PURE__ */ i("div", { children: [
223
- /* @__PURE__ */ s("h3", { className: "text-sm font-bold", children: n("result.nuanceTitle") }),
224
- /* @__PURE__ */ s("p", { className: "text-xs", children: t })
224
+ /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: r("result.nuanceTitle") }),
225
+ /* @__PURE__ */ a("p", { className: "text-xs", children: t })
225
226
  ] })
226
227
  ] });
227
228
  }
228
- function V({ analysis: e }) {
229
+ function de({ analysis: e }) {
229
230
  return /* @__PURE__ */ i("div", { children: [
230
231
  /* @__PURE__ */ i("div", { className: "mb-4 flex flex-col gap-4", children: [
231
- (e.translation || e.nuance_explanation) && /* @__PURE__ */ s(
232
- Z,
232
+ (e.translation || e.nuance_explanation) && /* @__PURE__ */ a(
233
+ K,
233
234
  {
234
235
  translation: e.translation,
235
236
  nuance: e.nuance_explanation
236
237
  }
237
238
  ),
238
- e.price_analysis && /* @__PURE__ */ s(x, { data: e.price_analysis }),
239
- e.recommendation && /* @__PURE__ */ s(v, { recommendation: e.recommendation })
239
+ e.price_analysis && /* @__PURE__ */ a(C, { data: e.price_analysis }),
240
+ e.recommendation && /* @__PURE__ */ a(P, { recommendation: e.recommendation })
240
241
  ] }),
241
- e.risk_signals.length > 0 && /* @__PURE__ */ s(m, { signals: e.risk_signals, variant: "error" }),
242
- e.cautions.length > 0 && /* @__PURE__ */ s(m, { signals: e.cautions, variant: "warning" }),
243
- e.safe_indicators.length > 0 && /* @__PURE__ */ s(m, { signals: e.safe_indicators, variant: "success" }),
244
- e.safety_checklist.length > 0 && /* @__PURE__ */ s(j, { items: e.safety_checklist })
242
+ e.risk_signals.length > 0 && /* @__PURE__ */ a(v, { signals: e.risk_signals, variant: "error" }),
243
+ e.cautions.length > 0 && /* @__PURE__ */ a(v, { signals: e.cautions, variant: "warning" }),
244
+ e.safe_indicators.length > 0 && /* @__PURE__ */ a(v, { signals: e.safe_indicators, variant: "success" }),
245
+ e.safety_checklist.length > 0 && /* @__PURE__ */ a(H, { items: e.safety_checklist })
245
246
  ] });
246
247
  }
247
- const h = r.object({
248
- category: r.enum(["payment", "seller", "platform", "price", "content"]),
249
- severity: r.enum(["high", "medium", "low"]),
250
- title: r.string(),
251
- description: r.string(),
252
- what_to_do: r.string()
253
- }), F = r.object({
254
- market_price_range: r.string().nullish(),
255
- offered_price: r.number().nullish(),
256
- currency: r.string().nullish(),
257
- price_assessment: r.string(),
258
- warnings: r.array(r.string())
259
- }), M = r.object({
260
- translation: r.string().nullish(),
261
- nuance_explanation: r.string().nullish(),
262
- risk_signals: r.array(h),
263
- cautions: r.array(h),
264
- safe_indicators: r.array(h),
265
- price_analysis: F,
266
- safety_checklist: r.array(r.string()),
267
- risk_score: r.number(),
268
- recommendation: r.string(),
269
- emotional_support: r.string()
270
- }), B = r.object({
271
- risk_signals_count: r.number(),
272
- cautions_count: r.number(),
273
- safe_indicators_count: r.number()
274
- }), D = r.object({
275
- id: r.string(),
276
- user_id: r.string().nullish(),
277
- input_text: r.string(),
278
- llm_analysis: M,
279
- risk_score: r.number(),
280
- expert_advice: r.string().nullish(),
281
- expert_reviewed: r.boolean(),
282
- expert_reviewed_at: r.string().nullish(),
283
- expert_reviewed_by: r.string().nullish(),
284
- created_at: r.string(),
285
- updated_at: r.string()
286
- }), O = r.union([
287
- D,
288
- r.object({
289
- id: r.string(),
290
- quick_summary: B,
291
- signup_required: r.literal(!0)
292
- })
293
- ]);
294
- class K extends p {
248
+ var S = {
249
+ color: void 0,
250
+ size: void 0,
251
+ className: void 0,
252
+ style: void 0,
253
+ attr: void 0
254
+ }, y = m.createContext && /* @__PURE__ */ m.createContext(S), W = ["attr", "size", "title"];
255
+ function $(e, t) {
256
+ if (e == null) return {};
257
+ var r = V(e, t), n, s;
258
+ if (Object.getOwnPropertySymbols) {
259
+ var c = Object.getOwnPropertySymbols(e);
260
+ for (s = 0; s < c.length; s++)
261
+ n = c[s], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
262
+ }
263
+ return r;
264
+ }
265
+ function V(e, t) {
266
+ if (e == null) return {};
267
+ var r = {};
268
+ for (var n in e)
269
+ if (Object.prototype.hasOwnProperty.call(e, n)) {
270
+ if (t.indexOf(n) >= 0) continue;
271
+ r[n] = e[n];
272
+ }
273
+ return r;
274
+ }
275
+ function g() {
276
+ return g = Object.assign ? Object.assign.bind() : function(e) {
277
+ for (var t = 1; t < arguments.length; t++) {
278
+ var r = arguments[t];
279
+ for (var n in r)
280
+ Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
281
+ }
282
+ return e;
283
+ }, g.apply(this, arguments);
284
+ }
285
+ function N(e, t) {
286
+ var r = Object.keys(e);
287
+ if (Object.getOwnPropertySymbols) {
288
+ var n = Object.getOwnPropertySymbols(e);
289
+ t && (n = n.filter(function(s) {
290
+ return Object.getOwnPropertyDescriptor(e, s).enumerable;
291
+ })), r.push.apply(r, n);
292
+ }
293
+ return r;
294
+ }
295
+ function x(e) {
296
+ for (var t = 1; t < arguments.length; t++) {
297
+ var r = arguments[t] != null ? arguments[t] : {};
298
+ t % 2 ? N(Object(r), !0).forEach(function(n) {
299
+ X(e, n, r[n]);
300
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : N(Object(r)).forEach(function(n) {
301
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
302
+ });
303
+ }
304
+ return e;
305
+ }
306
+ function X(e, t, r) {
307
+ return t = G(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
308
+ }
309
+ function G(e) {
310
+ var t = U(e, "string");
311
+ return typeof t == "symbol" ? t : t + "";
312
+ }
313
+ function U(e, t) {
314
+ if (typeof e != "object" || !e) return e;
315
+ var r = e[Symbol.toPrimitive];
316
+ if (r !== void 0) {
317
+ var n = r.call(e, t);
318
+ if (typeof n != "object") return n;
319
+ throw new TypeError("@@toPrimitive must return a primitive value.");
320
+ }
321
+ return (t === "string" ? String : Number)(e);
322
+ }
323
+ function j(e) {
324
+ return e && e.map((t, r) => /* @__PURE__ */ m.createElement(t.tag, x({
325
+ key: r
326
+ }, t.attr), j(t.child)));
327
+ }
328
+ function E(e) {
329
+ return (t) => /* @__PURE__ */ m.createElement(Y, g({
330
+ attr: x({}, e.attr)
331
+ }, t), j(e.child));
332
+ }
333
+ function Y(e) {
334
+ var t = (r) => {
335
+ var {
336
+ attr: n,
337
+ size: s,
338
+ title: c
339
+ } = e, b = $(e, W), u = s || r.size || "1em", d;
340
+ return r.className && (d = r.className), e.className && (d = (d ? d + " " : "") + e.className), /* @__PURE__ */ m.createElement("svg", g({
341
+ stroke: "currentColor",
342
+ fill: "currentColor",
343
+ strokeWidth: "0"
344
+ }, r.attr, n, b, {
345
+ className: d,
346
+ style: x(x({
347
+ color: e.color || r.color
348
+ }, r.style), e.style),
349
+ height: u,
350
+ width: u,
351
+ xmlns: "http://www.w3.org/2000/svg"
352
+ }), c && /* @__PURE__ */ m.createElement("title", null, c), e.children);
353
+ };
354
+ return y !== void 0 ? /* @__PURE__ */ m.createElement(y.Consumer, null, (r) => t(r)) : t(S);
355
+ }
356
+ function q(e) {
357
+ 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
+ }
359
+ function J(e) {
360
+ 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
+ }
362
+ function me({
363
+ value: e,
364
+ onChange: t,
365
+ onSubmit: r,
366
+ isLoading: n,
367
+ error: s
368
+ }) {
369
+ const { t: c } = h(f), b = n ? /* @__PURE__ */ a("span", { className: "loading loading-spinner loading-sm" }) : c("hero.checkSafety"), u = n || !e.trim();
370
+ 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: [
371
+ /* @__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
+ /* @__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__ */ i("div", { className: O("mb-4", !s && "sm:mb-8 md:mb-12"), children: [
374
+ /* @__PURE__ */ i("div", { className: "relative hidden lg:block", children: [
375
+ /* @__PURE__ */ a(
376
+ "input",
377
+ {
378
+ type: "text",
379
+ className: "input input-bordered h-[72px] w-full pr-36 text-sm placeholder:text-base-300 focus:outline-none",
380
+ placeholder: c("hero.placeholder"),
381
+ "aria-label": c("hero.placeholder"),
382
+ value: e,
383
+ onChange: (d) => t(d.target.value),
384
+ disabled: n,
385
+ onKeyDown: (d) => {
386
+ d.key === "Enter" && !u && r();
387
+ }
388
+ }
389
+ ),
390
+ /* @__PURE__ */ a(
391
+ "button",
392
+ {
393
+ 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
+ onClick: r,
395
+ disabled: u,
396
+ children: b
397
+ }
398
+ )
399
+ ] }),
400
+ /* @__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: [
401
+ !e && /* @__PURE__ */ a(
402
+ "div",
403
+ {
404
+ className: "pointer-events-none absolute inset-0 overflow-hidden p-5 pb-24 text-base text-base-300",
405
+ "aria-hidden": "true",
406
+ children: /* @__PURE__ */ i("div", { className: "whitespace-pre-line leading-relaxed", children: [
407
+ /* @__PURE__ */ a("p", { className: "mb-4 text-base-300", children: c("hero.placeholder") }),
408
+ c("hero.placeholderExample")
409
+ ] })
410
+ }
411
+ ),
412
+ /* @__PURE__ */ a("div", { className: "absolute inset-0 overflow-hidden pb-24", children: /* @__PURE__ */ a(
413
+ "textarea",
414
+ {
415
+ className: "textarea size-full resize-none overflow-auto bg-transparent p-4 leading-6 text-base-content focus:outline-none",
416
+ value: e,
417
+ "aria-label": c("hero.placeholder"),
418
+ onChange: (d) => t(d.target.value),
419
+ disabled: n,
420
+ placeholder: ""
421
+ }
422
+ ) }),
423
+ /* @__PURE__ */ a("div", { className: "absolute inset-x-4 bottom-4 z-10", children: /* @__PURE__ */ a(
424
+ "button",
425
+ {
426
+ className: "btn btn-neutral h-16 w-full text-base font-medium text-neutral-content",
427
+ onClick: r,
428
+ disabled: u,
429
+ children: b
430
+ }
431
+ ) })
432
+ ] }) })
433
+ ] }),
434
+ s && /* @__PURE__ */ a("div", { className: "alert alert-error mb-6 flex items-center gap-2 text-sm", children: /* @__PURE__ */ a("span", { children: s }) }),
435
+ /* @__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__ */ i("div", { className: "flex items-center justify-start gap-6 sm:justify-center", children: [
437
+ /* @__PURE__ */ a(
438
+ "a",
439
+ {
440
+ href: "https://x.com",
441
+ target: "_blank",
442
+ rel: "noopener noreferrer",
443
+ "aria-label": "X",
444
+ children: /* @__PURE__ */ a(J, { className: "size-6 text-base-content transition-colors hover:text-base-content/70" })
445
+ }
446
+ ),
447
+ /* @__PURE__ */ a(
448
+ "a",
449
+ {
450
+ href: "https://reddit.com",
451
+ target: "_blank",
452
+ rel: "noopener noreferrer",
453
+ "aria-label": "Reddit",
454
+ children: /* @__PURE__ */ a(q, { className: "size-6 text-base-content transition-colors hover:text-base-content/70" })
455
+ }
456
+ )
457
+ ] })
458
+ ] }) });
459
+ }
460
+ const w = l.object({
461
+ category: l.enum(["payment", "seller", "platform", "price", "content"]),
462
+ severity: l.enum(["high", "medium", "low"]),
463
+ title: l.string(),
464
+ description: l.string(),
465
+ what_to_do: l.string()
466
+ }), Q = l.object({
467
+ market_price_range: l.string().nullish(),
468
+ offered_price: l.number().nullish(),
469
+ currency: l.string().nullish(),
470
+ price_assessment: l.string(),
471
+ warnings: l.array(l.string())
472
+ }), ee = l.object({
473
+ translation: l.string().nullish(),
474
+ nuance_explanation: l.string().nullish(),
475
+ risk_signals: l.array(w),
476
+ cautions: l.array(w),
477
+ safe_indicators: l.array(w),
478
+ price_analysis: Q,
479
+ safety_checklist: l.array(l.string()),
480
+ risk_score: l.number(),
481
+ recommendation: l.string(),
482
+ emotional_support: l.string()
483
+ }), te = l.object({
484
+ id: l.string(),
485
+ user_id: l.string().nullish(),
486
+ input_text: l.string(),
487
+ llm_analysis: ee,
488
+ risk_score: l.number(),
489
+ expert_advice: l.string().nullish(),
490
+ expert_reviewed: l.boolean(),
491
+ expert_reviewed_at: l.string().nullish(),
492
+ expert_reviewed_by: l.string().nullish(),
493
+ created_at: l.string(),
494
+ updated_at: l.string()
495
+ });
496
+ class ue extends R {
295
497
  constructor() {
296
498
  super(...arguments), this.resource = "trade-safety";
297
499
  }
298
500
  getDataSchema() {
299
- return O;
501
+ return te;
300
502
  }
301
503
  }
302
- const U = {
504
+ const he = {
303
505
  high: 70,
304
506
  // >= 70: High risk (red)
305
507
  medium: 40
@@ -307,10 +509,11 @@ const U = {
307
509
  // < 40: Low risk (green)
308
510
  };
309
511
  export {
310
- V as DetailedResult,
311
- U as RISK_SCORE_THRESHOLDS,
312
- d as TRADE_SAFETY_NS,
313
- K as TradeSafetyRepository,
314
- J as tradeSafetyTranslations
512
+ de as DetailedResult,
513
+ me as HomeHeroSection,
514
+ he as RISK_SCORE_THRESHOLDS,
515
+ f as TRADE_SAFETY_NS,
516
+ ue as TradeSafetyRepository,
517
+ be as tradeSafetyTranslations
315
518
  };
316
519
  //# sourceMappingURL=index.mjs.map