(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2525],{20063:(e,t,s)=>{"use strict";var r=s(47260);s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})},35652:(e,t,s)=>{"use strict";s.d(t,{ProofList:()=>p});var r=s(95155),a=s(20063),o=s(12115),n=s(95088),i=s(84820),c=s(56502),l=s(89678),d=s(52985);function p(e){let{initialProofs:t,defaultAsset:s,canCreate:p}=e,{t:u,locale:x}=(0,c.s)(),m=(0,a.useRouter)(),[f,h]=(0,o.useState)(t),[b,j]=(0,o.useState)(s),[v,N]=(0,o.useState)(!1),[g,k]=(0,o.useState)(null),y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(0,d.ZV)(x,e,{maximumFractionDigits:t})},w=async()=>{N(!0),k(null);try{let e=await l.FH.post("/api/decisions/".concat(b,"/proof"),{assetCode:b}),t=await l.FH.get("/api/proofs?limit=20");h(t.proofs),m.push("/proofs/".concat(e.code))}catch(e){k(e instanceof Error?e.message:u("common.error"))}finally{N(!1)}};return(0,r.jsxs)("div",{className:"space-y-4","data-testid":"proof-list",children:[(0,r.jsx)(n.Notice,{tone:"info",children:u("proof.note")}),p?(0,r.jsxs)(i.Zk,{children:[(0,r.jsx)(i.aO,{title:u("proof.create")}),(0,r.jsxs)(i.l_,{className:"flex flex-wrap items-end gap-2",children:[(0,r.jsxs)("label",{className:"block",children:[(0,r.jsx)("span",{className:"mb-1 block text-[11px] text-text-muted",children:u("proof.asset")}),(0,r.jsx)("input",{value:b,onChange:e=>j(e.target.value.toUpperCase()),className:"h-8 w-40 rounded-md border border-border bg-surface-2 px-2 font-mono text-xs text-text","aria-label":u("proof.asset")})]}),(0,r.jsx)(n.$n,{onClick:w,disabled:v||!b,"data-testid":"prove-it",children:v?u("proof.creating"):u("proof.proveIt")}),g?(0,r.jsx)("p",{className:"text-[11px] text-critical",children:g}):null]})]}):null,0===f.length?(0,r.jsx)(i.pp,{title:u("uiState.empty"),body:u("proof.empty")}):(0,r.jsxs)(i.Zk,{children:[(0,r.jsx)(i.aO,{title:u("proof.list")}),(0,r.jsx)(i.l_,{children:(0,r.jsx)("ul",{className:"space-y-1.5",children:f.map(e=>(0,r.jsx)("li",{children:(0,r.jsxs)("a",{href:"/proofs/".concat(e.code),"data-proof":e.code,className:"flex flex-wrap items-baseline justify-between gap-2 rounded-lg border border-border bg-surface-2/40 px-3 py-2 text-[12px] transition-colors hover:border-brand/30",children:[(0,r.jsxs)("span",{className:"min-w-0",children:[(0,r.jsx)("span",{className:"me-2 font-mono text-[11px] text-text-faint",children:e.assetCode}),"ar"===x?e.recommendationAr:e.recommendation]}),(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)(i.Ex,{tone:"accent",children:"observed"===e.evidenceKind?u("proof.evidenceObserved"):u("proof.evidenceSimulated")}),(0,r.jsxs)("span",{className:"font-mono tabular-nums text-text-faint",children:[y(e.riskBefore,1)," → ",y(e.riskAfter,1)," \xb7"," ",y(e.frameCount)," ",u("proof.frames")," \xb7"," ",(0,d.r6)(x,e.createdAt)]})]})]})},e.code))})})]})]})}},61079:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,52619,23)),Promise.resolve().then(s.bind(s,35652))}},e=>{e.O(0,[2619,4909,4820,4672,8441,1255,7358],()=>e(e.s=61079)),_N_E=e.O()}]);