trade-safety 1.12.0 → 1.13.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.
@@ -1,9 +1,13 @@
1
+ import { LinkPreviewData } from '../types';
1
2
  export interface HomeHeroSectionProps {
2
3
  value: string;
3
4
  onChange: (value: string) => void;
4
5
  onSubmit: () => void;
5
6
  isLoading: boolean;
6
7
  error: string | null;
8
+ previewData: LinkPreviewData | null;
9
+ isLoadingPreview: boolean;
10
+ previewError: string | null;
7
11
  }
8
- export declare function HomeHeroSection({ value, onChange, onSubmit, isLoading, error, }: HomeHeroSectionProps): import("react").JSX.Element;
12
+ export declare const HomeHeroSection: import('react').MemoExoticComponent<({ value, onChange, onSubmit, isLoading, error, previewData, isLoadingPreview, previewError, }: HomeHeroSectionProps) => import("react").JSX.Element>;
9
13
  //# sourceMappingURL=HomeHeroSection.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"HomeHeroSection.d.ts","sourceRoot":"","sources":["../../src/components/HomeHeroSection.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,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;IACrB,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;IACpC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,eAAe,sIAUvB,oBAAoB,iCA+JxB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { LinkPreviewData } from '../types';
2
+ interface UrlPreviewCardProps {
3
+ data: LinkPreviewData;
4
+ }
5
+ export declare function UrlPreviewCard({ data }: UrlPreviewCardProps): import("react").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=UrlPreviewCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UrlPreviewCard.d.ts","sourceRoot":"","sources":["../../src/components/UrlPreviewCard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,UAAU,mBAAmB;IAC3B,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,EAAE,mBAAmB,+BAqC3D"}
@@ -0,0 +1,2 @@
1
+ export declare function UrlPreviewCardSkeleton(): import("react").JSX.Element;
2
+ //# sourceMappingURL=UrlPreviewCardSkeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UrlPreviewCardSkeleton.d.ts","sourceRoot":"","sources":["../../src/components/UrlPreviewCardSkeleton.tsx"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,gCAiBrC"}
@@ -32,6 +32,7 @@ export declare const tradeSafetyTranslations: {
32
32
  analyzingDescription: string;
33
33
  tryExample: string;
34
34
  disclaimer: string;
35
+ previewError: string;
35
36
  };
36
37
  features: {
37
38
  title: string;
@@ -163,6 +164,7 @@ export declare const tradeSafetyTranslations: {
163
164
  analyzingDescription: string;
164
165
  tryExample: string;
165
166
  disclaimer: string;
167
+ previewError: string;
166
168
  };
167
169
  features: {
168
170
  title: string;
@@ -294,6 +296,7 @@ export declare const tradeSafetyTranslations: {
294
296
  analyzingDescription: string;
295
297
  tryExample: string;
296
298
  disclaimer: string;
299
+ previewError: string;
297
300
  };
298
301
  features: {
299
302
  title: string;
@@ -425,6 +428,7 @@ export declare const tradeSafetyTranslations: {
425
428
  analyzingDescription: string;
426
429
  tryExample: string;
427
430
  disclaimer: string;
431
+ previewError: string;
428
432
  };
429
433
  features: {
430
434
  title: string;
@@ -556,6 +560,7 @@ export declare const tradeSafetyTranslations: {
556
560
  analyzingDescription: string;
557
561
  tryExample: string;
558
562
  disclaimer: string;
563
+ previewError: string;
559
564
  };
560
565
  features: {
561
566
  title: string;
@@ -687,6 +692,7 @@ export declare const tradeSafetyTranslations: {
687
692
  analyzingDescription: string;
688
693
  tryExample: string;
689
694
  disclaimer: string;
695
+ previewError: string;
690
696
  };
691
697
  features: {
692
698
  title: string;
@@ -818,6 +824,7 @@ export declare const tradeSafetyTranslations: {
818
824
  analyzingDescription: string;
819
825
  tryExample: string;
820
826
  disclaimer: string;
827
+ previewError: string;
821
828
  };
822
829
  features: {
823
830
  title: string;
@@ -949,6 +956,7 @@ export declare const tradeSafetyTranslations: {
949
956
  analyzingDescription: string;
950
957
  tryExample: string;
951
958
  disclaimer: string;
959
+ previewError: string;
952
960
  };
953
961
  features: {
954
962
  title: string;
@@ -1080,6 +1088,7 @@ export declare const tradeSafetyTranslations: {
1080
1088
  analyzingDescription: string;
1081
1089
  tryExample: string;
1082
1090
  disclaimer: string;
1091
+ previewError: string;
1083
1092
  };
1084
1093
  features: {
1085
1094
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../src/i18n/translations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,6BAA6B;AAC7B,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUnC,CAAC"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../src/i18n/translations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,6BAA6B;AAC7B,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUnC,CAAC"}
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),E=require("react-i18next");require("i18next");require("i18next-resources-to-backend");const R=require("./locale.js"),N=require("react"),zt=require("@aioia/core"),c=require("zod");function Pt(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,o.get?o:{enumerable:!0,get:()=>t[a]})}}return r.default=t,Object.freeze(r)}const D=Pt(N);function Dt({title:t,titleId:r,...a},o){return D.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:o,"aria-labelledby":r},a),t?D.createElement("title",{id:r},t):null,D.createElement("path",{fillRule:"evenodd",d:"M2.625 6.75a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875 0A.75.75 0 0 1 8.25 6h12a.75.75 0 0 1 0 1.5h-12a.75.75 0 0 1-.75-.75ZM2.625 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0ZM7.5 12a.75.75 0 0 1 .75-.75h12a.75.75 0 0 1 0 1.5h-12A.75.75 0 0 1 7.5 12Zm-4.875 5.25a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875 0a.75.75 0 0 1 .75-.75h12a.75.75 0 0 1 0 1.5h-12a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))}const At=D.forwardRef(Dt);function Ct({title:t,titleId:r,...a},o){return D.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:o,"aria-labelledby":r},a),t?D.createElement("title",{id:r},t):null,D.createElement("path",{fillRule:"evenodd",d:"M9 4.5a.75.75 0 0 1 .721.544l.813 2.846a3.75 3.75 0 0 0 2.576 2.576l2.846.813a.75.75 0 0 1 0 1.442l-2.846.813a3.75 3.75 0 0 0-2.576 2.576l-.813 2.846a.75.75 0 0 1-1.442 0l-.813-2.846a3.75 3.75 0 0 0-2.576-2.576l-2.846-.813a.75.75 0 0 1 0-1.442l2.846-.813A3.75 3.75 0 0 0 7.466 7.89l.813-2.846A.75.75 0 0 1 9 4.5ZM18 1.5a.75.75 0 0 1 .728.568l.258 1.036c.236.94.97 1.674 1.91 1.91l1.036.258a.75.75 0 0 1 0 1.456l-1.036.258c-.94.236-1.674.97-1.91 1.91l-.258 1.036a.75.75 0 0 1-1.456 0l-.258-1.036a2.625 2.625 0 0 0-1.91-1.91l-1.036-.258a.75.75 0 0 1 0-1.456l1.036-.258a2.625 2.625 0 0 0 1.91-1.91l.258-1.036A.75.75 0 0 1 18 1.5ZM16.5 15a.75.75 0 0 1 .712.513l.394 1.183c.15.447.5.799.948.948l1.183.395a.75.75 0 0 1 0 1.422l-1.183.395c-.447.15-.799.5-.948.948l-.395 1.183a.75.75 0 0 1-1.422 0l-.395-1.183a1.5 1.5 0 0 0-.948-.948l-1.183-.395a.75.75 0 0 1 0-1.422l1.183-.395c.447-.15.799-.5.948-.948l.395-1.183A.75.75 0 0 1 16.5 15Z",clipRule:"evenodd"}))}const Ft=D.forwardRef(Ct);function He(t){var r,a,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var p=t.length;for(r=0;r<p;r++)t[r]&&(a=He(t[r]))&&(o&&(o+=" "),o+=a)}else for(a in t)t[a]&&(o&&(o+=" "),o+=a);return o}function V(){for(var t,r,a=0,o="",p=arguments.length;a<p;a++)(t=arguments[a])&&(r=He(t))&&(o&&(o+=" "),o+=r);return o}const $t={danger:"bg-error/10 text-error",caution:"bg-error/10 text-error",safe:"bg-neutral/10 text-neutral"},Lt={danger:"result.danger.badge",caution:"result.caution.badge",safe:"result.safe.badge"},It={sm:"text-xl font-bold",lg:"text-2xl font-bold"};function q({badgeVariant:t,subtitle:r,icon:a,title:o,titleSize:p="lg",children:h}){const{t:j}=E.useTranslation(R.TRADE_SAFETY_NS);return s.jsxs("section",{className:"rounded-2xl bg-neutral-content p-6 shadow-sm",children:[s.jsxs("header",{className:"mb-4 flex flex-col items-start",children:[t&&s.jsx("div",{className:V("mb-2 rounded-full px-4 py-1 text-sm font-bold",$t[t]),children:j(Lt[t])}),r&&s.jsx("p",{className:"mb-1 break-keep text-lg font-medium text-neutral",children:r}),s.jsxs("div",{className:"flex items-center gap-2 text-neutral",children:[a&&s.jsx("span",{className:"text-base",children:a}),s.jsx("h2",{className:V("whitespace-pre-line break-keep sm:whitespace-normal",It[p]),children:o})]})]}),s.jsx("div",{children:h})]})}function Mt({summary:t}){const{t:r}=E.useTranslation(R.TRADE_SAFETY_NS);return t.length===0?null:s.jsx(q,{title:r("result.aiSummary"),icon:s.jsx(Ft,{className:"size-6"}),children:s.jsx("div",{children:t.map((a,o)=>s.jsx("p",{className:V("py-2 text-sm leading-relaxed text-neutral first:pt-0",o<t.length-1&&"border-b border-base-300"),children:a},`${a}-${o}`))})})}function F({title:t,content:r}){return s.jsxs("div",{className:"text-neutral",children:[s.jsx("h3",{className:"mb-1 break-keep text-lg font-semibold",children:t}),s.jsx("p",{className:"break-keep",children:r})]})}function Yt({data:t}){const{t:r,i18n:a}=E.useTranslation(R.TRADE_SAFETY_NS);return t?s.jsx(q,{subtitle:r("result.priceAnalysis.subtitle"),title:r("result.priceAnalysis.title"),children:s.jsxs("div",{className:"space-y-4",children:[t.market_price_range&&s.jsx(F,{title:r("result.marketPrice"),content:t.market_price_range}),t.offered_price&&s.jsx(F,{title:r("result.offeredPrice"),content:new Intl.NumberFormat(a.language,{style:"currency",currency:t.currency||"USD"}).format(t.offered_price)}),t.price_assessment&&s.jsx(F,{title:r("result.priceAssessment"),content:t.price_assessment})]})}):null}function Wt({items:t}){const{t:r}=E.useTranslation(R.TRADE_SAFETY_NS);return t.length===0?null:s.jsx(q,{icon:s.jsx(At,{className:"size-6"}),title:r("result.safetyChecklist"),titleSize:"sm",children:s.jsx("div",{className:"space-y-4",children:t.map((a,o)=>s.jsxs("label",{className:"label cursor-pointer gap-4 rounded-2xl bg-base-200 p-4",children:[s.jsx("span",{className:"label-text break-keep text-neutral",children:a}),s.jsx("input",{type:"checkbox",className:"checkbox checkbox-sm [--chkbg:theme(colors.neutral)] [--chkfg:theme(colors.neutral-content)]"})]},o))})})}const qt={danger:"result.danger.title",caution:"result.caution.title",safe:"result.safe.title"};function ie({signals:t,variant:r}){const{t:a}=E.useTranslation(R.TRADE_SAFETY_NS);return t.length===0?null:s.jsx(q,{badgeVariant:r,title:a(qt[r]),children:s.jsx("div",{className:"divide-y divide-base-300",children:t.map((o,p)=>s.jsxs("div",{className:"space-y-4 py-4 first:pt-0 last:pb-0",children:[s.jsx(F,{title:o.title,content:o.description}),s.jsx(F,{title:a("result.whatToDo"),content:o.what_to_do})]},p))})})}function Ht({translation:t,nuance:r}){const{t:a}=E.useTranslation(R.TRADE_SAFETY_NS);return s.jsx(q,{subtitle:a("result.translation.subtitle"),title:a("result.translation.title"),children:s.jsxs("div",{className:"space-y-4",children:[t&&s.jsx(F,{title:a("result.translation.label"),content:t}),r&&s.jsx(F,{title:a("result.nuance.label"),content:r})]})})}function Bt({analysis:t}){return s.jsxs("div",{className:"space-y-6",children:[t.ai_summary.length>0&&s.jsx(Mt,{summary:t.ai_summary}),t.risk_signals.length>0&&s.jsx(ie,{signals:t.risk_signals,variant:"danger"}),t.cautions.length>0&&s.jsx(ie,{signals:t.cautions,variant:"caution"}),t.safe_indicators.length>0&&s.jsx(ie,{signals:t.safe_indicators,variant:"safe"}),t.safety_checklist.length>0&&s.jsx(Wt,{items:t.safety_checklist}),(t.translation||t.nuance_explanation)&&s.jsx(Ht,{translation:t.translation,nuance:t.nuance_explanation}),t.price_analysis&&s.jsx(Yt,{data:t.price_analysis})]})}var Be={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Le=N.createContext&&N.createContext(Be),Ut=["attr","size","title"];function Zt(t,r){if(t==null)return{};var a=Kt(t,r),o,p;if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(t);for(p=0;p<h.length;p++)o=h[p],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(a[o]=t[o])}return a}function Kt(t,r){if(t==null)return{};var a={};for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(r.indexOf(o)>=0)continue;a[o]=t[o]}return a}function X(){return X=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(t[o]=a[o])}return t},X.apply(this,arguments)}function Ie(t,r){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);r&&(o=o.filter(function(p){return Object.getOwnPropertyDescriptor(t,p).enumerable})),a.push.apply(a,o)}return a}function G(t){for(var r=1;r<arguments.length;r++){var a=arguments[r]!=null?arguments[r]:{};r%2?Ie(Object(a),!0).forEach(function(o){Jt(t,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ie(Object(a)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(a,o))})}return t}function Jt(t,r,a){return r=Vt(r),r in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a,t}function Vt(t){var r=Xt(t,"string");return typeof r=="symbol"?r:r+""}function Xt(t,r){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var o=a.call(t,r);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function Ue(t){return t&&t.map((r,a)=>N.createElement(r.tag,G({key:a},r.attr),Ue(r.child)))}function Ze(t){return r=>N.createElement(Gt,X({attr:G({},t.attr)},r),Ue(t.child))}function Gt(t){var r=a=>{var{attr:o,size:p,title:h}=t,j=Zt(t,Ut),v=p||a.size||"1em",d;return a.className&&(d=a.className),t.className&&(d=(d?d+" ":"")+t.className),N.createElement("svg",X({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,o,j,{className:d,style:G(G({color:t.color||a.color},a.style),t.style),height:v,width:v,xmlns:"http://www.w3.org/2000/svg"}),h&&N.createElement("title",null,h),t.children)};return Le!==void 0?N.createElement(Le.Consumer,null,a=>r(a)):r(Be)}function Qt(t){return Ze({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:[]}]})(t)}function er(t){return Ze({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:[]}]})(t)}function tr({value:t,onChange:r,onSubmit:a,isLoading:o,error:p}){const{t:h}=E.useTranslation(R.TRADE_SAFETY_NS),j=o?s.jsx("span",{className:"loading loading-spinner loading-sm"}):h("hero.checkSafety"),v=o||!t.trim();return s.jsx("div",{className:"flex w-full flex-col items-center justify-center",children:s.jsxs("div",{className:"w-full lg:max-w-[720px]",children:[s.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:h("hero.title")}),s.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:h("hero.subtitle")}),s.jsxs("div",{className:V("mb-4",!p&&"sm:mb-8 md:mb-12"),children:[s.jsxs("div",{className:"relative hidden lg:block",children:[s.jsx("input",{type:"text",className:"input input-bordered h-[72px] w-full pr-36 text-sm placeholder:text-base-300 focus:outline-none",placeholder:h("hero.placeholder"),"aria-label":h("hero.placeholder"),value:t,onChange:d=>r(d.target.value),disabled:o,onKeyDown:d=>{d.key==="Enter"&&!v&&a()}}),s.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:a,disabled:v,children:j})]}),s.jsx("div",{className:"block lg:hidden",children:s.jsxs("div",{className:"relative h-[400px] w-full overflow-hidden rounded-xl border border-base-300 bg-base-100",children:[!t&&s.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden p-5 pb-24 text-base text-base-300","aria-hidden":"true",children:s.jsxs("div",{className:"whitespace-pre-line leading-relaxed",children:[s.jsx("p",{className:"mb-4 text-base-300",children:h("hero.placeholder")}),h("hero.placeholderExample")]})}),s.jsx("div",{className:"absolute inset-0 overflow-hidden pb-24",children:s.jsx("textarea",{className:"textarea size-full resize-none overflow-auto bg-transparent p-4 leading-6 text-base-content focus:outline-none",value:t,"aria-label":h("hero.placeholder"),onChange:d=>r(d.target.value),disabled:o,placeholder:""})}),s.jsx("div",{className:"absolute inset-x-4 bottom-4 z-10",children:s.jsx("button",{className:"btn btn-neutral h-16 w-full text-base font-medium text-neutral-content",onClick:a,disabled:v,children:j})})]})})]}),p&&s.jsx("div",{className:"alert alert-error mb-6 flex items-center gap-2 text-sm",children:s.jsx("span",{children:p})}),s.jsx("p",{className:"mb-4 text-left text-xs text-base-content/60 sm:mb-8 sm:text-center md:mb-12",children:h("hero.disclaimer")}),s.jsxs("div",{className:"flex items-center justify-start gap-6 sm:justify-center",children:[s.jsx("a",{href:"https://x.com",target:"_blank",rel:"noopener noreferrer","aria-label":"X",children:s.jsx(er,{className:"size-6 text-base-content transition-colors hover:text-base-content/70"})}),s.jsx("a",{href:"https://reddit.com",target:"_blank",rel:"noopener noreferrer","aria-label":"Reddit",children:s.jsx(Qt,{className:"size-6 text-base-content transition-colors hover:text-base-content/70"})})]})]})})}var le={exports:{}},W={},Me;function rr(){if(Me)return W;Me=1;var t=N,r=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,p=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function j(v,d,z){var x,w={},T=null,H=null;z!==void 0&&(T=""+z),d.key!==void 0&&(T=""+d.key),d.ref!==void 0&&(H=d.ref);for(x in d)o.call(d,x)&&!h.hasOwnProperty(x)&&(w[x]=d[x]);if(v&&v.defaultProps)for(x in d=v.defaultProps,d)w[x]===void 0&&(w[x]=d[x]);return{$$typeof:r,type:v,key:T,ref:H,props:w,_owner:p.current}}return W.Fragment=a,W.jsx=j,W.jsxs=j,W}var J={},Ye;function nr(){return Ye||(Ye=1,process.env.NODE_ENV!=="production"&&(function(){var t=N,r=Symbol.for("react.element"),a=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),v=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),H=Symbol.for("react.offscreen"),pe=Symbol.iterator,Ke="@@iterator";function Je(e){if(e===null||typeof e!="object")return null;var n=pe&&e[pe]||e[Ke];return typeof n=="function"?n:null}var $=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){{for(var n=arguments.length,i=new Array(n>1?n-1:0),l=1;l<n;l++)i[l-1]=arguments[l];Ve("error",e,i)}}function Ve(e,n,i){{var l=$.ReactDebugCurrentFrame,m=l.getStackAddendum();m!==""&&(n+="%s",i=i.concat([m]));var y=i.map(function(f){return String(f)});y.unshift("Warning: "+n),Function.prototype.apply.call(console[e],console,y)}}var Xe=!1,Ge=!1,Qe=!1,et=!1,tt=!1,de;de=Symbol.for("react.module.reference");function rt(e){return!!(typeof e=="string"||typeof e=="function"||e===o||e===h||tt||e===p||e===z||e===x||et||e===H||Xe||Ge||Qe||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===w||e.$$typeof===j||e.$$typeof===v||e.$$typeof===d||e.$$typeof===de||e.getModuleId!==void 0))}function nt(e,n,i){var l=e.displayName;if(l)return l;var m=n.displayName||n.name||"";return m!==""?i+"("+m+")":i}function me(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case o:return"Fragment";case a:return"Portal";case h:return"Profiler";case p:return"StrictMode";case z:return"Suspense";case x:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case v:var n=e;return me(n)+".Consumer";case j:var i=e;return me(i._context)+".Provider";case d:return nt(e,e.render,"ForwardRef");case w:var l=e.displayName||null;return l!==null?l:P(e.type)||"Memo";case T:{var m=e,y=m._payload,f=m._init;try{return P(f(y))}catch{return null}}}return null}var A=Object.assign,M=0,ye,he,be,ge,ve,xe,je;function _e(){}_e.__reactDisabledLog=!0;function at(){{if(M===0){ye=console.log,he=console.info,be=console.warn,ge=console.error,ve=console.group,xe=console.groupCollapsed,je=console.groupEnd;var e={configurable:!0,enumerable:!0,value:_e,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}}function st(){{if(M--,M===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:ye}),info:A({},e,{value:he}),warn:A({},e,{value:be}),error:A({},e,{value:ge}),group:A({},e,{value:ve}),groupCollapsed:A({},e,{value:xe}),groupEnd:A({},e,{value:je})})}M<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Q=$.ReactCurrentDispatcher,ee;function B(e,n,i){{if(ee===void 0)try{throw Error()}catch(m){var l=m.stack.trim().match(/\n( *(at )?)/);ee=l&&l[1]||""}return`
2
- `+ee+e}}var te=!1,U;{var ot=typeof WeakMap=="function"?WeakMap:Map;U=new ot}function Se(e,n){if(!e||te)return"";{var i=U.get(e);if(i!==void 0)return i}var l;te=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var y;y=Q.current,Q.current=null,at();try{if(n){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(k){l=k}Reflect.construct(e,[],f)}else{try{f.call()}catch(k){l=k}e.call(f.prototype)}}else{try{throw Error()}catch(k){l=k}e()}}catch(k){if(k&&l&&typeof k.stack=="string"){for(var u=k.stack.split(`
3
- `),S=l.stack.split(`
4
- `),b=u.length-1,g=S.length-1;b>=1&&g>=0&&u[b]!==S[g];)g--;for(;b>=1&&g>=0;b--,g--)if(u[b]!==S[g]){if(b!==1||g!==1)do if(b--,g--,g<0||u[b]!==S[g]){var O=`
5
- `+u[b].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,O),O}while(b>=1&&g>=0);break}}}finally{te=!1,Q.current=y,st(),Error.prepareStackTrace=m}var I=e?e.displayName||e.name:"",C=I?B(I):"";return typeof e=="function"&&U.set(e,C),C}function it(e,n,i){return Se(e,!1)}function lt(e){var n=e.prototype;return!!(n&&n.isReactComponent)}function Z(e,n,i){if(e==null)return"";if(typeof e=="function")return Se(e,lt(e));if(typeof e=="string")return B(e);switch(e){case z:return B("Suspense");case x:return B("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return it(e.render);case w:return Z(e.type,n,i);case T:{var l=e,m=l._payload,y=l._init;try{return Z(y(m),n,i)}catch{}}}return""}var Y=Object.prototype.hasOwnProperty,we={},ke=$.ReactDebugCurrentFrame;function K(e){if(e){var n=e._owner,i=Z(e.type,e._source,n?n.type:null);ke.setExtraStackFrame(i)}else ke.setExtraStackFrame(null)}function ct(e,n,i,l,m){{var y=Function.call.bind(Y);for(var f in e)if(y(e,f)){var u=void 0;try{if(typeof e[f]!="function"){var S=Error((l||"React class")+": "+i+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw S.name="Invariant Violation",S}u=e[f](n,f,l,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(b){u=b}u&&!(u instanceof Error)&&(K(m),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",l||"React class",i,f,typeof u),K(null)),u instanceof Error&&!(u.message in we)&&(we[u.message]=!0,K(m),_("Failed %s type: %s",i,u.message),K(null))}}}var ut=Array.isArray;function re(e){return ut(e)}function ft(e){{var n=typeof Symbol=="function"&&Symbol.toStringTag,i=n&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function pt(e){try{return Ne(e),!1}catch{return!0}}function Ne(e){return""+e}function Oe(e){if(pt(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ft(e)),Ne(e)}var Ee=$.ReactCurrentOwner,dt={key:!0,ref:!0,__self:!0,__source:!0},Re,Te;function mt(e){if(Y.call(e,"ref")){var n=Object.getOwnPropertyDescriptor(e,"ref").get;if(n&&n.isReactWarning)return!1}return e.ref!==void 0}function yt(e){if(Y.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function ht(e,n){typeof e.ref=="string"&&Ee.current}function bt(e,n){{var i=function(){Re||(Re=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function gt(e,n){{var i=function(){Te||(Te=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var vt=function(e,n,i,l,m,y,f){var u={$$typeof:r,type:e,key:n,ref:i,props:f,_owner:y};return u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:m}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function xt(e,n,i,l,m){{var y,f={},u=null,S=null;i!==void 0&&(Oe(i),u=""+i),yt(n)&&(Oe(n.key),u=""+n.key),mt(n)&&(S=n.ref,ht(n));for(y in n)Y.call(n,y)&&!dt.hasOwnProperty(y)&&(f[y]=n[y]);if(e&&e.defaultProps){var b=e.defaultProps;for(y in b)f[y]===void 0&&(f[y]=b[y])}if(u||S){var g=typeof e=="function"?e.displayName||e.name||"Unknown":e;u&&bt(f,g),S&&gt(f,g)}return vt(e,u,S,m,l,Ee.current,f)}}var ne=$.ReactCurrentOwner,ze=$.ReactDebugCurrentFrame;function L(e){if(e){var n=e._owner,i=Z(e.type,e._source,n?n.type:null);ze.setExtraStackFrame(i)}else ze.setExtraStackFrame(null)}var ae;ae=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===r}function Pe(){{if(ne.current){var e=P(ne.current.type);if(e)return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),T=require("react-i18next");require("i18next");require("i18next-resources-to-backend");const z=require("./locale.js"),j=require("react"),Pt=require("next/image"),Ct=require("@aioia/core"),c=require("zod");function At(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(n,s,o.get?o:{enumerable:!0,get:()=>t[s]})}}return n.default=t,Object.freeze(n)}const D=At(j);function Dt({title:t,titleId:n,...s},o){return D.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:o,"aria-labelledby":n},s),t?D.createElement("title",{id:n},t):null,D.createElement("path",{fillRule:"evenodd",d:"M2.625 6.75a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875 0A.75.75 0 0 1 8.25 6h12a.75.75 0 0 1 0 1.5h-12a.75.75 0 0 1-.75-.75ZM2.625 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0ZM7.5 12a.75.75 0 0 1 .75-.75h12a.75.75 0 0 1 0 1.5h-12A.75.75 0 0 1 7.5 12Zm-4.875 5.25a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875 0a.75.75 0 0 1 .75-.75h12a.75.75 0 0 1 0 1.5h-12a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))}const Ft=D.forwardRef(Dt);function $t({title:t,titleId:n,...s},o){return D.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:o,"aria-labelledby":n},s),t?D.createElement("title",{id:n},t):null,D.createElement("path",{fillRule:"evenodd",d:"M9 4.5a.75.75 0 0 1 .721.544l.813 2.846a3.75 3.75 0 0 0 2.576 2.576l2.846.813a.75.75 0 0 1 0 1.442l-2.846.813a3.75 3.75 0 0 0-2.576 2.576l-.813 2.846a.75.75 0 0 1-1.442 0l-.813-2.846a3.75 3.75 0 0 0-2.576-2.576l-2.846-.813a.75.75 0 0 1 0-1.442l2.846-.813A3.75 3.75 0 0 0 7.466 7.89l.813-2.846A.75.75 0 0 1 9 4.5ZM18 1.5a.75.75 0 0 1 .728.568l.258 1.036c.236.94.97 1.674 1.91 1.91l1.036.258a.75.75 0 0 1 0 1.456l-1.036.258c-.94.236-1.674.97-1.91 1.91l-.258 1.036a.75.75 0 0 1-1.456 0l-.258-1.036a2.625 2.625 0 0 0-1.91-1.91l-1.036-.258a.75.75 0 0 1 0-1.456l1.036-.258a2.625 2.625 0 0 0 1.91-1.91l.258-1.036A.75.75 0 0 1 18 1.5ZM16.5 15a.75.75 0 0 1 .712.513l.394 1.183c.15.447.5.799.948.948l1.183.395a.75.75 0 0 1 0 1.422l-1.183.395c-.447.15-.799.5-.948.948l-.395 1.183a.75.75 0 0 1-1.422 0l-.395-1.183a1.5 1.5 0 0 0-.948-.948l-1.183-.395a.75.75 0 0 1 0-1.422l1.183-.395c.447-.15.799-.5.948-.948l.395-1.183A.75.75 0 0 1 16.5 15Z",clipRule:"evenodd"}))}const It=D.forwardRef($t);function Ue(t){var n,s,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var d=t.length;for(n=0;n<d;n++)t[n]&&(s=Ue(t[n]))&&(o&&(o+=" "),o+=s)}else for(s in t)t[s]&&(o&&(o+=" "),o+=s);return o}function U(){for(var t,n,s=0,o="",d=arguments.length;s<d;s++)(t=arguments[s])&&(n=Ue(t))&&(o&&(o+=" "),o+=n);return o}const Lt={danger:"bg-error/10 text-error",caution:"bg-error/10 text-error",safe:"bg-neutral/10 text-neutral"},Mt={danger:"result.danger.badge",caution:"result.caution.badge",safe:"result.safe.badge"},Yt={sm:"text-xl font-bold",lg:"text-2xl font-bold"};function B({badgeVariant:t,subtitle:n,icon:s,title:o,titleSize:d="lg",children:x}){const{t:S}=T.useTranslation(z.TRADE_SAFETY_NS);return r.jsxs("section",{className:"rounded-2xl bg-neutral-content p-6 shadow-sm",children:[r.jsxs("header",{className:"mb-4 flex flex-col items-start",children:[t&&r.jsx("div",{className:U("mb-2 rounded-full px-4 py-1 text-sm font-bold",Lt[t]),children:S(Mt[t])}),n&&r.jsx("p",{className:"mb-1 break-keep text-lg font-medium text-neutral",children:n}),r.jsxs("div",{className:"flex items-center gap-2 text-neutral",children:[s&&r.jsx("span",{className:"text-base",children:s}),r.jsx("h2",{className:U("whitespace-pre-line break-keep sm:whitespace-normal",Yt[d]),children:o})]})]}),r.jsx("div",{children:x})]})}function Ht({summary:t}){const{t:n}=T.useTranslation(z.TRADE_SAFETY_NS);return t.length===0?null:r.jsx(B,{title:n("result.aiSummary"),icon:r.jsx(It,{className:"size-6"}),children:r.jsx("div",{children:t.map((s,o)=>r.jsx("p",{className:U("py-2 text-sm leading-relaxed text-neutral first:pt-0",o<t.length-1&&"border-b border-base-300"),children:s},`${s}-${o}`))})})}function I({title:t,content:n}){return r.jsxs("div",{className:"text-neutral",children:[r.jsx("h3",{className:"mb-1 break-keep text-lg font-semibold",children:t}),r.jsx("p",{className:"break-keep",children:n})]})}function qt({data:t}){const{t:n,i18n:s}=T.useTranslation(z.TRADE_SAFETY_NS);return t?r.jsx(B,{subtitle:n("result.priceAnalysis.subtitle"),title:n("result.priceAnalysis.title"),children:r.jsxs("div",{className:"space-y-4",children:[t.market_price_range&&r.jsx(I,{title:n("result.marketPrice"),content:t.market_price_range}),t.offered_price&&r.jsx(I,{title:n("result.offeredPrice"),content:new Intl.NumberFormat(s.language,{style:"currency",currency:t.currency||"USD"}).format(t.offered_price)}),t.price_assessment&&r.jsx(I,{title:n("result.priceAssessment"),content:t.price_assessment})]})}):null}function Wt({items:t}){const{t:n}=T.useTranslation(z.TRADE_SAFETY_NS);return t.length===0?null:r.jsx(B,{icon:r.jsx(Ft,{className:"size-6"}),title:n("result.safetyChecklist"),titleSize:"sm",children:r.jsx("div",{className:"space-y-4",children:t.map((s,o)=>r.jsxs("label",{className:"label cursor-pointer gap-4 rounded-2xl bg-base-200 p-4",children:[r.jsx("span",{className:"label-text break-keep text-neutral",children:s}),r.jsx("input",{type:"checkbox",className:"checkbox checkbox-sm [--chkbg:theme(colors.neutral)] [--chkfg:theme(colors.neutral-content)]"})]},o))})})}const Ut={danger:"result.danger.title",caution:"result.caution.title",safe:"result.safe.title"};function ce({signals:t,variant:n}){const{t:s}=T.useTranslation(z.TRADE_SAFETY_NS);return t.length===0?null:r.jsx(B,{badgeVariant:n,title:s(Ut[n]),children:r.jsx("div",{className:"divide-y divide-base-300",children:t.map((o,d)=>r.jsxs("div",{className:"space-y-4 py-4 first:pt-0 last:pb-0",children:[r.jsx(I,{title:o.title,content:o.description}),r.jsx(I,{title:s("result.whatToDo"),content:o.what_to_do})]},d))})})}function Bt({translation:t,nuance:n}){const{t:s}=T.useTranslation(z.TRADE_SAFETY_NS);return r.jsx(B,{subtitle:s("result.translation.subtitle"),title:s("result.translation.title"),children:r.jsxs("div",{className:"space-y-4",children:[t&&r.jsx(I,{title:s("result.translation.label"),content:t}),n&&r.jsx(I,{title:s("result.nuance.label"),content:n})]})})}function Zt({analysis:t}){return r.jsxs("div",{className:"space-y-6",children:[t.ai_summary.length>0&&r.jsx(Ht,{summary:t.ai_summary}),t.risk_signals.length>0&&r.jsx(ce,{signals:t.risk_signals,variant:"danger"}),t.cautions.length>0&&r.jsx(ce,{signals:t.cautions,variant:"caution"}),t.safe_indicators.length>0&&r.jsx(ce,{signals:t.safe_indicators,variant:"safe"}),t.safety_checklist.length>0&&r.jsx(Wt,{items:t.safety_checklist}),(t.translation||t.nuance_explanation)&&r.jsx(Bt,{translation:t.translation,nuance:t.nuance_explanation}),t.price_analysis&&r.jsx(qt,{data:t.price_analysis})]})}var Be={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Le=j.createContext&&j.createContext(Be),Kt=["attr","size","title"];function Jt(t,n){if(t==null)return{};var s=Vt(t,n),o,d;if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(t);for(d=0;d<x.length;d++)o=x[d],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(s[o]=t[o])}return s}function Vt(t,n){if(t==null)return{};var s={};for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(n.indexOf(o)>=0)continue;s[o]=t[o]}return s}function Q(){return Q=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(t[o]=s[o])}return t},Q.apply(this,arguments)}function Me(t,n){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(d){return Object.getOwnPropertyDescriptor(t,d).enumerable})),s.push.apply(s,o)}return s}function ee(t){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?Me(Object(s),!0).forEach(function(o){Xt(t,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):Me(Object(s)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(s,o))})}return t}function Xt(t,n,s){return n=Gt(n),n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t}function Gt(t){var n=Qt(t,"string");return typeof n=="symbol"?n:n+""}function Qt(t,n){if(typeof t!="object"||!t)return t;var s=t[Symbol.toPrimitive];if(s!==void 0){var o=s.call(t,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}function Ze(t){return t&&t.map((n,s)=>j.createElement(n.tag,ee({key:s},n.attr),Ze(n.child)))}function Ke(t){return n=>j.createElement(er,Q({attr:ee({},t.attr)},n),Ze(t.child))}function er(t){var n=s=>{var{attr:o,size:d,title:x}=t,S=Jt(t,Kt),_=d||s.size||"1em",f;return s.className&&(f=s.className),t.className&&(f=(f?f+" ":"")+t.className),j.createElement("svg",Q({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,S,{className:f,style:ee(ee({color:t.color||s.color},s.style),t.style),height:_,width:_,xmlns:"http://www.w3.org/2000/svg"}),x&&j.createElement("title",null,x),t.children)};return Le!==void 0?j.createElement(Le.Consumer,null,s=>n(s)):n(Be)}function tr(t){return Ke({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:[]}]})(t)}function rr(t){return Ke({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:[]}]})(t)}function nr({data:t}){const n=t.images.slice(0,3),s=n.length>0;return r.jsxs("div",{className:"relative rounded-l-md border-l-4 border-neutral/50 bg-base-100 px-5 py-2",children:[r.jsxs("div",{className:"mb-3",children:[r.jsx("h3",{className:"mb-2 text-sm font-bold text-base-content",children:t.title}),r.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-sm text-base-content/60",children:[r.jsx("span",{className:"truncate",children:t.author}),t.date&&r.jsx("span",{className:"shrink-0 whitespace-nowrap",children:t.date})]})]}),s&&r.jsx("div",{className:"flex gap-2",children:n.map((o,d)=>r.jsx("div",{className:"relative size-14 overflow-hidden rounded bg-base-200",children:r.jsx(Pt,{src:o,alt:`Image ${d+1} from post by ${t.author}`,fill:!0,className:"object-cover"})},`${o}-${d}`))})]})}function ar(){return r.jsxs("div",{className:"relative border-l-4 border-base-300 bg-base-100 px-5 py-2",children:[r.jsxs("div",{className:"mb-3",children:[r.jsx("div",{className:"skeleton mb-2 h-4 w-3/4"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"skeleton h-3 w-20"}),r.jsx("div",{className:"skeleton h-3 w-16"})]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("div",{className:"skeleton size-14 rounded"}),r.jsx("div",{className:"skeleton size-14 rounded"}),r.jsx("div",{className:"skeleton size-14 rounded"})]})]})}const Je=j.memo(({value:t,onChange:n,onSubmit:s,isLoading:o,error:d,previewData:x,isLoadingPreview:S,previewError:_})=>{const{t:f}=T.useTranslation(z.TRADE_SAFETY_NS),k=j.useRef(null),v=j.useRef(!0),y=!t&&!x&&!S&&!_;j.useEffect(()=>{if(v.current&&!y&&k.current){k.current.focus();const Z=k.current.value.length;k.current.setSelectionRange(Z,Z)}v.current=y},[y]);const E=o?r.jsx("span",{className:"loading loading-spinner loading-sm"}):f("hero.checkSafety"),C=o||!t.trim();return r.jsx("div",{className:"flex w-full flex-col items-center justify-center",children:r.jsxs("div",{className:"w-full lg:max-w-3xl",children:[r.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:f("hero.title")}),r.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:f("hero.subtitle")}),r.jsxs("div",{className:U("mb-4",!d&&"sm:mb-8 md:mb-12"),children:[y?r.jsx("div",{className:"hidden lg:block",children:r.jsxs("div",{className:"relative",children:[r.jsx("input",{type:"text",className:"input input-bordered h-20 w-full pr-36 text-sm placeholder:text-base-300 focus:outline-none",placeholder:f("hero.placeholder"),"aria-label":f("hero.placeholder"),value:t,onChange:P=>n(P.target.value),disabled:o,onKeyDown:P=>{P.key==="Enter"&&!C&&s()}}),r.jsx("button",{className:"btn btn-neutral absolute right-2 top-1/2 h-14 min-h-0 -translate-y-1/2 !animate-none px-6 font-bold text-neutral-content",onClick:s,disabled:C,children:E})]})}):null,r.jsx("div",{className:U(y?"block lg:hidden":"block"),children:r.jsxs("div",{className:"relative flex min-h-[400px] w-full flex-col overflow-hidden rounded-xl border border-base-300 bg-base-100",children:[!t&&r.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden p-5 pb-24 text-base text-base-300","aria-hidden":"true",children:r.jsxs("div",{className:"whitespace-pre-line leading-relaxed",children:[r.jsx("p",{className:"mb-4 text-base-300",children:f("hero.placeholder")}),f("hero.placeholderExample")]})}),r.jsxs("div",{className:"flex flex-1 flex-col pb-24",children:[r.jsx("textarea",{ref:k,className:"flex-1 resize-none overflow-auto border-none bg-transparent p-4 leading-6 text-base-content outline-none",value:t,"aria-label":f("hero.placeholder"),onChange:P=>n(P.target.value),disabled:o,placeholder:""}),x&&r.jsx("div",{className:"px-4 pb-4",children:r.jsx(nr,{data:x})}),S&&r.jsx("div",{className:"px-4 pb-4",children:r.jsx(ar,{})}),_&&r.jsx("div",{className:"alert alert-error mx-4 mb-4 flex w-auto items-center text-sm",children:r.jsx("span",{children:_})})]}),r.jsx("div",{className:"absolute inset-x-4 bottom-4 z-10",children:r.jsx("button",{className:"btn btn-neutral h-16 w-full text-base font-medium text-neutral-content",onClick:s,disabled:C,children:E})})]})})]}),d&&r.jsx("div",{className:"alert alert-error mb-6 flex items-center gap-2 text-sm",children:r.jsx("span",{children:d})}),r.jsx("p",{className:"mb-4 text-left text-xs text-base-content/60 sm:mb-8 sm:text-center md:mb-12",children:f("hero.disclaimer")}),r.jsxs("div",{className:"flex items-center justify-start gap-6 sm:justify-center",children:[r.jsx("a",{href:"https://x.com",target:"_blank",rel:"noopener noreferrer","aria-label":"X",children:r.jsx(rr,{className:"size-6 text-base-content transition-colors hover:text-base-content/70"})}),r.jsx("a",{href:"https://reddit.com",target:"_blank",rel:"noopener noreferrer","aria-label":"Reddit",children:r.jsx(tr,{className:"size-6 text-base-content transition-colors hover:text-base-content/70"})})]})]})})});Je.displayName="HomeHeroSection";var ue={exports:{}},W={},Ye;function sr(){if(Ye)return W;Ye=1;var t=j,n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,d=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function S(_,f,k){var v,y={},E=null,C=null;k!==void 0&&(E=""+k),f.key!==void 0&&(E=""+f.key),f.ref!==void 0&&(C=f.ref);for(v in f)o.call(f,v)&&!x.hasOwnProperty(v)&&(y[v]=f[v]);if(_&&_.defaultProps)for(v in f=_.defaultProps,f)y[v]===void 0&&(y[v]=f[v]);return{$$typeof:n,type:_,key:E,ref:C,props:y,_owner:d.current}}return W.Fragment=s,W.jsx=S,W.jsxs=S,W}var G={},He;function or(){return He||(He=1,process.env.NODE_ENV!=="production"&&(function(){var t=j,n=Symbol.for("react.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),_=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),C=Symbol.for("react.offscreen"),P=Symbol.iterator,Z="@@iterator";function Ve(e){if(e===null||typeof e!="object")return null;var a=P&&e[P]||e[Z];return typeof a=="function"?a:null}var L=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(e){{for(var a=arguments.length,i=new Array(a>1?a-1:0),l=1;l<a;l++)i[l-1]=arguments[l];Xe("error",e,i)}}function Xe(e,a,i){{var l=L.ReactDebugCurrentFrame,m=l.getStackAddendum();m!==""&&(a+="%s",i=i.concat([m]));var h=i.map(function(p){return String(p)});h.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,h)}}var Ge=!1,Qe=!1,et=!1,tt=!1,rt=!1,me;me=Symbol.for("react.module.reference");function nt(e){return!!(typeof e=="string"||typeof e=="function"||e===o||e===x||rt||e===d||e===k||e===v||tt||e===C||Ge||Qe||et||typeof e=="object"&&e!==null&&(e.$$typeof===E||e.$$typeof===y||e.$$typeof===S||e.$$typeof===_||e.$$typeof===f||e.$$typeof===me||e.getModuleId!==void 0))}function at(e,a,i){var l=e.displayName;if(l)return l;var m=a.displayName||a.name||"";return m!==""?i+"("+m+")":i}function he(e){return e.displayName||"Context"}function A(e){if(e==null)return null;if(typeof e.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case o:return"Fragment";case s:return"Portal";case x:return"Profiler";case d:return"StrictMode";case k:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _:var a=e;return he(a)+".Consumer";case S:var i=e;return he(i._context)+".Provider";case f:return at(e,e.render,"ForwardRef");case y:var l=e.displayName||null;return l!==null?l:A(e.type)||"Memo";case E:{var m=e,h=m._payload,p=m._init;try{return A(p(h))}catch{return null}}}return null}var F=Object.assign,H=0,be,ye,ge,xe,ve,je,_e;function Se(){}Se.__reactDisabledLog=!0;function st(){{if(H===0){be=console.log,ye=console.info,ge=console.warn,xe=console.error,ve=console.group,je=console.groupCollapsed,_e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Se,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}H++}}function ot(){{if(H--,H===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:be}),info:F({},e,{value:ye}),warn:F({},e,{value:ge}),error:F({},e,{value:xe}),group:F({},e,{value:ve}),groupCollapsed:F({},e,{value:je}),groupEnd:F({},e,{value:_e})})}H<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=L.ReactCurrentDispatcher,re;function K(e,a,i){{if(re===void 0)try{throw Error()}catch(m){var l=m.stack.trim().match(/\n( *(at )?)/);re=l&&l[1]||""}return`
2
+ `+re+e}}var ne=!1,J;{var it=typeof WeakMap=="function"?WeakMap:Map;J=new it}function we(e,a){if(!e||ne)return"";{var i=J.get(e);if(i!==void 0)return i}var l;ne=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var h;h=te.current,te.current=null,st();try{if(a){var p=function(){throw Error()};if(Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch(O){l=O}Reflect.construct(e,[],p)}else{try{p.call()}catch(O){l=O}e.call(p.prototype)}}else{try{throw Error()}catch(O){l=O}e()}}catch(O){if(O&&l&&typeof O.stack=="string"){for(var u=O.stack.split(`
3
+ `),N=l.stack.split(`
4
+ `),b=u.length-1,g=N.length-1;b>=1&&g>=0&&u[b]!==N[g];)g--;for(;b>=1&&g>=0;b--,g--)if(u[b]!==N[g]){if(b!==1||g!==1)do if(b--,g--,g<0||u[b]!==N[g]){var R=`
5
+ `+u[b].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),typeof e=="function"&&J.set(e,R),R}while(b>=1&&g>=0);break}}}finally{ne=!1,te.current=h,ot(),Error.prepareStackTrace=m}var Y=e?e.displayName||e.name:"",$=Y?K(Y):"";return typeof e=="function"&&J.set(e,$),$}function lt(e,a,i){return we(e,!1)}function ct(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function V(e,a,i){if(e==null)return"";if(typeof e=="function")return we(e,ct(e));if(typeof e=="string")return K(e);switch(e){case k:return K("Suspense");case v:return K("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return lt(e.render);case y:return V(e.type,a,i);case E:{var l=e,m=l._payload,h=l._init;try{return V(h(m),a,i)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,Ne={},ke=L.ReactDebugCurrentFrame;function X(e){if(e){var a=e._owner,i=V(e.type,e._source,a?a.type:null);ke.setExtraStackFrame(i)}else ke.setExtraStackFrame(null)}function ut(e,a,i,l,m){{var h=Function.call.bind(q);for(var p in e)if(h(e,p)){var u=void 0;try{if(typeof e[p]!="function"){var N=Error((l||"React class")+": "+i+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw N.name="Invariant Violation",N}u=e[p](a,p,l,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(b){u=b}u&&!(u instanceof Error)&&(X(m),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",l||"React class",i,p,typeof u),X(null)),u instanceof Error&&!(u.message in Ne)&&(Ne[u.message]=!0,X(m),w("Failed %s type: %s",i,u.message),X(null))}}}var ft=Array.isArray;function ae(e){return ft(e)}function pt(e){{var a=typeof Symbol=="function"&&Symbol.toStringTag,i=a&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function dt(e){try{return Oe(e),!1}catch{return!0}}function Oe(e){return""+e}function Ee(e){if(dt(e))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",pt(e)),Oe(e)}var Re=L.ReactCurrentOwner,mt={key:!0,ref:!0,__self:!0,__source:!0},Te,ze;function ht(e){if(q.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function bt(e){if(q.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function yt(e,a){typeof e.ref=="string"&&Re.current}function gt(e,a){{var i=function(){Te||(Te=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",a))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function xt(e,a){{var i=function(){ze||(ze=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",a))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var vt=function(e,a,i,l,m,h,p){var u={$$typeof:n,type:e,key:a,ref:i,props:p,_owner:h};return u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:m}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function jt(e,a,i,l,m){{var h,p={},u=null,N=null;i!==void 0&&(Ee(i),u=""+i),bt(a)&&(Ee(a.key),u=""+a.key),ht(a)&&(N=a.ref,yt(a));for(h in a)q.call(a,h)&&!mt.hasOwnProperty(h)&&(p[h]=a[h]);if(e&&e.defaultProps){var b=e.defaultProps;for(h in b)p[h]===void 0&&(p[h]=b[h])}if(u||N){var g=typeof e=="function"?e.displayName||e.name||"Unknown":e;u&&gt(p,g),N&&xt(p,g)}return vt(e,u,N,m,l,Re.current,p)}}var se=L.ReactCurrentOwner,Pe=L.ReactDebugCurrentFrame;function M(e){if(e){var a=e._owner,i=V(e.type,e._source,a?a.type:null);Pe.setExtraStackFrame(i)}else Pe.setExtraStackFrame(null)}var oe;oe=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Ce(){{if(se.current){var e=A(se.current.type);if(e)return`
6
6
 
7
- Check the render method of \``+e+"`."}return""}}function jt(e){return""}var De={};function _t(e){{var n=Pe();if(!n){var i=typeof e=="string"?e:e.displayName||e.name;i&&(n=`
7
+ Check the render method of \``+e+"`."}return""}}function _t(e){return""}var Ae={};function St(e){{var a=Ce();if(!a){var i=typeof e=="string"?e:e.displayName||e.name;i&&(a=`
8
8
 
9
- Check the top-level render call using <`+i+">.")}return n}}function Ae(e,n){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=_t(n);if(De[i])return;De[i]=!0;var l="";e&&e._owner&&e._owner!==ne.current&&(l=" It was passed a child from "+P(e._owner.type)+"."),L(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,l),L(null)}}function Ce(e,n){{if(typeof e!="object")return;if(re(e))for(var i=0;i<e.length;i++){var l=e[i];se(l)&&Ae(l,n)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var m=Je(e);if(typeof m=="function"&&m!==e.entries)for(var y=m.call(e),f;!(f=y.next()).done;)se(f.value)&&Ae(f.value,n)}}}function St(e){{var n=e.type;if(n==null||typeof n=="string")return;var i;if(typeof n=="function")i=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===d||n.$$typeof===w))i=n.propTypes;else return;if(i){var l=P(n);ct(i,e.props,"prop",l,e)}else if(n.PropTypes!==void 0&&!ae){ae=!0;var m=P(n);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",m||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function wt(e){{for(var n=Object.keys(e.props),i=0;i<n.length;i++){var l=n[i];if(l!=="children"&&l!=="key"){L(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",l),L(null);break}}e.ref!==null&&(L(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}var Fe={};function $e(e,n,i,l,m,y){{var f=rt(e);if(!f){var u="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(u+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var S=jt();S?u+=S:u+=Pe();var b;e===null?b="null":re(e)?b="array":e!==void 0&&e.$$typeof===r?(b="<"+(P(e.type)||"Unknown")+" />",u=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,u)}var g=xt(e,n,i,m,y);if(g==null)return g;if(f){var O=n.children;if(O!==void 0)if(l)if(re(O)){for(var I=0;I<O.length;I++)Ce(O[I],e);Object.freeze&&Object.freeze(O)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ce(O,e)}if(Y.call(n,"key")){var C=P(e),k=Object.keys(n).filter(function(Tt){return Tt!=="key"}),oe=k.length>0?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}";if(!Fe[C+oe]){var Rt=k.length>0?"{"+k.join(": ..., ")+": ...}":"{}";_(`A props object containing a "key" prop is being spread into JSX:
9
+ Check the top-level render call using <`+i+">.")}return a}}function De(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=St(a);if(Ae[i])return;Ae[i]=!0;var l="";e&&e._owner&&e._owner!==se.current&&(l=" It was passed a child from "+A(e._owner.type)+"."),M(e),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,l),M(null)}}function Fe(e,a){{if(typeof e!="object")return;if(ae(e))for(var i=0;i<e.length;i++){var l=e[i];ie(l)&&De(l,a)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var m=Ve(e);if(typeof m=="function"&&m!==e.entries)for(var h=m.call(e),p;!(p=h.next()).done;)ie(p.value)&&De(p.value,a)}}}function wt(e){{var a=e.type;if(a==null||typeof a=="string")return;var i;if(typeof a=="function")i=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===f||a.$$typeof===y))i=a.propTypes;else return;if(i){var l=A(a);ut(i,e.props,"prop",l,e)}else if(a.PropTypes!==void 0&&!oe){oe=!0;var m=A(a);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",m||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nt(e){{for(var a=Object.keys(e.props),i=0;i<a.length;i++){var l=a[i];if(l!=="children"&&l!=="key"){M(e),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",l),M(null);break}}e.ref!==null&&(M(e),w("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}var $e={};function Ie(e,a,i,l,m,h){{var p=nt(e);if(!p){var u="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(u+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var N=_t();N?u+=N:u+=Ce();var b;e===null?b="null":ae(e)?b="array":e!==void 0&&e.$$typeof===n?(b="<"+(A(e.type)||"Unknown")+" />",u=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,u)}var g=jt(e,a,i,m,h);if(g==null)return g;if(p){var R=a.children;if(R!==void 0)if(l)if(ae(R)){for(var Y=0;Y<R.length;Y++)Fe(R[Y],e);Object.freeze&&Object.freeze(R)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(R,e)}if(q.call(a,"key")){var $=A(e),O=Object.keys(a).filter(function(zt){return zt!=="key"}),le=O.length>0?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}";if(!$e[$+le]){var Tt=O.length>0?"{"+O.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
10
10
  let props = %s;
11
11
  <%s {...props} />
12
12
  React keys must be passed directly to JSX without using spread:
13
13
  let props = %s;
14
- <%s key={someKey} {...props} />`,oe,C,Rt,C),Fe[C+oe]=!0}}return e===o?wt(g):St(g),g}}function kt(e,n,i){return $e(e,n,i,!0)}function Nt(e,n,i){return $e(e,n,i,!1)}var Ot=Nt,Et=kt;J.Fragment=o,J.jsx=Ot,J.jsxs=Et})()),J}var We;function ar(){return We||(We=1,process.env.NODE_ENV==="production"?le.exports=rr():le.exports=nr()),le.exports}var qe=ar();function sr({src:t,autoplay:r,loop:a=!0,...o}){const[p,h]=N.useState(!1),[j,v]=N.useState(null),[d,z]=N.useState(!1);return N.useEffect(()=>{let x=!0;return h(!0),Promise.all([Promise.resolve().then(()=>require("./lottie-react.esm-Bv7L41xK.js")),Promise.resolve().then(()=>require("./isChromatic-5i32AXac-BWePUv7P.js"))]).then(([{Player:w},{default:T}])=>{x&&(v(()=>w),z(T()))}).catch(w=>{throw console.error("[LottiePlayer] Failed to load dependencies:",w),w}),()=>{x=!1}},[]),!p||!j?qe.jsx("div",{...o}):qe.jsx(j,{src:t,loop:a,autoplay:r!==void 0?r:!d,...o})}const or={danger:{lottie:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a8/lottie.json",webp:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a8/512.webp",gif:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a8/512.gif",alt:"🚨"},caution:{lottie:"https://fonts.gstatic.com/s/e/notoemoji/latest/26a0_fe0f/lottie.json",webp:"https://fonts.gstatic.com/s/e/notoemoji/latest/26a0_fe0f/512.webp",gif:"https://fonts.gstatic.com/s/e/notoemoji/latest/26a0_fe0f/512.gif",alt:"⚠️"},safe:{lottie:"https://fonts.gstatic.com/s/e/notoemoji/latest/2705/lottie.json",webp:"https://fonts.gstatic.com/s/e/notoemoji/latest/2705/512.webp",gif:"https://fonts.gstatic.com/s/e/notoemoji/latest/2705/512.gif",alt:"✅"}},ce={danger:"font-bold text-error",caution:"font-bold text-warning",safe:"font-bold text-success"};function ir({level:t,score:r}){const{t:a}=E.useTranslation(R.TRADE_SAFETY_NS),o=or[t];return s.jsxs("div",{className:"mb-8 flex flex-col items-center text-center",children:[s.jsx("div",{className:"mb-5 rounded-full bg-neutral/75 px-4 py-1.5",children:s.jsx("span",{className:"text-sm font-medium text-neutral-content",children:a(`result.safetyLevel.${t}.badge`)})}),s.jsx("h1",{className:"mb-9 break-keep text-4xl font-bold leading-tight text-base-content",children:s.jsx(E.Trans,{t:a,i18nKey:`result.safetyLevel.${t}.title`,components:[s.jsx("strong",{className:ce[t]},"0")]})}),s.jsx("div",{className:"mb-9 flex size-32 items-center justify-center",children:s.jsx(sr,{src:o.lottie,autoplay:!0,loop:!0,className:"size-full"})}),s.jsx("p",{className:"max-w-md break-keep text-xl leading-relaxed text-base-content",children:s.jsx(E.Trans,{t:a,i18nKey:`result.safetyLevel.${t}.description`,values:{score:r},components:[s.jsx("strong",{className:ce[t]},"0"),s.jsx("strong",{className:ce[t]},"1")]})})]})}const fe={safe:70,caution:40},lr=t=>t>=fe.safe?"safe":t>=fe.caution?"caution":"danger",ue=c.z.object({category:c.z.enum(["payment","seller","platform","price","content"]),severity:c.z.enum(["high","medium","low"]),title:c.z.string(),description:c.z.string(),what_to_do:c.z.string()}),cr=c.z.object({market_price_range:c.z.string().nullish(),offered_price:c.z.number().nullish(),currency:c.z.string().nullish(),price_assessment:c.z.string(),warnings:c.z.array(c.z.string())}),ur=c.z.object({ai_summary:c.z.array(c.z.string()),translation:c.z.string().nullish(),nuance_explanation:c.z.string().nullish(),risk_signals:c.z.array(ue),cautions:c.z.array(ue),safe_indicators:c.z.array(ue),price_analysis:cr,safety_checklist:c.z.array(c.z.string()),safe_score:c.z.number(),recommendation:c.z.string(),emotional_support:c.z.string()}),fr=c.z.object({id:c.z.string(),user_id:c.z.string().nullish(),input_text:c.z.string(),llm_analysis:ur,safe_score:c.z.number(),expert_advice:c.z.string().nullish(),expert_reviewed:c.z.boolean(),expert_reviewed_at:c.z.string().nullish(),expert_reviewed_by:c.z.string().nullish(),created_at:c.z.string(),updated_at:c.z.string()}),pr=c.z.enum(["twitter"]),dr=c.z.object({platform:pr,author:c.z.string(),created_at:c.z.string().nullish(),text:c.z.string(),text_preview:c.z.string(),images:c.z.array(c.z.string())}),mr=c.z.object({data:dr});class yr extends zt.BaseCrudRepository{constructor(){super(...arguments),this.resource="trade-safety"}getDataSchema(){return fr}async fetchPreview(r,a){const o=`${this.apiService.buildUrl(this.resource)}/preview`,p=await this.apiService.request(o,{...a,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:r})});return this.validateResponse(p,mr).data}}exports.TRADE_SAFETY_NS=R.TRADE_SAFETY_NS;exports.tradeSafetyTranslations=R.tradeSafetyTranslations;exports.DetailedResult=Bt;exports.HomeHeroSection=tr;exports.PageHeader=ir;exports.SAFETY_SCORE_THRESHOLDS=fe;exports.TradeSafetyRepository=yr;exports.getSafetyLevel=lr;
14
+ <%s key={someKey} {...props} />`,le,$,Tt,$),$e[$+le]=!0}}return e===o?Nt(g):wt(g),g}}function kt(e,a,i){return Ie(e,a,i,!0)}function Ot(e,a,i){return Ie(e,a,i,!1)}var Et=Ot,Rt=kt;G.Fragment=o,G.jsx=Et,G.jsxs=Rt})()),G}var qe;function ir(){return qe||(qe=1,process.env.NODE_ENV==="production"?ue.exports=sr():ue.exports=or()),ue.exports}var We=ir();function lr({src:t,autoplay:n,loop:s=!0,...o}){const[d,x]=j.useState(!1),[S,_]=j.useState(null),[f,k]=j.useState(!1);return j.useEffect(()=>{let v=!0;return x(!0),Promise.all([Promise.resolve().then(()=>require("./lottie-react.esm-Bv7L41xK.js")),Promise.resolve().then(()=>require("./isChromatic-5i32AXac-BWePUv7P.js"))]).then(([{Player:y},{default:E}])=>{v&&(_(()=>y),k(E()))}).catch(y=>{throw console.error("[LottiePlayer] Failed to load dependencies:",y),y}),()=>{v=!1}},[]),!d||!S?We.jsx("div",{...o}):We.jsx(S,{src:t,loop:s,autoplay:n!==void 0?n:!f,...o})}const cr={danger:{lottie:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a8/lottie.json",webp:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a8/512.webp",gif:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a8/512.gif",alt:"🚨"},caution:{lottie:"https://fonts.gstatic.com/s/e/notoemoji/latest/26a0_fe0f/lottie.json",webp:"https://fonts.gstatic.com/s/e/notoemoji/latest/26a0_fe0f/512.webp",gif:"https://fonts.gstatic.com/s/e/notoemoji/latest/26a0_fe0f/512.gif",alt:"⚠️"},safe:{lottie:"https://fonts.gstatic.com/s/e/notoemoji/latest/2705/lottie.json",webp:"https://fonts.gstatic.com/s/e/notoemoji/latest/2705/512.webp",gif:"https://fonts.gstatic.com/s/e/notoemoji/latest/2705/512.gif",alt:"✅"}},fe={danger:"font-bold text-error",caution:"font-bold text-warning",safe:"font-bold text-success"};function ur({level:t,score:n}){const{t:s}=T.useTranslation(z.TRADE_SAFETY_NS),o=cr[t];return r.jsxs("div",{className:"mb-8 flex flex-col items-center text-center",children:[r.jsx("div",{className:"mb-5 rounded-full bg-neutral/75 px-4 py-1.5",children:r.jsx("span",{className:"text-sm font-medium text-neutral-content",children:s(`result.safetyLevel.${t}.badge`)})}),r.jsx("h1",{className:"mb-9 break-keep text-4xl font-bold leading-tight text-base-content",children:r.jsx(T.Trans,{t:s,i18nKey:`result.safetyLevel.${t}.title`,components:[r.jsx("strong",{className:fe[t]},"0")]})}),r.jsx("div",{className:"mb-9 flex size-32 items-center justify-center",children:r.jsx(lr,{src:o.lottie,autoplay:!0,loop:!0,className:"size-full"})}),r.jsx("p",{className:"max-w-md break-keep text-xl leading-relaxed text-base-content",children:r.jsx(T.Trans,{t:s,i18nKey:`result.safetyLevel.${t}.description`,values:{score:n},components:[r.jsx("strong",{className:fe[t]},"0"),r.jsx("strong",{className:fe[t]},"1")]})})]})}const de={safe:70,caution:40},fr=t=>t>=de.safe?"safe":t>=de.caution?"caution":"danger",pe=c.z.object({category:c.z.enum(["payment","seller","platform","price","content"]),severity:c.z.enum(["high","medium","low"]),title:c.z.string(),description:c.z.string(),what_to_do:c.z.string()}),pr=c.z.object({market_price_range:c.z.string().nullish(),offered_price:c.z.number().nullish(),currency:c.z.string().nullish(),price_assessment:c.z.string(),warnings:c.z.array(c.z.string())}),dr=c.z.object({ai_summary:c.z.array(c.z.string()),translation:c.z.string().nullish(),nuance_explanation:c.z.string().nullish(),risk_signals:c.z.array(pe),cautions:c.z.array(pe),safe_indicators:c.z.array(pe),price_analysis:pr,safety_checklist:c.z.array(c.z.string()),safe_score:c.z.number(),recommendation:c.z.string(),emotional_support:c.z.string()}),mr=c.z.object({id:c.z.string(),user_id:c.z.string().nullish(),input_text:c.z.string(),llm_analysis:dr,safe_score:c.z.number(),expert_advice:c.z.string().nullish(),expert_reviewed:c.z.boolean(),expert_reviewed_at:c.z.string().nullish(),expert_reviewed_by:c.z.string().nullish(),created_at:c.z.string(),updated_at:c.z.string()}),hr=c.z.enum(["twitter","reddit"]),br=c.z.object({platform:hr,author:c.z.string(),created_at:c.z.string().nullish(),text:c.z.string(),text_preview:c.z.string(),images:c.z.array(c.z.string())}),yr=c.z.object({data:br});class gr extends Ct.BaseCrudRepository{constructor(){super(...arguments),this.resource="trade-safety"}getDataSchema(){return mr}async fetchPreview(n,s){const o=`${this.apiService.buildUrl(this.resource)}/preview`,d=await this.apiService.request(o,{...s,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:n})});return this.validateResponse(d,yr).data}}exports.TRADE_SAFETY_NS=z.TRADE_SAFETY_NS;exports.tradeSafetyTranslations=z.tradeSafetyTranslations;exports.DetailedResult=Zt;exports.HomeHeroSection=Je;exports.PageHeader=ur;exports.SAFETY_SCORE_THRESHOLDS=de;exports.TradeSafetyRepository=gr;exports.getSafetyLevel=fr;
15
15
  //# sourceMappingURL=index.js.map