PageSourceSearch

https://graph-pers.ru/assets/RiskScorePage-BN7Wu3Ff.js

js graph-pers.ru collected 2026-10-05 23:19:26 UTC 7,043 bytes, 1 lines download raw bytes

1import{a as C,j as t}from"./index-Cusj2f3B.js";import{r as a}from"./i18n-SxJ0WgAy.js";const E=["ETH","BTC","SOL","BSC","POLYGON","LTC","DOGE"],R={low:"var(--au-accent)",medium:"var(--au-warn)",high:"var(--au-warn)",critical:"var(--au-danger)"},z={low:"Низкий риск",medium:"Средний риск",high:"Высокий риск",critical:"Критический риск"},l={sanctions:"var(--au-danger)",fraud:"var(--au-warn)",proximity:"var(--au-warn)",behavior:"#5fc2b0",volume:"var(--au-accent)",other:"var(--au-text-mute)"},S={sanctions:"Санкции",fraud:"Мошенничество",proximity:"Окружение",behavior:"Поведение",volume:"Объём",other:"Прочее"},L={maxWidth:1100,margin:"24px auto",padding:"0 16px",fontFamily:'Calibri, "Segoe UI", sans-serif'},T={fontFamily:"Cambria, Georgia, serif",fontSize:32,fontWeight:600,margin:"0 0 4px"},W={fontSize:14,opacity:.65,marginBottom:20,fontStyle:"italic"},$={display:"flex",gap:8,flexWrap:"wrap",alignItems:"center",marginBottom:16},w={padding:"6px 10px"},m={background:"var(--td-panel)",borderRadius:12,border:"1px solid var(--td-border)",padding:16,marginBottom:14};function d(r,c){if(r.startsWith("#")){const p=r.slice(1),h=parseInt(p.slice(0,2),16),u=parseInt(p.slice(2,4),16),i=parseInt(p.slice(4,6),16);return`rgba(${h},${u},${i},${c})`}return r}function k(r){return!r||r.length<14?r:`${r.slice(0,8)}…${r.slice(-4)}`}function I(){const r=new URLSearchParams(typeof window<"u"?window.location.search:""),[c,p]=a.useState(r.get("network")?.toUpperCase()||"ETH"),[h,u]=a.useState(r.get("address")||""),[i,y]=a.useState(null),[v,b]=a.useState(!1),[j,x]=a.useState(null),f=a.useCallback(async(e,s)=>{if(!s.trim()){x("Введите адрес кошелька.");return}b(!0),x(null);try{const n=await C.riskScore(e,s.trim());y(n)}catch(n){x(n instanceof Error?n.message:String(n)),y(null)}finally{b(!1)}},[]);a.useEffect(()=>{const e=r.get("address");e&&f((r.get("network")||"ETH").toUpperCase(),e)},[]);const o=i?R[i.level]:"var(--au-text-mute)",g=i?.components??[];return t.jsxs("div",{style:L,children:[t.jsx("a",{href:"/",style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--au-accent)",fontSize:13,marginBottom:8,textDecoration:"none",borderBottom:"1px dashed rgba(52, 194, 133,0.4)"},children:"← Вернуться к графу"}),t.jsx("h1",{style:T,children:"🛡 Объяснимый Risk Score"}),t.jsx("div",{style:W,children:"Не просто число, а разбор: из чего складывается риск адреса, что значит каждый фактор и насколько он весит. Санкции, близость к OFAC, мошеннические паттерны, поведение и объём."}),t.jsxs("div",{style:$,children:[t.jsx("select",{style:w,value:c,onChange:e=>p(e.target.value),children:E.map(e=>t.jsx("option",{value:e,children:e},e))}),t.jsx("input",{style:{...w,minWidth:420,flex:1},placeholder:"адрес кошелька",value:h,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key==="Enter"&&f(c,h)}}),t.jsx("button",{type:"button",onClick:()=>void f(c,h),disabled:v,children:v?"считаю…":"Посчитать риск"})]}),j&&t.jsx("div",{style:{background:"rgba(226, 112, 95,0.15)",border:"1px solid var(--au-danger)",borderRadius:8,padding:12,marginBottom:16},children:j}),i&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{...m,display:"flex",gap:18,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("div",{style:{width:92,height:92,borderRadius:20,flexShrink:0,background:`linear-gradient(135deg, ${d(o,.85)}, ${d(o,.4)})`,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--au-text)",fontSize:"2.2rem",fontWeight:700,boxShadow:`0 4px 18px ${d(o,.35)}`},"aria-label":`Risk Score ${i.score} из 100`,children:i.score}),t.jsxs("div",{style:{flex:1,minWidth:240},children:[t.jsxs("div",{style:{fontSize:12,opacity:.7,textTransform:"uppercase",letterSpacing:.6},children:["Risk Score · ",k(i.address)," · ",i.network]}),t.jsx("div",{style:{fontSize:"1.3rem",fontWeight:700,color:o},children:z[i.level]}),i.summary&&t.jsx("div",{style:{fontSize:14,marginTop:6,opacity:.9},children:i.summary}),i.benchmark&&t.jsx("div",{style:{fontSize:13,marginTop:4,opacity:.6},children:i.benchmark})]})]}),i.recommendation&&t.jsxs("div",{style:{...m,borderColor:d(o,.5),background:d(o,.08)},children:[t.jsx("b",{children:"Что делать:"})," ",i.recommendation]}),g.length>0&&t.jsxs("div",{style:m,children:[t.jsx("div",{style:{fontSize:13,opacity:.7,marginBottom:8},children:"Вклад факторов в риск"}),t.jsx("div",{style:{display:"flex",height:18,borderRadius:9,overflow:"hidden",background:"var(--td-panel)"},children:g.map(e=>t.jsx("div",{title:`${e.label}: ${e.contribution_pct??0}%`,style:{width:`${Math.max(2,e.contribution_pct??0)}%`,background:l[e.category??"other"]??l.other}}
1,e.code))}),t.jsx("div",{style:{display:"flex",gap:14,flexWrap:"wrap",marginTop:10,fontSize:12,opacity:.8},children:Array.from(new Set(g.map(e=>e.category??"other"))).map(e=>t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[t.jsx("span",{style:{width:10,height:10,borderRadius:3,background:l[e]??l.other}}),S[e]??e]},e))})]}),g.length===0?t.jsx("div",{style:m,children:"Известных риск-факторов нет — по нашим данным адрес выглядит чистым."}):g.map(e=>{const s=e.category??"other",n=l[s]??l.other;return t.jsxs("div",{style:{...m,borderLeft:`4px solid ${n}`},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("div",{style:{fontWeight:700,fontSize:"1.02rem"},children:e.label}),t.jsxs("div",{style:{fontWeight:700,color:"var(--au-warn)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:["+",e.weight]})]}),t.jsxs("div",{style:{marginTop:4},children:[t.jsx("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:20,background:d(n,.18),color:n,fontWeight:600},children:S[s]??s}),(e.contribution_pct??0)>0&&t.jsxs("span",{style:{fontSize:12,opacity:.6,marginLeft:8},children:[e.contribution_pct,"% вклада"]})]}),e.explanation&&t.jsx("div",{style:{fontSize:14,marginTop:8},children:e.explanation}),e.detail&&t.jsx("div",{style:{fontSize:13,opacity:.65,marginTop:4},children:e.detail}),e.evidence&&e.evidence.length>0&&t.jsxs("div",{style:{fontSize:12,opacity:.7,marginTop:6,fontFamily:"Consolas, monospace"},children:["Связанные адреса: ",e.evidence.map(k).join(", ")]}),e.link&&t.jsx("a",{href:e.link,style:{display:"inline-block",marginTop:8,fontSize:13,color:"var(--au-accent)",textDecoration:"none",borderBottom:"1px dashed rgba(52, 194, 133,0.4)"},children:"Открыть связанные кластеры →"})]},e.code)}),t.jsxs("div",{style:{fontSize:12,opacity:.45,marginTop:8},children:["Рассчитано: ",new Date(i.computed_at).toLocaleString("ru-RU",{hour12:!1})]})]})]})}export{I as RiskScorePage};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.