PageSourceSearch

https://scanmalware.com/_next/static/chunks/pages/script/[...slug]-656ec5333dd84cb5.js

js scanmalware.com collected 2026-10-07 17:05:57 UTC 111,391 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3047],{3203:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSP:()=>$,default:()=>A});var s=a(7876),r=a(4232),l=a(9099),i=a(8230),n=a.n(i),d=a(8028),c=a(4891),o=a(9018),x=a(2791),m=a(2205),h=a(269),g=a(5773),u=a(1391),p=a(7266),y=a(1035),b=a(4237),f=a(4084),j=a(3536),v=a(2495),k=a(825);let N=e=>{let{className:t,title:a}=e;return(0,s.jsx)("i",{className:t,title:a})},_=["overview","hashes","segments","similar","headers","security","source"],w=new Set(["eval_usage","function_constructor","escape_sequences","minified"]),S=(e,t)=>{let a=Array.isArray(t)?t:[],s="number"==typeof e?e:0;if(!a.includes("high_entropy"))return{score:s,factors:a};let r=a.filter(e=>"high_entropy"!==e);return 0===r.length?{score:0,factors:r}:{score:Math.max(0,s-(r.some(e=>w.has(e))?20:25)),factors:r}};var $=!0;function A(){var e,t,a,i,w,$,A,C,L,R,T,M,E,F,z,P,H,D,I,U,B,q,O,J,W,V,K,Y,G,Q,X,Z,ee,et,ea,es,er,el,ei,en,ed,ec,eo,ex,em,eh,eg,eu,ep,ey,eb,ef,ej,ev,ek,eN,e_,ew,eS,e$,eA,eC,eL,eR,eT,eM,eE,eF,ez,eP,eH,eD,eI,eU;let{initialFingerprint:eB,initialSegments:eq,initialPrevalence:eO,initialInlineAttribution:eJ,initialSegmentTotal:eW}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},eV=(0,l.useRouter)(),{slug:eK}=eV.query,eY=Array.isArray(eK)?eK[0]:eK,[eG,eQ]=(0,r.useState)(eB||null),[e
1X,eZ]=(0,r.useState)(eq||[]),[e0,e2]=(0,r.useState)([]),[e4,e1]=(0,r.useState)(!1),[e5,e3]=(0,r.useState)(!1),[e9,e6]=(0,r.useState)(1),[e8,e7]=(0,r.useState)(!1),[te]=(0,r.useState)(50),[tt,ta]=(0,r.useState)(eO||null),[ts,tr]=(0,r.useState)(eJ||null),[tl,ti]=(0,r.useState)(eW??null),[tn,td]=(0,r.useState)(null),[tc,to]=(0,r.useState)(!1),[tx,tm]=(0,r.useState)([]),[th,tg]=(0,r.useState)([]),[tu,tp]=(0,r.useState)(null),ty=(0,r.useMemo)(()=>eX.map(e=>{let t=S(e.risk_score,e.risk_factors);return{...e,risk_score:t.score,risk_factors:t.factors,is_suspicious:e.is_suspicious&&t.factors.length>0}}),[eX]),tb=ty.length,tf=tl??tb,tj=tf>tb,tv=null==eG||null==(e=eG.bundle_analysis)?void 0:e.bundler_type,tk=!!tv&&"unknown"!==tv,tN=!!(null==eG||null==(t=eG.bundle_analysis)?void 0:t.is_bundled)||tx.length>0||tk,t_=(0,r.useMemo)(()=>tu?{...tu,detailed_events:Array.isArray(tu.detailed_events)?tu.detailed_events.map(e=>{let t=S(e.riskScore,e.riskFactors);return{...e,riskScore:t.score,riskFactors:t.factors}}):tu.detailed_events,high_risk_events:Array.isArray(tu.high_risk_events)?tu.high_risk_events.map(e=>{let t=S(e.score,e.factors);return{...e,score:t.score,factors:t.factors}}).filter(e=>e.score>=60):tu.high_risk_events}:null,[tu]),[tw,tS]=(0,r.useState)(null),[t$,tA]=(0,r.useState)(null),[tC,tL]=(0,r.useState)(!1),[tR,tT]=(0,r.useState)(null),[tM,tE]=(0,r.useState)(!1),[tF,tz]=(0,r.useState)(!eB),[tP,tH]=(0,r.useState)(null),[tD,tI]=(0,r.useState)("overview"),tU=(0,r.useMemo)(()=>{if(!(null==t_?void 0:t_.url_table)||!(null==eG?void 0:eG.script_url))return new Set;let e=t_.url_table,t=new Set;for(let[a,s]of Object.entries(e))s===eG.script_url&&t.add(a);return t},[null==t_?void 0:t_.url_table,null==eG?void 0:eG.script_url]),tB=(0,r.useMemo)(()=>(null==t_?void 0:t_.high_risk_events)&&0!==tU.size?t_.high_risk_events.filter(e=>tU.has(e.urlId)):[],[null==t_?void 0:t_.high_risk_events,tU]),tq=(0,r.useMemo)(()=>(null==t_?void 0:t_.detailed_events)&&0!==tU.size?t_.detailed_events.filter(e=>tU.has(e.urlId)):[],[null==t_?void 0:t_.detailed_events,tU]),tO=(null==eG||null==(i=eG.copyright)||null==(a=i.vulnerability_detection)?void 0:a.has_vulnerabilities)?eG.copyright.vulnerability_detection.vulnerability_count??0:0,tJ=th.length+tO,tW=(0,r.useMemo)(()=>{let e=tq.filter(e=>"static_analysis"===e.type),t=e.map(e=>e.riskScore).filter(e=>"number"==typeof e),a=t.length?Math.max(...t):0,s=t.length?t.reduce((e,t)=>e+t,0)/t.length:0,r=e.map(e=>{var t;return null==(t=e.patterns)?void 0:t.entropy}).filter(e=>"number"==typeof e&&e>0);return{staticEvents:e,maxRisk:a,avgRisk:s,analyses:e.length,evalCalls:tq.filter(e=>"eval"===e.type).length,funcCalls:tq.filter(e=>"function_constructor"===e.type).length,avgEntropy:r.length?r.reduce((e,t)=>e+t,0)/r.length:null,level:a>=80?"critical":a>=60?"high":a>=40?"medium":"low"}},[tq]);(0,r.useEffect)(()=>{if(!eV.isReady)return;let e=eV.query.tab,t=window.location.hash.replace("#","").split(/[=&?]/)[0],a=e||t;a&&_.includes(a)&&tI(a);let s=eV.query.page;if(s){let e=parseInt(s,10);!isNaN(e)&&e>0&&e6(e)}let r=()=>{let e=window.location.hash.replace("#","").split(/[=&?]/)[0];e&&_.includes(e)&&tI(e)};return window.addEventListener("hashchange",r),()=>{window.removeEventListener("hashchange",r)}},[eV.isReady,eV.query.tab,eV.query.page,eV]),(0,r.useEffect)(()=>{if(eY){if(eB)return void tz(!1);(async()=>{var e,t,a;tz(!0),tH(null);try{let t=await d.A.get(`/api/v1/jsfingerprints/${eY}`,{headers:await (0,c.Pw)()});if(eQ(t.data),t.data.scan_id&&t.data.script_url)try{let e=await d.A.get(`/api/v1/js-segments/scan/${t.data.scan_id}`,{headers:await (0,c.Pw)(),params:{script_url:t.data.script_url,limit:500}});eZ(e.data.segments||[]),tr(e.data.inline_attribution??null),ti("number"==typeof e.data.total_count?e.data.total_count:null)}catch(e){tr(null),ti(null)}if(null==(e=t.data.hashes)?void 0:e.sha256)try{let e=await d.A.get(`/api/v1/jsfingerprints/search/sha256/${t.data.hashes.sha256}`),a=(e=>{var t,a,s,r;let l=(null==e||null==(t=e.context)?void 0:t.prevalence_count)??(null==e?void 0:e.total)??0;return l?{sha256_count:l,normalized_count:0,fuzzy_count:0,first_seen:(null==e||null==(a=e.context)?void 0:a.first_seen)||"",last_seen:(null==e||null==(s=e.context)?void 0:s.last_seen)||"",common_filenames:(null==e||null==(r=e.context)?void 0:r.common_filenames)??null}:null})(e.data);a&&ta(a)}catch(e){}}catch(e){tH((null==(a=e.response)||null==(t=a.data)?void 0:t.detail)||"Failed to load script data")}finally{tz(!1)}})()}},[eY,eB]),(0,r.useEffect)(()=>{(null==eG?void 0:eG.scan_id)&&(async()=>{try{let e=((await d.A.get(`/api/v1/yara/scan/${eG.scan_id}`,{headers:await (0,c.Pw)()})).data.matches||[]).map(e=>({...e,source:"scan_yara"}));tg(t=>[...t.filter(e=>"scan_yara"!==e.source),...e])}catch(e){}try{let e=await d.A.get(`/api/v1/js-fingerprinter2/${eG.scan_id}?include_detailed_events=true`,{headers:await (0,c.Pw)()});tp(e.data)}catch(e){}})()},[null==eG?void 0:eG.scan_id]),(0,r.useEffect)(()=>{ty.length&&(async()=>
1{if(!(null==eG?void 0:eG.scan_id))return;let e=[];try{e=(await d.A.get(`/api/v1/segments/by-scan/${eG.scan_id}/security`,{headers:await (0,c.Pw)()})).data.segments||[]}catch(e){return}let t=new Map(ty.filter(e=>e.segment_id).map(e=>[String(e.segment_id),e])),a=e.flatMap(e=>{var a;let s=t.get(String(e.segment_id));return s?((null==(a=e.security)?void 0:a.pattern_matches)||[]).map(t=>({...t,threat_names:t.threat_names||[],mitre_techniques:t.mitre_techniques||[],segment_id:e.segment_id,function_name:s.function_name,source:"segment_security"})):[]});tg(e=>[...a,...e.filter(e=>"segment_security"!==e.source)])})()},[ty,null==eG?void 0:eG.scan_id]),(0,r.useEffect)(()=>{if(!eG||!eY||!eV.isReady)return;let e=(0,j.lI)(eY,eG.filename),t=eV.asPath.split("?")[0].split("#")[0];if(eG.filename&&t!==e){let t=window.location.hash;eV.replace(e+t,void 0,{shallow:!0})}},[eG,eY,eV.isReady]),(0,r.useEffect)(()=>{(null==eG?void 0:eG.scan_id)&&(null==eG?void 0:eG.script_url)&&(async()=>{try{var e;let t=(null==(e=(await d.A.get(`/api/v1/js-fingerprinting3/scan/${eG.scan_id}`,{headers:await (0,c.Pw)()})).data)?void 0:e.fingerprints)||[],a=t.find(e=>null==e.module_of&&e.script_url===eG.script_url);if(!a)return;td(a),tm(t.filter(e=>e.module_of===a.id))}catch{}finally{to(!0)}})()},[null==eG?void 0:eG.scan_id,null==eG?void 0:eG.script_url]),(0,r.useEffect)(()=>{if(!eY)return;let e=!1;return(async()=>{try{let t=await d.A.get(`/api/v1/jsfingerprints/${eY}/command-literals`,{headers:await (0,c.Pw)()});e||tA(t.data)}catch{e||tA(null)}})(),()=>{e=!0}},[eY]),(0,r.useEffect)(()=>{eY&&("source"!==tD||tw||tC||tR||(async()=>{tL(!0),tT(null);try{let e=await d.A.get(`/api/v1/jsfingerprints/${eY}/source`,{headers:await (0,c.Pw)()});tS(e.data.source)}catch(a){var e,t;tT((null==(t=a.response)||null==(e=t.data)?void 0:e.detail)||"Failed to load source code")}finally{tL(!1)}})())},[tD,eY,tw,tC,tR]),(0,r.useEffect)(()=>{eY&&tc&&"similar"===tD&&(async()=>{e1(!0);try{let t=[],a=!1;if(null==tn?void 0:tn.id){var e;t=((null==(e=(await d.A.get(`/api/v1/js-fingerprinting3/similar/${tn.id}?limit=100`,{headers:await (0,c.Pw)()})).data)?void 0:e.matches)||[]).map(e=>({id:e.fingerprint_id??null,scan_id:e.scan_id,script_url:e.script_url,similarity:e.similarity,code_length:e.code_length??null,is_module:!!e.is_module,scan_created_at:e.scan_created_at??null,final_url:e.final_url??null,library_detected:e.library_detected||"",library_version:e.library_version||null})),a=!1}else{let e=(e9-1)*te,s=await d.A.get(`/api/v1/jsfingerprints/${eY}/similar?limit=${te}&offset=${e}`,{headers:await (0,c.Pw)()});t=s.data.similar_fingerprints||[],a=s.data.has_more||!1}let s=new Set;t=t.filter(e=>{let t=`${e.scan_id}|${e.script_url}`;return!s.has(t)&&(s.add(t),!0)}),e2(t),e7(a),e3(!0)}catch(e){e3(!0)}finally{e1(!1)}})()},[tD,eY,e9,te,tc,null==tn?void 0:tn.id]);let tV=e=>e?e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(2)} MB`:"-",tK=e=>e?new Date(e).toLocaleString():"-",tY=async e=>{try{await navigator.clipboard.writeText(e)}catch(e){}},tG=e=>{let t=new URL(window.location.href);e>1?t.searchParams.set("page",e.toString()):t.searchParams.delete("page"),eV.push(t.pathname+t.search+t.hash,void 0,{shallow:!0})},tQ=e=>e<30?"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400":e<60?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":e<80?"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400":"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",tX=(0,r.useMemo)(()=>{var e,t,a;if(!eG)return"JavaScript security analysis";let s=[];return eG.filename?s.push(`Security analysis of ${eG.filename}`):s.push("JavaScript security analysis"),(null==(e=eG.library_detection)?void 0:e.detected)&&s.push(`detected library: ${eG.library_detection.primary_library}${eG.library_detection.version?` v${eG.library_detection.version}`:""}`),(null==(t=eG.bundle_analysis)?void 0:t.is_bundled)&&s.push(`bundler: ${tk?tv:"detected"}`),(null==(a=eG.metrics)?void 0:a.code_length)&&s.push(`size: ${tV(eG.metrics.code_length)}`),th.length>0&&s.push(`${th.length} security pattern${th.length>
11?"s":""} detected`),s.join(" | ")+". View SHA-256 hash, TLSH fuzzy hash, ML embeddings, similar scripts, and detailed code analysis."},[eG,th]),tZ=(0,r.useMemo)(()=>{var e,t;if(!eG)return"javascript analysis, js security scanner, code fingerprinting, malware detection";let a=["javascript analysis","js security scanner","code fingerprinting","malware detection","script analysis","sha256 hash","tlsh hash","obfuscation detection"];return(null==(e=eG.library_detection)?void 0:e.detected)&&(a.push(eG.library_detection.primary_library.toLowerCase()),a.push(`${eG.library_detection.primary_library.toLowerCase()} security`)),tk&&a.push(tv.toLowerCase()),(null==(t=eG.cdn_info)?void 0:t.cdn_type)&&a.push(eG.cdn_info.cdn_type.toLowerCase()),a.join(", ")},[eG]),t0=(0,r.useMemo)(()=>{var e,t,a,s,r,l,i;if(!eG)return[];let n=[];if(n.push({"@type":"Question",name:`What is ${eG.filename||"this JavaScript file"}?`,acceptedAnswer:{"@type":"Answer",text:`${eG.filename||"This JavaScript file"} is a ${eG.script_type||"script"} file${(null==(e=eG.library_detection)?void 0:e.detected)?` identified as ${eG.library_detection.primary_library}${eG.library_detection.version?` version ${eG.library_detection.version}`:""}`:""}. It has a size of ${tV((null==(t=eG.metrics)?void 0:t.code_length)||0)} and contains ${(null==(a=eG.metrics)?void 0:a.function_count)||0} functions.`}}),th.length>0){let e=th.map(e=>e.severity).filter((e,t,a)=>a.indexOf(e)===t);n.push({"@type":"Question",name:`Does ${eG.filename||"this script"} contain malware?`,acceptedAnswer:{"@type":"Answer",text:`This script matched ${th.length} security pattern${th.length>1?"s":""} in our YARA malware detection database. Severity levels detected: ${e.join(", ")}. This indicates potentially malicious code that should be investigated.`}})}return(null==(s=eG.bundle_analysis)?void 0:s.is_bundled)&&n.push({"@type":"Question",name:`What bundler was used for ${eG.filename||"this script"}
1?`,acceptedAnswer:{"@type":"Answer",text:`This script was bundled using ${tk?tv:"an unidentified bundler"}${eG.bundle_analysis.bundle_format?` in ${eG.bundle_analysis.bundle_format} format`:""}. Bundled scripts combine multiple source files into one for production deployment.`}}),[{"@context":"https://schema.org","@type":"TechArticle",name:`JavaScript Analysis: ${eG.filename||"Script"}`,headline:`Security Analysis of ${eG.filename||"JavaScript File"}`,description:tX,url:(0,j.Dl)(eY,eG.filename),datePublished:eG.created_at,dateModified:eG.created_at,author:{"@type":"Organization",name:"ScanMalware.com",url:"https://scanmalware.com"},publisher:{"@type":"Organization",name:"ScanMalware.com",url:"https://scanmalware.com",logo:{"@type":"ImageObject",url:"https://scanmalware.com/logo.png"}},mainEntityOfPage:{"@type":"WebPage","@id":(0,j.Dl)(eY,eG.filename)},about:{"@type":"SoftwareSourceCode",name:eG.filename||"JavaScript file",programmingLanguage:"JavaScript",codeRepository:eG.script_url,...(0,u.k)(null==(r=eG.copyright)?void 0:r.licenses)[0]&&{license:(0,u.k)(null==(l=eG.copyright)?void 0:l.licenses)[0]},...(null==(i=eG.library_detection)?void 0:i.detected)&&{runtimePlatform:eG.library_detection.primary_library}},keywords:tZ,articleSection:"JavaScript Security Analysis",inLanguage:"en-US"},{"@context":"https://schema.org","@type":"FAQPage",mainEntity:n},{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://scanmalware.com"},{"@type":"ListItem",position:2,name:"Scan Result",item:`https://scanmalware.com/result/${eG.scan_id}`},{"@type":"ListItem",position:3,name:"Script Analysis",item:(0,j.Dl)(eY,eG.filename)}]}]},[eG,eY,tX,tZ,th]),t2=eG?(0,j.Dl)(eY,eG.filename):"";return tF?(0,s.jsxs)("div",{className:"min-h-screen bg-background-light dark:bg-background-dark",children:[(0,s.jsx)(o.A,{}),(0,s.jsx)("div",{className:"max-w-7xl mx-auto py-8 px-4",children:(0,s.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,s.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"})})}),(0,s.jsx)(x.A,{})]}):tP||!eG?(0,s.jsxs)("div",{className:"min-h-screen bg-background-light dark:bg-background-dark",children:[(0,s.jsx)(o.A,{}),(0,s.jsx)("div",{className:"max-w-7xl mx-auto py-8 px-4",children:(0,s.jsxs)("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-6 text-center",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold text-red-800 dark:text-red-200 mb-2",children:"Error Loading Script"}),(0,s.jsx)("p",{className:"text-red-600 dark:text-red-400",children:tP||"Script not found"}),(0,s.jsx)(n(),{href:"/",className:"mt-4 inline-block text-blue-600 hover:underline",children:"Return to Home"})]})}),(0,s.jsx)(x.A,{})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b.A,{title:`${eG.filename||"Script"} - JavaScript Security Analysis`,description:tX,canonical:t2,keywords:tZ,ogType:"article",structuredData:t0,noindexFollow:!0}),(0,s.jsxs)("div",{className:"min-h-screen bg-background-light dark:bg-background-dark transition-colors",children:[(0,s.jsx)(o.A,{}),(0,s.jsx)(f.A,{items:[{label:"Result",href:`/result/${eG.scan_id}`},{label:"Script Analysis"}]}),(0,s.jsxs)("main",{className:"max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between flex-wrap gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white truncate flex items-center",children:[(0,s.jsx)(N,{className:"fab fa-js-square mr-3 text-yellow-500"}),eG.filename||"JavaScript Analysis"]}),(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400 break-all",children:eG.script_url}),eG.is_whitelisted&&(0,s.jsx)("span",{className:"inline-block mt-2 px-2 py-0.5 bg-cyan-100 text-cyan-800 dark:bg-cyan-900/30 dark:text-cyan-400 text-xs rounded",title:"Trusted CDN/third-party domain",children:"\uD83D\uDD12 trusted"}),eG.created_at&&(0,s.jsxs)("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",suppressHydrationWarning:!0,children:["Analyzed: ",tK(eG.created_at)]}),eG.scan_final_url&&(0,s.jsxs)("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:["Scan: ",(0,s.jsx)(n(),{href:`/result/${eG.scan_id}
1`,className:"text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300 hover:underline",children:eG.scan_final_url})]})]}),(0,s.jsxs)(n(),{href:`/result/${eG.scan_id}#scripts`,className:"flex-shrink-0 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors text-sm font-medium flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-external-link-alt mr-2"}),"View Scan Result"]})]}),(0,s.jsxs)("article",{className:"mt-4 p-4 bg-gray-50 dark:bg-gray-800/50 rounded-lg border border-gray-200 dark:border-gray-700",itemScope:!0,itemType:"https://schema.org/TechArticle",children:[(0,s.jsx)("h2",{className:"sr-only",children:"Script Analysis Summary"}),(0,s.jsxs)("p",{className:"text-sm text-gray-700 dark:text-gray-300",itemProp:"description",children:[(0,s.jsx)("strong",{children:"Summary:"})," ",eG.filename||"JavaScript file"," is a ",tV((null==(w=eG.metrics)?void 0:w.code_length)||0)," ",eG.script_type||"script",(null==($=eG.library_detection)?void 0:$.detected)&&` identified as ${eG.library_detection.primary_library}${eG.library_detection.version?` v${eG.library_detection.version}`:""}`,(null==(A=eG.bundle_analysis)?void 0:A.is_bundled)&&(tk?` bundled with ${tv}`:" bundled, though the bundler could not be identified"),th.length>0&&`. Warning: ${th.length} malware pattern${th.length>1?"s":""} detected`,". Contains ",(null==(C=eG.metrics)?void 0:C.function_count)||0," functions with complexity score of ",(null==(L=eG.metrics)?void 0:L.complexity_score)||0,".",(null==(R=eG.hashes)?void 0:R.sha256)&&` SHA-256: ${eG.hashes.sha256.substring(0,16)}...`]}),(0,s.jsx)("meta",{itemProp:"datePublished",content:eG.created_at}),(0,s.jsx)("meta",{itemProp:"url",content:`https://scanmalware.com/script/${eY}`})]}),(null==t$?void 0:t$.candidates)&&t$.candidates.length>0&&(()=>{let e=t$.stealth_markers.length>0,t={hidden_window:"hidden window",minimised_window:"minimised window",encoded_command:"encoded command",mshta_url:"mshta fetching a URL",msiexec_url:"msiexec installing from a URL",ip_literal_host:"raw IP address",temp_drop_and_run:"drops a file to a temp folder and runs it",decoy_comment:"decoy comment after the command",base64_to_shell:"base64 decoded straight into a shell",tunnel_host_exec:"runs a script from a temporary tunnel address",osascript_remote:"AppleScript running a downloaded script"};return(0,s.jsxs)("div",{className:`mt-4 p-4 rounded-lg border ${e?"bg-red-50 dark:bg-red-900/20 border-red-300 dark:border-red-800":"bg-yellow-50 dark:bg-yellow-900/20 border-yellow-300 dark:border-yellow-800"}`,children:[(0,s.jsxs)("div",{className:`text-sm font-semibold ${e?"text-red-800 dark:text-red-300":"text-yellow-800 dark:text-yellow-300"}`,children:[(0,s.jsx)(N,{className:"fas fa-terminal mr-2"}),e?"Hidden command staged for copy-paste":"Command string"]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-gray-700 dark:text-gray-300",children:e?`This script holds a shell command with traits used to deliver malware (${t$.stealth_markers.map(e=>t[e]||e).join(", ")}). Fake "verify you are human" pages copy commands like this and ask visitors to paste them into Run or Terminal.`:"This script contains a shell command as text. Installation guides do this too; it is shown here as context, not as a finding."}),(0,s.jsx)("pre",{className:"mt-2 p-2 bg-white/70 dark:bg-gray-900/60 rounded text-xs font-mono whitespace-pre-wrap break-all text-gray-800 dark:text-gray-200",children:t$.candidates[0].literal}),t$.candidates.length>1&&(0,s.jsxs)("div",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:["+",t$.candidates.length-1," more command string",t$.candidates.length>2?"s":""," in this script"]})]})})(),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap gap-3",children:[eG.script_type&&(0,s.jsx)("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-800 rounded-full text-sm capitalize",children:eG.script_type}),(null==(T=eG.metrics)?void 0:T.code_length)&&(0,s.jsx)("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-800 rounded-full text-sm",children:tV(eG.metrics.code_length)}),(null==(M=eG.library_detection)?void 0:M.detected)&&(0,s.jsxs)("span",{className:"px-3 py-1 bg-blue-100 dar
1k:bg-blue-900/30 text-blue-800 dark:text-blue-300 rounded-full text-sm",children:[eG.library_detection.primary_library,eG.library_detection.version&&` v${eG.library_detection.version}`]}),(null==(E=eG.bundle_analysis)?void 0:E.is_bundled)&&(0,s.jsx)("span",{className:"px-3 py-1 bg-purple-100 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300 rounded-full text-sm",children:tk?tv:"Bundled"}),(null==(F=eG.cdn_info)?void 0:F.is_cdn)&&(0,s.jsxs)("span",{className:"px-3 py-1 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 rounded-full text-sm",children:["CDN: ",eG.cdn_info.cdn_type]}),(null==(z=eG.ml_vectors)?void 0:z.composite_vector_available)&&(0,s.jsx)("span",{className:"px-3 py-1 bg-indigo-100 dark:bg-indigo-900/30 text-indigo-800 dark:text-indigo-300 rounded-full text-sm",children:"ML Embeddings Available"}),th.length>0&&(0,s.jsxs)("span",{className:`px-3 py-1 rounded-full text-sm font-semibold ${th.some(e=>"CRITICAL"===e.severity)?"bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-300":th.some(e=>"HIGH"===e.severity)?"bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-300":"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-300"}`,children:[(0,s.jsx)(N,{className:"fas fa-exclamation-triangle mr-1"}),th.length," Threat",th.length>1?"s":""," Detected"]})]})]}),(0,s.jsx)(m.$e,{fp3:tn}),(0,s.jsxs)("div",{className:"border-b border-gray-200 dark:border-gray-700 mb-6 flex items-end gap-4",children:[(0,s.jsx)("nav",{className:"flex space-x-8 -mb-px overflow-x-auto flex-1 min-w-0",children:[{id:"overview",label:"Overview",icon:"fas fa-chart-pie"},{id:"hashes",label:"Hashes & Fingerprints",icon:"fas fa-fingerprint"},{id:"segments",label:`Segments (${tf})`,icon:"fas fa-puzzle-piece"},{id:"similar",label:e5?`Similar Scripts (${e0.length})`:"Similar Scripts",icon:"fas fa-clone"},{id:"headers",label:"HTTP Headers",icon:"fas fa-exchange-alt"},{id:"security",label:`Security${tJ>0?` (${tJ})`:""}`,icon:"fas fa-shield-alt"},{id:"source",label:"View Source",icon:"fas fa-code"}].map(e=>(0,s.jsxs)("button",{onClick:()=>(e=>{tI(e);let t=new URL(window.location.href);t.searchParams.set("tab",e),t.hash="",window.history.pushState(null,"",t.pathname+t.search)})(e.id),className:`whitespace-nowrap py-3 px-1 border-b-2 font-medium text-sm transition-colors flex items-center ${tD===e.id?"border-blue-500 text-blue-600 dark:text-blue-400":"border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"}`,children:[(0,s.jsx)(N,{className:`${e.icon} mr-2 hidden sm:inline`}),e.label]},e.id))}),(0,s.jsx)(h.K_,{links:(e=>{if(!eG||!eY)return[];let t=eG.scan_id,a={label:"Script fingerprint",href:`/api/v1/jsfingerprints/${eY}`},s=t?[{label:"Structural fingerprints (scan)",href:`/api/v1/js-fingerprinting3/scan/${t}`}]:[];switch(e){case"overview":return[a,...s];case"hashes":var r;return[a,...(null==(r=eG.hashes)?void 0:r.sha256)?[{label:"Hash prevalence",href:`/api/v1/jsfingerprints/search/sha256/${eG.hashes.sha256}`}]:[],...s];case"segments":return t&&eG.script_url?[{label:"Code segments for this script",href:`/api/v1/js-segments/scan/${t}?script_url=${encodeURIComponent(eG.script_url)}&limit=500`}]:[];case"similar":if(!tc)return[];return(null==tn?void 0:tn.id)?[{label:"Similar scripts (structural)",href:`/api/v1/js-fingerprinting3/similar/${tn.id}?limit=100`}]:[{label:"Similar scripts",href:`/api/v1/jsfingerprints/${eY}/similar?limit=${te}&offset=${(e9-1)*te}`}];case"headers":return[a];case"security":return[a,...t?[{label:"YARA matches (scan)",href:`/api/v1/yara/scan/${t}`},{label:"JavaScript analysis (scan)",href:`/api/v1/js-fingerprinter2/${t}?include_detailed_events=true`},{label:"Segment pattern matches (scan)",href:`/api/v1/segments/by-scan/${t}/security`}]:[]];case"source":return[{label:"Source code",href:`/api/v1/jsfingerprints/${eY}/source`}];default:return[]}})(tD),className:"py-3"})]}),(0,s.jsxs)("div",{className:"space-y-6",children:["overview"===tD&&(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-tachometer-alt mr-2 text-blue-500"}),"Code Metrics"]}),(0,s.jsxs)("dl",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"File Size"}),(0,s.jsx)("dd",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:tV(null==(P=eG.metrics)?void 0:P.code_length)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Functions"}),(0,s.jsxs)("dd",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:[(null==(D=eG.metrics)||null==(H=D.function_count)?void 0:H.toLocaleStr
1ing())||"-",(null==(I=eG.metrics)?void 0:I.function_count_method)==="ast"&&(0,s.jsx)("span",{className:"ml-1 text-xs text-green-600",title:"AST parsed",children:"*"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Complexity"}),(0,s.jsx)("dd",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:(null==(B=eG.metrics)||null==(U=B.complexity_score)?void 0:U.toLocaleString())||"-"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"AST Nodes"}),(0,s.jsx)("dd",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:(null==(q=eG.metrics)?void 0:q.ast_node_count)===0?(0,s.jsx)("span",{className:"text-base font-normal text-gray-500 dark:text-gray-400",title:"The AST parse did not complete — a parse failure, or the AST step ran out of its time budget. Not a measurement of zero.",children:"Not parsed"}):(null==(J=eG.metrics)||null==(O=J.ast_node_count)?void 0:O.toLocaleString())||"-"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"AST Depth"}),(0,s.jsx)("dd",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:(null==(W=eG.metrics)?void 0:W.ast_node_count)===0||(null==(V=eG.metrics)?void 0:V.ast_depth)===0?(0,s.jsx)("span",{className:"text-base font-normal text-gray-500 dark:text-gray-400",title:"The AST parse did not complete — a parse failure, or the AST step ran out of its time budget. Not a measurement of zero.",children:"Not parsed"}):(null==(K=eG.metrics)?void 0:K.ast_depth)||"-"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Function Calls"}),(0,s.jsx)("dd",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:(null==(G=eG.metrics)||null==(Y=G.function_call_count)?void 0:Y.toLocaleString())||"-"})]}),((null==(Q=eG.metrics)?void 0:Q.url_count)??(null==(Z=eG.feature_summary)||null==(X=Z.strings)?void 0:X.urls))>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",title:"URL literals found in the script source. Counts occurrences, not distinct URLs.",children:"URLs in Source"}),(0,s.jsx)("dd",{className:"text-lg font-semibold text-yellow-600 dark:text-yellow-400",children:null==(ee=(null==(et=eG.metrics)?void 0:et.url_count)??(null==(es=eG.feature_summary)||null==(ea=es.str
1ings)?void 0:ea.urls))?void 0:ee.toLocaleString()})]}),(null==(er=eG.metrics)?void 0:er.normalized_length)&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Normalized Size"}),(0,s.jsx)("dd",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:tV(eG.metrics.normalized_length)})]}),(null==(el=eG.metrics)?void 0:el.module_count)!==void 0&&eG.metrics.module_count>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Modules"}),(0,s.jsx)("dd",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:eG.metrics.module_count})]})]})]}),eG.feature_summary&&(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-search-plus mr-2 text-teal-500"}),"Code Analysis"]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[eG.feature_summary.apis&&Object.keys(eG.feature_summary.apis).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"API Usage"}),(0,s.jsx)("div",{className:"space-y-2",children:Object.entries(eG.feature_summary.apis).map(e=>{let[t,a]=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 dark:text-gray-400 capitalize",children:t}),(0,s.jsxs)("span",{className:`text-sm font-medium ${"crypto"===t||"network"===t?"text-yellow-600 dark:text-yellow-400":"text-gray-900 dark:text-white"}`,children:[a," calls"]})]},t)})})]}),eG.feature_summary.control_flow&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Control Flow"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Functions"}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:null==(ei=eG.feature_summary.control_flow.functions)?void 0:ei.toLocaleString()})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Loops"}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:null==(en=eG.feature_summary.control_flow.loops)?void 0:en.toLocaleString()})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Conditionals"}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:null==(ed=eG.feature_summary.control_flow.conditionals)?void 0:ed.toLocaleString()})]})]})]}),eG.feature_summary.strings&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"String Statistics"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Total Strings"}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:null==(ec=eG.feature_summary.strings.total)?void 0:ec.toLocaleString()})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Unique Strings"}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:null==(eo=eG.feature_summary.strings.unique)?void 0:eo.toLocaleString()})]})]})]}),eG.feature_summary.security&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Security Indicators"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[eG.feature_summary.security.has_eval&&(0,s.jsx)("span",{className:"px-2 py-1 bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300 rounded text-xs font-medium",children:"Uses eval()"}),eG.feature_summary.security.has_crypto&&(0,s.jsx)("span",{className:"px-2 py-1 bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300 rounded text-xs font-medium",children:"Crypto APIs"}),eG.feature_summary.security.has_encoding&&(0,s.jsx)("span",{className:"px-2 py-1 bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300 rounded text-xs font-medium",children:"Encoding Functions"}),(null==t$?void 0:t$.candidates)&&t$.candidates.length>0&&(0,s.jsx)("span",{className:`px-2 py-1 rounded text-xs font-medium ${t$.stealth_markers.length>0?"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300":"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300"}`,children:t$.stealth_markers.length>0?"Hidden command":"Command string"}),!eG.feature_summary.security.has_eval&&!eG.feature_summary.security.has_crypto&&!eG.feature_summary.security.has_encoding&&!((null==t$?void 0:t$.candidates)&&t$.candidates.length>0)&&(0,s.jsx)("span",{className:"px-2 py-1 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300 rounded text-xs font-medium",children:"No suspicious patterns"})]})]}),eG.feature_summary.style&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Code Style"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Lines of Code"}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:null==(ex=eG.feature_summary.style.lines)?void 0:ex.toLocaleStr
1ing()})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Minified"}),(0,s.jsx)("span",{className:`text-sm font-medium ${eG.feature_summary.style.is_minified?"text-blue-600 dark:text-blue-400":"text-gray-600"}`,children:eG.feature_summary.style.is_minified?"Yes":"No"})]})]})]})]})]}),(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-mask mr-2 text-orange-500"}),"Obfuscation Analysis"]}),tq.length>0?(()=>{let{staticEvents:e,maxRisk:t,avgRisk:a,evalCalls:r,funcCalls:l}=tW,i=e.filter(e=>e.patterns).map(e=>e.patterns),n=new Set;i.forEach(e=>{e.hasEval&&n.add("eval() usage"),e.hasFunctionConstructor&&n.add("Function() constructor"),e.hasBase64&&n.add("Base64 encoding"),e.bracketNotation>0&&n.add("Bracket notation"),e.hexEscapes>0&&n.add("Hex escapes"),e.unicodeEscapes>0&&n.add("Unicode escapes"),e.stringConcatenation>3&&n.add("String concatenation"),e.suspiciousVarNames>50&&n.add("Suspicious variable names")});let d=t>=80?"text-red-600":t>=60?"text-orange-600":t>=40?"text-yellow-600":"text-green-600",c=t>=80?"bg-red-500":t>=60?"bg-orange-500":t>=40?"bg-yellow-500":"bg-green-500";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-1 text-xs text-gray-400 dark:text-gray-500 italic",children:"Runtime analysis (CDP-based)"}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Risk Score"}),(0,s.jsxs)("span",{className:`text-2xl font-bold ${d}`,children:[t,"/100 ",(0,s.jsxs)("span",{className:"text-base",children:["(",t>=80?"Critical":t>=60?"High":t>=40?"Medium":"Low",")"]})]})]}),(0,s.jsx)("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-3",children:(0,s.jsx)("div",{className:`h-3 rounded-full ${c}`,style:{width:`${t}%`}})})]}),(0,s.jsxs)("dl",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Static Analyses"}),(0,s.jsx)("dd",{className:"font-medium text-gray-900 dark:text-white",children:e.length})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Average Risk"}),(0,s.jsxs)("dd",{className:"font-medium text-gray-900 dark:text-white",children:[a.toFixed(1),"/100"]})]}),r>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"eval() Calls"}),(0,s.jsx)("dd",{className:"font-medium text-orange-600",children:r})]}),l>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Function() Calls"}),(0,s.jsx)("dd",{className:"font-medium text-orange-600",children:l})]}),i.length>0&&void 0!==i[0].entropy&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Code Entropy"}),(0,s.jsx)("dd",{className:"font-medium text-gray-900 dark:text-white",children:i[0].entropy.toFixed(3)})]}),i.length>0&&void 0!==i[0].codeLength&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Analyzed Code Size"}),(0,s.jsxs)("dd",{className:"font-medium text-gray-900 dark:text-white",children:[(i[0].codeLength/1024).toFixed(1)," KB"]})]})]}),n.size>0&&(0,s.jsxs)("div",{className:"mt-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400 mb-2",children:"Detected Patterns"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:Array.from(n).map((e,t)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 text-xs font-medium bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-300 rounded-full",children:e},t))})]})]})})():eG.obfuscation&&null!=eG.obfuscation.score?(()=>{let e=eG.obfuscation,t=Math.round((e.score??0)*100),a=e.classification||"unknown",r="heavily_obfuscated"===a?"text-red-600 dark:text-red-400":"obfuscated"===a?"text-orange-600 dar
1k:text-orange-400":"minified"===a?"text-yellow-600 dark:text-yellow-400":"text-green-600 dark:text-green-400",l=t>=80?"bg-red-500":t>=60?"bg-orange-500":t>=40?"bg-yellow-500":"bg-green-500",i=(e,t)=>null==t?null:(0,s.jsxs)("div",{className:"flex justify-between text-sm py-1",children:[(0,s.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:e}),(0,s.jsx)("span",{className:"font-medium text-gray-900 dark:text-white",children:t.toFixed(4)})]},e);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-1 text-xs text-gray-400 dark:text-gray-500 italic",children:"Static analysis"}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Obfuscation Score"}),(0,s.jsxs)("span",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:[t,"/100"]})]}),(0,s.jsx)("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-3",children:(0,s.jsx)("div",{className:`${l} h-3 rounded-full`,style:{width:`${Math.min(t,100)}%`}})})]}),(0,s.jsxs)("div",{className:"flex justify-between text-sm py-1",children:[(0,s.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"Classification"}),(0,s.jsx)("span",{className:`font-semibold capitalize ${r}`,children:a.replace(/_/g," ")})]}),e.confidence&&(0,s.jsxs)("div",{className:"flex justify-between text-sm py-1",children:[(0,s.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"Confidence"}),(0,s.jsx)("span",{className:"font-medium capitalize text-gray-900 dark:text-white",children:e.confidence})]}),i("Token entropy",e.token_entropy),i("Character entropy",e.char_entropy),i("Minimum entropy",e.min_entropy),i("Keyword diversity",e.keyword_diversity),i("Keyword ratio",e.keyword_ratio),e.indicators&&e.indicators.length>0&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400 mb-2",children:"Indicators"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:e.indicators.map((e,t)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 text-xs font-medium bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-300 rounded-full",children:e},t))})]})]})})():(0,s.jsx)("p",{className:"text-gray-500 dark:text-gray-400",children:"No obfuscation data available"})]}),(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-book mr-2 text-purple-500"}),"Library Detection"]}),(null==(em=eG.library_detection)?void 0:em.detected)?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)("span",{className:"text-2xl font-bold text-blue-600 dark:text-blue-400",children:eG.library_detection.primary_library}),eG.library_detection.version&&(0,s.jsxs)("span",{className:"px-2 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300 rounded text-sm",children:["v",eG.library_detection.version]})]}),eG.library_detection.all_libraries&&eG.library_detection.all_libraries.length>1&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"All Detected Libraries"}),(0,s.jsx)("div",{className:"space-y-2",children:eG.library_detection.all_libraries.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{className:"text-gray-900 dark:text-white",children:e.name}),(0,s.jsxs)("span",{className:"text-gray-500 dark:text-gray-400",children:[(100*e.confidence).toFixed(0),"% confidence"]})]},t))})]})]}):(null==tn?void 0:tn.lib_match_name)?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2 flex-wrap",children:[(0,s.jsx)("span",{className:"text-2xl font-bold text-blue-600 dark:text-blue-400",children:tn.lib_match_name}),tn.lib_match_version&&(0,s.jsxs)("span",{className:"px-2 py-1 bg-blue-100 dar
1k:bg-blue-900/30 text-blue-800 dark:text-blue-300 rounded text-sm",children:["v",tn.lib_match_version]})]}),(0,s.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"\uD83C\uDFAF Matched against the known-library code-signature database (byte-identical to a published release)"})]}):(()=>{let e=(0,g.D)(eG.script_url);return e?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,s.jsx)("span",{className:"text-2xl font-bold text-blue-600 dark:text-blue-400",children:e.library}),e.version&&(0,s.jsxs)("span",{className:"px-2 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300 rounded text-sm",children:["v",e.version]})]}),(0,s.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"\uD83D\uDCCE Identified from URL pattern (no signature match)"})]}):(0,s.jsx)("p",{className:"text-gray-500 dark:text-gray-400",children:"No known library detected"})})()]}),(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-box mr-2 text-indigo-500"}),"Bundle Analysis"]}),tN?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4 flex-wrap",children:[(0,s.jsx)("span",{className:"text-2xl font-bold text-purple-600 dark:text-purple-400",children:tk?tv:"Bundled"}),!tk&&(0,s.jsx)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"bundler not identified"}),tx.length>0?(0,s.jsxs)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[tx.length," modules detected via AST",tk?" (bundler named by signature match)":""]}):(null==(eh=eG.bundle_analysis)?void 0:eh.bundle_confidence)?(0,s.jsxs)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[(100*eG.bundle_analysis.bundle_confidence).toFixed(0),"% confidence"]}):null]}),(null==(eg=eG.bundle_analysis)?void 0:eg.bundle_format)&&(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Format: "}),(0,s.jsx)("span",{className:"font-medium text-gray-900 dark:text-white",children:eG.bundle_analysis.bundle_format})]}),(null==(eu=eG.bundle_analysis)?void 0:eu.bundler_indicators)&&eG.bundle_analysis.bundler_indicators.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Detection Indicators"}),(0,s.jsx)("div",{className:"space-y-1",children:eG.bundle_analysis.bundler_indicators.slice(0,5).map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:e.type}),(0,s.jsxs)("span",{className:"text-gray-500 dark:text-gray-400",children:[(100*e.confidence).toFixed(0),"%"]})]},t))})]})]}):(0,s.jsx)("p",{className:"text-gray-500 dark:text-gray-400",children:"No bundler detected"})]}),((null==(ep=eG.source_map)?void 0:ep.has_source_map)||(null==(ey=eG.source_map)?void 0:ey.source_map_url))&&(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-map mr-2 text-cyan-500"}),"Source Map"]}),(0,s.jsxs)("dl",{className:"space-y-3",children:[(null==(eb=eG.source_map)?void 0:eb.source_map_url)&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Source Map URL"}),(0,s.jsx)("dd",{className:"text-sm font-mono text-gray-900 dark:text-white break-all",children:eG.source_map.source_map_url})]}),(null==(ef=eG.source_map)?void 0:ef.original_file_count)!=null&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Original Files"}),(0,s.jsx)("dd",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:eG.source_map.original_file_count.toLocaleStr
1ing()})]}),(null==(ej=eG.source_map)?void 0:ej.original_files)&&eG.source_map.original_files.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400 mb-1",children:"Pre-bundle Sources"}),(0,s.jsxs)("dd",{className:"space-y-1",children:[eG.source_map.original_files.slice(0,5).map((e,t)=>(0,s.jsx)("div",{className:"text-xs font-mono text-gray-700 dark:text-gray-300 break-all",children:e},t)),eG.source_map.original_files.length>5&&(0,s.jsxs)("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:["+ ",(eG.source_map.original_files.length-5).toLocaleString()," more"]})]})]})]})]}),(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-copyright mr-2 text-gray-500"}),"Copyright & License"]}),(null==(ev=eG.copyright)?void 0:ev.has_copyright)&&((0,u.k)(eG.copyright.licenses).length>0||((null==(ek=eG.copyright.authors)?void 0:ek.length)||0)>0||(0,u.x)(eG.copyright.notices).length>0||eG.copyright.version_from_header)?(0,s.jsxs)("dl",{className:"space-y-3",children:[(0,u.k)(eG.copyright.licenses).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"License"}),(0,s.jsx)("dd",{className:"font-medium text-gray-900 dark:text-white",children:(0,u.k)(eG.copyright.licenses).join(", ")})]}),eG.copyright.authors&&eG.copyright.authors.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Authors"}),(0,s.jsx)("dd",{className:"font-medium text-gray-900 dark:text-white",children:eG.copyright.authors.join(", ")})]}),eG.copyright.version_from_header&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Version (from header)"}),(0,s.jsx)("dd",{className:"font-medium text-gray-900 dark:text-white",children:eG.copyright.version_from_header})]}),(0,u.x)(eG.copyright.notices).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Copyright Notice"}),(0,s.jsx)("dd",{className:"text-sm text-gray-700 dark:text-gray-300 bg-gray-50 dark:bg-gray-900 p-2 rounded mt-1",children:(0,u.x)(eG.copyright.notices)[0]})]})]}):(0,s.jsx)("p",{className:"text-gray-500 dark:text-gray-400",children:"No copyright information found"})]}),(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-brain mr-2 text-green-500"}),"ML Analysis"]}),(null==(eN=eG.ml_vectors)?void 0:eN.available)?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[eG.ml_vectors.codebert_available?(0,s.jsx)("span",{className:"px-3 py-1 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 rounded-full text-sm",children:"CodeBERT (768d)"}):(0,s.jsx)("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700/50 text-gray-600 dark:text-gray-400 rounded-full text-sm",title:"CodeBERT embedding generation is disabled in production (USE_CODEBERT=false). Absent by configuration, not a gap in this script.",children:"CodeBERT — disabled"}),eG.ml_vectors.graphcodebert_available?(0,s.jsx)("span",{className:"px-3 py-1 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 rounded-full text-sm",children:"GraphCodeBERT (768d)"}):(0,s.jsx)("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700/50 text-gray-600 dark:text-gray-400 rounded-full text-sm",title:"GraphCodeBERT embedding generation is disabled in production (USE_GRAPHCODEBERT=false). Absent by configuration, not a gap in this script.",children:"GraphCodeBERT — disabled"}),eG.ml_vectors.ast_features_available&&(0,s.jsx)("span",{className:"px-3 py-1 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 rounded-full text-sm",children:"AST Features (128d)"}),eG.ml_vectors.handcrafted_features_available&&(0,s.jsx)("span",{className:"px-3 py-1 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 rounded-full text-sm",children:"Handcrafted (64d)"})]}),eG.ml_vectors.composite_vector_available&&(0,s.jsxs)("div",{className:"p-3 bg-indigo-50 dark:bg-indigo-900/20 rounded-lg",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"font-medium text-indigo-800 dark:text-indigo-300",children:"Composite Vector"}),(0,s.jsx)("span",{className:"text-sm text-indigo-600 dark:text-indigo-400",title:"128 AST + 64 handcrafted. The two 768d transformer embeddings are disabled in production, so they contribute 0 to the composite.",children:"192 dimensions"})]}),(0,s.jsx)("p",{className:"text-sm text-indigo-700 dark:text-indigo-300 mt-1",children:"Used for semantic similarity search across the database"})]})]}):(0,s.jsxs)("p",{className:"text-gray-500 dark:text-gray-400",children:["No ML vectors were stored for this script.",(0,s.jsx)("span",{className:"block mt-1 text-sm",children:"CodeBERT and GraphCodeBERT are disabled in production, so they are absent on every script; the AST and handcrafted vectors were not recorded for this one."})]})]}),((null==(e_=eG.module_info)?void 0:e_.is_module)||(null==(ew=eG.module_info)?void 0:e
1w.pattern))&&(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-cubes mr-2 text-cyan-500"}),"Module Information"]}),(0,s.jsxs)("dl",{className:"grid grid-cols-2 gap-4",children:[eG.module_info.pattern&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Module Pattern"}),(0,s.jsx)("dd",{className:"font-medium text-gray-900 dark:text-white capitalize",children:eG.module_info.pattern})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Is Module"}),(0,s.jsx)("dd",{className:`font-medium ${eG.module_info.is_module?"text-green-600":"text-gray-500"}`,children:eG.module_info.is_module?"Yes":"No"})]}),void 0!==eG.module_info.import_count&&eG.module_info.import_count>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Import Count"}),(0,s.jsx)("dd",{className:"font-medium text-gray-900 dark:text-white",children:eG.module_info.import_count})]})]}),eG.module_info.detected_modules&&eG.module_info.detected_modules.length>0&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Detected Modules"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:eG.module_info.detected_modules.map((e,t)=>(0,s.jsx)("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded text-sm font-mono",children:e},t))})]})]}),(null==(eS=eG.cdn_info)?void 0:eS.is_cdn)&&(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-cloud mr-2 text-blue-400"}),"CDN Information"]}),(0,s.jsxs)("dl",{className:"grid grid-cols-2 gap-4",children:[eG.cdn_info.cdn_type&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"CDN Type"}),(0,s.jsx)("dd",{className:"font-medium text-gray-900 dark:text-white",children:eG.cdn_info.cdn_type})]}),eG.cdn_info.url_protocol&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Protocol"}),(0,s.jsx)("dd",{className:"font-medium text-gray-900 dark:text-white",children:eG.cdn_info.url_protocol})]}),eG.cdn_info.npm_package_name&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"NPM Package"}),(0,s.jsxs)("dd",{className:"font-medium text-gray-900 dark:text-white",children:[eG.cdn_info.npm_package_name,eG.cdn_info.npm_package_version&&` v${eG.cdn_info.npm_package_version}`]})]}),eG.cdn_info.url_version&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"URL Version"}),(0,s.jsx)("dd",{className:"font-medium text-gray-900 dark:text-white",children:eG.cdn_info.url_version})]}),void 0!==eG.cdn_info.is_minified_url&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Minified URL"}),(0,s.jsx)("dd",{className:eG.cdn_info.is_minified_url?"text-green-600":"text-gray-500",children:eG.cdn_info.is_minified_url?"Yes":"No"})]}),eG.cdn_info.cache_buster&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Cache Buster"}),(0,s.jsx)("dd",{className:"font-mono text-sm text-gray-900 dark:text-white truncate",children:eG.cdn_info.cache_buster})]})]}),(eG.cdn_info.suggests_production||eG.cdn_info.suggests_development)&&(0,s.jsxs)("div",{className:"mt-4 flex gap-2",children:[eG.cdn_info.suggests_production&&(0,s.jsx)("span",{className:"px-3 py-1 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 rounded-full text-sm",children:"Production Build"}),eG.cdn_info.suggests_development&&(0,s.jsx)("span",{className:"px-3 py-1 bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-300 rounded-full text-sm",children:"Development Build"})]})]}),tn&&(0,s.jsxs)("div",{className:"lg:col-span-2 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6 space-y-4",children:[(0,s.jsx)(m.Pv,{fp3:tn}),(0,s.jsx)(m._O,{extractedHosts:tn.extracted_hosts,referencedHosts:tn.referenced_hosts}),(0,s.jsx)(m.Sp,{modules:tx})]})]}),"hashes"===tD&&(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-fingerprint mr-2 text-indigo-500"}),"Cryptographic Hashes & Fingerprints"]}),(0,s.jsx)("div",{className:"space-y-4",children:[{label:"SHA-256 (Content)",value:null==(e$=eG.hashes)?void 0:e$.sha256,description:"Exact content hash",searchType:"sha256"},{label:"MD5 (Content)",value:null==(eA=eG.hashes)?void 0:eA.md5,description:"Legacy content hash",searchType:"md5"},{label:"SHA-1 (Content)",value:null==(eC=eG.hashes)?void 0:eC.sha1,description:"Legacy content hash",searchType:"sha1"},{label:"Normalized Hash",value:null==(eL=eG.hashes)?void 0:eL.normalized,description:"Whitespace-normalized hash",searchType:"normalized"},{label:"Function Composite",value:null==(eR=eG.hashes)?void 0:eR.function_composite,de
1scription:"Combined function signatures",searchType:"function"},{label:"Block Signature",value:null==(eT=eG.hashes)?void 0:eT.fuzzy,description:"First 64 chunks of normalized source; exact match, not ssdeep",searchType:"fuzzy"},{label:"String Set Hash",value:null==(eM=eG.hashes)?void 0:eM.string_set,description:"Hash of extracted strings",searchType:"strings"},{label:"Call Graph Hash",value:null==(eE=eG.hashes)?void 0:eE.call_graph,description:"Function call relationship hash",searchType:"callgraph"},{label:"Import Hash",value:null==(eF=eG.hashes)?void 0:eF.import_hash,description:"Module import fingerprint",searchType:"import"},{label:"Export Hash",value:null==(ez=eG.hashes)?void 0:ez.export_hash,description:"Module export fingerprint",searchType:"export"},{label:"Dependency Hash",value:null==(eP=eG.hashes)?void 0:eP.dependency,description:"External dependency fingerprint",searchType:"dependency"},{label:"Structural Fingerprint",value:null==tn?void 0:tn.canonical_ast_hash,description:"Matches even when variable names are changed (obfuscation-resistant)",searchType:"fp_canonical"},{label:"TLSH (Fuzzy)",value:null==tn?void 0:tn.tlsh,description:"Locality-sensitive hash for near-duplicate detection",searchType:"fp_tlsh"}].filter(e=>e.value).map((e,t)=>{let a=(0,p.Uo)(e.searchType,e.value),r=(0,p.fh)(e.searchType,e.value);return(0,s.jsxs)("div",{className:"flex items-start justify-between p-3 bg-gray-50 dark:bg-gray-900 rounded-lg",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900 dark:text-white",children:e.label}),(0,s.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:e.description}),tt&&"sha256"===e.searchType&&tt.sha256_count>1&&(0,s.jsxs)("span",{className:"px-2 py-0.5 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded-full text-xs",children:[tt.sha256_count," matches"]})]}),(0,s.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[a?(0,s.jsx)(n(),{href:a,className:"text-sm text-blue-600 dark:text-blue-400 font-mono break-all hover:underline",title:"Find scans containing a script with this hash",children:e.value}):(0,s.jsx)("span",{className:"text-sm text-gray-500 dark:text-gray-400 font-mono break-all",title:r?"Not searchable: this value is shared by every script with nothing to hash":"Search not available for this hash type yet",children:e.value}),r&&(0,s.jsxs)("span",{className:"text-xs italic text-gray-500 dark:text-gray-400",children:["(",r,")"]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 ml-3",children:[a&&(0,s.jsx)(n(),{href:a,className:"p-2 text-blue-500 hover:text-blue-700 dark:hover:text-blue-300 transition-colors",title:"Find scans containing a script with this hash",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,s.jsx)("button",{onClick:()=>tY(e.value||""),className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors",title:"Copy to clipboard",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]},t)})}),tt&&(0,s.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg",children:[(0,s.jsx)("h4",{className:"font-medium text-blue-800 dark:text-blue-300 mb-2",children:"Hash Prevalence"}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-blue-600 dark:text-blue-400",children:"Seen in "}),(0,s.jsxs)(n(),{href:(0,p.Uo)("sha256",null==(eH=eG.hashes)?void 0:eH.sha256)||"#",className:"font-bold text-blue-800 dark:text-blue-200 hover:underline",children:[tt.sha256_count," ",1===tt.sha256_count?"scan":"scans"]})]}),tt.first_seen&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-blue-600 dar
1k:text-blue-400",children:"First seen"}),(0,s.jsx)("span",{className:"ml-2 text-blue-800 dark:text-blue-200",suppressHydrationWarning:!0,children:tK(tt.first_seen)})]}),tt.last_seen&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-blue-600 dark:text-blue-400",children:"Last seen"}),(0,s.jsx)("span",{className:"ml-2 text-blue-800 dark:text-blue-200",suppressHydrationWarning:!0,children:tK(tt.last_seen)})]})]}),tt.common_filenames&&tt.common_filenames.length>1&&(0,s.jsxs)("div",{className:"mt-4 pt-3 border-t border-blue-200 dark:border-blue-800/50",children:[(0,s.jsxs)("div",{className:"text-sm text-blue-600 dark:text-blue-400 mb-2",children:["Also served as",(0,s.jsx)("span",{className:"ml-1 text-xs text-blue-500 dark:text-blue-500",children:"(same bytes, different filenames)"})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:tt.common_filenames.slice(0,10).map((e,t)=>(0,s.jsxs)("span",{className:"px-2 py-0.5 bg-blue-100 dark:bg-blue-900/40 text-blue-800 dark:text-blue-200 rounded text-xs font-mono",title:`${e.count.toLocaleString()} of the scans carrying this hash (${e.percentage}%)`,children:[e.filename,(0,s.jsxs)("span",{className:"ml-1 text-blue-500 dark:text-blue-400",children:[e.percentage,"%"]})]},t))})]})]})]}),"segments"===tD&&(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-puzzle-piece mr-2 text-amber-500"}),"Code Segments (",tf,")"]}),tj&&(0,s.jsxs)("p",{className:"text-sm text-gray-500 dark:text-gray-400 -mt-2 mb-4",children:["Showing the first ",tb.toLocaleString()," of ",tf.toLocaleString(),"."]}),ty.length>0?(0,s.jsx)("div",{className:"space-y-4",children:ty.map((e,t)=>(0,s.jsxs)("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-900",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:`px-2 py-1 rounded text-xs font-medium ${"function"===e.segment_type?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300":"arrow_function"===e.segment_type?"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300":"method"===e.segment_type?"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300":"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"}`,children:e.segment_type}),(0,s.jsx)("h4",{className:"font-mono text-sm text-gray-900 dark:text-white font-semibold",children:e.function_name||"(anonymous)"}),e.start_line&&(0,s.jsxs)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Lines ",e.start_line,"-",e.end_line]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[void 0!==e.risk_score&&e.risk_score>0&&(0,s.jsxs)("span",{className:`px-2 py-1 rounded text-xs font-medium ${tQ(e.risk_score)}`,children:["Risk: ",e.risk_score]}),e.is_known_library&&(0,s.jsx)("span",{className:"px-2 py-1 bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 rounded text-xs",children:"Known Library"}),(0,s.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:tV(e.code_length)})]})]}),e.code_snippet&&(0,s.jsxs)("pre",{className:"p-3 text-xs font-mono text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-950 overflow-x-auto max-h-40",children:[e.code_snippet.substring(0,500),e.code_snippet.length>500&&"..."]}),e.risk_factors&&e.risk_factors.length>0&&(0,s.jsxs)("div",{className:"p-3 border-t border-gray-200 dark:border-gray-700",children:[(0,s.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Risk factors: "}),e.risk_factors.map((e,t)=>(0,s.jsx)("span",{className:"ml-1 px-2 py-0.5 bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300 rounded text-xs",children:e},t))]})]},t))}):ts&&"exact"!==ts?(0,s.jsxs)("div",{className:"text-gray-500 dark:text-gray-400 space-y-2",children:[(0,s.jsxs)("p",{className:"flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-circle-question mr-2 text-gray-400"}),"Segments could not be looked up for this inline script."]}),(0,s.jsxs)("p",{className:"text-sm",children:["unavailable_source_not_stored"===ts?"Attribution needs the script’s stored source, and this one is not available.":"This script has no stored content hash, so its segments cannot be identified."," ","This is ",(0,s.jsx)("span",{className:"font-medium",children:"not"})," a statement that the script has no segments — it means the question could not be answered."]})]}):(0,s.jsxs)("div",{className:"text-gray-500 dark:text-gray-400 space-y-2",children:[(0,s.jsx)("p",{children:"No code segments were extracted from this script."}),"exact"===ts&&(0,s.jsx)("p",{className:"text-sm",children:"Checked exactly: every segment in this scan’s pooled inline set was tested against this script’s own bytes, and none matched. Inline scripts are segmented on a separate browser visit, so a script that renders different c
1ontent on each load — or one too small to contain an extractable function — legitimately has none."})]})]}),"similar"===tD&&(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-clone mr-2 text-cyan-600"}),"Similar Scripts ",e5&&e0.length>0&&`(${e0.length} on this page)`]}),e4||!e5?(0,s.jsxs)("div",{className:"overflow-x-auto",children:[(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b dark:border-gray-700",children:[(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Script URL"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Similarity"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Size"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Website"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Scan Date"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Actions"})]})}),(0,s.jsx)("tbody",{children:[...Array(10)].map((e,t)=>(0,s.jsxs)("tr",{className:"border-b dark:border-gray-700 animate-pulse",children:[(0,s.jsx)("td",{className:"py-2 px-3",children:(0,s.jsx)("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-64"})}),(0,s.jsx)("td",{className:"py-2 px-3",children:(0,s.jsx)("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-12"})}),(0,s.jsx)("td",{className:"py-2 px-3",children:(0,s.jsx)("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-16"})}),(0,s.jsx)("td",{className:"py-2 px-3",children:(0,s.jsx)("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-48"})}),(0,s.jsx)("td",{className:"py-2 px-3",children:(0,s.jsx)("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-24"})}),(0,s.jsx)("td",{className:"py-2 px-3",children:(0,s.jsx)("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-12"})})]},t))})]}),(0,s.jsxs)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-4 text-center",children:[(0,s.jsx)(N,{className:"fas fa-spinner fa-spin mr-2"}),"Loading similar scripts..."]})]}):e0.length>0?(0,s.jsxs)("div",{className:"overflow-x-auto",children:[(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b dark:border-gray-700",children:[(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Script URL"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Similarity"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Size"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Website"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Scan Date"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Actions"})]})}),(0,s.jsx)("tbody",{children:e0.map((e,t)=>(0,s.jsxs)("tr",{className:"border-b dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-900",children:[(0,s.jsx)("td",{className:"py-2 px-3 font-mono text-xs truncate max-w-xs",title:e.script_url,children:e.script_url}),(0,s.jsx)("td",{className:"py-2 px-3",children:(0,s.jsxs)("span",{className:`font-medium ${e.similarity>.95?"text-green-600":e.similarity>.85?"text-blue-600":"text-yellow-600"}`,children:[(100*e.similarity).toFixed(1),"%"]})}),(0,s.jsx)("td",{className:"py-2 px-3 text-gray-600 dark:text-gray-300",children:e.code_length?tV(e.code_length):(0,s.jsx)("span",{className:"text-gray-400 dark:text-gray-500",title:e.is_module?"Module inside a bundle — only the whole bundle has a byte size":"Size not recorded for this script",children:"—"})}),(0,s.jsx)("td",{className:"py-2 px-3",children:e.final_url?(0,s.jsx)(n(),{href:`/result/${e.scan_id}`,className:"text-blue-600 hover:underline text-xs truncate max-w-xs block",title:e.final_url,children:e.final_url}):"-"}),(0,s.jsx)("td",{className:"py-2 px-3 text-gray-500 dark:text-gray-400 text-xs",suppressHydrationWarning:!0,children:tK(e.scan_created_at)}),(0,s.jsx)("td",{className:"py-2 px-3",children:e.id?(0,s.jsx)(n(),{href:(0,j.lI)(e.id,(0,j.KQ)(e.script_url)),className:"text-blue-600 hover:underline text-xs",title:e.is_module?"Opens the bundle this module belongs to":void 0,children:e.is_module?"View bundle":"View"}):(0,s.jsx)("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})})]},t))})]}),(e9>1||e8)&&(0,s.jsxs)("div",{className:"mt-6 flex items-center justify-between border-t border-gray-200 dark:border-gray-700 pt-4",children:[(0,s.jsxs)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:["Showing ",(e9-1)*te+1," to ",(e9-1)*te+e0.length," results (page ",e9,")"]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>{e6(1),tG(1)},disabled:1===e9,className:"px-3 py-1 text-sm rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed",title:"First page",children:(0,s.jsx)(N,{className:"fas fa-angle-double-left"})}),(0,s.jsxs)("button",{onClick:()=>{let e=Math.max(1,e9-1);e6(e),tG(e)},disabled:1===e9,className:"px-3 py-1 text-sm rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed",title:"Previous page",children:[(0,s.jsx)(N,{className:"fas fa-angle-left mr-1"}),"Previous"]}),(0,s.jsxs)("span",{className:"px-3 py-1 text-sm text-gray-700 dark:text-gray-300",children:["Page ",e9]}),(0,s.jsxs)("button",{onClick:()=>{let e=e9+1;e6(e),tG(e)},disabled:!e8,className:"px-3 py-1 text-sm rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed",title:"Next page",children:["Next",(0,s.jsx)(N,{className:"fas fa-angle-right ml-1"})]})]})]})]}):(0,s.jsx)("p",{className:"text-gray-500 dark:text-gray-400",children:(null==tn?void 0:tn.id)?"No structurally similar scripts found in the database. Nothing in the corpus is close enough to this script to be a meaningful match.":(null==eG||null==(eD=eG.ml_vectors)?void 0:eD.composite_vector_available)?"No similar scripts found in the database":"ML embeddings not available for this script - similarity search requires composite vectors"})]}),"headers"===tD&&(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-exchange-alt mr-2 text-blue-500"}),"HTTP Response Headers"]}),Object.values(eG.http_headers??{}).some(e=>null!=e)?(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-medium text-gray-900 dark:text-white mb-3",children:"Server Information"}),(0,s.jsxs)("dl",{className:"space-y-2",children:[eG.http_headers.server&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"Server"}),(0,s.jsx)("dd",{className:"font-mono text-gray-900 dark:text-white",children:eG.http_headers.server})]}),eG.http_headers.server_type&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"Server Type"}),(0,s.jsx)("dd",{className:"text-gray-900 dark:text-white",children:eG.http_headers.server_type})]}),eG.http_headers.x_powered_by&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"X-Powered-By"}),(0,s.jsx)("dd",{className:"font-mono text-gray-900 dark:text-white",children:eG.http_headers.x_powered_by})]}),eG.http_headers.via&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"Via"}),(0,s.jsx)("dd",{className:"font-mono text-gray-900 dark:text-white",children:eG.http_headers.via})]}),null!=eG.http_headers.content_length&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"Content-Length"}),(0,s.jsx)("dd",{className:"text-gray-900 dark:text-white",children:tV(eG.http_headers.content_length)})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-medium text-gray-900 dark:text-white mb-3",children:"Caching"}),(0,s.jsxs)("dl",{className:"space-y-2",children:[eG.http_headers.cache_control&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"Cache-Control"}),(0,s.jsx)("dd",{className:"font-mono text-gray-900 dark:text-white text-sm",children:eG.http_headers.cache_control})]}),null!=eG.http_headers.max_age&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"Max-Age"}),(0,s.jsxs)("dd",{className:"text-gray-900 dark:text-white",children:[eG.http_headers.max_age,"s"]}
1)]}),null!=eG.http_headers.age&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"Age"}),(0,s.jsxs)("dd",{className:"text-gray-900 dark:text-white",children:[eG.http_headers.age,"s"]})]}),eG.http_headers.etag&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"ETag"}),(0,s.jsx)("dd",{className:"font-mono text-gray-900 dark:text-white text-sm truncate max-w-xs",children:eG.http_headers.etag})]}),eG.http_headers.last_modified&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"Last-Modified"}),(0,s.jsx)("dd",{className:"text-gray-900 dark:text-white text-sm",suppressHydrationWarning:!0,children:tK(eG.http_headers.last_modified)})]}),null!=eG.http_headers.is_immutable&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"Immutable"}),(0,s.jsx)("dd",{className:"text-gray-900 dark:text-white",children:eG.http_headers.is_immutable?"Yes":"No"})]}),eG.http_headers.caching_strategy&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"Strategy"}),(0,s.jsx)("dd",{className:"text-gray-900 dark:text-white",children:eG.http_headers.caching_strategy})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-medium text-gray-900 dark:text-white mb-3",children:"CDN & Proxy"}),(0,s.jsxs)("dl",{className:"space-y-2",children:[eG.http_headers.cdn_cache_status&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"CDN Cache Status"}),(0,s.jsx)("dd",{className:"font-mono text-gray-900 dark:text-white",children:eG.http_headers.cdn_cache_status})]}),eG.http_headers.cdn_ray_id&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"CDN Ray ID"}),(0,s.jsx)("dd",{className:"font-mono text-gray-900 dark:text-white text-sm",children:eG.http_headers.cdn_ray_id})]}),eG.http_headers.x_cache&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"X-Cache"}),(0,s.jsx)("dd",{className:"font-mono text-gray-900 dark:text-white",children:eG.http_headers.x_cache})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-medium text-gray-900 dark:text-white mb-3",children:"Security"}),(0,s.jsxs)("dl",{className:"space-y-2",children:[void 0!==eG.http_headers.cors_enabled&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"CORS Enabled"}),(0,s.jsx)("dd",{className:eG.http_headers.cors_enabled?"text-green-600":"text-gray-500",children:eG.http_headers.cors_enabled?"Yes":"No"})]}),eG.http_headers.cors_origin&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"CORS Origin"}),(0,s.jsx)("dd",{className:"font-mono text-gray-900 dark:text-white text-sm",children:eG.http_headers.cors_origin})]}),void 0!==eG.http_headers.has_csp&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"CSP"}),(0,s.jsx)("dd",{className:eG.http_headers.has_csp?"text-green-600":"text-gray-500",children:eG.http_headers.has_csp?"Present":"Not Present"})]}),eG.http_headers.content_encoding&&(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:"Content Encoding"}),(0,s.jsx)("dd",{className:"font-mono text-gray-900 dark:text-white",children:eG.http_headers.content_encoding})]})]})]})]}):(0,s.jsx)("div",{className:"text-center py-8",children:(0,s.jsx)("p",{className:"text-gray-500 dark:text-gray-400",children:"inline"===eG.script_type?"This is an inline script embedded directly in the HTML page. Inline scripts are not fetched via HTTP request, so there are no HTTP headers to display.":"No HTTP header data available for this script."})})]}),"security"===tD&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)(m.Q$,{copyright:eG.copyright}),(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-virus mr-2 text-red-500"}),"YARA Pattern Matches (",th.length,")"]}),th.length>0?(0,s.jsx)("div",{className:"space-y-3",children:th.map((e,t)=>(0,s.jsxs)("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:`px-2 py-1 rounded text-xs font-medium uppercase ${(e=>{switch(null==e?void 0:e.toLowerCase()){case"critical":return"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300";
1case"high":return"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300";case"medium":return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300";case"low":return"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300";default:return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"}})(e.severity)}`,children:e.severity}),(0,s.jsx)(n(),{href:`/js-fingerprint-search?type=yara&value=${encodeURIComponent(e.pattern_name)}`,className:"font-medium text-blue-600 dark:text-blue-400 hover:underline",children:e.pattern_name}),e.category&&(0,s.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 rounded text-xs",children:e.category})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400",children:[(()=>{let t=e.confidence??e.match_confidence;return null==t||isNaN(t)?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{children:["Confidence: ",(100*t).toFixed(0),"%"]}),(0,s.jsx)("span",{children:"•"})]})})(),(0,s.jsx)("span",{suppressHydrationWarning:!0,children:tK(e.detected_at)})]})]}),e.description&&(0,s.jsx)("p",{className:"mt-2 text-sm text-gray-600 dark:text-gray-300",children:e.description}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.threat_names&&e.threat_names.length>0&&e.threat_names.map((e,t)=>(0,s.jsx)("span",{className:"px-2 py-1 bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-300 rounded text-xs",children:e},t)),e.mitre_techniques&&e.mitre_techniques.length>0&&e.mitre_techniques.map((e,t)=>(0,s.jsxs)("a",{href:`https://attack.mitre.org/techniques/${e.replace(".","/")}/`,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 bg-purple-50 dark:bg-purple-900/20 text-purple-700 dark:text-purple-300 rounded text-xs hover:underline",children:["MITRE ",e]},t)),e.cve_ids&&e.cve_ids.length>0&&e.cve_ids.map((e,t)=>(0,s.jsx)("a",{href:`https://nvd.nist.gov/vuln/detail/${e}`,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 bg-orange-50 dark:bg-orange-900/20 text-orange-700 dark:text-orange-300 rounded text-xs hover:underline",children:e},t))]}),e.matched_strings&&e.matched_strings.length>0&&(0,s.jsxs)("div",{className:"mt-3 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"Matched Strings: "}),(0,s.jsxs)("div",{className:"mt-1 space-y-1",children:[e.matched_strings.slice(0,5).map((e,t)=>(0,s.jsx)("code",{className:"block text-xs bg-gray-100 dark:bg-gray-900 px-2 py-1 rounded font-mono",children:e.length>100?e.substring(0,100)+"...":e},t)),e.matched_strings.length>5&&(0,s.jsxs)("span",{className:"text-xs text-gray-500",children:["...and ",e.matched_strings.length-5," more"]})]})]}),e.matched_patterns&&Object.keys(e.matched_patterns).length>0&&(0,s.jsxs)("div",{className:"mt-3 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"Match Details: "}),(0,s.jsxs)("code",{className:"text-xs bg-gray-100 dark:bg-gray-900 px-2 py-1 rounded",children:[JSON.stringify(e.matched_patterns).substring(0,200),JSON.stringify(e.matched_patterns).length>200&&"..."]})]}),e.matched_rule&&(0,s.jsxs)("div",{className:"mt-3 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"Matched Rule: "}),(0,s.jsx)("code",{className:"text-xs bg-gray-100 dark:bg-gray-900 px-2 py-1 rounded font-mono",children:e.matched_rule})]}),e.intel_references&&e.intel_references.length>0&&(0,s.jsxs)("div",{className:"mt-3 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"Intel References: "}),(0,s.jsx)("div",{className:"mt-1 flex flex-wrap gap-2",children:e.intel_references.slice(0,8).map((e,t)=>/^https?:\/\//.test(e)?(0,s.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 rounded text-xs hover:underline break-all",children:e},t):(0,s.jsx)("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-700/50 text-gray-700 dark:text-gray-300 rounded text-xs font-mono break-all",children:e},t))})]})]},t))}):(0,s.jsx)("p",{className:"text-gray-500 dark:text-gray-400",children:"No YARA pattern matches found for this script"})]}),t_&&(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-user-secret mr-2 text-purple-500"}),"Runtime Obfuscation Detection"]}),(0,s.jsxs)("div",{className:"mb-1 text-xs text-gray-400 dark:text-gray-500 italic",children:["This script — ",eG.filename||"current script"]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[(0,s.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-lg p-4 text-center",children:[(0,s.jsx)("div",{className:`text-2xl font-bold ${"critical"===tW.level?"text-red-600":"high"===tW.level?"text-orange-600":"medium"===tW.level?"text-yellow-600":"text-green-600"}
1`,children:tW.analyses>0?tW.level.toUpperCase():"N/A"}),(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Risk Level"})]}),(0,s.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-lg p-4 text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:tW.maxRisk}),(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Max Risk Score"})]}),(0,s.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-lg p-4 text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:tW.avgRisk.toFixed(1)}),(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Avg Risk Score"})]}),(0,s.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-lg p-4 text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:tW.analyses}),(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Static Analyses"})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[(0,s.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-lg p-4 text-center",children:[(0,s.jsx)("div",{className:`text-2xl font-bold ${tW.evalCalls>0?"text-orange-600":"text-gray-900 dark:text-white"}`,children:tW.evalCalls}),(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"eval() Calls"})]}),(0,s.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-lg p-4 text-center",children:[(0,s.jsx)("div",{className:`text-2xl font-bold ${tW.funcCalls>0?"text-orange-600":"text-gray-900 dark:text-white"}`,children:tW.funcCalls}),(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Function() Calls"})]}),(0,s.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-lg p-4 text-center",children:[(0,s.jsx)("div",{className:`text-2xl font-bold ${tB.length>0?"text-red-600":"text-gray-900 dark:text-white"}`,children:tB.length}),(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"High Risk Events"})]}),(0,s.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-lg p-4 text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:(null==(eI=tW.avgEntropy)?void 0:eI.toFixed(2))??"N/A"}),(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Avg Entropy"})]})]}),t_.statistics&&(0,s.jsxs)("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg",children:[(0,s.jsx)("h4",{className:"font-medium text-blue-800 dark:text-blue-300 mb-1",children:"Scan-wide Statistics"}),(0,s.jsxs)("p",{className:"text-xs text-blue-600 dark:text-blue-400 mb-3",children:["Across all ",t_.total_scripts||0," scripts on"," ",t_.target_url||"the scanned page",", not just this one."]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-blue-600 dark:text-blue-400",children:"Scripts: "}),(0,s.jsx)("span",{className:"font-medium text-blue-800 dark:text-blue-200",children:t_.total_scripts||0})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-blue-600 dark:text-blue-400",children:"Total Events: "}),(0,s.jsx)("span",{className:"font-medium text-blue-800 dark:text-blue-200",children:t_.statistics.totalEvents||0})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-blue-600 dark:text-blue-400",children:"Static Analyses: "}),(0,s.jsx)("span",{className:"font-medium text-blue-800 dark:text-blue-200",children:t_.statistics.staticAnalysesPerformed||0})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-blue-600 dark:text-blue-400",children:"Average Entropy: "}),(0,s.jsx)("span",{className:"font-medium text-blue-800 dark:text-blue-200",children:(null==(eU=t_.statistics.averageEntropy)?void 0:eU.toFixed(3))||"N/A"})]})]})]}),tB.length>0&&(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsxs)("h4",{className:"font-medium text-gray-900 dark:text-white mb-3 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-exclamation-triangle mr-2 text-red-500"}),"High Risk Events (",tB.length,")"]}),(0,s.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:tB.slice(0,10).map((e,t)=>(0,s.jsxs)("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3 text-sm",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,s.jsx)("span",{className:"font-medium text-red-800 dark:text-red-300 uppercase text-xs",children:e.type||"Unknown"}),null!=e.score&&(0,s.jsxs)("span",{className:`px-2 py-0.5 rounded text-xs font-bold ${e.score>=80?"bg-red-600 text-white":e.score>=60?"bg-orange-600 text-white":"bg-yellow-600 text-white"}`,children:["Score: ",e.score]})]}),e.factors&&e.factors.length>0&&(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:e.factors.map((e,t)=>(0,s.jsx)("span",{className:"px-2 py-0.5 bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-300 rounded text-xs font-mono",children:e.replace(/_/g," ")},t))})}),e.codeSnippet&&(0,s.jsx)("pre",{className:"text-xs bg-gray-900 text-gray-100 p-2 rounded overflow-x-auto max-h-24 mt-1",children:(0,s.jsxs)("code",{children:[e.codeSnippet.substring(0,300),e.codeSnippet.length>300?"...":""]})})]},t))})]}),tq.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("h4",{className:"font-medium text-gray-900 dark:text-white mb-3 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-list-ul mr-2 text-blue-500"}),"Detailed Analysis Events (",tq.length,")"]}),(0,s.jsxs)("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:[tq.filter(e=>"static_analysis"===e.type&&e.riskScore>0).slice(0,20).map((e,t)=>{var a;return(0,s.jsxs)("div",{className:`border rounded p-3 text-sm ${e.riskScore>=60?"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800":e.riskScore>=40?"bg-orange-50 dark:bg-orange-900/20 border-orange-200 dark:border-orange-800":e.riskScore>0?"bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800":"bg-gray-50 dark:bg-gray-900 border-gray-200 dark:border-gray-700"}`,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900 dark:text-white",children:e.type}),(0,s.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:e.urlId})]}),(0,s.jsxs)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${e.riskScore>=60?"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300":e.riskScore>
1=40?"bg-orange-100 dark:bg-orange-900/40 text-orange-700 dark:text-orange-300":e.riskScore>0?"bg-yellow-100 dark:bg-yellow-900/40 text-yellow-700 dark:text-yellow-300":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300"}`,children:["Risk: ",e.riskScore||0]})]}),e.patterns&&(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-xs mt-2",children:[(0,s.jsx)("div",{className:"flex items-center gap-1",children:(0,s.jsxs)("span",{className:e.patterns.hasEval?"text-red-600":"text-gray-400",children:[e.patterns.hasEval?"✓":"✗"," eval"]})}),(0,s.jsx)("div",{className:"flex items-center gap-1",children:(0,s.jsxs)("span",{className:e.patterns.hasFunctionConstructor?"text-red-600":"text-gray-400",children:[e.patterns.hasFunctionConstructor?"✓":"✗"," Function()"]})}),(0,s.jsx)("div",{className:"flex items-center gap-1",children:(0,s.jsxs)("span",{className:e.patterns.hasBase64?"text-orange-600":"text-gray-400",children:[e.patterns.hasBase64?"✓":"✗"," Base64"]})}),(0,s.jsx)("div",{className:"flex items-center gap-1",children:(0,s.jsxs)("span",{className:"text-gray-600 dark:text-gray-300",children:["Entropy: ",(null==(a=e.patterns.entropy)?void 0:a.toFixed(2))||"N/A"]})})]}),e.riskFactors&&e.riskFactors.length>0&&(0,s.jsx)("div",{className:"mt-2 flex flex-wrap gap-1",children:e.riskFactors.map((e,t)=>(0,s.jsx)("span",{className:"px-2 py-0.5 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded text-xs",children:e},t))})]},t)}),0===t_.detailed_events.filter(e=>"static_analysis"===e.type&&e.riskScore>0).length&&(0,s.jsx)("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No risky static analysis events detected"})]})]})]}),ty.length>0&&(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Segment Risk Analysis"}),tj&&(0,s.jsxs)("p",{className:"text-sm text-gray-500 dark:text-gray-400 -mt-2 mb-4",children:["This script has ",tf.toLocaleString()," segments; the analysis below covers the first ",tb.toLocaleString()," loaded."]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:tb.toLocaleString()}),(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:tj?"Segments Analysed":"Total Segments"})]}),(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-green-600",children:ty.filter(e=>e.is_known_library).length}),(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Known Libraries"})]}),(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-yellow-600",children:ty.filter(e=>e.risk_score>0&&e.risk_score<60).length}),(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Medium Risk"})]}),(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-red-600",children:ty.filter(e=>e.risk_score>=60).length}),(0,s.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"High Risk"})]})]}),ty.filter(e=>e.risk_score>=60).length>0&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("h4",{className:"font-medium text-gray-900 dark:text-white mb-2 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-exclamation-triangle mr-2 text-red-500"}),"High Risk Segments"]}),(0,s.jsx)("div",{className:"space-y-2",children:ty.filter(e=>e.risk_score>=60).map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center justify-between p-2 bg-red-50 dark:bg-red-900/20 rounded",children:[(0,s.jsx)("span",{className:"font-mono text-sm",children:e.function_name||"(anonymous)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:`px-2 py-0.5 rounded text-xs ${tQ(e.risk_score)}`,children:["Risk: ",e.risk_score]}),e.tlsh_hash&&(0,s.jsx)(n(),{href:`/search?type=js-hash&hash_type=tlsh&q=${encodeURIComponent(e.tlsh_hash)}`,className:"text-xs text-blue-600 hover:underline",children:"Search Similar"})]})]},t))})]}),ty.filter(e=>e.risk_score>0&&e.risk_score<60).length>0&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("h4",{className:"font-medium text-gray-900 dark:text-white mb-2 flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-exclamation-circle mr-2 text-yellow-500"}),"Medium Risk Segments"]}),(0,s.jsx)("div",{className:"space-y-2",children:ty.filter(e=>e.risk_score>0&&e.risk_score<60).map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center justify-between p-2 bg-yellow-50 dark:bg-yellow-900/20 rounded",children:[(0,s.jsx)("span",{className:"font-mono text-sm",children:e.function_name||"(anonymous)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:`px-2 py-0.5 rounded text-xs ${tQ(e.risk_score)}`,children:["Risk: ",e.risk_score]}),e.tlsh_hash&&(0,s.jsx)(n(),{href:`/search?type=js-hash&hash_type=tlsh&q=${encodeURIComponent(e.tlsh_hash)}`,className:"text-xs text-blue-600 hover:underline",children:"Search Similar"})]})]},t))})]})]})]}),"source"===tD&&(0,s.jsx)("div",{className:"space-y-6",children:(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center",children:[(0,s.jsx)(N,{className:"fas fa-code mr-2 text-emerald-500"}),"JavaScript Source Code"]}),tw&&(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsxs)("div",{className:"text-xs text-gray-400 dark:text-gray-500 bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded",children:[tw.length.toLocaleStr
1ing()," characters"]}),(0,s.jsx)("button",{onClick:()=>tE(!tM),className:"px-3 py-1.5 text-sm bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300 rounded hover:bg-purple-200 dark:hover:bg-purple-900/50 transition-colors",children:tM?"View Highlighted":"View Raw"}),(0,s.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(tw)},className:"px-3 py-1.5 text-sm bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded hover:bg-blue-200 dark:hover:bg-blue-900/50 transition-colors",children:"Copy to Clipboard"}),(0,s.jsx)("button",{onClick:()=>{let e=new Blob([tw],{type:"application/javascript"}),t=URL.createObjectURL(e),a=document.createElement("a");a.href=t,a.download=(null==eG?void 0:eG.filename)||`script_${eY}.js`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(t)},className:"px-3 py-1.5 text-sm bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300 rounded hover:bg-green-200 dark:hover:bg-green-900/50 transition-colors",children:"Download"})]})]}),tC?(0,s.jsxs)("div",{className:"flex items-center justify-center py-12",children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),(0,s.jsx)("span",{className:"ml-3 text-gray-500 dark:text-gray-400",children:"Loading source code..."})]}):tR?(0,s.jsx)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-700 rounded-lg p-4",children:(0,s.jsxs)("div",{className:"flex items-start",children:[(0,s.jsx)("svg",{className:"h-5 w-5 text-yellow-400 mr-2 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200",children:"Source Code Not Available"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-yellow-700 dark:text-yellow-300",children:tR}),(0,s.jsx)("p",{className:"mt-2 text-xs text-yellow-600 dark:text-yellow-400",children:"Scripts analyzed before source storage was enabled won't have their source code available. New scans will store the source code for viewing."})]})]})}):tw?(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"rounded-lg overflow-hidden max-h-[70vh] overflow-y-auto",children:tM?(0,s.jsx)("pre",{className:"bg-[#1e1e1e] text-[#d4d4d4] p-4 text-sm font-mono whitespace-pre-wrap break-all overflow-x-auto",children:tw}):(0,s.jsx)(v.A,{language:"javascript",style:k.xJ,showLineNumbers:!0,customStyle:{margin:0,fontSize:"0.875rem",maxHeight:"70vh"},children:tw})})}):(0,s.jsx)("div",{className:"text-center py-12",children:(0,s.jsx)("div",{className:"text-gray-500 dark:text-gray-400",children:"Loading source code..."})})]})})]})]}),(null==eG?void 0:eG.created_at)&&(0,s.jsx)(y.A,{submittedAt:eG.created_at}),(0,s.jsx)(x.A,{})]})]})}},3536:(e,t,a)=>{"use strict";function s(e,t){let a=t?t.replace(/%[0-9A-Fa-f]{2}/g,e=>{try{return decodeURIComponent(e)}catch{return e}}).replace(/[^a-zA-Z0-9._-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,100).replace(/-+$/,""):"";return a?`/script/${e}/${a}`:`/script/${e}`}function r(e,t){return`https://scanmalware.com${s(e,t)}`}function l(e){if(!e)return"";try{let t=new URL(e).pathname.split("/");return t[t.length-1]||""}catch{let t=(e||"").split("/");return t[t.length-1]||""}}a.d(t,{Dl:()=>r,KQ:()=>l,lI:()=>s})},4084:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var s=a(7876),r=a(8230),l=a.n(r),i=a(9099),n=a(7250);let d=e=>{let{items:t,current:a}=e,r=(0,i.useRouter)();if("/"===r.pathname)return null;let d=t||(()=>{let e=r.pathname.split("/").filter(Boolean),t=[{label:"Home",href:"/"}],s="";return e.forEach((l,i)=>{if(s+=`/${l}`,"[id]"===l&&r.query.id)t.push({label:a||`Result ${r.query.id}`,href:i===e.length-1?void 0:s.replace("[id]",r.query.id)});else if("[query]"===l&&r.query.query)t.push({label:a||decodeURIComponent(r.query.query
1),href:void 0});else if("s"===l)t.push({label:"Search",href:"/search"});else if("cpe"===l&&r.query.slug&&Array.isArray(r.query.slug)){let e=r.query.slug;t.push({label:"CPE",href:"/search?type=cpe"});let a=e.slice(0,2).join(" / ");e[2]?t.push({label:`${a} v${e[2]}`,href:void 0}):t.push({label:a,href:void 0})}else if("[[...slug]]"===l);else if("[query]"!==l){let a=l.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),r=i!==e.length-1&&"result"!==l;t.push({label:a,href:r?s:void 0})}}),t})(),c={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:d.map((e,t)=>{let a={"@type":"ListItem",position:t+1,name:e.label};return e.href?a.item=`https://scanmalware.com${e.href}`:t<d.length-1&&(a.item=`https://scanmalware.com${r.asPath.split("?")[0]}`),a})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:(0,n.x)(c)}}),(0,s.jsx)("nav",{"aria-label":"Breadcrumb",className:"bg-white dark:bg-gray-900 border-b dark:border-gray-700",children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,s.jsx)("ol",{className:"flex items-center space-x-2 py-3 text-sm",children:d.map((e,t)=>(0,s.jsxs)("li",{className:"flex items-center",children:[t>0&&(0,s.jsx)("svg",{className:"flex-shrink-0 h-4 w-4 text-gray-400 mx-2",fill:"
1currentColor",viewBox:"0 0 20 20","aria-hidden":"true",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),e.href?(0,s.jsx)(l(),{href:e.href,className:"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 transition-colors",children:e.label}):(0,s.jsx)("span",{className:"text-gray-900 dark:text-white font-medium","aria-current":"page",children:e.label})]},t))})})})]})}},4237:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var s=a(7876),r=a(7328),l=a.n(r),i=a(7250);let n=e=>{let{title:t,description:a,canonical:r,ogImage:n="https://scanmalware.com/banner.jpg",ogType:d="website",keywords:c="malware scanner, url scanner, website security, phishing detection, security analysis, website malware check, online virus scanner, url safety checker, website vulnerability scanner",author:o="ScanMalware.com",noindex:x=!1,noindexFollow:m=!1,structuredData:h}=e,g="ScanMalware.com",u=t.includes("ScanMalware")?t:`${t} | ${g}`,p=r||"https://scanmalware.com";return(0,s.jsxs)(l(),{children:[(0,s.jsx)("title",{children:u}),(0,s.jsx)("meta",{name:"description",content:a}),(0,s.jsx)("meta",{name:"keywords",content:c}),(0,s.jsx)("meta",{name:"author",content:o}),(0,s.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=5"}),(0,s.jsx)("meta",{charSet:"utf-8"}),(0,s.jsx)("meta",{httpEquiv:"X-UA-Compatible",content:"IE=edge"}),r&&(0,s.jsx)("link",{rel:"canonical",href:r}),x?(0,s.jsx)("meta",{name:"robots",content:"noindex, nofollow"}):m?(0,s.jsx)("meta",{name:"robots",content:"noindex, follow, max-image-preview:large"}):(0,s.jsx)("meta",{name:"robots",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),(0,s.jsx)("meta",{property:"og:title",content:u}),(0,s.jsx)("meta",{property:"og:description",content:a}),(0,s.jsx)("meta",{property:"og:type",content:d}),(0,s.jsx)("meta",{property:"og:url",content:p}),(0,s.jsx)("meta",{property:"og:site_name",content:g}),(0,s.jsx)("meta",{property:"og:image",content:n}),(0,s.jsx)("meta",{property:"og:image:width",content:"3546"}),(0,s.jsx)("meta",{property:"og:image:height",content:"1312"}),(0,s.jsx)("meta",{property:"og:image:alt",content:`${t} - ScanMalware.com`}),(0,s.jsx)("meta",{property:"og:locale",content:"en_US"}),(0,s.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,s.jsx)("meta",{name:"twitter:title",content:u}),(0,s.jsx)("meta",{name:"twitter:description",content:a}),(0,s.jsx)("meta",{name:"twitter:image",content:n}),(0,s.jsx)("meta",{name:"twitter:site",content:"@scanmalware"}),(0,s.jsx)("meta",{name:"twitter:creator",content:"@scanmalware"}),(0,s.jsx)("meta",{name:"mobile-web-app-capable",content:"yes"}),(0,s.jsx)("meta",{name:"apple-mobile-web-app-status-bar-style",content:"default"}),(0,s.jsx)("meta",{name:"apple-mobile-web-app-title",content:"ScanMalware"}),(0,s.jsx)("meta",{name:"application-name",content:"ScanMalware"}),(0,s.jsx)("meta",{name:"format-detection",content:"telephone=no"}),(0,s.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:(0,i.x)(h||{"@context":"https://schema.org","@type":"WebApplication",name:"ScanMalware.com",url:"https://scanmalware.com",description:"Free online URL and website security scanner to detect malware, phishing, and security threats",applicationCategory:"SecurityApplication",operatingSystem:"Web",offers:{"@type":"Offer",price:"0",priceCurrency:"USD"},aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",ratingCount:"1250"},author:{"@type":"Organization",name:"ScanMalware.com",url:"https://scanmalware.com"}})}}),(0,s.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:(0,i.x)({"@context":"https://schema.org","@type":"Organization",name:"ScanMalware.com",alternateName:"ScanMalware",url:"https://scanmalware.com",logo:"https://scanmalware.com/scanmalware.svg",description:"Free online URL and website security scanner to detect malware, phishing, and security threats",email:"[email protected]",sameAs:["https://x.com/scanmalware","https://www.facebook.com/ScanMalware/","https://www.instagram.com/scanmalware","https://infosec.exchange/@scanmalware","https://www.linkedin.com/company/scanmalware/"],contactPoint:{"@type":"ContactPoint",contactType:"Customer Support",url:"https://scanmalware.com/contact"}})}}),(0,s.jsx)("link",{rel:"dns-prefetch",href:"https://www.google-analytics.com"}),(0,s.jsx)("link",{rel:"alternate",hrefLang:"en",href:"https://scanmalware.com/"}),(0,s.jsx)("link",{rel:"alternate",hrefLang:"x-default",href:"https://scanmalware.com/"})]})}},4891:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>l,Pw:()=>r});let s=a(8028).A.create({baseURL:"",headers:{"Content-Type":"application/json"},timeout:3e4});async function r(){try{let e=a(1096).A;if((null==e?void 0:e.authenticated)&&e.token){try{await e.updateToken(30)}catch{}if(e.authenticated&&e.token)return{Authorization:`Bearer ${e.token}`}}}catch{}return{}}s.interceptors.request.use(async e=>{var t;if(!(null==(t=e.headers)?void 0:t.Authorization)){let{Authorization:t}=await r();t&&e.headers.set("Authorization",t)}return e});let l=s},9454:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/script/[...slug]",function(){return a(3203)}])}},e=>{e.O(0,[8230,8028,5681,7422,8640,5967,255,636,6593,8792],()=>e(e.s=9454)),_N_E=e.O()}]);

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.