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.
@@ -0,0 +1,9 @@
1
+ export interface HomeHeroSectionProps {
2
+ value: string;
3
+ onChange: (value: string) => void;
4
+ onSubmit: () => void;
5
+ isLoading: boolean;
6
+ error: string | null;
7
+ }
8
+ export declare function HomeHeroSection({ value, onChange, onSubmit, isLoading, error, }: HomeHeroSectionProps): import("react").JSX.Element;
9
+ //# sourceMappingURL=HomeHeroSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HomeHeroSection.d.ts","sourceRoot":"","sources":["../../src/components/HomeHeroSection.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,KAAK,GACN,EAAE,oBAAoB,+BAqHtB"}
@@ -24,12 +24,14 @@ export declare const tradeSafetyTranslations: {
24
24
  title: string;
25
25
  subtitle: string;
26
26
  placeholder: string;
27
+ placeholderExample: string;
27
28
  advancedOptions: string;
28
29
  amountPlaceholder: string;
29
30
  checkSafety: string;
30
31
  analyzing: string;
31
32
  analyzingDescription: string;
32
33
  tryExample: string;
34
+ disclaimer: string;
33
35
  };
34
36
  features: {
35
37
  title: string;
@@ -115,12 +117,14 @@ export declare const tradeSafetyTranslations: {
115
117
  title: string;
116
118
  subtitle: string;
117
119
  placeholder: string;
120
+ placeholderExample: string;
118
121
  advancedOptions: string;
119
122
  amountPlaceholder: string;
120
123
  checkSafety: string;
121
124
  analyzing: string;
122
125
  analyzingDescription: string;
123
126
  tryExample: string;
127
+ disclaimer: string;
124
128
  };
125
129
  features: {
126
130
  title: string;
@@ -206,12 +210,14 @@ export declare const tradeSafetyTranslations: {
206
210
  title: string;
207
211
  subtitle: string;
208
212
  placeholder: string;
213
+ placeholderExample: string;
209
214
  advancedOptions: string;
210
215
  amountPlaceholder: string;
211
216
  checkSafety: string;
212
217
  analyzing: string;
213
218
  analyzingDescription: string;
214
219
  tryExample: string;
220
+ disclaimer: string;
215
221
  };
216
222
  features: {
217
223
  title: string;
@@ -297,12 +303,14 @@ export declare const tradeSafetyTranslations: {
297
303
  title: string;
298
304
  subtitle: string;
299
305
  placeholder: string;
306
+ placeholderExample: string;
300
307
  advancedOptions: string;
301
308
  amountPlaceholder: string;
302
309
  checkSafety: string;
303
310
  analyzing: string;
304
311
  analyzingDescription: string;
305
312
  tryExample: string;
313
+ disclaimer: string;
306
314
  };
307
315
  features: {
308
316
  title: string;
@@ -388,12 +396,14 @@ export declare const tradeSafetyTranslations: {
388
396
  title: string;
389
397
  subtitle: string;
390
398
  placeholder: string;
399
+ placeholderExample: string;
391
400
  advancedOptions: string;
392
401
  amountPlaceholder: string;
393
402
  checkSafety: string;
394
403
  analyzing: string;
395
404
  analyzingDescription: string;
396
405
  tryExample: string;
406
+ disclaimer: string;
397
407
  };
398
408
  features: {
399
409
  title: string;
@@ -479,12 +489,14 @@ export declare const tradeSafetyTranslations: {
479
489
  title: string;
480
490
  subtitle: string;
481
491
  placeholder: string;
492
+ placeholderExample: string;
482
493
  advancedOptions: string;
483
494
  amountPlaceholder: string;
484
495
  checkSafety: string;
485
496
  analyzing: string;
486
497
  analyzingDescription: string;
487
498
  tryExample: string;
499
+ disclaimer: string;
488
500
  };
489
501
  features: {
490
502
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../src/i18n/translations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,6BAA6B;AAC7B,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOnC,CAAC"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../src/i18n/translations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,6BAA6B;AAC7B,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOnC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -4,8 +4,10 @@
4
4
  * AI-powered safety analysis for K-pop merchandise trading
5
5
  */
6
6
  export { DetailedResult } from './components/DetailedResult';
7
+ export { HomeHeroSection } from './components/HomeHeroSection';
8
+ export type { HomeHeroSectionProps } from './components/HomeHeroSection';
7
9
  export { TradeSafetyRepository } from './repositories';
8
- export type { TradeSafetyCheckRepositoryResponse, TradeSafetyCheckFullResponse, QuickCheckRepositoryResponse, } from './repositories/TradeSafetyRepository';
10
+ export type { TradeSafetyCheckRepositoryResponse } from './repositories/TradeSafetyRepository';
9
11
  export * from './types';
10
12
  export { TRADE_SAFETY_NS, tradeSafetyTranslations } from './i18n/translations';
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EACV,kCAAkC,EAClC,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,sCAAsC,CAAC;AAG9C,cAAc,SAAS,CAAC;AAIxB,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAG/F,cAAc,SAAS,CAAC;AAIxB,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("react-i18next");require("i18next");require("i18next-resources-to-backend");const l=require("./locale.js"),x=require("react"),g=require("@aioia/core"),t=require("zod");function p(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(s,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return s.default=e,Object.freeze(s)}const c=p(x);function f(e){var s,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(s=0;s<i;s++)e[s]&&(n=f(e[s]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function _(){for(var e,s,n=0,a="",i=arguments.length;n<i;n++)(e=arguments[n])&&(s=f(e))&&(a&&(a+=" "),a+=s);return a}const b={default:"border-base-300",error:"border-error bg-error/10",warning:"border-warning bg-warning/10",success:"border-success bg-success/10",info:"border-info bg-info/10"};function u({title:e,icon:s,variant:n="default",children:a}){return a?r.jsxs("div",{className:_("rounded-lg border p-6",b[n]),children:[e&&r.jsxs("h2",{className:"mb-2 flex items-center gap-2 font-bold",children:[e,s]}),a]}):null}function j({data:e}){const{t:s,i18n:n}=o.useTranslation(l.TRADE_SAFETY_NS);return e?r.jsxs(u,{title:s("result.priceAnalysis"),children:[e.market_price_range&&r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"text-sm font-bold",children:s("result.marketPrice")}),r.jsx("p",{className:"text-xs",children:e.market_price_range})]}),e.offered_price&&r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"text-sm font-bold",children:s("result.offeredPrice")}),r.jsx("p",{className:"text-xs",children:new Intl.NumberFormat(n.language,{style:"currency",currency:e.currency||"USD"}).format(e.offered_price)})]}),e.price_assessment&&r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-bold",children:s("result.priceAssessment")}),r.jsx("p",{className:"text-xs",children:e.price_assessment})]})]}):null}function S({recommendation:e}){const{t:s}=o.useTranslation(l.TRADE_SAFETY_NS);return e?r.jsx(u,{title:s("result.recommendation"),children:r.jsx("p",{className:"text-xs",children:e})}):null}function v({title:e,titleId:s,...n},a){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},n),e?c.createElement("title",{id:s},e):null,c.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"}))}const y=c.forwardRef(v);function z({title:e,titleId:s,...n},a){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},n),e?c.createElement("title",{id:s},e):null,c.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"}))}const w=c.forwardRef(z);function N({title:e,titleId:s,...n},a){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},n),e?c.createElement("title",{id:s},e):null,c.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"}))}const R=c.forwardRef(N);function T({title:e,titleId:s,...n},a){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},n),e?c.createElement("title",{id:s},e):null,c.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"}))}const E=c.forwardRef(T);function k({items:e}){const{t:s}=o.useTranslation(l.TRADE_SAFETY_NS);return e.length===0?null:r.jsxs("div",{className:"mb-4",children:[r.jsxs("h2",{className:"flex items-center gap-1 py-4 font-bold",children:[s("result.safetyChecklist")," ",r.jsx(y,{className:"size-6"})]}),r.jsx(u,{variant:"info",children:e.map((n,a)=>r.jsxs("label",{className:"label w-fit cursor-pointer gap-2",children:[r.jsx("input",{type:"checkbox",className:"checkbox rounded-full [--chkbg:theme(colors.neutral)] [--chkfg:theme(colors.neutral-content)]"}),r.jsx("span",{className:"label-text",children:n})]},a))})]})}const A={error:R,warning:w,success:E},D={error:"result.riskSignals",warning:"result.cautions",success:"result.safeIndicators"};function d({signals:e,variant:s="error"}){const{t:n}=o.useTranslation(l.TRADE_SAFETY_NS);if(e.length===0)return null;const a=A[s];return r.jsxs("div",{className:"mb-4",children:[r.jsxs("h2",{className:"flex items-center gap-1 py-4 font-bold",children:[n(D[s])," ",r.jsx(a,{className:"size-6"})]}),r.jsx("div",{className:"space-y-3",children:e.map((i,h)=>r.jsx(u,{variant:s,children:r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-bold",children:i.title}),r.jsx("p",{className:"text-xs",children:i.description})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-bold",children:n("result.whatToDo")}),r.jsx("p",{className:"text-xs",children:i.what_to_do})]})]})},h))})]})}function C({translation:e,nuance:s}){const{t:n}=o.useTranslation(l.TRADE_SAFETY_NS);return r.jsxs(u,{title:n("result.translation"),children:[e&&r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"text-sm font-bold",children:n("result.translationTitle")}),r.jsx("p",{className:"text-xs",children:e})]}),s&&r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-bold",children:n("result.nuanceTitle")}),r.jsx("p",{className:"text-xs",children:s})]})]})}function F({analysis:e}){return r.jsxs("div",{children:[r.jsxs("div",{className:"mb-4 flex flex-col gap-4",children:[(e.translation||e.nuance_explanation)&&r.jsx(C,{translation:e.translation,nuance:e.nuance_explanation}),e.price_analysis&&r.jsx(j,{data:e.price_analysis}),e.recommendation&&r.jsx(S,{recommendation:e.recommendation})]}),e.risk_signals.length>0&&r.jsx(d,{signals:e.risk_signals,variant:"error"}),e.cautions.length>0&&r.jsx(d,{signals:e.cautions,variant:"warning"}),e.safe_indicators.length>0&&r.jsx(d,{signals:e.safe_indicators,variant:"success"}),e.safety_checklist.length>0&&r.jsx(k,{items:e.safety_checklist})]})}const m=t.z.object({category:t.z.enum(["payment","seller","platform","price","content"]),severity:t.z.enum(["high","medium","low"]),title:t.z.string(),description:t.z.string(),what_to_do:t.z.string()}),O=t.z.object({market_price_range:t.z.string().nullish(),offered_price:t.z.number().nullish(),currency:t.z.string().nullish(),price_assessment:t.z.string(),warnings:t.z.array(t.z.string())}),Z=t.z.object({translation:t.z.string().nullish(),nuance_explanation:t.z.string().nullish(),risk_signals:t.z.array(m),cautions:t.z.array(m),safe_indicators:t.z.array(m),price_analysis:O,safety_checklist:t.z.array(t.z.string()),risk_score:t.z.number(),recommendation:t.z.string(),emotional_support:t.z.string()}),q=t.z.object({risk_signals_count:t.z.number(),cautions_count:t.z.number(),safe_indicators_count:t.z.number()}),M=t.z.object({id:t.z.string(),user_id:t.z.string().nullish(),input_text:t.z.string(),llm_analysis:Z,risk_score:t.z.number(),expert_advice:t.z.string().nullish(),expert_reviewed:t.z.boolean(),expert_reviewed_at:t.z.string().nullish(),expert_reviewed_by:t.z.string().nullish(),created_at:t.z.string(),updated_at:t.z.string()}),I=t.z.union([M,t.z.object({id:t.z.string(),quick_summary:q,signup_required:t.z.literal(!0)})]);class Y extends g.BaseCrudRepository{constructor(){super(...arguments),this.resource="trade-safety"}getDataSchema(){return I}}const B={high:70,medium:40};exports.TRADE_SAFETY_NS=l.TRADE_SAFETY_NS;exports.tradeSafetyTranslations=l.tradeSafetyTranslations;exports.DetailedResult=F;exports.RISK_SCORE_THRESHOLDS=B;exports.TradeSafetyRepository=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),f=require("react-i18next");require("i18next");require("i18next-resources-to-backend");const u=require("./locale.js"),d=require("react"),E=require("@aioia/core"),a=require("zod");function O(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const c=O(d);function w(e){var t,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(r=w(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function _(){for(var e,t,r=0,s="",l=arguments.length;r<l;r++)(e=arguments[r])&&(t=w(e))&&(s&&(s+=" "),s+=t);return s}const R={default:"border-base-300",error:"border-error bg-error/10",warning:"border-warning bg-warning/10",success:"border-success bg-success/10",info:"border-info bg-info/10"};function h({title:e,icon:t,variant:r="default",children:s}){return s?n.jsxs("div",{className:_("rounded-lg border p-6",R[r]),children:[e&&n.jsxs("h2",{className:"mb-2 flex items-center gap-2 font-bold",children:[e,t]}),s]}):null}function T({data:e}){const{t,i18n:r}=f.useTranslation(u.TRADE_SAFETY_NS);return e?n.jsxs(h,{title:t("result.priceAnalysis"),children:[e.market_price_range&&n.jsxs("div",{className:"mb-2",children:[n.jsx("h3",{className:"text-sm font-bold",children:t("result.marketPrice")}),n.jsx("p",{className:"text-xs",children:e.market_price_range})]}),e.offered_price&&n.jsxs("div",{className:"mb-2",children:[n.jsx("h3",{className:"text-sm font-bold",children:t("result.offeredPrice")}),n.jsx("p",{className:"text-xs",children:new Intl.NumberFormat(r.language,{style:"currency",currency:e.currency||"USD"}).format(e.offered_price)})]}),e.price_assessment&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold",children:t("result.priceAssessment")}),n.jsx("p",{className:"text-xs",children:e.price_assessment})]})]}):null}function A({recommendation:e}){const{t}=f.useTranslation(u.TRADE_SAFETY_NS);return e?n.jsx(h,{title:t("result.recommendation"),children:n.jsx("p",{className:"text-xs",children:e})}):null}function k({title:e,titleId:t,...r},s){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?c.createElement("title",{id:t},e):null,c.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"}))}const P=c.forwardRef(k);function C({title:e,titleId:t,...r},s){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?c.createElement("title",{id:t},e):null,c.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"}))}const D=c.forwardRef(C);function F({title:e,titleId:t,...r},s){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?c.createElement("title",{id:t},e):null,c.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"}))}const M=c.forwardRef(F);function H({title:e,titleId:t,...r},s){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?c.createElement("title",{id:t},e):null,c.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"}))}const Z=c.forwardRef(H);function I({items:e}){const{t}=f.useTranslation(u.TRADE_SAFETY_NS);return e.length===0?null:n.jsxs("div",{className:"mb-4",children:[n.jsxs("h2",{className:"flex items-center gap-1 py-4 font-bold",children:[t("result.safetyChecklist")," ",n.jsx(P,{className:"size-6"})]}),n.jsx(h,{variant:"info",children:e.map((r,s)=>n.jsxs("label",{className:"label w-fit cursor-pointer gap-2",children:[n.jsx("input",{type:"checkbox",className:"checkbox rounded-full [--chkbg:theme(colors.neutral)] [--chkfg:theme(colors.neutral-content)]"}),n.jsx("span",{className:"label-text",children:r})]},s))})]})}const B={error:M,warning:D,success:Z},L={error:"result.riskSignals",warning:"result.cautions",success:"result.safeIndicators"};function g({signals:e,variant:t="error"}){const{t:r}=f.useTranslation(u.TRADE_SAFETY_NS);if(e.length===0)return null;const s=B[t];return n.jsxs("div",{className:"mb-4",children:[n.jsxs("h2",{className:"flex items-center gap-1 py-4 font-bold",children:[r(L[t])," ",n.jsx(s,{className:"size-6"})]}),n.jsx("div",{className:"space-y-3",children:e.map((l,i)=>n.jsx(h,{variant:t,children:n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold",children:l.title}),n.jsx("p",{className:"text-xs",children:l.description})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold",children:r("result.whatToDo")}),n.jsx("p",{className:"text-xs",children:l.what_to_do})]})]})},i))})]})}function q({translation:e,nuance:t}){const{t:r}=f.useTranslation(u.TRADE_SAFETY_NS);return n.jsxs(h,{title:r("result.translation"),children:[e&&n.jsxs("div",{className:"mb-2",children:[n.jsx("h3",{className:"text-sm font-bold",children:r("result.translationTitle")}),n.jsx("p",{className:"text-xs",children:e})]}),t&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold",children:r("result.nuanceTitle")}),n.jsx("p",{className:"text-xs",children:t})]})]})}function Y({analysis:e}){return n.jsxs("div",{children:[n.jsxs("div",{className:"mb-4 flex flex-col gap-4",children:[(e.translation||e.nuance_explanation)&&n.jsx(q,{translation:e.translation,nuance:e.nuance_explanation}),e.price_analysis&&n.jsx(T,{data:e.price_analysis}),e.recommendation&&n.jsx(A,{recommendation:e.recommendation})]}),e.risk_signals.length>0&&n.jsx(g,{signals:e.risk_signals,variant:"error"}),e.cautions.length>0&&n.jsx(g,{signals:e.cautions,variant:"warning"}),e.safe_indicators.length>0&&n.jsx(g,{signals:e.safe_indicators,variant:"success"}),e.safety_checklist.length>0&&n.jsx(I,{items:e.safety_checklist})]})}var N={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},v=d.createContext&&d.createContext(N),K=["attr","size","title"];function W(e,t){if(e==null)return{};var r=$(e,t),s,l;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(l=0;l<i.length;l++)s=i[l],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function $(e,t){if(e==null)return{};var r={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;r[s]=e[s]}return r}function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},b.apply(this,arguments)}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),r.push.apply(r,s)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?y(Object(r),!0).forEach(function(s){V(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function V(e,t,r){return t=X(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X(e){var t=G(e,"string");return typeof t=="symbol"?t:t+""}function G(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var s=r.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function S(e){return e&&e.map((t,r)=>d.createElement(t.tag,p({key:r},t.attr),S(t.child)))}function z(e){return t=>d.createElement(U,b({attr:p({},e.attr)},t),S(e.child))}function U(e){var t=r=>{var{attr:s,size:l,title:i}=e,x=W(e,K),m=l||r.size||"1em",o;return r.className&&(o=r.className),e.className&&(o=(o?o+" ":"")+e.className),d.createElement("svg",b({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,s,x,{className:o,style:p(p({color:e.color||r.color},r.style),e.style),height:m,width:m,xmlns:"http://www.w3.org/2000/svg"}),i&&d.createElement("title",null,i),e.children)};return v!==void 0?d.createElement(v.Consumer,null,r=>t(r)):t(N)}function J(e){return z({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)}function Q(e){return z({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)}function ee({value:e,onChange:t,onSubmit:r,isLoading:s,error:l}){const{t:i}=f.useTranslation(u.TRADE_SAFETY_NS),x=s?n.jsx("span",{className:"loading loading-spinner loading-sm"}):i("hero.checkSafety"),m=s||!e.trim();return n.jsx("div",{className:"flex w-full flex-col items-center justify-center",children:n.jsxs("div",{className:"w-full lg:max-w-[720px]",children:[n.jsx("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:i("hero.title")}),n.jsx("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:i("hero.subtitle")}),n.jsxs("div",{className:_("mb-4",!l&&"sm:mb-8 md:mb-12"),children:[n.jsxs("div",{className:"relative hidden lg:block",children:[n.jsx("input",{type:"text",className:"input input-bordered h-[72px] w-full pr-36 text-sm placeholder:text-base-300 focus:outline-none",placeholder:i("hero.placeholder"),"aria-label":i("hero.placeholder"),value:e,onChange:o=>t(o.target.value),disabled:s,onKeyDown:o=>{o.key==="Enter"&&!m&&r()}}),n.jsx("button",{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",onClick:r,disabled:m,children:x})]}),n.jsx("div",{className:"block lg:hidden",children:n.jsxs("div",{className:"relative h-[400px] w-full overflow-hidden rounded-xl border border-base-300 bg-base-100",children:[!e&&n.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden p-5 pb-24 text-base text-base-300","aria-hidden":"true",children:n.jsxs("div",{className:"whitespace-pre-line leading-relaxed",children:[n.jsx("p",{className:"mb-4 text-base-300",children:i("hero.placeholder")}),i("hero.placeholderExample")]})}),n.jsx("div",{className:"absolute inset-0 overflow-hidden pb-24",children:n.jsx("textarea",{className:"textarea size-full resize-none overflow-auto bg-transparent p-4 leading-6 text-base-content focus:outline-none",value:e,"aria-label":i("hero.placeholder"),onChange:o=>t(o.target.value),disabled:s,placeholder:""})}),n.jsx("div",{className:"absolute inset-x-4 bottom-4 z-10",children:n.jsx("button",{className:"btn btn-neutral h-16 w-full text-base font-medium text-neutral-content",onClick:r,disabled:m,children:x})})]})})]}),l&&n.jsx("div",{className:"alert alert-error mb-6 flex items-center gap-2 text-sm",children:n.jsx("span",{children:l})}),n.jsx("p",{className:"mb-4 text-left text-xs text-base-content/60 sm:mb-8 sm:text-center md:mb-12",children:i("hero.disclaimer")}),n.jsxs("div",{className:"flex items-center justify-start gap-6 sm:justify-center",children:[n.jsx("a",{href:"https://x.com",target:"_blank",rel:"noopener noreferrer","aria-label":"X",children:n.jsx(Q,{className:"size-6 text-base-content transition-colors hover:text-base-content/70"})}),n.jsx("a",{href:"https://reddit.com",target:"_blank",rel:"noopener noreferrer","aria-label":"Reddit",children:n.jsx(J,{className:"size-6 text-base-content transition-colors hover:text-base-content/70"})})]})]})})}const j=a.z.object({category:a.z.enum(["payment","seller","platform","price","content"]),severity:a.z.enum(["high","medium","low"]),title:a.z.string(),description:a.z.string(),what_to_do:a.z.string()}),te=a.z.object({market_price_range:a.z.string().nullish(),offered_price:a.z.number().nullish(),currency:a.z.string().nullish(),price_assessment:a.z.string(),warnings:a.z.array(a.z.string())}),re=a.z.object({translation:a.z.string().nullish(),nuance_explanation:a.z.string().nullish(),risk_signals:a.z.array(j),cautions:a.z.array(j),safe_indicators:a.z.array(j),price_analysis:te,safety_checklist:a.z.array(a.z.string()),risk_score:a.z.number(),recommendation:a.z.string(),emotional_support:a.z.string()}),ne=a.z.object({id:a.z.string(),user_id:a.z.string().nullish(),input_text:a.z.string(),llm_analysis:re,risk_score:a.z.number(),expert_advice:a.z.string().nullish(),expert_reviewed:a.z.boolean(),expert_reviewed_at:a.z.string().nullish(),expert_reviewed_by:a.z.string().nullish(),created_at:a.z.string(),updated_at:a.z.string()});class se extends E.BaseCrudRepository{constructor(){super(...arguments),this.resource="trade-safety"}getDataSchema(){return ne}}const ae={high:70,medium:40};exports.TRADE_SAFETY_NS=u.TRADE_SAFETY_NS;exports.tradeSafetyTranslations=u.tradeSafetyTranslations;exports.DetailedResult=Y;exports.HomeHeroSection=ee;exports.RISK_SCORE_THRESHOLDS=ae;exports.TradeSafetyRepository=se;
2
2
  //# sourceMappingURL=index.js.map